diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a28673eb47440b..2bed35daf190ea 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -69,3 +69,6 @@ RUN chown -R $USERNAME:$USERNAME /opt/android/sdk # AmebaD requires access to change build_info.h RUN chown -R $USERNAME:$USERNAME /opt/ameba/ambd_sdk_with_chip_non_NDA/ + +# NXP uses a patch_sdk script to change SDK files +RUN chown -R $USERNAME:$USERNAME /opt/sdk/sdks/ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3daabb694fb026..3740ac511ff36f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,7 +17,7 @@ "build": { "dockerfile": "Dockerfile", "args": { - "BUILD_VERSION": "0.5.33" + "BUILD_VERSION": "0.5.40" } }, "remoteUser": "vscode", diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 99a8a1a6fd6a0c..79ecf55feebc8e 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -150,6 +150,7 @@ CFLAGS cgit cgroup changeset +Channel characterised CharString checkmark @@ -726,6 +727,7 @@ OTARequesterImpl OTARequestor OTARequestorDriver OTARequestorSerialPort +otasoftwareupdaterequestor OTBR otcli PAA @@ -994,12 +996,12 @@ TransportMgrBase TrustedRootCertificates TSG tsv +TTL tty ttyACM ttyACMx ttymxc ttyUSB -TvChannel TXD txt UART diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 384a9db623b0bf..9370f617b819d5 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-android:0.5.33 + image: connectedhomeip/chip-build-android:0.5.40 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index 36532934ada930..40e0d5355a65a2 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.5.33 + image: connectedhomeip/chip-build:0.5.40 steps: - name: Checkout diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ff032ef9bafa42..9fc60797f9e97e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.33 + image: connectedhomeip/chip-build:0.5.40 volumes: - "/tmp/log_output:/tmp/test_logs" options: @@ -98,7 +98,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.33 + image: connectedhomeip/chip-build:0.5.40 volumes: - "/tmp/log_output:/tmp/test_logs" options: @@ -204,7 +204,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.33 + image: connectedhomeip/chip-build:0.5.40 volumes: - "/tmp/log_output:/tmp/test_logs" options: diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index a695bb218e96d7..bf213f37f2f19c 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -29,7 +29,7 @@ jobs: timeout-minutes: 60 env: - DOCKER_RUN_VERSION: 0.5.33 + DOCKER_RUN_VERSION: 0.5.40 GITHUB_CACHE_PATH: /tmp/cirque-cache/ runs-on: ubuntu-latest @@ -38,7 +38,7 @@ jobs: # need to run with privilege, which isn't supported by job.XXX.contaner # https://github.com/actions/container-action/issues/2 # container: -# image: connectedhomeip/chip-build-cirque:0.5.33 +# image: connectedhomeip/chip-build-cirque:0.5.40 # volumes: # - "/tmp:/tmp" # - "/dev/pts:/dev/pts" diff --git a/.github/workflows/docker_img.yaml b/.github/workflows/docker_img.yaml index 02d970ced79050..ea657a7398eb96 100644 --- a/.github/workflows/docker_img.yaml +++ b/.github/workflows/docker_img.yaml @@ -49,6 +49,7 @@ jobs: - "-tizen" # NOTE: vscode image consumes ~52 GB disk space but GitHub-hosted runners provide ~10 GB free disk space(https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources) #- "-vscode" + - "-zap" steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml index df454c8ce40479..83941d82b64da9 100644 --- a/.github/workflows/doxygen.yaml +++ b/.github/workflows/doxygen.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: connectedhomeip/chip-build-doxygen:0.5.33 + image: connectedhomeip/chip-build-doxygen:0.5.40 if: github.actor != 'restyled-io[bot]' diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index 5c36324109bd32..d058866af0e6e9 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -28,7 +28,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ameba:0.5.33 + image: connectedhomeip/chip-build-ameba:0.5.40 options: --user root steps: diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index e3c748d363d892..b34bfb0106065e 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-efr32:0.5.33 + image: connectedhomeip/chip-build-efr32:0.5.40 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index c187535254a730..023d1b2bdbb611 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32:0.5.33 + image: connectedhomeip/chip-build-esp32:0.5.40 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 09b743c7ff414b..cfbefeea96d23e 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-infineon:0.5.33 + image: connectedhomeip/chip-build-infineon:0.5.40 steps: - name: Checkout diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 198af15b87de4f..cada68ca75c908 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-k32w:0.5.33 + image: connectedhomeip/chip-build-k32w:0.5.40 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -60,34 +60,31 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - - name: Build example K32W Lock App - timeout-minutes: 5 + - name: Build examples + timeout-minutes: 30 run: | - scripts/examples/k32w_example.sh \ - examples/lock-app/nxp/k32w/k32w0 out/lock_app_debug - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - k32w k32w061+debug lock-app \ - out/lock_app_debug/chip-k32w061-lock-example \ - /tmp/bloat_reports/ - - name: Build example K32W Shell App + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target k32w-light-release \ + --target k32w-lock-low-power-release \ + --target k32w-shell-release \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Get light size stats timeout-minutes: 5 run: | - scripts/examples/k32w_example.sh \ - examples/shell/nxp/k32w/k32w0 out/shell_app_debug no_low_power .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - k32w k32w061+debug shell \ - out/shell_app_debug/chip-k32w061-shell-example \ + k32w k32w061+release light \ + out/artifacts/k32w-light-release/chip-k32w061-light-example \ /tmp/bloat_reports/ - - name: Build example K32W Lighting App with Secure Element + - name: Get lock size stats timeout-minutes: 5 run: | - scripts/examples/k32w_se_example.sh \ - examples/lighting-app/nxp/k32w/k32w0 out/lighting_app_se_release .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - k32w k32w061+se05x+release lighting-app \ - out/lighting_app_se_release/chip-k32w061-light-example \ + k32w k32w061+release lock \ + out/artifacts/k32w-lock-low-power-release/chip-k32w061-lock-example \ /tmp/bloat_reports/ - - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index 1d4f598e666846..78db5bfa1146c0 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -31,7 +31,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-crosscompile:0.5.33 + image: connectedhomeip/chip-build-crosscompile:0.5.40 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 8bec26ebd5bf10..6ab3fa16e3e8f4 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.33 + image: connectedhomeip/chip-build:0.5.40 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index 17be30c5c1c232..ebb083efb8acef 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-mbed-os:0.5.33 + image: connectedhomeip/chip-build-mbed-os:0.5.40 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 4b3690ec4ba66d..3ef75f5f7173da 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-nrf-platform:0.5.33 + image: connectedhomeip/chip-build-nrf-platform:0.5.40 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index a67125cd3edf99..555edda31fa26c 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.5.33 + image: connectedhomeip/chip-build:0.5.40 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index ae7ba8569bd0fd..73dd6c774cd3e0 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-telink:0.5.33 + image: connectedhomeip/chip-build-telink:0.5.40 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index 2d51cde782ccc3..06f0bfdf0dacee 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -28,7 +28,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-tizen:0.5.33 + image: connectedhomeip/chip-build-tizen:0.5.40 options: --user root volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 8cb4edf47f36be..b4a340f7d525df 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32-qemu:0.5.33 + image: connectedhomeip/chip-build-esp32-qemu:0.5.40 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -54,12 +54,20 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - - name: Build example All Clusters App - timeout-minutes: 25 - run: scripts/examples/esp_example.sh all-clusters-app - - name: Build ESP32 QEMU and Run Tests - timeout-minutes: 35 - run: scripts/tests/esp32_qemu_tests.sh /tmp/test_logs + - name: Build ESP32 QEMU test images + timeout-minutes: 20 + run: | + scripts/run_in_build_env.sh " \ + ./scripts/build/build_examples.py \ + --target esp32-qemu-tests \ + build \ + " + - name: Run all tests + timeout-minutes: 30 + run: | + src/test_driver/esp32/run_qemu_image.py \ + --verbose \ + --file-image-list ./out/esp32-qemu-tests/test_images.txt - name: Uploading Logs uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index cae99f252b8119..a92195c022dce2 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-esp32:0.5.33 + image: connectedhomeip/chip-build-esp32:0.5.40 steps: - name: Checkout @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-efr32:0.5.33 + image: connectedhomeip/chip-build-efr32:0.5.40 steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4e7cc5b84567c0..1577d0280eee0b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.5.33 + image: connectedhomeip/chip-build:0.5.40 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -68,8 +68,7 @@ jobs: if: ${{ always() }} && ${{ !env.ACT }} with: name: - bootstrap-logs-linux-${{ matrix.type }}-${{ - matrix.eventloop }} + bootstrap-logs-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log @@ -100,8 +99,7 @@ jobs: if: ${{ failure() }} && ${{ !env.ACT }} with: name: - crash-core-linux-${{ matrix.type }}-${{ matrix.eventloop - }} + crash-core-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} path: /tmp/cores/ # Cores are big; don't hold on to them too long. retention-days: 5 @@ -110,8 +108,7 @@ jobs: if: ${{ failure() }} && ${{ !env.ACT }} with: name: - crash-objdir-linux-${{ matrix.type }}-${{ matrix.eventloop - }} + crash-objdir-linux-${{ matrix.build_variant }}${{ matrix.chip_tool }} path: objdir-clone/ # objdirs are big; don't hold on to them too long. retention-days: 5 @@ -161,8 +158,7 @@ jobs: if: ${{ always() }} && ${{ !env.ACT }} with: name: - bootstrap-logs-darwin-${{ matrix.type }}-${{ - matrix.eventloop }} + bootstrap-logs-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log @@ -192,8 +188,7 @@ jobs: if: ${{ failure() }} && ${{ !env.ACT }} with: name: - crash-core-darwin-${{ matrix.type }}-${{ matrix.eventloop - }} + crash-core-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} path: /cores/ # Cores are big; don't hold on to them too long. retention-days: 5 @@ -202,16 +197,14 @@ jobs: if: ${{ failure() }} && ${{ !env.ACT }} with: name: - crash-log-darwin-${{ matrix.type }}-${{ matrix.eventloop - }} + crash-log-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} path: ~/Library/Logs/DiagnosticReports/ - name: Uploading objdir for debugging uses: actions/upload-artifact@v2 if: ${{ failure() }} && ${{ !env.ACT }} with: name: - crash-objdir-darwin-${{ matrix.type }}-${{ - matrix.eventloop }} + crash-objdir-darwin-${{ matrix.build_variant }}${{ matrix.chip_tool }} path: objdir-clone/ # objdirs are big; don't hold on to them too long. retention-days: 5 diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index d692edd02592d5..8d7a3044215967 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.5.33 + image: connectedhomeip/chip-build:0.5.40 volumes: - "/tmp/log_output:/tmp/test_logs" options: diff --git a/.gitmodules b/.gitmodules index 85e0f84d9a05ce..e90a9c72373ae2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -161,4 +161,4 @@ branch = stable [submodule "p6/lwip"] path = third_party/p6/p6_sdk/libs/lwip - url = https://git.savannah.nongnu.org/git/lwip + url = https://github.com/lwip-tcpip/lwip.git diff --git a/README.md b/README.md index b93a81a83639e8..462457a3307e2e 100644 --- a/README.md +++ b/README.md @@ -89,13 +89,13 @@ to help achieve our interoperability architectural goal. Matter will initially support Wi-Fi and Thread for core, operational communications and Bluetooth Low Energy (BLE) to simplify device commissioning and setup. -The Application Layer can be further broken down seven main components: +The Application Layer can be further broken down into seven main components: ![Matter Stack Architecture](docs/images/CHIP_Arch_Pyramid.png) 1. **Application:** High order business logic of a device. For example, an application that is focused on lighting might contain logic to handle turning - on/off the bulb as well its color characteristics. + on/off the bulb as well as its color characteristics. 2. **Data Model:** Data primitives that help describe the various functionalities of the devices. The Application operates on these data @@ -116,7 +116,7 @@ The Application Layer can be further broken down seven main components: 6. **Message Framing & Routing:** With an interaction encrypted and signed, the Message Layer constructs the payload format with required and optional header - fields; which specify properties of the message as well some routing + fields; which specify properties of the message as well as some routing information. 7. **IP Framing & Transport Management:** After the final payload has been diff --git a/config/ameba/args.gni b/config/ameba/args.gni index d0cea9dfeb220f..fe49e059010256 100755 --- a/config/ameba/args.gni +++ b/config/ameba/args.gni @@ -36,3 +36,4 @@ custom_toolchain = "//third_party/connectedhomeip/config/ameba/toolchain:ameba" pw_build_PIP_CONSTRAINTS = [ "//third_party/connectedhomeip/scripts/constraints.txt" ] +cpp_standard = "c++17" diff --git a/config/ameba/chip.cmake b/config/ameba/chip.cmake index 92a138d0536f7d..9d39d92c72698f 100644 --- a/config/ameba/chip.cmake +++ b/config/ameba/chip.cmake @@ -41,6 +41,8 @@ list( -Wno-deprecated-declarations -Wno-unused-parameter -Wno-format + -Wno-stringop-truncation + -std=c++17 ) list( @@ -98,6 +100,15 @@ string(APPEND CHIP_GN_ARGS "ameba_cc = \"arm-none-eabi-gcc\"\n") string(APPEND CHIP_GN_ARGS "ameba_cxx = \"arm-none-eabi-c++\"\n") string(APPEND CHIP_GN_ARGS "ameba_cpu = \"ameba\"\n") +# Build RPC +#string(APPEND CHIP_GN_ARGS "remove_default_configs = [\"//third_party/connectedhomeip/third_party/pigweed/repo/pw_build:cpp17\"]\n") +string(APPEND CHIP_GN_ARGS "chip_build_pw_rpc_lib = true\n") +string(APPEND CHIP_GN_ARGS "pw_log_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_log_basic\"\n") +string(APPEND CHIP_GN_ARGS "pw_assert_BACKEND = \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_assert_log\"\n") +string(APPEND CHIP_GN_ARGS "pw_sys_io_BACKEND = \"//third_party/connectedhomeip/examples/platform/ameba/pw_sys_io:pw_sys_io_ameba\"\n") +string(APPEND CHIP_GN_ARGS "dir_pw_third_party_nanopb = \"//third_party/connectedhomeip/third_party/nanopb/repo\"\n") +string(APPEND CHIP_GN_ARGS "pw_build_LINK_DEPS = [\"//third_party/connectedhomeip/third_party/pigweed/repo/pw_assert:impl\", \"//third_party/connectedhomeip/third_party/pigweed/repo/pw_log:impl\"]\n") + file(GENERATE OUTPUT ${CHIP_OUTPUT}/args.gn CONTENT ${CHIP_GN_ARGS}) ExternalProject_Add( @@ -106,9 +117,9 @@ ExternalProject_Add( SOURCE_DIR ${CHIP_ROOT} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} CONFIGURE_COMMAND gn --root=${CHIP_ROOT}/config/ameba gen --check --fail-on-unused-args ${CHIP_OUTPUT} - BUILD_COMMAND ninja -C ${CHIP_OUTPUT} + BUILD_COMMAND ninja -C ${CHIP_OUTPUT} :ameba INSTALL_COMMAND "" - BUILD_BYPRODUCTS -lCHIP + BUILD_BYPRODUCTS -lCHIP -lPwRpc CONFIGURE_ALWAYS TRUE BUILD_ALWAYS TRUE USES_TERMINAL_CONFIGURE TRUE diff --git a/config/nrfconnect/chip-gn/lib/pw_rpc/BUILD.gn b/config/ameba/lib/pw_rpc/BUILD.gn similarity index 81% rename from config/nrfconnect/chip-gn/lib/pw_rpc/BUILD.gn rename to config/ameba/lib/pw_rpc/BUILD.gn index e99ab14b29c454..4b47ab1d61a16a 100644 --- a/config/nrfconnect/chip-gn/lib/pw_rpc/BUILD.gn +++ b/config/ameba/lib/pw_rpc/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Project CHIP Authors +# 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. @@ -19,20 +19,18 @@ import("$dir_pw_build/target_types.gni") static_library("pw_rpc") { output_name = "libPwRpc" - sources = [ "${dir_pigweed}/pw_hdlc/rpc_example/hdlc_rpc_server.cc" ] - + public_configs = [ "${dir_pigweed}/pw_hdlc:default_config" ] deps = [ "$dir_pw_rpc:server", "$dir_pw_rpc/nanopb:echo_service", - "$dir_pw_rpc/system_server", - "${chip_root}/examples/platform/nrfconnect/pw_sys_io:pw_sys_io_nrfconnect", + "${chip_root}/examples/platform/ameba/pw_sys_io:pw_sys_io_ameba", "${dir_pigweed}/pw_hdlc:pw_rpc", dir_pw_assert, dir_pw_hdlc, dir_pw_log, ] - public_configs = [ "${dir_pigweed}/pw_hdlc:default_config" ] + deps += pw_build_LINK_DEPS output_dir = "${root_out_dir}/lib" diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 3e59822a63553b..b7837b42cc9696 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -149,6 +149,12 @@ menu "CHIP Core" help The maximum number of simultaneously timers in the CHIP System Layer. + config ENABLE_OTA_REQUESTOR + bool "Enable OTA Requestor" + default n + help + Enable this option to enable OTA Requestor for example + endmenu # "System Options" menu "Security Options" diff --git a/config/nrfconnect/.nrfconnect-recommended-revision b/config/nrfconnect/.nrfconnect-recommended-revision index 94918f5001ceb9..fa795cfddad312 100644 --- a/config/nrfconnect/.nrfconnect-recommended-revision +++ b/config/nrfconnect/.nrfconnect-recommended-revision @@ -1 +1 @@ -ffcf07fe4586634a6793a48e5444a7196e7ebac6 +cfedfdfa08567b2252b511a4d1db15fbeba8152d diff --git a/config/nrfconnect/app/overlay-multi_image_dfu_support.conf b/config/nrfconnect/app/overlay-multi_image_dfu_support.conf index 7e78f41eaf2900..644a86c64d5835 100644 --- a/config/nrfconnect/app/overlay-multi_image_dfu_support.conf +++ b/config/nrfconnect/app/overlay-multi_image_dfu_support.conf @@ -22,13 +22,6 @@ CONFIG_NORDIC_QSPI_NOR=y CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 -# External flash memory configuration -CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y -CONFIG_PM_EXTERNAL_FLASH=y -CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64" -CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000 -CONFIG_PM_EXTERNAL_FLASH_BASE=0 - # MCU Manager and SMP configuration CONFIG_MCUMGR=y CONFIG_MCUMGR_CMD_IMG_MGMT=y diff --git a/config/nrfconnect/app/overlay-single_image_dfu_support.conf b/config/nrfconnect/app/overlay-single_image_dfu_support.conf index bb329f79f2469e..363cd4bcd5f925 100644 --- a/config/nrfconnect/app/overlay-single_image_dfu_support.conf +++ b/config/nrfconnect/app/overlay-single_image_dfu_support.conf @@ -21,13 +21,6 @@ CONFIG_NORDIC_QSPI_NOR=y CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 -# External flash memory configuration -CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y -CONFIG_PM_EXTERNAL_FLASH=y -CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64" -CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000 -CONFIG_PM_EXTERNAL_FLASH_BASE=0 - # MCU Manager and SMP configuration CONFIG_MCUMGR=y CONFIG_MCUMGR_CMD_IMG_MGMT=y diff --git a/config/nrfconnect/app/sample-defaults.conf b/config/nrfconnect/app/sample-defaults.conf index 93ac000214ad8b..7e451f40ed6536 100644 --- a/config/nrfconnect/app/sample-defaults.conf +++ b/config/nrfconnect/app/sample-defaults.conf @@ -20,6 +20,7 @@ CONFIG_STD_CPP14=y CONFIG_LOG=y CONFIG_LOG_MODE_MINIMAL=y +CONFIG_MATTER_LOG_LEVEL_DBG=y CONFIG_PRINTK_SYNC=y CONFIG_ASSERT=y CONFIG_HW_STACK_PROTECTION=y diff --git a/config/nrfconnect/chip-gn/BUILD.gn b/config/nrfconnect/chip-gn/BUILD.gn index b9a71c9d34334d..63ddd225669d0d 100644 --- a/config/nrfconnect/chip-gn/BUILD.gn +++ b/config/nrfconnect/chip-gn/BUILD.gn @@ -19,22 +19,12 @@ import("${chip_root}/build/chip/tests.gni") assert(current_os == "zephyr") -declare_args() { - chip_build_pw_rpc_lib = false -} - group("nrfconnect") { deps = [ "${chip_root}/src/lib" ] if (chip_build_tests) { deps += [ "${chip_root}/src:tests" ] } - - # Building PW_RPC lib with GN may go obsolete after getting full CMake - # support in Pigweed. - if (chip_build_pw_rpc_lib) { - deps += [ "lib/pw_rpc" ] - } } group("default") { diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 4f9ce318cba0df..9a9ed9529afb41 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -121,10 +121,6 @@ if (NOT CHIP_LIBRARIES) set(CHIP_LIBRARIES -lCHIP) endif() -if (CONFIG_CHIP_PW_RPC) - list(APPEND CHIP_LIBRARIES -lPwRpc) -endif() - # Set up CHIP project configuration file if (CONFIG_CHIP_PROJECT_CONFIG) @@ -180,10 +176,6 @@ find_package(Python3 REQUIRED) # Generate configuration for CHIP GN build system # ============================================================================== -if (CONFIG_CHIP_PW_RPC) - chip_gn_arg_import("${GN_ROOT_TARGET}/lib/pw_rpc/pw_rpc.gni") -endif() - chip_gn_arg_cflags("target_cflags" ${CHIP_CFLAGS}) chip_gn_arg_cflags("target_cflags_c" ${CHIP_CFLAGS_C}) chip_gn_arg_cflags("target_cflags_cc" ${CHIP_CFLAGS_CC}) @@ -202,7 +194,6 @@ chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TE chip_gn_arg_bool ("chip_monolithic_tests" CONFIG_CHIP_BUILD_TESTS) chip_gn_arg_bool ("chip_inet_config_enable_tcp_endpoint" CONFIG_CHIP_BUILD_TESTS) chip_gn_arg_bool ("chip_build_libshell" CONFIG_CHIP_LIB_SHELL) -chip_gn_arg_bool ("chip_build_pw_rpc_lib" CONFIG_CHIP_PW_RPC) if (CONFIG_CHIP_ENABLE_DNSSD_SRP) chip_gn_arg_string("chip_mdns" "platform") diff --git a/config/nrfconnect/chip-module/Kconfig b/config/nrfconnect/chip-module/Kconfig index 1789996f2d3279..38dcd3bb3845ac 100644 --- a/config/nrfconnect/chip-module/Kconfig +++ b/config/nrfconnect/chip-module/Kconfig @@ -34,3 +34,11 @@ config CHIP_OTA_REQUESTOR imply DFU_TARGET imply STREAM_FLASH imply STREAM_FLASH_ERASE + +config CHIP_OTA_REQUESTOR_BUFFER_SIZE + int "OTA Requestor image buffer size" + default 1024 + depends on CHIP_OTA_REQUESTOR + help + Configures size of the buffer used by OTA Requestor when downloading and + writing a new firmware image to flash. diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index 63b9e727d17fbb..a390f78b429527 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -108,6 +108,16 @@ config CHIP_OTA_REQUESTOR Device Firmware Upgrade by quering and downloading a new firmware image from an external OTA Provider node. +config CHIP_OPERATIONAL_TIME_SAVE_INTERVAL + int "Interval of saving node operation time to flash in hours unit" + default 10 + range 1 4294967295 + help + Interval in hours with which the node operation time is saved to the flash + memory. Selected value is a trade off between performing frequent saves to know + precisely operation time in case of device reboot and maximizing flash memory + lifetime. + config APP_LINK_WITH_CHIP bool "Link 'app' with Connected Home over IP" default y @@ -115,4 +125,8 @@ config APP_LINK_WITH_CHIP Add Connected Home over IP header files to the 'app' include path and link the 'app' with Connected Home over IP libraries. +module = MATTER +module-str = Matter +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + endif diff --git a/docs/PROJECT_FLOW.md b/docs/PROJECT_FLOW.md index d2b44415c07ed9..d8579a4e962154 100644 --- a/docs/PROJECT_FLOW.md +++ b/docs/PROJECT_FLOW.md @@ -9,7 +9,7 @@ repository. Matter uses issues as simple problem descriptions or feature requests. In general, all work contributed to the repository in the form of pull requests (PR) should be under the auspices of some open issue. This may seem onerous and -in some cases duplicative, so consider these guidelines when deciding whether to +in some cases duplicative, so consider these guidelines when deciding whether you can get away with not creating an issue: - Trivial fixes: issues can function as TODO lists, simple reminders that diff --git a/docs/QUICK_START.md b/docs/QUICK_START.md index 04a8eaedb236f4..2191f08e5f8d15 100644 --- a/docs/QUICK_START.md +++ b/docs/QUICK_START.md @@ -2,8 +2,8 @@ ## Demo Overview -The Matter reference implementation contains support for a number examples and -platforms. +The Matter reference implementation contains support for a number of examples +and platforms. ## Wi-Fi Nodes diff --git a/docs/STYLE_GUIDE.md b/docs/STYLE_GUIDE.md index c3cd822e4a3bec..b5ff308297b611 100644 --- a/docs/STYLE_GUIDE.md +++ b/docs/STYLE_GUIDE.md @@ -75,7 +75,7 @@ $ git clone https://github.com/project-chip/connectedhomeip.git ### Terminal prompts -If you need use a full terminal prompt with username and hostname, use the +If you need to use a full terminal prompt with username and hostname, use the format of `root@{hostname}{special-characters}#`. For example, when logged into a Docker container, you might have a prompt like diff --git a/docs/guides/BUILDING.md b/docs/guides/BUILDING.md index 5a76a187e39fd2..cf8310b4220f43 100644 --- a/docs/guides/BUILDING.md +++ b/docs/guides/BUILDING.md @@ -280,7 +280,7 @@ all of the target instances. For example: gn desc out/unified '//src/controller(//build/toolchain/host:linux_x64_clang)' ``` -Note: Some platforms that can be build as part of the unified build require +Note: Some platforms that can be built as part of the unified build require downloading additional SDKs. To add these to the build, the location of the SDK installation must be provided as a build argument. For example, to add the Simplelink cc13x2_26x2 examples to the unified build, install the diff --git a/docs/guides/nrfconnect_examples_cli.md b/docs/guides/nrfconnect_examples_cli.md index 5ac2589113d678..b6104289e844cc 100644 --- a/docs/guides/nrfconnect_examples_cli.md +++ b/docs/guides/nrfconnect_examples_cli.md @@ -103,24 +103,33 @@ Performs device factory reset that is hardware reset preceded by erasing of the whole Matter settings stored in a non-volatile memory. ```shell -uart:~$ matter factoryreset +uart:~$ matter device factoryreset Performing factory reset ... ``` ### onboardingcodes Handles a group of commands that are used to view information about device -onboarding codes. You can use this command without any subcommand to print all -available onboarding codes or to add a specific subcommand. +onboarding codes. The `onboardingcodes` command takes one required parameter for +the rendezvous type, then an optional parameter for printing a specific type of +onboarding code. + +The full format of the command is: + +``` +onboardingcodes none|softap|ble|onnetwork [qrcode|qrcodeurl|manualpairingcode] +``` + +To print all the onboardingcodes: ```shell -uart:~$ matter onboardingcodes +uart:~$ matter onboardingcodes none QRCode: MT:W0GU2OTB00KA0648G00 QRCodeUrl: https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3AW0GU2OTB00KA0648G00 ManualPairingCode: 34970112332 ``` -The `onboardingcodes` command can also take the subcommands listed below. +To print a specific type of onboarding code: #### qrcode @@ -129,7 +138,7 @@ Prints the device Takes no arguments. ```shell -uart:~$ matter onboardingcodes qrcode +uart:~$ matter onboardingcodes none qrcode MT:W0GU2OTB00KA0648G00 ``` @@ -140,7 +149,7 @@ Prints the URL to view the in a web browser. Takes no arguments. ```shell -uart:~$ matter onboardingcodes qrcodeurl +uart:~$ matter onboardingcodes none qrcodeurl https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3AW0GU2OTB00KA0648G00 ``` @@ -150,7 +159,7 @@ Prints the pairing code for the manual onboarding of a device. Takes no arguments. ```shell -uart:~$ matter onboardingcodes manualpairingcode +uart:~$ matter onboardingcodes none manualpairingcode 34970112332 ``` diff --git a/docs/guides/nrfconnect_examples_software_update.md b/docs/guides/nrfconnect_examples_software_update.md index 3966e40e4e6940..5b83ac0c9a4515 100644 --- a/docs/guides/nrfconnect_examples_software_update.md +++ b/docs/guides/nrfconnect_examples_software_update.md @@ -69,7 +69,7 @@ Complete the following steps to perform DFU using mcumgr: 4. Upload the application firmware image to the device by running the following command in your example directory: - $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image upload build/zephyr/app_update.bin -n 0 + $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image upload build/zephyr/app_update.bin -n 0 -w 1 The operation can take a few minutes. Wait until the progress bar reaches 100%. @@ -125,7 +125,7 @@ Complete the following steps to perform DFU using mcumgr: 7. Upload the network core firmware image to the device by running the following command in your example directory: - $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image upload build/zephyr/net_core_app_update.bin -n 1 + $ sudo mcumgr --conntype ble --hci ble-hci-number --connstring peer_name='ble-device-name' image upload build/zephyr/net_core_app_update.bin -n 1 -w 1 The operation can take a few minutes. Wait until the progress bar reaches 100%. diff --git a/docs/guides/python_chip_controller_building.md b/docs/guides/python_chip_controller_building.md index 3bd822f94a872f..d7deba4b07dd49 100644 --- a/docs/guides/python_chip_controller_building.md +++ b/docs/guides/python_chip_controller_building.md @@ -516,7 +516,7 @@ RelativeHumidityMeasurement Scenes SoftwareDiagnostics Switch -TvChannel +Channel TargetNavigator TemperatureMeasurement TestCluster diff --git a/docs/style/DOXYGEN.adoc b/docs/style/DOXYGEN.adoc index 2ae28a31c43ade..95dd325e320160 100644 --- a/docs/style/DOXYGEN.adoc +++ b/docs/style/DOXYGEN.adoc @@ -165,7 +165,7 @@ Objective C{plusplus}. Adapt as appropriate for Perl, Python and Shell. * interpreted and parsed. If 0 or 16, the string may * be hexadecimal and prefixed with "0x". Otherwise, a 0 * is implied as 10 unless a leading 0 is encountered in - * which 8 is implied. + * which case 8 is implied. * * @retval 0 on success. * @retval #EINVAL if the given base contains an unsupported value or if no diff --git a/docs/style/coding/CODING_STYLE_GUIDE.adoc b/docs/style/coding/CODING_STYLE_GUIDE.adoc index 453ab3d80b4513..c04f22c8d1ac01 100644 --- a/docs/style/coding/CODING_STYLE_GUIDE.adoc +++ b/docs/style/coding/CODING_STYLE_GUIDE.adoc @@ -273,7 +273,7 @@ Heap-based resource allocation should be avoided. As emphasized throughout this document, the software produced by Project CHIP is consumed both inside and outside Project CHIP, across a variety of platforms. The capabilities of these platforms are broad, spanning -soft real-time, deeply-embedded systems based on based on RTOSes that +soft real-time, deeply-embedded systems based on RTOSes that may cover life safety and/or physical security applications to richer, softly-embedded systems based on non-RTOS platforms such as Darwin or Linux. While the latter are apt to have fully-functional heaps, the 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 8c4384de9db207..29ab97bdd7c445 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 @@ -1369,7 +1369,7 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, + "code": 2, "mfgCode": null, "source": "client", "incoming": 1, @@ -1377,11 +1377,11 @@ }, { "name": "NotifyUpdateApplied", - "code": 2, + "code": 4, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 } ], "attributes": [ @@ -1412,15 +1412,15 @@ "commands": [ { "name": "QueryImageResponse", - "code": 3, + "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -1428,6 +1428,36 @@ } ], "attributes": [ + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1452,7 +1482,16 @@ "define": "OTA_REQUESTOR_CLUSTER", "side": "client", "enabled": 0, - "commands": [], + "commands": [ + { + "name": "AnnounceOtaProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], "attributes": [ { "name": "ClusterRevision", @@ -1481,7 +1520,22 @@ "commands": [], "attributes": [ { - "name": "default ota provider", + "name": "DefaultOtaProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", "code": 1, "mfgCode": null, "side": "server", @@ -1489,14 +1543,14 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "update possible", + "name": "UpdateState", "code": 2, "mfgCode": null, "side": "server", @@ -1504,12 +1558,57 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -4304,7 +4403,40 @@ "define": "GROUP_KEY_MANAGEMENT_CLUSTER", "side": "client", "enabled": 0, - "commands": [], + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], "attributes": [ { "name": "ClusterRevision", @@ -4330,15 +4462,32 @@ "define": "GROUP_KEY_MANAGEMENT_CLUSTER", "side": "server", "enabled": 1, - "commands": [], + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4348,12 +4497,12 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4362,6 +4511,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "maxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "maxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -7508,6 +7687,30 @@ "source": "client", "incoming": 1, "outgoing": 1 + }, + { + "name": "OffWithEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OnWithRecallGlobalScene", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OnWithTimedOff", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 } ], "attributes": [ @@ -8672,14 +8875,6 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "NotifyUpdateApplied", "code": 2, "mfgCode": null, "source": "client", @@ -8713,17 +8908,9 @@ "side": "server", "enabled": 0, "commands": [ - { - "name": "QueryImageResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -9142,6 +9329,14 @@ "incoming": 1, "outgoing": 0 }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, { "name": "RemoveNetwork", "code": 4, @@ -9191,7 +9386,7 @@ "mfgCode": null, "define": "NETWORK_COMMISSIONING_CLUSTER", "side": "server", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "ScanNetworksResponse", @@ -9220,20 +9415,155 @@ ], "attributes": [ { - "name": "ClusterRevision", - "code": 65533, + "name": "MaxNetworks", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 - } + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } ] }, { @@ -9436,7 +9766,7 @@ "commands": [], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", @@ -9451,7 +9781,7 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", @@ -13595,15 +13925,15 @@ ] }, { - "name": "TV Channel", + "name": "Channel", "code": 1284, "mfgCode": null, - "define": "TV_CHANNEL_CLUSTER", + "define": "CHANNEL_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "ChangeChannel", + "name": "ChangeChannelRequest", "code": 0, "mfgCode": null, "source": "client", @@ -13611,15 +13941,7 @@ "outgoing": 1 }, { - "name": "ChangeChannelByNumber", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "SkipChannel", + "name": "ChangeChannelByNumberRequest", "code": 2, "mfgCode": null, "source": "client", @@ -13646,25 +13968,16 @@ ] }, { - "name": "TV Channel", + "name": "Channel", "code": 1284, "mfgCode": null, - "define": "TV_CHANNEL_CLUSTER", + "define": "CHANNEL_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "ChangeChannelResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "commands": [], "attributes": [ { - "name": "tv channel list", + "name": "channel list", "code": 0, "mfgCode": null, "side": "server", @@ -13679,7 +13992,7 @@ "reportableChange": 0 }, { - "name": "tv channel lineup", + "name": "channel lineup", "code": 1, "mfgCode": null, "side": "server", @@ -13694,7 +14007,7 @@ "reportableChange": 0 }, { - "name": "current tv channel", + "name": "current channel", "code": 2, "mfgCode": null, "side": "server", @@ -13708,6 +14021,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -13734,7 +14077,7 @@ "enabled": 0, "commands": [ { - "name": "NavigateTarget", + "name": "NavigateTargetRequest", "code": 0, "mfgCode": null, "source": "client", @@ -13767,16 +14110,7 @@ "define": "TARGET_NAVIGATOR_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "NavigateTargetResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "commands": [], "attributes": [ { "name": "target navigator list", @@ -13808,6 +14142,36 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -13834,7 +14198,7 @@ "enabled": 0, "commands": [ { - "name": "MediaPlay", + "name": "PlayRequest", "code": 0, "mfgCode": null, "source": "client", @@ -13842,7 +14206,7 @@ "outgoing": 1 }, { - "name": "MediaPause", + "name": "PauseRequest", "code": 1, "mfgCode": null, "source": "client", @@ -13850,7 +14214,7 @@ "outgoing": 1 }, { - "name": "MediaStop", + "name": "StopRequest", "code": 2, "mfgCode": null, "source": "client", @@ -13858,7 +14222,7 @@ "outgoing": 1 }, { - "name": "MediaStartOver", + "name": "StartOverRequest", "code": 3, "mfgCode": null, "source": "client", @@ -13866,7 +14230,7 @@ "outgoing": 1 }, { - "name": "MediaPrevious", + "name": "PreviousRequest", "code": 4, "mfgCode": null, "source": "client", @@ -13874,7 +14238,7 @@ "outgoing": 1 }, { - "name": "MediaNext", + "name": "NextRequest", "code": 5, "mfgCode": null, "source": "client", @@ -13882,7 +14246,7 @@ "outgoing": 1 }, { - "name": "MediaRewind", + "name": "RewindRequest", "code": 6, "mfgCode": null, "source": "client", @@ -13890,7 +14254,7 @@ "outgoing": 1 }, { - "name": "MediaFastForward", + "name": "FastForwardRequest", "code": 7, "mfgCode": null, "source": "client", @@ -13898,7 +14262,7 @@ "outgoing": 1 }, { - "name": "MediaSkipForward", + "name": "SkipForwardRequest", "code": 8, "mfgCode": null, "source": "client", @@ -13906,20 +14270,12 @@ "outgoing": 1 }, { - "name": "MediaSkipBackward", + "name": "SkipBackwardRequest", "code": 9, "mfgCode": null, "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "MediaSeek", - "code": 10, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -13947,96 +14303,7 @@ "define": "MEDIA_PLAYBACK_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "MediaPlayResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaPauseResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaStopResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaStartOverResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaPreviousResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaNextResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaRewindResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaFastForwardResponse", - "code": 7, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaSkipForwardResponse", - "code": 8, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaSkipBackwardResponse", - "code": 9, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaSeekResponse", - "code": 11, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 0 - } - ], + "commands": [], "attributes": [ { "name": "playback state", @@ -14084,7 +14351,7 @@ "reportableChange": 0 }, { - "name": "position updated at", + "name": "position", "code": 3, "mfgCode": null, "side": "server", @@ -14099,7 +14366,7 @@ "reportableChange": 0 }, { - "name": "position", + "name": "playback speed", "code": 4, "mfgCode": null, "side": "server", @@ -14114,7 +14381,7 @@ "reportableChange": 0 }, { - "name": "playback speed", + "name": "seek range end", "code": 5, "mfgCode": null, "side": "server", @@ -14129,7 +14396,7 @@ "reportableChange": 0 }, { - "name": "seek range end", + "name": "seek range start", "code": 6, "mfgCode": null, "side": "server", @@ -14143,6 +14410,36 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -14169,7 +14466,7 @@ "enabled": 0, "commands": [ { - "name": "SelectInput", + "name": "SelectInputRequest", "code": 0, "mfgCode": null, "source": "client", @@ -14177,7 +14474,7 @@ "outgoing": 1 }, { - "name": "ShowInputStatus", + "name": "ShowInputStatusRequest", "code": 1, "mfgCode": null, "source": "client", @@ -14185,7 +14482,7 @@ "outgoing": 1 }, { - "name": "HideInputStatus", + "name": "HideInputStatusRequest", "code": 2, "mfgCode": null, "source": "client", @@ -14193,7 +14490,7 @@ "outgoing": 1 }, { - "name": "RenameInput", + "name": "RenameInputRequest", "code": 3, "mfgCode": null, "source": "client", @@ -14258,6 +14555,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -14345,7 +14672,7 @@ "enabled": 0, "commands": [ { - "name": "SendKey", + "name": "SendKeyRequest", "code": 0, "mfgCode": null, "source": "client", @@ -14378,16 +14705,7 @@ "define": "KEYPAD_INPUT_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "SendKeyResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -14415,7 +14733,7 @@ "enabled": 0, "commands": [ { - "name": "LaunchContent", + "name": "LaunchContentRequest", "code": 0, "mfgCode": null, "source": "client", @@ -14423,7 +14741,7 @@ "outgoing": 1 }, { - "name": "LaunchURL", + "name": "LaunchURLRequest", "code": 1, "mfgCode": null, "source": "client", @@ -14456,27 +14774,10 @@ "define": "CONTENT_LAUNCH_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "LaunchContentResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "LaunchURLResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "commands": [], "attributes": [ { - "name": "accepts header list", + "name": "accept header list", "code": 0, "mfgCode": null, "side": "server", @@ -14491,7 +14792,7 @@ "reportableChange": 0 }, { - "name": "supported streaming types", + "name": "supported streaming protocols", "code": 1, "mfgCode": null, "side": "server", @@ -14531,7 +14832,7 @@ "enabled": 0, "commands": [ { - "name": "SelectOutput", + "name": "SelectOutputRequest", "code": 0, "mfgCode": null, "source": "client", @@ -14539,7 +14840,7 @@ "outgoing": 1 }, { - "name": "RenameOutput", + "name": "RenameOutputRequest", "code": 1, "mfgCode": null, "source": "client", @@ -14630,7 +14931,7 @@ "enabled": 0, "commands": [ { - "name": "LaunchApp", + "name": "LaunchAppRequest", "code": 0, "mfgCode": null, "source": "client", @@ -14663,16 +14964,7 @@ "define": "APPLICATION_LAUNCHER_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "LaunchAppResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "commands": [], "attributes": [ { "name": "application launcher list", @@ -14690,7 +14982,7 @@ "reportableChange": 0 }, { - "name": "catalog vendor id", + "name": "application launcher app", "code": 1, "mfgCode": null, "side": "server", @@ -14817,7 +15109,7 @@ "reportableChange": 0 }, { - "name": "application id", + "name": "application status", "code": 5, "mfgCode": null, "side": "server", @@ -14832,7 +15124,7 @@ "reportableChange": 0 }, { - "name": "catalog vendor id", + "name": "application version", "code": 6, "mfgCode": null, "side": "server", @@ -14846,6 +15138,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "allowed vendor list", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -14872,20 +15179,12 @@ "enabled": 0, "commands": [ { - "name": "GetSetupPIN", + "name": "GetSetupPINRequest", "code": 0, "mfgCode": null, "source": "client", "incoming": 0, "outgoing": 1 - }, - { - "name": "Login", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 } ], "attributes": [ @@ -14913,16 +15212,7 @@ "define": "ACCOUNT_LOGIN_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "GetSetupPINResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -15726,7 +16016,7 @@ "reportableChange": 0 }, { - "name": "struct", + "name": "struct_attr", "code": 37, "mfgCode": null, "side": "server", @@ -15764,7 +16054,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "-20", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -15794,7 +16084,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "-100", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -16304,7 +16594,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "-20", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -16334,7 +16624,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "-100", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp index caaad460a616b3..af3b4763054ef0 100644 --- a/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp @@ -53,13 +53,13 @@ constexpr uint16_t BridgedActionsAttrAccess::ClusterRevision; CHIP_ERROR BridgedActionsAttrAccess::ReadActionListAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) { // Just return an empty list - return aEncoder.Encode(DataModel::List()); + return aEncoder.EncodeEmptyList(); } CHIP_ERROR BridgedActionsAttrAccess::ReadEndpointListAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) { // Just return an empty list - return aEncoder.Encode(DataModel::List()); + return aEncoder.EncodeEmptyList(); } CHIP_ERROR BridgedActionsAttrAccess::ReadSetupUrlAttribute(EndpointId endpoint, AttributeValueEncoder & aEncoder) diff --git a/examples/all-clusters-app/all-clusters-common/src/ota-requestor-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/ota-requestor-stub.cpp new file mode 100644 index 00000000000000..ceff034374f750 --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/src/ota-requestor-stub.cpp @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OtaSoftwareUpdateRequestor; + +namespace { + +class OtaSoftwareUpdateRequestorAttrAccess : public AttributeAccessInterface +{ +public: + // Register for the OTA Requestor Cluster on all endpoints. + OtaSoftwareUpdateRequestorAttrAccess() : + AttributeAccessInterface(Optional::Missing(), OtaSoftwareUpdateRequestor::Id) + {} + + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; +}; + +OtaSoftwareUpdateRequestorAttrAccess gAttrAccess; + +CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + switch (aPath.mAttributeId) + { + case Attributes::DefaultOtaProviders::Id: + return aEncoder.Encode(DataModel::List()); + default: + break; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + switch (aPath.mAttributeId) + { + case Attributes::DefaultOtaProviders::Id: { + DataModel::DecodableList list; + ReturnErrorOnFailure(aDecoder.Decode(list)); + break; + } + default: + break; + } + return CHIP_NO_ERROR; +} + +} // namespace + +bool emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::DecodableType & commandData) +{ + return false; +} + +// ----------------------------------------------------------------------------- +// Plugin initialization + +void MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(void) +{ + registerAttributeAccessOverride(&gAttrAccess); +} diff --git a/examples/all-clusters-app/ameba/README.md b/examples/all-clusters-app/ameba/README.md index 69dfd29aa11c4c..ad0f95ecffd8de 100644 --- a/examples/all-clusters-app/ameba/README.md +++ b/examples/all-clusters-app/ameba/README.md @@ -13,6 +13,7 @@ control. - [BLE mode](#ble-mode) - [IP mode](#ip-mode) - [Cluster control](#cluster-control) + - [Running RPC Console](#running-rpc-console) --- @@ -113,3 +114,31 @@ to be On or Off. [Python Controller](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/python_chip_controller_building.md#step-8-control-application-zcl-clusters) $ chip-device-ctrl > zcl OnOff Toggle 1234 1 0 + +## Running RPC Console + +- Connect a USB-TTL Adapter as shown below + + Ameba USB-TTL + A19 TX + A18 RX + GND GND + +- Build the + [chip-rpc console](https://github.com/project-chip/connectedhomeip/tree/master/examples/common/pigweed/rpc_console) + +- As part of building the example with RPCs enabled the chip_rpc python + interactive console is installed into your venv. The python wheel files are + also created in the output folder: out/debug/chip_rpc_console_wheels. To + install the wheel files without rebuilding: + + $ pip3 install out/debug/chip_rpc_console_wheels/*.whl + +- Launch the chip-rpc console after inputting `ATS$` command + + $ python3 -m chip_rpc.console --device /dev/tty -b 115200 + +- Get and Set lighting directly using the RPC console + + rpcs.chip.rpc.Lighting.Get() + rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5)) diff --git a/examples/all-clusters-app/ameba/chip_main.cmake b/examples/all-clusters-app/ameba/chip_main.cmake index db77f4bce9cd26..fa03acfbd1673c 100755 --- a/examples/all-clusters-app/ameba/chip_main.cmake +++ b/examples/all-clusters-app/ameba/chip_main.cmake @@ -8,8 +8,110 @@ set(dir "${sdk_root}/component/common/api") set(chip_main chip_main) set(list_chip_main_sources chip_main_sources) +if (matter_enable_rpc) +set(pigweed_dir "${chip_dir}/third_party/pigweed/repo") + +include(${pigweed_dir}/pw_build/pigweed.cmake) +include(${pigweed_dir}/pw_protobuf_compiler/proto.cmake) + +set(dir_pw_third_party_nanopb "${chip_dir}/third_party/nanopb/repo" CACHE STRING "" FORCE) + +pw_set_backend(pw_log pw_log_basic) +pw_set_backend(pw_assert pw_assert_log) +pw_set_backend(pw_sys_io pw_sys_io.ameba) +pw_set_backend(pw_trace pw_trace_tokenized) + +add_subdirectory(${chip_dir}/third_party/pigweed/repo ${chip_dir}/examples/all-clusters-app/ameba/out/pigweed) +add_subdirectory(${chip_dir}/third_party/nanopb/repo ${chip_dir}/examples/all-clusters-app/ameba/out/nanopb) +add_subdirectory(${chip_dir}/examples/platform/ameba/pw_sys_io ${chip_dir}/examples/all-clusters-app/ameba/out/pw_sys_io) + +pw_proto_library(attributes_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/attributes_service.proto + INPUTS + ${chip_dir}/examples/common/pigweed/protos/attributes_service.options + PREFIX + attributes_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_protos +) + +pw_proto_library(button_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/button_service.proto + PREFIX + button_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_protos +) + +pw_proto_library(device_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/device_service.proto + INPUTS + ${chip_dir}/examples/common/pigweed/protos/device_service.options + PREFIX + device_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_protos +) + +pw_proto_library(lighting_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/lighting_service.proto + PREFIX + lighting_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_protos +) + +pw_proto_library(locking_service + SOURCES + ${chip_dir}/examples/common/pigweed/protos/locking_service.proto + PREFIX + locking_service + STRIP_PREFIX + ${chip_dir}/examples/common/pigweed/protos + DEPS + pw_protobuf.common_protos +) + +pw_proto_library(wifi_service + SOURCES + ${chip_dir}/examples/ipv6only-app/common/wifi_service/wifi_service.proto + INPUTS + ${chip_dir}/examples/ipv6only-app/common/wifi_service/wifi_service.options + PREFIX + wifi_service + DEPS + pw_protobuf.common_protos + STRIP_PREFIX + ${chip_dir}/examples/ipv6only-app/common/wifi_service +) + +endif(matter_enable_rpc) + include(${prj_root}/GCC-RELEASE/project_hp/asdk/includepath.cmake) +if (matter_enable_rpc) +list( + APPEND ${list_chip_main_sources} + #rpc + ${chip_dir}/examples/platform/ameba/PigweedLogger.cpp + ${chip_dir}/examples/platform/ameba/Rpc.cpp + ${chip_dir}/examples/common/pigweed/RpcService.cpp + ${chip_dir}/examples/common/pigweed/ameba/PigweedLoggerMutex.cpp +) +endif (matter_enable_rpc) + list( APPEND ${list_chip_main_sources} @@ -19,6 +121,7 @@ list( ${chip_dir}/zzz_generated/all-clusters-app/zap-generated/CHIPClusters.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/ota-requestor-stub.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/chipinterface.cpp @@ -26,6 +129,7 @@ list( ${chip_dir}/examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/Globals.cpp ${chip_dir}/examples/all-clusters-app/ameba/main/LEDWidget.cpp + ${chip_dir}/examples/all-clusters-app/ameba/main/DsoHack.cpp ) add_library( @@ -39,10 +143,26 @@ chip_configure_data_model(chip_main ZAP_FILE ${matter_example_path}/../all-clusters-common/all-clusters-app.zap ) +if (matter_enable_rpc) target_include_directories( ${chip_main} PUBLIC - ${inc_path} + #rpc + ${chip_dir}/examples/platform/ameba + ${chip_dir}/examples/platform/ameba/pw_sys_io/public + ${chip_dir}/examples/common + ${chip_dir}/examples/common/pigweed + ${chip_dir}/examples/common/pigweed/ameba + ${chip_dir}/src + ${chip_dir}/src/lib/support + ${pigweed_dir}/pw_rpc/nanopb/public +) +endif (matter_enable_rpc) + +target_include_directories( + ${chip_main} + PUBLIC + ${inc_path} ${chip_dir}/zzz_generated/all-clusters-app ${chip_dir}/zzz_generated/all-clusters-app/zap-generated ${chip_dir}/zzz_generated/app-common @@ -62,6 +182,30 @@ target_include_directories( ${chip_dir}/third_party/nlunit-test/repo/src ) +if (matter_enable_rpc) +target_link_libraries(${chip_main} PUBLIC + attributes_service.nanopb_rpc + button_service.nanopb_rpc + 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_trace_tokenized + pw_trace_tokenized.trace_buffer + pw_trace_tokenized.rpc_service + pw_trace_tokenized.protos.nanopb_rpc + PwRpc +) + +link_directories( + ${chip_dir_output}/lib +) +endif (matter_enable_rpc) + list( APPEND chip_main_flags @@ -73,6 +217,19 @@ list( -DMBEDTLS_CONFIG_FILE= ) +if (matter_enable_rpc) +list( + APPEND chip_main_flags + + -DPW_RPC_ATTRIBUTE_SERVICE=1 + -DPW_RPC_BUTTON_SERVICE=1 + -DPW_RPC_DEVICE_SERVICE=1 + -DPW_RPC_LIGHTING_SERVICE=1 + -DPW_RPC_LOCKING_SERVICE=1 + -DCONFIG_ENABLE_PW_RPC=1 +) +endif (matter_enable_rpc) + list( APPEND chip_main_cpp_flags @@ -90,3 +247,4 @@ add_custom_command( POST_BUILD COMMAND cp lib${chip_main}.a ${CMAKE_CURRENT_SOURCE_DIR}/lib/application ) + diff --git a/zzz_generated/ota-provider-app/zap-generated/encoder.cpp b/examples/all-clusters-app/ameba/main/DsoHack.cpp similarity index 83% rename from zzz_generated/ota-provider-app/zap-generated/encoder.cpp rename to examples/all-clusters-app/ameba/main/DsoHack.cpp index 759d13c5028d26..6fc5d7a63307c5 100644 --- a/zzz_generated/ota-provider-app/zap-generated/encoder.cpp +++ b/examples/all-clusters-app/ameba/main/DsoHack.cpp @@ -1,5 +1,4 @@ /* - * * Copyright (c) 2021 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,4 +14,7 @@ * limitations under the License. */ -// THIS FILE IS GENERATED BY ZAP +// This hack is needed because Ameba SDK is not linking against libstdc++ correctly. +extern "C" { +void * __dso_handle = 0; +} diff --git a/examples/all-clusters-app/ameba/main/chipinterface.cpp b/examples/all-clusters-app/ameba/main/chipinterface.cpp index e49d28aaca6c24..c5d0071dd12ade 100644 --- a/examples/all-clusters-app/ameba/main/chipinterface.cpp +++ b/examples/all-clusters-app/ameba/main/chipinterface.cpp @@ -36,9 +36,9 @@ #include #include -extern "C" { -void * __dso_handle = 0; -} +#if CONFIG_ENABLE_PW_RPC +#include "Rpc.h" +#endif using namespace ::chip; using namespace ::chip::Credentials; @@ -190,6 +190,10 @@ extern "C" void ChipTest(void) ChipLogProgress(DeviceLayer, "All Clusters Demo!"); CHIP_ERROR err = CHIP_NO_ERROR; +#if CONFIG_ENABLE_PW_RPC + chip::rpc::Init(); +#endif + initPref(); CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index d3ad156f8ad442..f63bb3ab9d1443 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -40,14 +40,14 @@ the riscv-esp32-elf toolchain for ESP32C3 modules. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout branch - [release/v4.4](https://github.com/espressif/esp-idf/tree/release/v4.4) +- Clone the Espressif ESP-IDF and checkout + [v4.4-beta1 pre-release](https://github.com/espressif/esp-idf/releases/tag/v4.4-beta1) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.4 + $ git checkout v4.4-beta1 $ git submodule update --init $ ./install.sh diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 6e5deacb0edf4e..f35386484bc48d 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -48,7 +48,7 @@ set(SRC_DIRS_LIST "${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/network-commissioning-old" "${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" @@ -63,10 +63,12 @@ set(SRC_DIRS_LIST "${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/tv-channel-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/channel-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes" "${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" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" @@ -75,6 +77,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ias-zone-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-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/examples/all-clusters-app/all-clusters-common/src" @@ -229,6 +232,7 @@ target_compile_options(${COMPONENT_LIB} PRIVATE "-DPW_RPC_BUTTON_SERVICE=1" "-DPW_RPC_DEVICE_SERVICE=1" "-DPW_RPC_LIGHTING_SERVICE=1" - "-DPW_RPC_LOCKING_SERVICE=1") + "-DPW_RPC_LOCKING_SERVICE=1" + "-DPW_RPC_TRACING_SERVICE=1") endif (CONFIG_ENABLE_PW_RPC) diff --git a/examples/all-clusters-app/esp32/main/Kconfig.projbuild b/examples/all-clusters-app/esp32/main/Kconfig.projbuild index e82f04f2ac00e5..0960168aadca4a 100644 --- a/examples/all-clusters-app/esp32/main/Kconfig.projbuild +++ b/examples/all-clusters-app/esp32/main/Kconfig.projbuild @@ -140,12 +140,3 @@ depends on ENABLE_PW_RPC about available pin numbers for UART. endmenu - -menu "OTA Options" - - config ENABLE_OTA_REQUESTOR - bool "Enable OTA Requestor" - default y - help - Enable this option to enable the OTA Requestor -endmenu diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index 9c9126002c0604..82441ca30737aa 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -241,9 +241,10 @@ class EditAttributeListModel : public ListScreen::Model ESP_LOGI(TAG, "name and cluster: '%s' (%s)", name.c_str(), cluster.c_str()); if (name == "State" && cluster == "Lock") { + using namespace chip::app::Clusters; // update the doorlock attribute here - uint8_t attributeValue = value == "Closed" ? EMBER_ZCL_DOOR_LOCK_STATE_LOCKED : EMBER_ZCL_DOOR_LOCK_STATE_UNLOCKED; - chip::app::Clusters::DoorLock::Attributes::LockState::Set(DOOR_LOCK_SERVER_ENDPOINT, attributeValue); + auto attributeValue = value == "Closed" ? DoorLock::DlLockState::kLocked : DoorLock::DlLockState::kUnlocked; + DoorLock::Attributes::LockState::Set(DOOR_LOCK_SERVER_ENDPOINT, attributeValue); } } } @@ -472,7 +473,8 @@ void SetupPretendDevices() AddCluster("Lock"); AddAttribute("State", "Open"); // write the door lock state - chip::app::Clusters::DoorLock::Attributes::LockState::Set(DOOR_LOCK_SERVER_ENDPOINT, EMBER_ZCL_DOOR_LOCK_STATE_UNLOCKED); + chip::app::Clusters::DoorLock::Attributes::LockState::Set(DOOR_LOCK_SERVER_ENDPOINT, + chip::app::Clusters::DoorLock::DlLockState::kUnlocked); AddDevice("Garage 1"); AddEndpoint("Door 1"); AddCluster("Door"); diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index 351b79e8f5f316..9f2870d976d65b 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -18,8 +18,10 @@ import("//build_overrides/chip.gni") executable("chip-all-clusters-app") { 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/ota-requestor-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "include/tv-callbacks.cpp", + "include/tv-callbacks.h", "main.cpp", ] diff --git a/examples/all-clusters-app/linux/include/tv-callbacks.cpp b/examples/all-clusters-app/linux/include/tv-callbacks.cpp index 79a6ee8413daac..33a8154e9be6d7 100644 --- a/examples/all-clusters-app/linux/include/tv-callbacks.cpp +++ b/examples/all-clusters-app/linux/include/tv-callbacks.cpp @@ -22,7 +22,9 @@ ******************************************************************************* ******************************************************************************/ -bool lowPowerClusterSleep() +#include "tv-callbacks.h" + +bool LowPowerManager::HandleSleep() { return true; } diff --git a/examples/all-clusters-app/linux/include/tv-callbacks.h b/examples/all-clusters-app/linux/include/tv-callbacks.h new file mode 100644 index 00000000000000..1ee3f4264370af --- /dev/null +++ b/examples/all-clusters-app/linux/include/tv-callbacks.h @@ -0,0 +1,31 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/**************************************************************************** + * @file + * @brief Routines for TV stubs + *server stub implementation of TV cluster code. + ******************************************************************************* + ******************************************************************************/ + +#include + +class LowPowerManager : public chip::app::Clusters::LowPower::Delegate +{ +public: + bool HandleSleep() override; +}; diff --git a/examples/all-clusters-app/linux/main.cpp b/examples/all-clusters-app/linux/main.cpp index 3c8d5faa5a8e39..f7a58ab4e5dcfc 100644 --- a/examples/all-clusters-app/linux/main.cpp +++ b/examples/all-clusters-app/linux/main.cpp @@ -16,29 +16,40 @@ * limitations under the License. */ +#include "include/tv-callbacks.h" #include #include +#include #include +#include #include "AppMain.h" +using namespace chip; +using namespace chip::app; +using namespace chip::DeviceLayer; + +namespace { +static LowPowerManager lowPowerManager; +} // namespace + bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) { emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); return true; } -void OnIdentifyStart(Identify *) +void OnIdentifyStart(::Identify *) { ChipLogProgress(Zcl, "OnIdentifyStart"); } -void OnIdentifyStop(Identify *) +void OnIdentifyStop(::Identify *) { ChipLogProgress(Zcl, "OnIdentifyStop"); } -void OnTriggerEffect(Identify * identify) +void OnTriggerEffect(::Identify * identify) { switch (identify->mCurrentEffectIdentifier) { @@ -68,9 +79,43 @@ static Identify gIdentify1 = { chip::EndpointId{ 1 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, }; +// Network commissioning +namespace { +// This file is being used by platforms other than Linux, so we need this check to disable related features since we only +// implemented them on linux. +#if CHIP_DEVICE_LAYER_TARGET_LINUX +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +NetworkCommissioning::LinuxThreadDriver sLinuxThreadDriver; +Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(0 /* Endpoint Id */, &sLinuxThreadDriver); +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_WPA +NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver; +Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(1 /* Endpoint Id */, &sLinuxWiFiDriver); +#endif +#endif +} // namespace + +void ApplicationInit() +{ +#if CHIP_DEVICE_LAYER_TARGET_LINUX && defined(ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER) +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + sThreadNetworkCommissioningInstance.Init(); +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_WPA + sWiFiNetworkCommissioningInstance.Init(); +#endif +#endif +} + int main(int argc, char * argv[]) { VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0); ChipLinuxAppMainLoop(); return 0; } + +void emberAfLowPowerClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: LowPower::SetDefaultDelegate"); + chip::app::Clusters::LowPower::SetDefaultDelegate(endpoint, &lowPowerManager); +} diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index cb3fec04753396..03798b5d4d2258 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -68,6 +68,7 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/server/CommissioningWindowManager.cpp ${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp + ${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common/src/ota-requestor-stub.cpp ${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp ${APP_UTIL}/DataModelHandler.cpp @@ -113,15 +114,16 @@ target_sources(${APP_TARGET} PRIVATE ${APP_CLUSTERS}/media-input-server/media-input-server.cpp ${APP_CLUSTERS}/media-playback-server/media-playback-server.cpp ${APP_CLUSTERS}/mode-select-server/mode-select-server.cpp - ${APP_CLUSTERS}/network-commissioning/network-commissioning-ember.cpp - ${APP_CLUSTERS}/network-commissioning/network-commissioning.cpp + ${APP_CLUSTERS}/network-commissioning-old/network-commissioning-ember.cpp + ${APP_CLUSTERS}/network-commissioning-old/network-commissioning-old.cpp ${APP_CLUSTERS}/on-off-server/on-off-server.cpp ${APP_CLUSTERS}/ota-provider/ota-provider.cpp ${APP_CLUSTERS}/scenes/scenes.cpp + ${APP_CLUSTERS}/switch-server/switch-server.cpp ${APP_CLUSTERS}/target-navigator-server/target-navigator-server.cpp ${APP_CLUSTERS}/thermostat-server/thermostat-server.cpp ${APP_CLUSTERS}/thermostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp - ${APP_CLUSTERS}/tv-channel-server/tv-channel-server.cpp + ${APP_CLUSTERS}/channel-server/channel-server.cpp ${APP_CLUSTERS}/operational-credentials-server/operational-credentials-server.cpp ${APP_CLUSTERS}/test-cluster-server/test-cluster-server.cpp ${APP_CLUSTERS}/occupancy-sensor-server/occupancy-sensor-server.cpp @@ -129,12 +131,14 @@ target_sources(${APP_TARGET} PRIVATE ${APP_CLUSTERS}/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp ${APP_CLUSTERS}/software-diagnostics-server/software-diagnostics-server.cpp ${APP_CLUSTERS}/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp + ${APP_CLUSTERS}/wake-on-lan-server/wake-on-lan-server.cpp ${APP_CLUSTERS}/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp ${APP_CLUSTERS}/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp ${APP_CLUSTERS}/administrator-commissioning-server/administrator-commissioning-server.cpp ${APP_CLUSTERS}/identify-server/identify-server.cpp ${APP_CLUSTERS}/window-covering-server/window-covering-server.cpp ${APP_CLUSTERS}/general-diagnostics-server/general-diagnostics-server.cpp + ${APP_CLUSTERS}/group-key-mgmt-server/group-key-mgmt-server.cpp ${APP_CLUSTERS}/power-source-configuration-server/power-source-configuration-server.cpp ) diff --git a/examples/all-clusters-app/mbed/main/LowPowerManager.cpp b/examples/all-clusters-app/mbed/main/LowPowerManager.cpp index fc1a1f2b4dc950..57399c0ba1de5c 100644 --- a/examples/all-clusters-app/mbed/main/LowPowerManager.cpp +++ b/examples/all-clusters-app/mbed/main/LowPowerManager.cpp @@ -16,7 +16,10 @@ * limitations under the License. */ -bool lowPowerClusterSleep() +#include "LowPowerManager.h" + +bool LowPowerManager::HandleSleep() { + // TODO: Insert code here return true; } diff --git a/examples/tv-app/linux/include/tv-channel/TvChannelManager.h b/examples/all-clusters-app/mbed/main/include/LowPowerManager.h similarity index 70% rename from examples/tv-app/linux/include/tv-channel/TvChannelManager.h rename to examples/all-clusters-app/mbed/main/include/LowPowerManager.h index 5b0e4ed7027df3..92bb1417be514d 100644 --- a/examples/tv-app/linux/include/tv-channel/TvChannelManager.h +++ b/examples/all-clusters-app/mbed/main/include/LowPowerManager.h @@ -1,6 +1,7 @@ -/** +/* * * 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. @@ -17,15 +18,10 @@ #pragma once -#include +#include -#include -#include -#include - -class TvChannelManager +class LowPowerManager : public chip::app::Clusters::LowPower::Delegate { public: - CHIP_ERROR Init(); - CHIP_ERROR proxyGetTvChannelList(chip::EndpointId mEndpointId, chip::app::AttributeValueEncoder & aEncoder); + bool HandleSleep() override; }; diff --git a/examples/all-clusters-app/mbed/main/main.cpp b/examples/all-clusters-app/mbed/main/main.cpp index f92a5faf85c5f0..830168b936751c 100644 --- a/examples/all-clusters-app/mbed/main/main.cpp +++ b/examples/all-clusters-app/mbed/main/main.cpp @@ -48,7 +48,7 @@ int main(int argc, char * argv[]) err = chip::Platform::MemoryInit(); if (err != CHIP_NO_ERROR) { - ChipLogError(NotSpecified, "Memory initalization failed: %s", err.AsString()); + ChipLogError(NotSpecified, "Memory initialization failed: %s", err.AsString()); ret = EXIT_FAILURE; goto exit; } @@ -56,7 +56,7 @@ int main(int argc, char * argv[]) err = PlatformMgr().InitChipStack(); if (err != CHIP_NO_ERROR) { - ChipLogError(NotSpecified, "Chip stack initalization failed: %s", err.AsString()); + ChipLogError(NotSpecified, "Chip stack initialization failed: %s", err.AsString()); ret = EXIT_FAILURE; goto exit; } diff --git a/examples/all-clusters-app/p6/BUILD.gn b/examples/all-clusters-app/p6/BUILD.gn index 5b99c3f3b3b6f6..ccd4ac152789de 100644 --- a/examples/all-clusters-app/p6/BUILD.gn +++ b/examples/all-clusters-app/p6/BUILD.gn @@ -61,6 +61,7 @@ p6_executable("clusters_app") { 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/ota-requestor-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${examples_plat_dir}/LEDWidget.cpp", "${examples_plat_dir}/init_p6Platform.cpp", diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 752bb80bb1505e..79aa436e01699c 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -4493,6 +4493,5 @@ "endpointVersion": 1, "deviceIdentifier": 257 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/bridge-app/esp32/README.md b/examples/bridge-app/esp32/README.md index 9a7f3e29fcbf8e..7622731572e944 100644 --- a/examples/bridge-app/esp32/README.md +++ b/examples/bridge-app/esp32/README.md @@ -83,14 +83,14 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout branch - [release/v4.4](https://github.com/espressif/esp-idf/tree/release/v4.4) +- Clone the Espressif ESP-IDF and checkout + [v4.4-beta1 pre-release](https://github.com/espressif/esp-idf/releases/tag/v4.4-beta1) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.4 + $ git checkout v4.4-beta1 $ git submodule update --init $ ./install.sh diff --git a/examples/bridge-app/esp32/main/CMakeLists.txt b/examples/bridge-app/esp32/main/CMakeLists.txt index 4587054f593b5c..ee2ca2f5cab616 100644 --- a/examples/bridge-app/esp32/main/CMakeLists.txt +++ b/examples/bridge-app/esp32/main/CMakeLists.txt @@ -35,9 +35,11 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-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/descriptor" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 63c575acbcdf30..f6d7814d38f250 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -566,6 +566,8 @@ CHIP_ERROR PrintQRCodeContent() } } // namespace +void ApplicationInit() {} + int main(int argc, char * argv[]) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index 0ac0324703f36a..4b06c0eaba8589 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -25,7 +25,17 @@ declare_args() { config_use_separate_eventloop = true } -executable("chip-tool") { +config("config") { + include_dirs = [ + ".", + "${chip_root}/zzz_generated/chip-tool", + "${chip_root}/src/lib", + ] + + defines = [ "CONFIG_USE_SEPARATE_EVENTLOOP=${config_use_separate_eventloop}" ] +} + +static_library("chip-tool-utils") { sources = [ "commands/clusters/ModelCommand.cpp", "commands/common/CHIPCommand.cpp", @@ -33,6 +43,7 @@ executable("chip-tool") { "commands/common/Command.cpp", "commands/common/CommandInvoker.h", "commands/common/Commands.cpp", + "commands/common/CredentialIssuerCommands.h", "commands/discover/DiscoverCommand.cpp", "commands/discover/DiscoverCommissionablesCommand.cpp", "commands/discover/DiscoverCommissionersCommand.cpp", @@ -45,14 +56,11 @@ executable("chip-tool") { "commands/pairing/PairingCommand.cpp", "commands/payload/AdditionalDataParseCommand.cpp", "commands/payload/SetupPayloadParseCommand.cpp", - "commands/reporting/ReportingCommand.cpp", + "commands/payload/SetupPayloadVerhoeff.cpp", "commands/tests/TestCommand.cpp", "config/PersistentStorage.cpp", - "main.cpp", ] - defines = [ "CONFIG_USE_SEPARATE_EVENTLOOP=${config_use_separate_eventloop}" ] - deps = [ "${chip_root}/src/app/server", "${chip_root}/src/app/tests/suites/pics", @@ -64,11 +72,32 @@ executable("chip-tool") { cflags = [ "-Wconversion" ] - include_dirs = [ - ".", - "${chip_root}/zzz_generated/chip-tool", + public_configs = [ ":config" ] + + if (chip_enable_transport_trace) { + deps += [ "${chip_root}/examples/common/tracing:trace_handlers" ] + } + + output_dir = root_out_dir +} + +executable("chip-tool") { + sources = [ "main.cpp" ] + + deps = [ + ":chip-tool-utils", + "${chip_root}/src/app/server", + "${chip_root}/src/app/tests/suites/pics", + "${chip_root}/src/controller/data_model", + "${chip_root}/src/lib", + "${chip_root}/src/platform", + "${chip_root}/third_party/inipp", ] + cflags = [ "-Wconversion" ] + + public_configs = [ ":config" ] + if (chip_enable_transport_trace) { deps += [ "${chip_root}/examples/common/tracing:trace_handlers" ] } diff --git a/examples/chip-tool/README.md b/examples/chip-tool/README.md index cbe544a80291fc..b0a8a513e204e9 100644 --- a/examples/chip-tool/README.md +++ b/examples/chip-tool/README.md @@ -48,7 +48,7 @@ traces should go: For example: ``` -out/with_trace/chip-tool --trace_file trace.log pairing +out/with_trace/chip-tool pairing --trace_file trace.log ``` ## Using the Client to commission a device diff --git a/examples/chip-tool/commands/clusters/ModelCommand.cpp b/examples/chip-tool/commands/clusters/ModelCommand.cpp index 01406250d7a360..a8e5ddd0071086 100644 --- a/examples/chip-tool/commands/clusters/ModelCommand.cpp +++ b/examples/chip-tool/commands/clusters/ModelCommand.cpp @@ -36,7 +36,7 @@ void ModelCommand::OnDeviceConnectedFn(void * context, ChipDevice * device) command->SendCommand(device, command->mEndPointId); } -void ModelCommand::OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR err) +void ModelCommand::OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR err) { LogErrorOnFailure(err); diff --git a/examples/chip-tool/commands/clusters/ModelCommand.h b/examples/chip-tool/commands/clusters/ModelCommand.h index b03361433e0996..e769ad3f9ffad3 100644 --- a/examples/chip-tool/commands/clusters/ModelCommand.h +++ b/examples/chip-tool/commands/clusters/ModelCommand.h @@ -54,7 +54,7 @@ class ModelCommand : public CHIPCommand uint8_t mEndPointId; static void OnDeviceConnectedFn(void * context, ChipDevice * device); - static void OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR error); + static void OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error); chip::Callback::Callback mOnDeviceConnectedCallback; chip::Callback::Callback mOnDeviceConnectionFailureCallback; diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index b8568da129a48e..d1293ccc7bc6bd 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -19,14 +19,15 @@ #include "CHIPCommand.h" #include -#include -#include -#include -#include +#include #include #include #include +#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED +#include "TraceHandlers.h" +#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + using DeviceControllerFactory = chip::Controller::DeviceControllerFactory; constexpr chip::FabricId kIdentityAlphaFabricId = 1; @@ -35,6 +36,8 @@ constexpr chip::FabricId kIdentityGammaFabricId = 3; CHIP_ERROR CHIPCommand::Run() { + StartTracing(); + #if CHIP_DEVICE_LAYER_TARGET_LINUX && CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE // By default, Linux device is configured as a BLE peripheral while the controller needs a BLE central. ReturnLogErrorOnFailure(chip::DeviceLayer::Internal::BLEMgrImpl().ConfigureBle(0, true)); @@ -48,7 +51,9 @@ CHIP_ERROR CHIPCommand::Run() factoryInitParams.listenPort = static_cast(mDefaultStorage.GetListenPort() + CurrentCommissionerIndex()); ReturnLogErrorOnFailure(DeviceControllerFactory::GetInstance().Init(factoryInitParams)); - ReturnLogErrorOnFailure(InitializeCommissioner(GetIdentity(), CurrentCommissionerIndex())); + ReturnLogErrorOnFailure(InitializeCommissioner(kIdentityAlpha, kIdentityAlphaFabricId)); + ReturnLogErrorOnFailure(InitializeCommissioner(kIdentityBeta, kIdentityBetaFabricId)); + ReturnLogErrorOnFailure(InitializeCommissioner(kIdentityGamma, kIdentityGammaFabricId)); chip::DeviceLayer::PlatformMgr().ScheduleWork(RunQueuedCommand, reinterpret_cast(this)); ReturnLogErrorOnFailure(StartWaiting(GetWaitDuration())); @@ -60,11 +65,37 @@ CHIP_ERROR CHIPCommand::Run() // since the CHIP thread and event queue have been stopped, preventing any thread // races. // - ReturnLogErrorOnFailure(ShutdownCommissioner(GetIdentity())); + ReturnLogErrorOnFailure(ShutdownCommissioner(kIdentityAlpha)); + ReturnLogErrorOnFailure(ShutdownCommissioner(kIdentityBeta)); + ReturnLogErrorOnFailure(ShutdownCommissioner(kIdentityGamma)); + StopTracing(); return CHIP_NO_ERROR; } +void CHIPCommand::StartTracing() +{ +#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + chip::trace::InitTrace(); + + if (mTraceFile.HasValue()) + { + chip::trace::SetTraceStream(new chip::trace::TraceStreamFile(mTraceFile.Value())); + } + else if (mTraceLog.HasValue() && mTraceLog.Value() == true) + { + chip::trace::SetTraceStream(new chip::trace::TraceStreamLog()); + } +#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED +} + +void CHIPCommand::StopTracing() +{ +#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + chip::trace::DeInitTrace(); +#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED +} + void CHIPCommand::SetIdentity(const char * identity) { std::string name = std::string(identity); @@ -131,11 +162,11 @@ CHIP_ERROR CHIPCommand::InitializeCommissioner(std::string key, chip::FabricId f chip::Platform::ScopedMemoryBuffer icac; chip::Platform::ScopedMemoryBuffer rcac; - chip::Credentials::SetDeviceAttestationCredentialsProvider(chip::Credentials::Examples::GetExampleDACProvider()); + std::unique_ptr commissioner = std::make_unique(); + chip::Controller::SetupParams commissionerParams; - // TODO: Replace testingRootStore with a AttestationTrustStore that has the necessary official PAA roots available - const chip::Credentials::AttestationTrustStore * testingRootStore = chip::Credentials::GetTestAttestationTrustStore(); - chip::Credentials::SetDeviceAttestationVerifier(chip::Credentials::GetDefaultDACVerifier(testingRootStore)); + ReturnLogErrorOnFailure(mCredIssuerCmds->SetupDeviceAttestation(commissionerParams)); + chip::Credentials::SetDeviceAttestationVerifier(commissionerParams.deviceAttestationVerifier); VerifyOrReturnError(noc.Alloc(chip::Controller::kMaxCHIPDERCertLength), CHIP_ERROR_NO_MEMORY); VerifyOrReturnError(icac.Alloc(chip::Controller::kMaxCHIPDERCertLength), CHIP_ERROR_NO_MEMORY); @@ -152,14 +183,13 @@ CHIP_ERROR CHIPCommand::InitializeCommissioner(std::string key, chip::FabricId f // store the credentials in persistent storage, and // generate when not available in the storage. ReturnLogErrorOnFailure(mCommissionerStorage.Init(key.c_str())); - ReturnLogErrorOnFailure(mOpCredsIssuer.Initialize(mCommissionerStorage)); - ReturnLogErrorOnFailure(mOpCredsIssuer.GenerateNOCChainAfterValidation(mCommissionerStorage.GetLocalNodeId(), fabricId, - ephemeralKey.Pubkey(), rcacSpan, icacSpan, nocSpan)); + ReturnLogErrorOnFailure(mCredIssuerCmds->InitializeCredentialsIssuer(mCommissionerStorage)); + ReturnLogErrorOnFailure(mCredIssuerCmds->GenerateControllerNOCChain(mCommissionerStorage.GetLocalNodeId(), fabricId, + ephemeralKey, rcacSpan, icacSpan, nocSpan)); - std::unique_ptr commissioner = std::make_unique(); - chip::Controller::SetupParams commissionerParams; commissionerParams.storageDelegate = &mCommissionerStorage; - commissionerParams.operationalCredentialsDelegate = &mOpCredsIssuer; + commissionerParams.fabricIndex = static_cast(fabricId); + commissionerParams.operationalCredentialsDelegate = mCredIssuerCmds->GetCredentialIssuer(); commissionerParams.ephemeralKeypair = &ephemeralKey; commissionerParams.controllerRCAC = rcacSpan; commissionerParams.controllerICAC = icacSpan; diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index f1aeadbbffea81..930f5cd31c10a3 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -18,10 +18,10 @@ #pragma once -#include - #include "../../config/PersistentStorage.h" #include "Command.h" +#include +#include #pragma once @@ -39,9 +39,22 @@ class CHIPCommand : public Command using ChipDeviceController = ::chip::Controller::DeviceController; using IPAddress = ::chip::Inet::IPAddress; using NodeId = ::chip::NodeId; + using PeerId = ::chip::PeerId; using PeerAddress = ::chip::Transport::PeerAddress; - CHIPCommand(const char * commandName) : Command(commandName) { AddArgument("commissioner-name", &mCommissionerName); } + CHIPCommand(const char * commandName) : Command(commandName) + { + AddArgument("commissioner-name", &mCommissionerName); +#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + AddArgument("trace_file", &mTraceFile); + AddArgument("trace_log", 0, 1, &mTraceLog); +#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + } + + CHIPCommand(const char * commandName, CredentialIssuerCommands * credIssuerCmds) : CHIPCommand(commandName) + { + mCredIssuerCmds = credIssuerCmds; + } /////////// Command Interface ///////// CHIP_ERROR Run() override; @@ -71,13 +84,14 @@ class CHIPCommand : public Command PersistentStorage mDefaultStorage; PersistentStorage mCommissionerStorage; chip::SimpleFabricStorage mFabricStorage; - chip::Controller::ExampleOperationalCredentialsIssuer mOpCredsIssuer; + ExampleCredentialIssuerCommands mExampleCredentialIssuerCmds; + CredentialIssuerCommands * mCredIssuerCmds = &mExampleCredentialIssuerCmds; std::string GetIdentity(); void SetIdentity(const char * name); // This method returns the commissioner instance to be used for running the command. - // The default commissioner instance name is "alpha", but it can be overriden by passing + // The default commissioner instance name is "alpha", but it can be overridden by passing // --identity "instance name" when running a command. ChipDeviceCommissioner & CurrentCommissioner(); @@ -100,4 +114,12 @@ class CHIPCommand : public Command std::mutex cvWaitingForResponseMutex; bool mWaitingForResponse{ true }; #endif // CONFIG_USE_SEPARATE_EVENTLOOP + + void StartTracing(); + void StopTracing(); + +#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED + chip::Optional mTraceFile; + chip::Optional mTraceLog; +#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED }; diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp index 01559c5376599f..0310e412755f8b 100644 --- a/examples/chip-tool/commands/common/Command.cpp +++ b/examples/chip-tool/commands/common/Command.cpp @@ -119,16 +119,24 @@ static bool ParseAddressWithInterface(const char * addressString, Command::Addre return false; } - address->address = ::chip::Inet::IPAddress::FromSockAddr(*result->ai_addr); if (result->ai_family == AF_INET6) { struct sockaddr_in6 * addr = reinterpret_cast(result->ai_addr); + address->address = ::chip::Inet::IPAddress::FromSockAddr(*addr); address->interfaceId = ::chip::Inet::InterfaceId(addr->sin6_scope_id); } - else +#if INET_CONFIG_ENABLE_IPV4 + else if (result->ai_family == AF_INET) { + address->address = ::chip::Inet::IPAddress::FromSockAddr(*reinterpret_cast(result->ai_addr)); address->interfaceId = chip::Inet::InterfaceId::Null(); } +#endif // INET_CONFIG_ENABLE_IPV4 + else + { + ChipLogError(chipTool, "Unsupported address: %s", addressString); + return false; + } return true; } diff --git a/examples/chip-tool/commands/common/Commands.cpp b/examples/chip-tool/commands/common/Commands.cpp index f289c4ef52fba9..555c03a1133071 100644 --- a/examples/chip-tool/commands/common/Commands.cpp +++ b/examples/chip-tool/commands/common/Commands.cpp @@ -26,79 +26,6 @@ #include #include -#include - -#include - -#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED -#include "TraceHandlers.h" -#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED - -namespace { - -#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED -enum -{ - kOptionTraceFile = 0x1000, - kOptionTraceLog, -}; - -bool HandleTraceOptions(const char * program, chip::ArgParser::OptionSet * options, int identifier, const char * name, - const char * value) -{ - switch (identifier) - { - case kOptionTraceLog: - chip::trace::SetTraceStream(new chip::trace::TraceStreamLog()); - return true; - case kOptionTraceFile: - chip::trace::SetTraceStream(new chip::trace::TraceStreamFile(value)); - return true; - default: - chip::ArgParser::PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", program, name); - return false; - } -} - -chip::ArgParser::OptionDef traceCmdLineOptionDefs[] = { { "trace_file", chip::ArgParser::kArgumentRequired, kOptionTraceFile }, - { "trace_log", chip::ArgParser::kNoArgument, kOptionTraceLog }, - {} }; - -const char * traceOptionHelp = " --trace_file \n" - " Output trace data to the specified file.\n" - " --trace_log\n" - " Output trace data to the log stream.\n" - "\n"; -chip::ArgParser::OptionSet traceCmdLineOptions = { HandleTraceOptions, traceCmdLineOptionDefs, "TRACE OPTIONS", traceOptionHelp }; -#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED - -const char * kAppName = "chip-tool"; -const char * kUsage = "Usage: chip-tool [options] cluster command_name [param1] [param2]"; -const char * kVersion = nullptr; // Unknown -const char * kDescription = "A command line tool that uses Matter to send messages to a Matter server."; -chip::ArgParser::HelpOptions helpOptions(kAppName, kUsage, kVersion, kDescription); - -chip::ArgParser::OptionSet * allOptions[] = { -#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED - &traceCmdLineOptions, -#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED - &helpOptions, nullptr -}; - -int gPositionalArgc = 0; -char ** gPositionalArgv = nullptr; -const char * gProgramName = nullptr; - -bool GetPositionalArgs(const char * prog, int argc, char * argv[]) -{ - gProgramName = prog; - gPositionalArgc = argc; - gPositionalArgv = argv; - return true; -} - -} // namespace - void Commands::Register(const char * clusterName, commands_list commandsList) { for (auto & command : commandsList) @@ -119,81 +46,71 @@ int Commands::Run(int argc, char ** argv) chip::Logging::SetLogFilter(mStorage.GetLoggingLevel()); - VerifyOrExit(chip::ArgParser::ParseArgs("chip-tool", argc, argv, allOptions, GetPositionalArgs), - ChipLogError(chipTool, "Error parsing arguments")); - -#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED - chip::trace::InitTrace(); -#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED - - err = RunCommand(); + err = RunCommand(argc, argv); VerifyOrExit(err == CHIP_NO_ERROR, ChipLogError(chipTool, "Run command failure: %s", chip::ErrorStr(err))); exit: -#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED - chip::trace::DeInitTrace(); -#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED return (err == CHIP_NO_ERROR) ? EXIT_SUCCESS : EXIT_FAILURE; } -CHIP_ERROR Commands::RunCommand() +CHIP_ERROR Commands::RunCommand(int argc, char ** argv) { std::map::iterator cluster; Command * command = nullptr; - if (gPositionalArgc <= 0) + if (argc <= 1) { ChipLogError(chipTool, "Missing cluster name"); - ShowClusters(gProgramName); + ShowClusters(argv[0]); return CHIP_ERROR_INVALID_ARGUMENT; } - cluster = GetCluster(gPositionalArgv[0]); + cluster = GetCluster(argv[1]); if (cluster == mClusters.end()) { - ChipLogError(chipTool, "Unknown cluster: %s", gPositionalArgv[1]); - ShowClusters(gProgramName); + ChipLogError(chipTool, "Unknown cluster: %s", argv[1]); + ShowClusters(argv[0]); return CHIP_ERROR_INVALID_ARGUMENT; } - if (gPositionalArgc <= 1) + if (argc <= 2) { ChipLogError(chipTool, "Missing command name"); - ShowCluster(gProgramName, gPositionalArgv[0], cluster->second); + ShowCluster(argv[0], argv[1], cluster->second); return CHIP_ERROR_INVALID_ARGUMENT; } - if (!IsGlobalCommand(gPositionalArgv[1])) + if (!IsGlobalCommand(argv[2])) { - command = GetCommand(cluster->second, gPositionalArgv[1]); + command = GetCommand(cluster->second, argv[2]); if (command == nullptr) { - ChipLogError(chipTool, "Unknown command: %s", gPositionalArgv[1]); - ShowCluster(gProgramName, gPositionalArgv[0], cluster->second); + ChipLogError(chipTool, "Unknown command: %s", argv[2]); + ShowCluster(argv[0], argv[1], cluster->second); return CHIP_ERROR_INVALID_ARGUMENT; } } else { - if (gPositionalArgc <= 2) + if (argc <= 3) { ChipLogError(chipTool, "Missing attribute name"); - ShowClusterAttributes(gProgramName, gPositionalArgv[0], gPositionalArgv[1], cluster->second); + ShowClusterAttributes(argv[0], argv[1], argv[2], cluster->second); return CHIP_ERROR_INVALID_ARGUMENT; } - command = GetGlobalCommand(cluster->second, gPositionalArgv[1], gPositionalArgv[2]); + command = GetGlobalCommand(cluster->second, argv[2], argv[3]); if (command == nullptr) { - ChipLogError(chipTool, "Unknown attribute: %s", gPositionalArgv[2]); - ShowClusterAttributes(gProgramName, gPositionalArgv[0], gPositionalArgv[1], cluster->second); + ChipLogError(chipTool, "Unknown attribute: %s", argv[3]); + ShowClusterAttributes(argv[0], argv[1], argv[2], cluster->second); return CHIP_ERROR_INVALID_ARGUMENT; } } - if (!command->InitArguments(gPositionalArgc - 2, &gPositionalArgv[2])) + if (!command->InitArguments(argc - 3, &argv[3])) { - ShowCommand(gProgramName, gPositionalArgv[0], command); + ShowCommand(argv[0], argv[1], command); return CHIP_ERROR_INVALID_ARGUMENT; } diff --git a/examples/chip-tool/commands/common/Commands.h b/examples/chip-tool/commands/common/Commands.h index 2196eaf1ce5f02..e96d97ea9b0d3e 100644 --- a/examples/chip-tool/commands/common/Commands.h +++ b/examples/chip-tool/commands/common/Commands.h @@ -31,7 +31,7 @@ class Commands int Run(int argc, char ** argv); private: - CHIP_ERROR RunCommand(); + CHIP_ERROR RunCommand(int argc, char ** argv); std::map::iterator GetCluster(std::string clusterName); Command * GetCommand(CommandsVector & commands, std::string commandName); diff --git a/examples/chip-tool/commands/common/CredentialIssuerCommands.h b/examples/chip-tool/commands/common/CredentialIssuerCommands.h new file mode 100644 index 00000000000000..62b5638c6ee404 --- /dev/null +++ b/examples/chip-tool/commands/common/CredentialIssuerCommands.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include +#include +#include +#include + +class CredentialIssuerCommands +{ +public: + virtual ~CredentialIssuerCommands() {} + + /** + * @brief + * This function is used to initialize the Credentials Issuer, if needed. + * + * @param[in] storage A reference to the storage, where the Credentials Issuer can optionally use to access the keypair in + * storage. + * + * @return CHIP_ERROR CHIP_NO_ERROR on success, or corresponding error code. + */ + virtual CHIP_ERROR InitializeCredentialsIssuer(chip::PersistentStorageDelegate & storage) = 0; + + /** + * @brief + * This function is used to setup Device Attestation Singletons and intialize Setup/Commissioning Parameters with a custom + * Device Attestation Verifier object. + * + * @param[in] setupParams A reference to the Setup/Commissioning Parameters, to be initialized with custom Device Attestation + * Verifier. + * + * @return CHIP_ERROR CHIP_NO_ERROR on success, or corresponding error code. + */ + virtual CHIP_ERROR SetupDeviceAttestation(chip::Controller::SetupParams & setupParams) = 0; + + virtual chip::Controller::OperationalCredentialsDelegate * GetCredentialIssuer() = 0; + + /** + * @brief + * This function is used to Generate NOC Chain for the Controller/Commissioner. Parameters follow the example implementation, + * so some parameters may not translate to the real remote Credentials Issuer policy. + * + * @param[in] nodeId The desired NodeId for the generated NOC Chain - May be optional/unused in some implementations. + * @param[in] fabricId The desired FabricId for the generated NOC Chain - May be optional/unused in some implementations. + * @param[in] keypair The desired Keypair for the generated NOC Chain - May be optional/unused in some implementations. + * @param[inout] rcac Buffer to hold the Root Certificate of the generated NOC Chain. + * @param[inout] icac Buffer to hold the Intermediate Certificate of the generated NOC Chain. + * @param[inout] noc Buffer to hold the Leaf Certificate of the generated NOC Chain. + * + * @return CHIP_ERROR CHIP_NO_ERROR on success, or corresponding error code. + */ + virtual CHIP_ERROR GenerateControllerNOCChain(chip::NodeId nodeId, chip::FabricId fabricId, chip::Crypto::P256Keypair & keypair, + chip::MutableByteSpan & rcac, chip::MutableByteSpan & icac, + chip::MutableByteSpan & noc) = 0; +}; diff --git a/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp b/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp index 23e9b474a91dd5..a1d2ad122bed28 100644 --- a/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp +++ b/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp @@ -34,7 +34,7 @@ void DiscoverCommissionersCommand::Shutdown() const Dnssd::DiscoveredNodeData * commissioner = mCommissionableNodeController.GetDiscoveredCommissioner(i); if (commissioner != nullptr) { - ChipLogProgress(chipTool, "Discovered Commisioner #%d", commissionerCount); + ChipLogProgress(chipTool, "Discovered Commissioner #%d", commissionerCount); commissioner->LogDetail(); commissionerCount++; } diff --git a/examples/chip-tool/commands/example/ExampleCredentialIssuerCommands.h b/examples/chip-tool/commands/example/ExampleCredentialIssuerCommands.h new file mode 100644 index 00000000000000..b5b65fc847f142 --- /dev/null +++ b/examples/chip-tool/commands/example/ExampleCredentialIssuerCommands.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +class ExampleCredentialIssuerCommands : public CredentialIssuerCommands +{ +public: + CHIP_ERROR InitializeCredentialsIssuer(chip::PersistentStorageDelegate & storage) override + { + return mOpCredsIssuer.Initialize(storage); + } + CHIP_ERROR SetupDeviceAttestation(chip::Controller::SetupParams & setupParams) override + { + chip::Credentials::SetDeviceAttestationCredentialsProvider(chip::Credentials::Examples::GetExampleDACProvider()); + + // TODO: Replace testingRootStore with a AttestationTrustStore that has the necessary official PAA roots available + const chip::Credentials::AttestationTrustStore * testingRootStore = chip::Credentials::GetTestAttestationTrustStore(); + setupParams.deviceAttestationVerifier = chip::Credentials::GetDefaultDACVerifier(testingRootStore); + + return CHIP_NO_ERROR; + } + chip::Controller::OperationalCredentialsDelegate * GetCredentialIssuer() override { return &mOpCredsIssuer; } + CHIP_ERROR GenerateControllerNOCChain(chip::NodeId nodeId, chip::FabricId fabricId, chip::Crypto::P256Keypair & keypair, + chip::MutableByteSpan & rcac, chip::MutableByteSpan & icac, + chip::MutableByteSpan & noc) override + { + return mOpCredsIssuer.GenerateNOCChainAfterValidation(nodeId, fabricId, keypair.Pubkey(), rcac, icac, noc); + } + +private: + chip::Controller::ExampleOperationalCredentialsIssuer mOpCredsIssuer; +}; diff --git a/examples/chip-tool/commands/pairing/Commands.h b/examples/chip-tool/commands/pairing/Commands.h index 564bed55a2a889..20e3077a7919cf 100644 --- a/examples/chip-tool/commands/pairing/Commands.h +++ b/examples/chip-tool/commands/pairing/Commands.h @@ -23,63 +23,73 @@ #include "PairingCommand.h" #include +#include #include class Unpair : public PairingCommand { public: - Unpair() : PairingCommand("unpair", PairingMode::None, PairingNetworkType::None) {} + Unpair(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("unpair", PairingMode::None, PairingNetworkType::None, credsIssuerConfig) + {} }; class PairQRCode : public PairingCommand { public: - PairQRCode() : PairingCommand("qrcode", PairingMode::QRCode, PairingNetworkType::None) {} + PairQRCode(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("qrcode", PairingMode::QRCode, PairingNetworkType::None, credsIssuerConfig) + {} }; class PairManualCode : public PairingCommand { public: - PairManualCode() : PairingCommand("manualcode", PairingMode::ManualCode, PairingNetworkType::None) {} + PairManualCode(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("manualcode", PairingMode::ManualCode, PairingNetworkType::None, credsIssuerConfig) + {} }; class PairOnNetwork : public PairingCommand { public: - PairOnNetwork() : PairingCommand("onnetwork", PairingMode::OnNetwork, PairingNetworkType::None) {} + PairOnNetwork(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("onnetwork", PairingMode::OnNetwork, PairingNetworkType::None, credsIssuerConfig) + {} }; class PairOnNetworkShort : public PairingCommand { public: - PairOnNetworkShort() : - PairingCommand("onnetwork-short", PairingMode::OnNetwork, PairingNetworkType::None, - chip::Dnssd::DiscoveryFilterType::kShort) + PairOnNetworkShort(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("onnetwork-short", PairingMode::OnNetwork, PairingNetworkType::None, credsIssuerConfig, + chip::Dnssd::DiscoveryFilterType::kShortDiscriminator) {} }; class PairOnNetworkLong : public PairingCommand { public: - PairOnNetworkLong() : - PairingCommand("onnetwork-long", PairingMode::OnNetwork, PairingNetworkType::None, chip::Dnssd::DiscoveryFilterType::kLong) + PairOnNetworkLong(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("onnetwork-long", PairingMode::OnNetwork, PairingNetworkType::None, credsIssuerConfig, + chip::Dnssd::DiscoveryFilterType::kLongDiscriminator) {} }; class PairOnNetworkVendor : public PairingCommand { public: - PairOnNetworkVendor() : - PairingCommand("onnetwork-vendor", PairingMode::OnNetwork, PairingNetworkType::None, - chip::Dnssd::DiscoveryFilterType::kVendor) + PairOnNetworkVendor(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("onnetwork-vendor", PairingMode::OnNetwork, PairingNetworkType::None, credsIssuerConfig, + chip::Dnssd::DiscoveryFilterType::kVendorId) {} }; class PairOnNetworkFabric : public PairingCommand { public: - PairOnNetworkFabric() : - PairingCommand("onnetwork-fabric", PairingMode::OnNetwork, PairingNetworkType::None, + PairOnNetworkFabric(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("onnetwork-fabric", PairingMode::OnNetwork, PairingNetworkType::None, credsIssuerConfig, chip::Dnssd::DiscoveryFilterType::kCompressedFabricId) {} }; @@ -87,8 +97,8 @@ class PairOnNetworkFabric : public PairingCommand class PairOnNetworkCommissioningMode : public PairingCommand { public: - PairOnNetworkCommissioningMode() : - PairingCommand("onnetwork-commissioning-mode", PairingMode::OnNetwork, PairingNetworkType::None, + PairOnNetworkCommissioningMode(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("onnetwork-commissioning-mode", PairingMode::OnNetwork, PairingNetworkType::None, credsIssuerConfig, chip::Dnssd::DiscoveryFilterType::kCommissioningMode) {} }; @@ -96,8 +106,8 @@ class PairOnNetworkCommissioningMode : public PairingCommand class PairOnNetworkCommissioner : public PairingCommand { public: - PairOnNetworkCommissioner() : - PairingCommand("onnetwork-commissioner", PairingMode::OnNetwork, PairingNetworkType::None, + PairOnNetworkCommissioner(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("onnetwork-commissioner", PairingMode::OnNetwork, PairingNetworkType::None, credsIssuerConfig, chip::Dnssd::DiscoveryFilterType::kCommissioner) {} }; @@ -105,8 +115,8 @@ class PairOnNetworkCommissioner : public PairingCommand class PairOnNetworkDeviceType : public PairingCommand { public: - PairOnNetworkDeviceType() : - PairingCommand("onnetwork-device-type", PairingMode::OnNetwork, PairingNetworkType::None, + PairOnNetworkDeviceType(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("onnetwork-device-type", PairingMode::OnNetwork, PairingNetworkType::None, credsIssuerConfig, chip::Dnssd::DiscoveryFilterType::kDeviceType) {} }; @@ -114,8 +124,8 @@ class PairOnNetworkDeviceType : public PairingCommand class PairOnNetworkInstanceName : public PairingCommand { public: - PairOnNetworkInstanceName() : - PairingCommand("onnetwork-instance-name", PairingMode::OnNetwork, PairingNetworkType::None, + PairOnNetworkInstanceName(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("onnetwork-instance-name", PairingMode::OnNetwork, PairingNetworkType::None, credsIssuerConfig, chip::Dnssd::DiscoveryFilterType::kInstanceName) {} }; @@ -123,25 +133,33 @@ class PairOnNetworkInstanceName : public PairingCommand class PairBleWiFi : public PairingCommand { public: - PairBleWiFi() : PairingCommand("ble-wifi", PairingMode::Ble, PairingNetworkType::WiFi) {} + PairBleWiFi(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("ble-wifi", PairingMode::Ble, PairingNetworkType::WiFi, credsIssuerConfig) + {} }; class PairBleThread : public PairingCommand { public: - PairBleThread() : PairingCommand("ble-thread", PairingMode::Ble, PairingNetworkType::Thread) {} + PairBleThread(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("ble-thread", PairingMode::Ble, PairingNetworkType::Thread, credsIssuerConfig) + {} }; class PairSoftAP : public PairingCommand { public: - PairSoftAP() : PairingCommand("softap", PairingMode::SoftAP, PairingNetworkType::WiFi) {} + PairSoftAP(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("softap", PairingMode::SoftAP, PairingNetworkType::WiFi, credsIssuerConfig) + {} }; class Ethernet : public PairingCommand { public: - Ethernet() : PairingCommand("ethernet", PairingMode::Ethernet, PairingNetworkType::Ethernet) {} + Ethernet(CredentialIssuerCommands * credsIssuerConfig) : + PairingCommand("ethernet", PairingMode::Ethernet, PairingNetworkType::Ethernet, credsIssuerConfig) + {} }; class StartUdcServerCommand : public CHIPCommand @@ -157,31 +175,31 @@ class StartUdcServerCommand : public CHIPCommand } }; -void registerCommandsPairing(Commands & commands) +void registerCommandsPairing(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { const char * clusterName = "Pairing"; commands_list clusterCommands = { - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), - make_unique(), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), // TODO - enable CommissionedListCommand once DNS Cache is implemented // make_unique(), make_unique(), - make_unique(), + make_unique(credsIssuerConfig), }; commands.Register(clusterName, clusterCommands); diff --git a/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.cpp b/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.cpp index 030a5858067bd9..abc94a593e3948 100644 --- a/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.cpp +++ b/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.cpp @@ -31,7 +31,7 @@ void OpenCommissioningWindowCommand::OnDeviceConnectedFn(void * context, chip::O VerifyOrReturn(command != nullptr, ChipLogError(chipTool, "OnDeviceConnectedFn: context is null")); command->OpenCommissioningWindow(); } -void OpenCommissioningWindowCommand::OnDeviceConnectionFailureFn(void * context, NodeId remoteId, CHIP_ERROR err) +void OpenCommissioningWindowCommand::OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR err) { LogErrorOnFailure(err); diff --git a/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.h b/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.h index 92130cdb02ceca..cec775fc9fae8a 100644 --- a/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.h +++ b/examples/chip-tool/commands/pairing/OpenCommissioningWindowCommand.h @@ -23,8 +23,8 @@ class OpenCommissioningWindowCommand : public CHIPCommand { public: - OpenCommissioningWindowCommand() : - CHIPCommand("open-commissioning-window"), mOnDeviceConnectedCallback(OnDeviceConnectedFn, this), + OpenCommissioningWindowCommand(CredentialIssuerCommands * credIssuerCommands) : + CHIPCommand("open-commissioning-window", credIssuerCommands), mOnDeviceConnectedCallback(OnDeviceConnectedFn, this), mOnDeviceConnectionFailureCallback(OnDeviceConnectionFailureFn, this), mOnOpenCommissioningWindowCallback(OnOpenCommissioningWindowResponse, this) { @@ -48,7 +48,7 @@ class OpenCommissioningWindowCommand : public CHIPCommand CHIP_ERROR OpenCommissioningWindow(); static void OnDeviceConnectedFn(void * context, chip::OperationalDeviceProxy * device); - static void OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR error); + static void OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error); static void OnOpenCommissioningWindowResponse(void * context, NodeId deviceId, CHIP_ERROR status, chip::SetupPayload payload); chip::Callback::Callback mOnDeviceConnectedCallback; diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp index 08539ac5484ccb..cc1f4a7953abdf 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.cpp +++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp @@ -28,12 +28,10 @@ #include using namespace ::chip; - -constexpr uint64_t kBreadcrumb = 0; +using namespace ::chip::Controller; CHIP_ERROR PairingCommand::RunCommand() { - CurrentCommissioner().RegisterDeviceAddressUpdateDelegate(this); CurrentCommissioner().RegisterPairingDelegate(this); return RunInternal(mNodeId); } @@ -70,6 +68,21 @@ CHIP_ERROR PairingCommand::RunInternal(NodeId remoteId) return err; } +CommissioningParameters PairingCommand::GetCommissioningParameters() +{ + switch (mNetworkType) + { + case PairingNetworkType::WiFi: + return CommissioningParameters().SetWifiCredentials(Controller::WifiCredentials(mSSID, mPassword)); + case PairingNetworkType::Thread: + return CommissioningParameters().SetThreadOperationalDataset(mOperationalDataset); + case PairingNetworkType::Ethernet: + case PairingNetworkType::None: + return CommissioningParameters(); + } + return CommissioningParameters(); +} + CHIP_ERROR PairingCommand::PairWithQRCode(NodeId remoteId) { return CurrentCommissioner().PairDevice(remoteId, mOnboardingPayload); @@ -84,8 +97,8 @@ CHIP_ERROR PairingCommand::Pair(NodeId remoteId, PeerAddress address) { RendezvousParameters params = RendezvousParameters().SetSetupPINCode(mSetupPINCode).SetDiscriminator(mDiscriminator).SetPeerAddress(address); - - return CurrentCommissioner().PairDevice(remoteId, params); + CommissioningParameters commissioningParams = GetCommissioningParameters(); + return CurrentCommissioner().PairDevice(remoteId, params, commissioningParams); } CHIP_ERROR PairingCommand::PairWithMdns(NodeId remoteId) @@ -95,10 +108,10 @@ CHIP_ERROR PairingCommand::PairWithMdns(NodeId remoteId) { case chip::Dnssd::DiscoveryFilterType::kNone: break; - case chip::Dnssd::DiscoveryFilterType::kShort: - case chip::Dnssd::DiscoveryFilterType::kLong: + case chip::Dnssd::DiscoveryFilterType::kShortDiscriminator: + case chip::Dnssd::DiscoveryFilterType::kLongDiscriminator: case chip::Dnssd::DiscoveryFilterType::kCompressedFabricId: - case chip::Dnssd::DiscoveryFilterType::kVendor: + case chip::Dnssd::DiscoveryFilterType::kVendorId: case chip::Dnssd::DiscoveryFilterType::kDeviceType: filter.code = mDiscoveryFilterCode; break; @@ -142,7 +155,6 @@ void PairingCommand::OnPairingComplete(CHIP_ERROR err) if (err == CHIP_NO_ERROR) { ChipLogProgress(chipTool, "Pairing Success"); - err = SetupNetwork(); } else { @@ -183,183 +195,6 @@ void PairingCommand::OnCommissioningComplete(NodeId nodeId, CHIP_ERROR err) SetCommandExitStatus(err); } -CHIP_ERROR PairingCommand::SetupNetwork() -{ - - CHIP_ERROR err = CHIP_NO_ERROR; - - switch (mNetworkType) - { - case PairingNetworkType::None: - case PairingNetworkType::Ethernet: - // Nothing to do here - device address has been resolved as part of the commissioning process. - break; - case PairingNetworkType::WiFi: - case PairingNetworkType::Thread: - err = CurrentCommissioner().GetDeviceBeingCommissioned(mNodeId, &mDevice); - VerifyOrExit(err == CHIP_NO_ERROR, ChipLogError(chipTool, "Setup failure! No pairing for device: %" PRIu64, mNodeId)); - - mCluster.Associate(mDevice, mEndpointId); - - err = AddNetwork(mNetworkType); - VerifyOrExit(err == CHIP_NO_ERROR, - ChipLogError(chipTool, "Setup failure! Error calling AddOrUpdateWiFiNetwork: %s", ErrorStr(err))); - break; - } - -exit: - return err; -} - -CHIP_ERROR PairingCommand::AddNetwork(PairingNetworkType networkType) -{ - return (networkType == PairingNetworkType::WiFi) ? AddOrUpdateWiFiNetwork() : AddOrUpdateThreadNetwork(); -} - -CHIP_ERROR PairingCommand::AddOrUpdateThreadNetwork() -{ - Callback::Cancelable * successCallback = mOnAddOrUpdateThreadNetworkCallback.Cancel(); - Callback::Cancelable * failureCallback = mOnFailureCallback.Cancel(); - - return mCluster.AddOrUpdateThreadNetwork(successCallback, failureCallback, mOperationalDataset, kBreadcrumb); -} - -CHIP_ERROR PairingCommand::AddOrUpdateWiFiNetwork() -{ - Callback::Cancelable * successCallback = mOnAddOrUpdateWiFiNetworkCallback.Cancel(); - Callback::Cancelable * failureCallback = mOnFailureCallback.Cancel(); - - return mCluster.AddOrUpdateWiFiNetwork(successCallback, failureCallback, mSSID, mPassword, kBreadcrumb); -} - -chip::ByteSpan PairingCommand::GetThreadNetworkId() -{ - // For Thread devices the networkId is the extendedPanId and it is - // part of the dataset defined by OpenThread - - Thread::OperationalDataset dataset; - - if (dataset.Init(mOperationalDataset) != CHIP_NO_ERROR) - { - return ByteSpan(); - } - - if (dataset.GetExtendedPanId(mExtendedPanId) != CHIP_NO_ERROR) - { - return ByteSpan(); - } - - return ByteSpan(mExtendedPanId); -} - -CHIP_ERROR PairingCommand::ConnectNetwork() -{ - Callback::Cancelable * successCallback = mOnConnectNetworkCallback.Cancel(); - Callback::Cancelable * failureCallback = mOnFailureCallback.Cancel(); - - ByteSpan networkId; - if (mNetworkType == PairingNetworkType::WiFi) - { - networkId = mSSID; - } - else - { - networkId = GetThreadNetworkId(); - } - - if (networkId.empty()) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - return mCluster.ConnectNetwork(successCallback, failureCallback, networkId, kBreadcrumb); -} - -void PairingCommand::OnDefaultFailureResponse(void * context, uint8_t status) -{ - ChipLogProgress(chipTool, "Default Failure Response: 0x%02x", status); - - PairingCommand * command = reinterpret_cast(context); - command->SetCommandExitStatus(CHIP_ERROR_INTERNAL); -} - -void PairingCommand::OnAddNetworkResponse(void * context, uint8_t errorCode, CharSpan debugText) -{ - ChipLogProgress(chipTool, "AddNetworkResponse"); - - PairingCommand * command = reinterpret_cast(context); - - // Normally, the errorCode should be checked, but the current codebase send a default response - // instead of the command specific response. So errorCode is not set correctly. - // if (NetworkCommissioningStatus::kSuccess != errorCode) - // { - // ChipLogError(chipTool, "Setup failure. Error calling ConnectNetwork: %d", errorCode); - // command->SetCommandExitStatus(CHIP_ERROR_INTERNAL); - // return; - // } - - CHIP_ERROR err = command->ConnectNetwork(); - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, "Setup failure. Internal error calling ConnectNetwork: %s", ErrorStr(err)); - command->SetCommandExitStatus(err); - return; - } - - // When the accessory is configured as a SoftAP and WiFi is configured to an other network - // there won't be any response since the WiFi network is changing. - // So returns early, assuming everything goes well - // and the device address will be updated once a command is issued. - if (command->mPairingMode == PairingMode::SoftAP && command->mNetworkType == PairingNetworkType::WiFi) - { - command->SetCommandExitStatus(CHIP_NO_ERROR); - } -} - -void PairingCommand::OnConnectNetworkResponse(void * context, uint8_t errorCode, CharSpan debugText, int32_t errorValue) -{ - ChipLogProgress(chipTool, "ConnectNetworkResponse"); - - PairingCommand * command = reinterpret_cast(context); - - // Normally, the errorCode should be checked, but the current codebase send a default response - // instead of the command specific response. So errorCode is not set correctly. - // if (NetworkCommissioningStatus::kSuccess != errorCode) - // { - // ChipLogError(chipTool, "Setup failure. Error calling ConnectNetwork: %d", errorCode); - // command->SetCommandExitStatus(CHIP_ERROR_INTERNAL); - // return; - // } - - CHIP_ERROR err = command->UpdateNetworkAddress(); - if (CHIP_NO_ERROR != err) - { - ChipLogError(chipTool, "Setup failure. Internal error calling UpdateNetworkAddress: %s", ErrorStr(err)); - command->SetCommandExitStatus(err); - return; - } -} - -CHIP_ERROR PairingCommand::UpdateNetworkAddress() -{ - ChipLogProgress(chipTool, "Mdns: Updating NodeId: %" PRIx64 " Compressed FabricId: %" PRIx64 " ...", mNodeId, - CurrentCommissioner().GetCompressedFabricId()); - return CurrentCommissioner().UpdateDevice(mNodeId); -} - -void PairingCommand::OnAddressUpdateComplete(NodeId nodeId, CHIP_ERROR err) -{ - ChipLogProgress(chipTool, "OnAddressUpdateComplete: %" PRIx64 ": %s", nodeId, ErrorStr(err)); - if (err != CHIP_NO_ERROR) - { - // For some devices, it may take more time to appear on the network and become discoverable - // over DNS-SD, so don't give up on failure and restart the address update. Note that this - // will not be repeated endlessly as each chip-tool command has a timeout (in the case of - // the `pairing` command it equals 120s). - UpdateNetworkAddress(); - } -} - void PairingCommand::OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData & nodeData) { const uint16_t port = nodeData.port; diff --git a/examples/chip-tool/commands/pairing/PairingCommand.h b/examples/chip-tool/commands/pairing/PairingCommand.h index 49a63603026967..6d2e98fb36636a 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.h +++ b/examples/chip-tool/commands/pairing/PairingCommand.h @@ -19,9 +19,11 @@ #pragma once #include "../common/CHIPCommand.h" +#include #include #include +#include #include #include @@ -46,18 +48,15 @@ enum class PairingNetworkType class PairingCommand : public CHIPCommand, public chip::Controller::DevicePairingDelegate, - public chip::Controller::DeviceAddressUpdateDelegate, public chip::Controller::DeviceDiscoveryDelegate { public: PairingCommand(const char * commandName, PairingMode mode, PairingNetworkType networkType, + CredentialIssuerCommands * credIssuerCmds, chip::Dnssd::DiscoveryFilterType filterType = chip::Dnssd::DiscoveryFilterType::kNone) : - CHIPCommand(commandName), + CHIPCommand(commandName, credIssuerCmds), mPairingMode(mode), mNetworkType(networkType), - mFilterType(filterType), mRemoteAddr{ IPAddress::Any, chip::Inet::InterfaceId::Null() }, - mOnAddOrUpdateThreadNetworkCallback(OnAddNetworkResponse, this), - mOnAddOrUpdateWiFiNetworkCallback(OnAddNetworkResponse, this), mOnConnectNetworkCallback(OnConnectNetworkResponse, this), - mOnFailureCallback(OnDefaultFailureResponse, this) + mFilterType(filterType), mRemoteAddr{ IPAddress::Any, chip::Inet::InterfaceId::Null() } { AddArgument("node-id", 0, UINT64_MAX, &mNodeId); @@ -108,13 +107,13 @@ class PairingCommand : public CHIPCommand, { case chip::Dnssd::DiscoveryFilterType::kNone: break; - case chip::Dnssd::DiscoveryFilterType::kShort: + case chip::Dnssd::DiscoveryFilterType::kShortDiscriminator: AddArgument("discriminator", 0, 15, &mDiscoveryFilterCode); break; - case chip::Dnssd::DiscoveryFilterType::kLong: + case chip::Dnssd::DiscoveryFilterType::kLongDiscriminator: AddArgument("discriminator", 0, 4096, &mDiscoveryFilterCode); break; - case chip::Dnssd::DiscoveryFilterType::kVendor: + case chip::Dnssd::DiscoveryFilterType::kVendorId: AddArgument("vendor-id", 0, UINT16_MAX, &mDiscoveryFilterCode); break; case chip::Dnssd::DiscoveryFilterType::kCompressedFabricId: @@ -145,14 +144,6 @@ class PairingCommand : public CHIPCommand, /////////// DeviceDiscoveryDelegate Interface ///////// void OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData & nodeData) override; - /////////// DeviceAddressUpdateDelegate Interface ///////// - void OnAddressUpdateComplete(NodeId nodeId, CHIP_ERROR error) override; - - /////////// Network Commissioning Callbacks ///////// - static void OnDefaultFailureResponse(void * context, uint8_t status); - static void OnAddNetworkResponse(void * context, uint8_t errorCode, chip::CharSpan debugText); - static void OnConnectNetworkResponse(void * context, uint8_t errorCode, chip::CharSpan debugText, int32_t errorValue); - private: CHIP_ERROR RunInternal(NodeId remoteId); CHIP_ERROR Pair(NodeId remoteId, PeerAddress address); @@ -161,15 +152,7 @@ class PairingCommand : public CHIPCommand, CHIP_ERROR PairWithManualCode(NodeId remoteId); CHIP_ERROR PairWithCode(NodeId remoteId, chip::SetupPayload payload); CHIP_ERROR Unpair(NodeId remoteId); - - CHIP_ERROR SetupNetwork(); - CHIP_ERROR AddNetwork(PairingNetworkType networkType); - CHIP_ERROR AddOrUpdateThreadNetwork(); - CHIP_ERROR AddOrUpdateWiFiNetwork(); - CHIP_ERROR ConnectNetwork(); - CHIP_ERROR UpdateNetworkAddress(); - - chip::ByteSpan GetThreadNetworkId(); + chip::Controller::CommissioningParameters GetCommissioningParameters(); const PairingMode mPairingMode; const PairingNetworkType mNetworkType; @@ -180,18 +163,12 @@ class PairingCommand : public CHIPCommand, uint16_t mDiscriminator; uint32_t mSetupPINCode; chip::ByteSpan mOperationalDataset; - uint8_t mExtendedPanId[chip::Thread::kSizeExtendedPanId]; chip::ByteSpan mSSID; chip::ByteSpan mPassword; char * mOnboardingPayload; uint64_t mDiscoveryFilterCode; char * mDiscoveryFilterInstanceName; - chip::Callback::Callback mOnAddOrUpdateThreadNetworkCallback; - chip::Callback::Callback mOnAddOrUpdateWiFiNetworkCallback; - chip::Callback::Callback mOnConnectNetworkCallback; - chip::Callback::Callback mOnFailureCallback; chip::CommissioneeDeviceProxy * mDevice; - chip::Controller::NetworkCommissioningCluster mCluster; chip::EndpointId mEndpointId = 0; }; diff --git a/examples/chip-tool/commands/payload/Commands.h b/examples/chip-tool/commands/payload/Commands.h index e0ed52f25795f0..7d72b97e702905 100644 --- a/examples/chip-tool/commands/payload/Commands.h +++ b/examples/chip-tool/commands/payload/Commands.h @@ -20,11 +20,17 @@ #include "AdditionalDataParseCommand.h" #include "SetupPayloadParseCommand.h" +#include "SetupPayloadVerhoeff.h" void registerCommandsPayload(Commands & commands) { const char * clusterName = "Payload"; - commands_list clusterCommands = { make_unique(), make_unique() }; + commands_list clusterCommands = { + make_unique(), + make_unique(), + make_unique(), + make_unique(), + }; commands.Register(clusterName, clusterCommands); } diff --git a/examples/chip-tool/commands/payload/SetupPayloadParseCommand.h b/examples/chip-tool/commands/payload/SetupPayloadParseCommand.h index 83193f909e35b8..08474023a1ff9f 100644 --- a/examples/chip-tool/commands/payload/SetupPayloadParseCommand.h +++ b/examples/chip-tool/commands/payload/SetupPayloadParseCommand.h @@ -26,10 +26,10 @@ class SetupPayloadParseCommand : public Command public: SetupPayloadParseCommand() : Command("parse-setup-payload") { AddArgument("payload", &mCode); } CHIP_ERROR Run() override; + static bool IsQRCode(std::string codeString); private: char * mCode; CHIP_ERROR Parse(std::string codeString, chip::SetupPayload & payload); CHIP_ERROR Print(chip::SetupPayload payload); - bool IsQRCode(std::string codeString); }; diff --git a/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.cpp b/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.cpp new file mode 100644 index 00000000000000..238e753708921c --- /dev/null +++ b/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.cpp @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "SetupPayloadVerhoeff.h" +#include "SetupPayloadParseCommand.h" +#include +#include + +using namespace ::chip; + +CHIP_ERROR SetupPayloadVerhoeffVerify::Run() +{ + std::string codeString(mSetupCode); + + bool isQRCode = SetupPayloadParseCommand::IsQRCode(codeString); + + VerifyOrReturnError(codeString.length() > mPos && mPos >= 0, CHIP_ERROR_INVALID_STRING_LENGTH); + VerifyOrReturnError(!isQRCode, CHIP_ERROR_NOT_IMPLEMENTED); + + ChipLogProgress(SetupPayload, "%s is %sVALID at position %u", codeString.c_str(), Verify(codeString) ? "" : "IN", mPos); + + return CHIP_NO_ERROR; +} + +bool SetupPayloadVerhoeffVerify::Verify(std::string codeString) +{ + char checkChar; + bool result; + + checkChar = codeString.at(mPos); + codeString.erase(mPos, mPos); + ChipLogDetail(SetupPayload, "Verifying Manual Code: %s", codeString.c_str()); + + result = Verhoeff10::ValidateCheckChar(checkChar, codeString.c_str()); + + return result; +} + +CHIP_ERROR SetupPayloadVerhoeffGenerate::Run() +{ + std::string codeString(mSetupCode); + char generatedChar; + + ReturnErrorOnFailure(GenerateChar(codeString, generatedChar)); + ChipLogProgress(SetupPayload, "Generated Char: %c", generatedChar); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR SetupPayloadVerhoeffGenerate::GenerateChar(std::string codeString, char & generatedChar) +{ + bool isQRCode = SetupPayloadParseCommand::IsQRCode(codeString); + + VerifyOrReturnError(!isQRCode, CHIP_ERROR_INVALID_ARGUMENT); + + ChipLogDetail(SetupPayload, "Generating Character for: %s", codeString.c_str()); + generatedChar = Verhoeff10::ComputeCheckChar(codeString.c_str()); + + return CHIP_NO_ERROR; +} +// diff --git a/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.h b/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.h new file mode 100644 index 00000000000000..0f531e3dd822bb --- /dev/null +++ b/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include "../common/Command.h" +#include + +class SetupPayloadVerhoeffVerify : public Command +{ +public: + SetupPayloadVerhoeffVerify() : Command("verhoeff-verify") + { + AddArgument("payload", &mSetupCode); + AddArgument("position", 0, UINT8_MAX, &mPos); + } + CHIP_ERROR Run() override; + +private: + char * mSetupCode; + uint8_t mPos; + bool Verify(std::string codeString); +}; + +class SetupPayloadVerhoeffGenerate : public Command +{ +public: + SetupPayloadVerhoeffGenerate() : Command("verhoeff-generate") { AddArgument("payload", &mSetupCode); } + CHIP_ERROR Run() override; + +private: + char * mSetupCode; + CHIP_ERROR GenerateChar(std::string codeString, char & generatedChar); +}; diff --git a/examples/chip-tool/commands/reporting/ReportingCommand.cpp b/examples/chip-tool/commands/reporting/ReportingCommand.cpp deleted file mode 100644 index 7e627f4ba2a1b3..00000000000000 --- a/examples/chip-tool/commands/reporting/ReportingCommand.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2020 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include "ReportingCommand.h" - -#include "../common/Commands.h" -#include -#include - -using namespace ::chip; - -CHIP_ERROR ReportingCommand::RunCommand() -{ - CHIP_ERROR err = - CurrentCommissioner().GetConnectedDevice(mNodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback); - VerifyOrExit( - err == CHIP_NO_ERROR, - ChipLogError(chipTool, "Failed in initiating connection to the device: %" PRIu64 ", error %s", mNodeId, ErrorStr(err))); - -exit: - return err; -} - -void ReportingCommand::OnDeviceConnectedFn(void * context, chip::OperationalDeviceProxy * device) -{ - ReportingCommand * command = reinterpret_cast(context); - VerifyOrReturn(command != nullptr, - ChipLogError(chipTool, "Device connected, but cannot send the command, as the context is null")); - - chip::Controller::BasicCluster cluster; - cluster.Associate(device, command->mEndPointId); - - command->AddReportCallbacks(command->mNodeId, command->mEndPointId); - - CHIP_ERROR err = cluster.MfgSpecificPing(nullptr, nullptr); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Controller, "Init failure! Ping failure: %s", ErrorStr(err)); - command->SetCommandExitStatus(err); - } -} - -void ReportingCommand::OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR err) -{ - ChipLogError(chipTool, "Failed in connecting to the device %" PRIu64 ". Error %s", deviceId, ErrorStr(err)); - - ReportingCommand * command = reinterpret_cast(context); - VerifyOrReturn(command != nullptr, ChipLogError(chipTool, "ReportingCommand context is null")); - command->SetCommandExitStatus(err); -} diff --git a/examples/chip-tool/commands/reporting/ReportingCommand.h b/examples/chip-tool/commands/reporting/ReportingCommand.h deleted file mode 100644 index 609e11daf602ba..00000000000000 --- a/examples/chip-tool/commands/reporting/ReportingCommand.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#pragma once - -#include "../../config/PersistentStorage.h" -#include "../common/CHIPCommand.h" - -class ReportingCommand : public CHIPCommand -{ -public: - ReportingCommand(const char * commandName) : - CHIPCommand(commandName), mOnDeviceConnectedCallback(OnDeviceConnectedFn, this), - mOnDeviceConnectionFailureCallback(OnDeviceConnectionFailureFn, this) - { - AddArgument("node-id", 0, UINT64_MAX, &mNodeId); - AddArgument("endpoint-id", CHIP_ZCL_ENDPOINT_MIN, CHIP_ZCL_ENDPOINT_MAX, &mEndPointId); - } - - /////////// CHIPCommand Interface ///////// - CHIP_ERROR RunCommand() override; - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(UINT16_MAX); } - - virtual void AddReportCallbacks(NodeId remoteId, uint8_t endPointId) = 0; - -private: - NodeId mNodeId; - uint8_t mEndPointId; - - static void OnDeviceConnectedFn(void * context, chip::OperationalDeviceProxy * device); - static void OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR error); - - chip::Callback::Callback mOnDeviceConnectedCallback; - chip::Callback::Callback mOnDeviceConnectionFailureCallback; -}; diff --git a/examples/chip-tool/commands/tests/TestCommand.cpp b/examples/chip-tool/commands/tests/TestCommand.cpp index 4e9f01af3cdf5c..70af22f64663cb 100644 --- a/examples/chip-tool/commands/tests/TestCommand.cpp +++ b/examples/chip-tool/commands/tests/TestCommand.cpp @@ -45,10 +45,10 @@ void TestCommand::OnDeviceConnectedFn(void * context, chip::OperationalDevicePro command->NextTest(); } -void TestCommand::OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR error) +void TestCommand::OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error) { ChipLogProgress(chipTool, " **** Test Setup: Device Connection Failure [deviceId=%" PRIu64 ". Error %" CHIP_ERROR_FORMAT "\n]", - deviceId, error.Format()); + peerId.GetNodeId(), error.Format()); auto * command = static_cast(context); VerifyOrReturn(command != nullptr, ChipLogError(chipTool, "Test command context is null")); command->SetCommandExitStatus(error); diff --git a/examples/chip-tool/commands/tests/TestCommand.h b/examples/chip-tool/commands/tests/TestCommand.h index c314699e0e7a59..9fe32c392aa54d 100644 --- a/examples/chip-tool/commands/tests/TestCommand.h +++ b/examples/chip-tool/commands/tests/TestCommand.h @@ -66,7 +66,7 @@ class TestCommand : public CHIPCommand chip::NodeId mNodeId; static void OnDeviceConnectedFn(void * context, chip::OperationalDeviceProxy * device); - static void OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR error); + static void OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error); static void OnWaitForMsFn(chip::System::Layer * systemLayer, void * context); CHIP_ERROR ContinueOnChipMainThread() { return WaitForMs(0); }; @@ -92,6 +92,15 @@ class TestCommand : public CHIPCommand return true; } + template + bool CheckConstraintMinValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) + { + if (current.IsNull()) + { + return true; + } + return CheckConstraintMinValue(itemName, current.Value(), static_cast(expected)); + } template bool CheckConstraintMaxValue(const char * itemName, T current, T expected) { @@ -104,6 +113,15 @@ class TestCommand : public CHIPCommand return true; } template + bool CheckConstraintMaxValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) + { + if (current.IsNull()) + { + return true; + } + return CheckConstraintMaxValue(itemName, current.Value(), static_cast(expected)); + } + template bool CheckConstraintNotValue(const char * itemName, T current, U expected) { if (current == expected) @@ -114,6 +132,15 @@ class TestCommand : public CHIPCommand return true; } + template + bool CheckConstraintNotValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) + { + if (current.IsNull()) + { + return true; + } + return CheckConstraintNotValue(itemName, current.Value(), expected); + } bool CheckConstraintNotValue(const char * itemName, chip::CharSpan current, chip::CharSpan expected) { diff --git a/examples/chip-tool/main.cpp b/examples/chip-tool/main.cpp index c767020c72d160..dad23f39ea7d81 100644 --- a/examples/chip-tool/main.cpp +++ b/examples/chip-tool/main.cpp @@ -17,13 +17,13 @@ */ #include "commands/common/Commands.h" +#include "commands/example/ExampleCredentialIssuerCommands.h" #include "commands/discover/Commands.h" #include "commands/pairing/Commands.h" #include "commands/payload/Commands.h" #include -#include #include // ================================================================================ @@ -31,11 +31,11 @@ // ================================================================================ int main(int argc, char * argv[]) { + ExampleCredentialIssuerCommands credIssuerCommands; Commands commands; registerCommandsDiscover(commands); registerCommandsPayload(commands); - registerCommandsPairing(commands); - registerCommandsReporting(commands); + registerCommandsPairing(commands, &credIssuerCommands); registerCommandsTests(commands); registerClusters(commands); diff --git a/examples/chip-tool/templates/partials/test_cluster.zapt b/examples/chip-tool/templates/partials/test_cluster.zapt index 8581f50eca6bba..4784ad393a28ae 100644 --- a/examples/chip-tool/templates/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/partials/test_cluster.zapt @@ -60,6 +60,15 @@ class {{filename}}: public TestCommand {{/chip_tests_item_response_parameters}} {{/chip_tests_items}} + {{! Helper around zapTypeToDecodableClusterObjectType that lets us set the + array/nullable/etc context appropriately.}} + {{~#*inline "subscribeResponseDataArgument"~}} + {{zapTypeToDecodableClusterObjectType type ns=cluster isArgument=true}} value + {{~/inline~}} + {{~#*inline "subscribeResponseArguments"~}} + {{> subscribeResponseDataArgument type=attr.type isArray=attr.isArray isNullable=attr.isNullable}} + {{~/inline~}} + {{~#*inline "subscribeDataCallback"}} mTest_{{parent.filename}}_{{attribute}}_Reported {{/inline}} @@ -68,7 +77,7 @@ class {{filename}}: public TestCommand {{/inline}} {{#chip_tests_items}} {{#if allocateSubscribeDataCallback}} - typedef void (*{{> subscribeDataCallbackType}})(void * context, {{zapTypeToDecodableClusterObjectType attributeObject.type ns=parent.cluster isArgument=true}} value); + typedef void (*{{> subscribeDataCallbackType}})(void * context, {{> subscribeResponseArguments attr=attributeObject}}); {{> subscribeDataCallbackType}} {{> subscribeDataCallback}} = nullptr; {{/if}} {{/chip_tests_items}} @@ -260,7 +269,7 @@ class {{filename}}: public TestCommand } {{#if isSubscribeAttribute}} - void {{>successResponse}}({{zapTypeToDecodableClusterObjectType attributeObject.type ns=parent.cluster isArgument=true}} value) + void {{>successResponse}}({{> subscribeResponseArguments attr=attributeObject}}) { {{#if response.error}} ThrowSuccessResponse(); @@ -309,9 +318,13 @@ class {{filename}}: public TestCommand {{~#if expectedConstraints.endsWith}}VerifyOrReturn(CheckConstraintEndsWith("{{>item}}", {{>item}}, "{{expectedConstraints.endsWith}}"));{{/if}} {{~#if expectedConstraints.minLength}}VerifyOrReturn(CheckConstraintMinLength("{{>item}}", {{>item}}.size(), {{expectedConstraints.minLength}}));{{/if}} {{~#if expectedConstraints.maxLength}}VerifyOrReturn(CheckConstraintMaxLength("{{>item}}", {{>item}}.size(), {{expectedConstraints.maxLength}}));{{/if}} - {{~#if expectedConstraints.minValue}}VerifyOrReturn(CheckConstraintMinValue<{{chipType}}>("{{>item}}", {{>item}}, {{expectedConstraints.minValue}}));{{/if}} - {{~#if expectedConstraints.maxValue}}VerifyOrReturn(CheckConstraintMaxValue<{{chipType}}>("{{>item}}", {{>item}}, {{expectedConstraints.maxValue}}));{{/if}} - {{~#if expectedConstraints.notValue}}VerifyOrReturn(CheckConstraintNotValue("{{>item}}", {{>item}}, {{asTypedLiteral expectedConstraints.notValue type}}));{{/if}} + {{~#if expectedConstraints.minValue}}VerifyOrReturn(CheckConstraintMinValue<{{chipType}}>("{{>item}}", {{>item}}, {{asTypedLiteral expectedConstraints.minValue type}}));{{/if}} + {{~#if expectedConstraints.maxValue}}VerifyOrReturn(CheckConstraintMaxValue<{{chipType}}>("{{>item}}", {{>item}}, {{asTypedLiteral expectedConstraints.maxValue type}}));{{/if}} + {{~#if expectedConstraints.notValue}} + VerifyOrReturn(CheckConstraintNotValue("{{>item}}", {{>item}}, {{asTypedLiteral expectedConstraints.notValue type}})); + {{else if (isLiteralNull expectedConstraints.notValue)}} + VerifyOrReturn(CheckValueNonNull("{{>item}}", {{>item}})); + {{/if}} {{/if}} {{#if saveAs}} diff --git a/examples/chip-tool/templates/reporting-commands.zapt b/examples/chip-tool/templates/reporting-commands.zapt deleted file mode 100644 index a0d10f149d49a4..00000000000000 --- a/examples/chip-tool/templates/reporting-commands.zapt +++ /dev/null @@ -1,71 +0,0 @@ -{{> header}} - -#pragma once - -#include -#include "../cluster/Commands.h" // For the LogValue bits and read callbacks - -typedef void (*UnsupportedAttributeCallback)(void * context); - -class Listen : public ReportingCommand -{ -public: - Listen() : ReportingCommand("listen") - { - } - - ~Listen() - { -{{#chip_client_clusters}} -{{#chip_server_cluster_attributes}} -{{#if isReportableAttribute}} -{{#unless isList}} -{{#unless (isStrEqual chipCallback.name "Unsupported")}} - delete onReport{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}Callback; -{{/unless}} -{{/unless}} -{{/if}} -{{/chip_server_cluster_attributes}} -{{/chip_client_clusters}} - } - - void AddReportCallbacks(NodeId remoteId, uint8_t endpointId) override - { - chip::app::CHIPDeviceCallbacksMgr & callbacksMgr = chip::app::CHIPDeviceCallbacksMgr::GetInstance(); -{{#chip_client_clusters}} -{{#chip_server_cluster_attributes}} -{{#if isReportableAttribute}} -{{#unless isList}} -{{#unless (isStrEqual chipCallback.name "Unsupported")}} - callbacksMgr.AddReportCallback(remoteId, endpointId, {{asHex parent.code 4}}, {{asHex code 4}}, onReport{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}Callback->Cancel(), BasicAttributeFilter<{{chipCallback.name}}AttributeCallback>); -{{/unless}} -{{/unless}} -{{/if}} -{{/chip_server_cluster_attributes}} -{{/chip_client_clusters}} - } - -private: -{{#chip_client_clusters}} -{{#chip_server_cluster_attributes}} -{{#if isReportableAttribute}} -{{#unless isList}} -{{#unless (isStrEqual chipCallback.name "Unsupported")}} - chip::Callback::Callback * onReport{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}Callback = new chip::Callback::Callback(Read{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}::OnAttributeResponse, this); - {{/unless}} -{{/unless}} -{{/if}} -{{/chip_server_cluster_attributes}} -{{/chip_client_clusters}} -}; - -void registerCommandsReporting(Commands & commands) -{ - const char * clusterName = "Reporting"; - - commands_list clusterCommands = { - make_unique(), - }; - - commands.Register(clusterName, clusterCommands); -} diff --git a/examples/chip-tool/templates/templates.json b/examples/chip-tool/templates/templates.json index 17afafd04192de..e56bcf9f99c1f5 100644 --- a/examples/chip-tool/templates/templates.json +++ b/examples/chip-tool/templates/templates.json @@ -43,11 +43,6 @@ "name": "Cluster Commands header", "output": "cluster/Commands.h" }, - { - "path": "reporting-commands.zapt", - "name": "Reporting Commands header", - "output": "reporting/Commands.h" - }, { "path": "tests-commands.zapt", "name": "Tests Commands header", diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index 12ba90c3e99995..29d60ddf3cdc71 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -54,6 +54,14 @@ function getTests() 'Test_TC_CC_9_3', ]; + const DeviceDiscovery = [ + 'Test_TC_DD_1_5', + 'Test_TC_DD_1_6', + 'Test_TC_DD_1_7', + 'Test_TC_DD_1_8', + 'Test_TC_DD_1_9', + ]; + const DeviceManagement = [ 'Test_TC_DM_1_1', 'Test_TC_DM_3_1', @@ -171,8 +179,9 @@ function getTests() 'TV_WakeOnLanCluster', 'TV_ApplicationBasicCluster', 'TV_MediaPlaybackCluster', - 'TV_TvChannelCluster', + 'TV_ChannelCluster', 'TV_LowPowerCluster', + 'TV_ContentLauncherCluster', 'TV_MediaInputCluster', ]; @@ -187,6 +196,7 @@ function getTests() 'TestBasicInformation', 'TestIdentifyCluster', 'TestGroupsCluster', + 'TestGroupKeyManagementCluster', 'TestOperationalCredentialsCluster', 'TestModeSelectCluster', 'TestGroupMessaging', @@ -206,6 +216,7 @@ function getTests() BinaryInput, // BooleanState, // ColorControl, // + DeviceDiscovery, // DeviceManagement, // ElectricalMeasurement, // FlowMeasurement, // diff --git a/examples/common/pigweed/ameba/PigweedLoggerMutex.cpp b/examples/common/pigweed/ameba/PigweedLoggerMutex.cpp new file mode 100644 index 00000000000000..5061d53e768a6d --- /dev/null +++ b/examples/common/pigweed/ameba/PigweedLoggerMutex.cpp @@ -0,0 +1,27 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "PigweedLoggerMutex.h" + +namespace chip { +namespace rpc { + +PigweedLoggerMutex logger_mutex; + +} // namespace rpc +} // namespace chip diff --git a/examples/common/pigweed/ameba/PigweedLoggerMutex.h b/examples/common/pigweed/ameba/PigweedLoggerMutex.h new file mode 100644 index 00000000000000..ad0df28f7879eb --- /dev/null +++ b/examples/common/pigweed/ameba/PigweedLoggerMutex.h @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "FreeRTOS.h" +#include "PigweedLogger.h" +#include "RpcService.h" +#include "semphr.h" + +namespace chip { +namespace rpc { +class PigweedLoggerMutex : public chip::rpc::Mutex +{ + +public: + void Lock() override + { + SemaphoreHandle_t * sem = PigweedLogger::getSemaphore(); + if (sem) + { + xSemaphoreTake(*sem, portMAX_DELAY); + } + } + void Unlock() override + { + SemaphoreHandle_t * sem = PigweedLogger::getSemaphore(); + if (sem) + { + xSemaphoreGive(*sem); + } + } +}; + +extern PigweedLoggerMutex logger_mutex; + +} // namespace rpc +} // namespace chip diff --git a/examples/common/pigweed/protos/attributes_service.proto b/examples/common/pigweed/protos/attributes_service.proto index 2705498450d658..47545290700e2d 100644 --- a/examples/common/pigweed/protos/attributes_service.proto +++ b/examples/common/pigweed/protos/attributes_service.proto @@ -158,7 +158,7 @@ enum ClusterType { ZCL_IAS_ACE_CLUSTER_ID = 0x0501; ZCL_IAS_WD_CLUSTER_ID = 0x0502; ZCL_WAKE_ON_LAN_CLUSTER_ID = 0x0503; - ZCL_TV_CHANNEL_CLUSTER_ID = 0x0504; + ZCL_CHANNEL_CLUSTER_ID = 0x0504; ZCL_TARGET_NAVIGATOR_CLUSTER_ID = 0x0505; ZCL_MEDIA_PLAYBACK_CLUSTER_ID = 0x0506; ZCL_MEDIA_INPUT_CLUSTER_ID = 0x0507; diff --git a/examples/ipv6only-app/esp32/README.md b/examples/ipv6only-app/esp32/README.md index fa791fe71eba21..4dc6c28355ad88 100644 --- a/examples/ipv6only-app/esp32/README.md +++ b/examples/ipv6only-app/esp32/README.md @@ -20,14 +20,14 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout branch - [release/v4.4](https://github.com/espressif/esp-idf/tree/release/v4.4) +- Clone the Espressif ESP-IDF and checkout + [v4.4-beta1 pre-release](https://github.com/espressif/esp-idf/releases/tag/v4.4-beta1) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.4 + $ git checkout v4.4-beta1 $ git submodule update --init $ ./install.sh diff --git a/examples/ipv6only-app/esp32/include/wifi_service.h b/examples/ipv6only-app/esp32/include/wifi_service.h index b2db2e1223b3b2..bac312964be281 100644 --- a/examples/ipv6only-app/esp32/include/wifi_service.h +++ b/examples/ipv6only-app/esp32/include/wifi_service.h @@ -40,7 +40,7 @@ class Wifi final : public pw_rpc::nanopb::Wifi::Service // Initalize the wifi station pw::Status Init(); - // Blocks the calling thread until wifi connection is completed succesfully. + // Blocks the calling thread until wifi connection is completed successfully. // NOTE: Currently only supports blocking a single thread. void BlockUntilWifiConnected() { xSemaphoreTake(wifi_connected_semaphore_, portMAX_DELAY); } diff --git a/examples/ipv6only-app/esp32/main/wifi_service.cpp b/examples/ipv6only-app/esp32/main/wifi_service.cpp index 17935a49e357e9..1795d4def06af0 100644 --- a/examples/ipv6only-app/esp32/main/wifi_service.cpp +++ b/examples/ipv6only-app/esp32/main/wifi_service.cpp @@ -42,7 +42,7 @@ constexpr pw::containers::FlatMap kChannelToFreqMap({ { // Class handles the event handlers needed for station startup. // Creating the object will register all handlers needed, destroying will -// unregister. The object is only needed during initalization, after the station +// unregister. The object is only needed during initialization, after the station // is up it is safe to destroy this object. class WifiInitStationEventHandler { @@ -114,7 +114,7 @@ class WifiConnectionEventHandler vEventGroupDelete(handler_context_.event_group); } - // Waits for the events to determine if connected succesfully. + // Waits for the events to determine if connected successfully. pw::Status WaitForConnection(chip_rpc_ConnectionResult * result) { EventBits_t bits = xEventGroupWaitBits(handler_context_.event_group, kWifiFailBit | kWifiIpv6ConnectedBit, pdFALSE, pdFALSE, diff --git a/examples/lighting-app/ameba/chip_main.cmake b/examples/lighting-app/ameba/chip_main.cmake index f10e7a2ccf9de9..38b08742a0b5fe 100755 --- a/examples/lighting-app/ameba/chip_main.cmake +++ b/examples/lighting-app/ameba/chip_main.cmake @@ -25,6 +25,7 @@ list( ${chip_dir}/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp ${chip_dir}/examples/lighting-app/ameba/main/Globals.cpp ${chip_dir}/examples/lighting-app/ameba/main/LEDWidget.cpp + ${chip_dir}/examples/lighting-app/ameba/main/DsoHack.cpp ) add_library( diff --git a/examples/lighting-app/ameba/main/DsoHack.cpp b/examples/lighting-app/ameba/main/DsoHack.cpp new file mode 100644 index 00000000000000..6fc5d7a63307c5 --- /dev/null +++ b/examples/lighting-app/ameba/main/DsoHack.cpp @@ -0,0 +1,20 @@ +/* + * 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. + */ + +// This hack is needed because Ameba SDK is not linking against libstdc++ correctly. +extern "C" { +void * __dso_handle = 0; +} diff --git a/examples/lighting-app/ameba/main/chipinterface.cpp b/examples/lighting-app/ameba/main/chipinterface.cpp index 9300f960b487fb..6c9536c23fd2c9 100755 --- a/examples/lighting-app/ameba/main/chipinterface.cpp +++ b/examples/lighting-app/ameba/main/chipinterface.cpp @@ -38,10 +38,6 @@ #include -extern "C" { -void * __dso_handle = 0; -} - using namespace ::chip; using namespace ::chip::Credentials; using namespace ::chip::DeviceManager; diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 94dcee9b9675be..a0f66f9986e364 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -1284,7 +1284,7 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, + "code": 2, "mfgCode": null, "source": "client", "incoming": 0, @@ -1292,7 +1292,7 @@ }, { "name": "NotifyUpdateApplied", - "code": 2, + "code": 4, "mfgCode": null, "source": "client", "incoming": 0, @@ -1327,7 +1327,7 @@ "commands": [ { "name": "QueryImageResponse", - "code": 3, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -1335,7 +1335,7 @@ }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -1691,7 +1691,7 @@ "reportableChange": 0 }, { - "name": "NetworkDisabled", + "name": "InterfaceEnabled", "code": 4, "mfgCode": null, "side": "server", @@ -3612,6 +3612,26 @@ } ] }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [] + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [] + }, { "name": "AdministratorCommissioning", "code": 60, diff --git a/examples/lighting-app/linux/main.cpp b/examples/lighting-app/linux/main.cpp index 5cfb79ffd2298c..06e05b7cbdd1c3 100644 --- a/examples/lighting-app/linux/main.cpp +++ b/examples/lighting-app/linux/main.cpp @@ -60,6 +60,8 @@ void emberAfOnOffClusterInitCallback(EndpointId endpoint) // TODO: implement any additional Cluster Server init actions } +void ApplicationInit() {} + int main(int argc, char * argv[]) { if (ChipLinuxAppInit(argc, argv) != 0) diff --git a/examples/lighting-app/mbed/CMakeLists.txt b/examples/lighting-app/mbed/CMakeLists.txt index bc11cc1b1e0e07..e79b8e443772e9 100644 --- a/examples/lighting-app/mbed/CMakeLists.txt +++ b/examples/lighting-app/mbed/CMakeLists.txt @@ -85,15 +85,17 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/switch-server/switch-server.cpp ${CHIP_ROOT}/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp ${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp ${CHIP_ROOT}/src/app/clusters/level-control/level-control.cpp ${CHIP_ROOT}/src/app/clusters/color-control-server/color-control-server.cpp ${CHIP_ROOT}/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp - ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp - ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp + ${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp + ${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-old.cpp ) target_link_libraries(${APP_TARGET} mbed-os-posix-socket mbed-os mbed-ble mbed-events mbed-netsocket mbed-storage mbed-storage-kv-global-api mbed-mbedtls mbed-emac chip) diff --git a/examples/lighting-app/mbed/main/main.cpp b/examples/lighting-app/mbed/main/main.cpp index 4c99ea3c8cde4e..8d9ad2cae6d6f2 100644 --- a/examples/lighting-app/mbed/main/main.cpp +++ b/examples/lighting-app/mbed/main/main.cpp @@ -71,7 +71,7 @@ int main() err = chip::Platform::MemoryInit(); if (err != CHIP_NO_ERROR) { - ChipLogError(NotSpecified, "Memory initalization failed: %s", err.AsString()); + ChipLogError(NotSpecified, "Memory initialization failed: %s", err.AsString()); ret = EXIT_FAILURE; goto exit; } @@ -79,7 +79,7 @@ int main() err = PlatformMgr().InitChipStack(); if (err != CHIP_NO_ERROR) { - ChipLogError(NotSpecified, "Chip stack initalization failed: %s", err.AsString()); + ChipLogError(NotSpecified, "Chip stack initialization failed: %s", err.AsString()); ret = EXIT_FAILURE; goto exit; } diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index 1452ce1d6ef7ee..b5de67cf049a05 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -78,7 +78,9 @@ target_sources(app PRIVATE ${GEN_DIR}/lighting-app/zap-generated/CHIPClusters.cpp ${GEN_DIR}/lighting-app/zap-generated/IMClusterCommandHandler.cpp ${NRFCONNECT_COMMON}/util/LEDWidget.cpp - ${NRFCONNECT_COMMON}/util/ThreadUtil.cpp) + ${NRFCONNECT_COMMON}/util/ThreadUtil.cpp + ${CHIP_ROOT}/src/app/clusters/ota-requestor/OTARequestor.cpp + ${CHIP_ROOT}/src/app/clusters/ota-requestor/BDXDownloader.cpp) chip_configure_data_model(app INCLUDE_CLIENT_CALLBACKS @@ -104,6 +106,7 @@ include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake) pw_set_backend(pw_log pw_log_basic) pw_set_backend(pw_assert pw_assert_log) pw_set_backend(pw_sys_io pw_sys_io.nrfconnect) +pw_set_backend(pw_trace pw_trace_tokenized) set(dir_pw_third_party_nanopb "${CHIP_ROOT}/third_party/nanopb/repo" CACHE STRING "" FORCE) add_subdirectory(third_party/connectedhomeip/examples/platform/nrfconnect/pw_sys_io) @@ -178,7 +181,8 @@ target_compile_options(app PRIVATE "-DPW_RPC_ATTRIBUTE_SERVICE=1" "-DPW_RPC_BUTTON_SERVICE=1" "-DPW_RPC_DEVICE_SERVICE=1" - "-DPW_RPC_LIGHTING_SERVICE=1") + "-DPW_RPC_LIGHTING_SERVICE=1" + "-DPW_RPC_TRACING_SERVICE=1") target_link_libraries(app PRIVATE attributes_service.nanopb_rpc @@ -189,6 +193,15 @@ target_link_libraries(app PRIVATE pw_hdlc pw_log pw_rpc.server + pw_trace_tokenized + pw_trace_tokenized.trace_buffer + pw_trace_tokenized.rpc_service + pw_trace_tokenized.protos.nanopb_rpc +) + +target_link_options(app + PUBLIC + "-T${PIGWEED_ROOT}/pw_tokenizer/pw_tokenizer_linker_sections.ld" ) target_link_libraries(pw_build INTERFACE zephyr_interface) diff --git a/examples/lighting-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/lighting-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay index 68063fdeb48e84..aac348e1b971a5 100644 --- a/examples/lighting-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay +++ b/examples/lighting-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay @@ -15,6 +15,9 @@ */ / { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; /* * In some default configurations within the nRF Connect SDK, diff --git a/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index 4a69cbd6751c77..01794dc6524a33 100644 --- a/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -15,6 +15,10 @@ */ / { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + /* * By default, PWM module is only configured for led0 (LED1 on the board). * The lighting-app, however, uses LED2 to show the state of the lighting, diff --git a/examples/lighting-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf b/examples/lighting-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf index 33b31f28a28561..de4023efbc3c52 100644 --- a/examples/lighting-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf +++ b/examples/lighting-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf @@ -22,13 +22,6 @@ CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 CONFIG_MULTITHREADING=y CONFIG_BOOT_MAX_IMG_SECTORS=256 -# External flash memory configuration -CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y -CONFIG_PM_EXTERNAL_FLASH=y -CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64" -CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000 -CONFIG_PM_EXTERNAL_FLASH_BASE=0 - # The following configurations are required to support simultaneous multi image update CONFIG_PCD_APP=y CONFIG_UPDATEABLE_IMAGE_NUMBER=2 diff --git a/examples/lighting-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf b/examples/lighting-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf index 3c1c6ccdfe7564..09e708c4e4dfff 100644 --- a/examples/lighting-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf +++ b/examples/lighting-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf @@ -21,10 +21,3 @@ CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 CONFIG_MULTITHREADING=y CONFIG_BOOT_MAX_IMG_SECTORS=256 - -# External flash memory configuration -CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y -CONFIG_PM_EXTERNAL_FLASH=y -CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64" -CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000 -CONFIG_PM_EXTERNAL_FLASH_BASE=0 diff --git a/examples/lighting-app/nrfconnect/main/AppTask.cpp b/examples/lighting-app/nrfconnect/main/AppTask.cpp index 74efec03379d84..6ff8cf69f3f8a2 100644 --- a/examples/lighting-app/nrfconnect/main/AppTask.cpp +++ b/examples/lighting-app/nrfconnect/main/AppTask.cpp @@ -23,28 +23,35 @@ #include "LEDWidget.h" #include "LightingManager.h" #include "ThreadUtil.h" -#include -#include #include #include #include +#include +#include #include - #include #include - -#include - #include +#include #include +#if CONFIG_CHIP_OTA_REQUESTOR +#include +#include +#include +#include +#endif + #include #include #include LOG_MODULE_DECLARE(app); +using namespace ::chip::Credentials; +using namespace ::chip::DeviceLayer; + namespace { constexpr int kFactoryResetTriggerTimeout = 3000; @@ -65,10 +72,14 @@ bool sIsThreadProvisioned = false; bool sIsThreadEnabled = false; bool sHaveBLEConnections = false; -} // namespace +#if CONFIG_CHIP_OTA_REQUESTOR +GenericOTARequestorDriver sOTARequestorDriver; +OTAImageProcessorImpl sOTAImageProcessor; +chip::BDXDownloader sBDXDownloader; +chip::OTARequestor sOTARequestor; +#endif -using namespace ::chip::Credentials; -using namespace ::chip::DeviceLayer; +} // namespace AppTask AppTask::sAppTask; @@ -119,9 +130,24 @@ int AppTask::Init() PlatformMgr().AddEventHandler(ChipEventHandler, 0); #endif + InitOTARequestor(); + return 0; } +void AppTask::InitOTARequestor() +{ +#if CONFIG_CHIP_OTA_REQUESTOR + sOTAImageProcessor.SetOTADownloader(&sBDXDownloader); + sBDXDownloader.SetImageProcessorDelegate(&sOTAImageProcessor); + sOTARequestorDriver.Init(&sOTARequestor, &sOTAImageProcessor); + sOTARequestor.SetOtaRequestorDriver(&sOTARequestorDriver); + sOTARequestor.SetBDXDownloader(&sBDXDownloader); + sOTARequestor.SetServerInstance(&chip::Server::GetInstance()); + chip::SetRequestorInstance(&sOTARequestor); +#endif +} + int AppTask::StartApp() { int ret = Init(); diff --git a/examples/lighting-app/nrfconnect/main/include/AppTask.h b/examples/lighting-app/nrfconnect/main/include/AppTask.h index 12ff22ba963ca3..62c35ba0430d32 100644 --- a/examples/lighting-app/nrfconnect/main/include/AppTask.h +++ b/examples/lighting-app/nrfconnect/main/include/AppTask.h @@ -52,6 +52,7 @@ class AppTask friend AppTask & GetAppTask(void); int Init(); + void InitOTARequestor(); static void ActionInitiated(LightingManager::Action_t aAction, int32_t aActor); static void ActionCompleted(LightingManager::Action_t aAction, int32_t aActor); diff --git a/examples/lighting-app/nxp/k32w/k32w0/args.gni b/examples/lighting-app/nxp/k32w/k32w0/args.gni index 9e95d3b8f5a79c..0f921756420fce 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/args.gni +++ b/examples/lighting-app/nxp/k32w/k32w0/args.gni @@ -15,5 +15,5 @@ import("//build_overrides/chip.gni") import("${chip_root}/examples/platform/nxp/k32w/k32w0/args.gni") -# SDK target. This is overriden to add our SDK app_config.h & defines. +# SDK target. This is overridden to add our SDK app_config.h & defines. k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain") diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index e1a2865c22ebe0..2f367d1c761593 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -85,13 +85,15 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/switch-server/switch-server.cpp ${CHIP_ROOT}/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp ${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp ${CHIP_ROOT}/src/app/clusters/level-control/level-control.cpp ${CHIP_ROOT}/src/app/clusters/color-control-server/color-control-server.cpp ${CHIP_ROOT}/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp - ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp - ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp + ${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp + ${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-old.cpp ) diff --git a/examples/lock-app/esp32/README.md b/examples/lock-app/esp32/README.md index f5db4765e063f3..081e98fa914bfa 100644 --- a/examples/lock-app/esp32/README.md +++ b/examples/lock-app/esp32/README.md @@ -23,14 +23,14 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout branch - [release/v4.4](https://github.com/espressif/esp-idf/tree/release/v4.4) +- Clone the Espressif ESP-IDF and checkout + [v4.4-beta1 pre-release](https://github.com/espressif/esp-idf/releases/tag/v4.4-beta1) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.4 + $ git checkout v4.4-beta1 $ git submodule update --init $ ./install.sh diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index fbca6b270d9315..0659b890b8668a 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -44,7 +44,7 @@ idf_component_register(INCLUDE_DIRS "${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/fixed-label-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" @@ -53,9 +53,10 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-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/power-source-configuration-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" PRIV_REQUIRES bt chip QRCode) get_filename_component(CHIP_ROOT ../third_party/connectedhomeip REALPATH) @@ -141,8 +142,11 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-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/network-commissioning" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index f578fd674bc29e..5e690b7009cad9 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -1668,7 +1668,7 @@ "reportableChange": 0 }, { - "name": "NetworkDisabled", + "name": "InterfaceEnabled", "code": 4, "mfgCode": null, "side": "server", @@ -5703,6 +5703,5 @@ "endpointVersion": 1, "deviceIdentifier": 10 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/mbed/CMakeLists.txt b/examples/lock-app/mbed/CMakeLists.txt index 30b0e3651e9e16..39619ca596a658 100644 --- a/examples/lock-app/mbed/CMakeLists.txt +++ b/examples/lock-app/mbed/CMakeLists.txt @@ -82,10 +82,12 @@ target_sources(${APP_TARGET} PRIVATE ${CHIP_ROOT}/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp ${CHIP_ROOT}/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/switch-server/switch-server.cpp ${CHIP_ROOT}/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp + ${CHIP_ROOT}/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp - ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp - ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp + ${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp + ${CHIP_ROOT}/src/app/clusters/network-commissioning-old/network-commissioning-old.cpp ${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp ${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp ${CHIP_ROOT}/src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp diff --git a/examples/lock-app/mbed/main/main.cpp b/examples/lock-app/mbed/main/main.cpp index e527adec4cfa45..349d9ac8dc34a4 100644 --- a/examples/lock-app/mbed/main/main.cpp +++ b/examples/lock-app/mbed/main/main.cpp @@ -71,7 +71,7 @@ int main() err = chip::Platform::MemoryInit(); if (err != CHIP_NO_ERROR) { - ChipLogError(NotSpecified, "Memory initalization failed: %s", err.AsString()); + ChipLogError(NotSpecified, "Memory initialization failed: %s", err.AsString()); ret = EXIT_FAILURE; goto exit; } @@ -79,7 +79,7 @@ int main() err = PlatformMgr().InitChipStack(); if (err != CHIP_NO_ERROR) { - ChipLogError(NotSpecified, "Chip stack initalization failed: %s", err.AsString()); + ChipLogError(NotSpecified, "Chip stack initialization failed: %s", err.AsString()); ret = EXIT_FAILURE; goto exit; } diff --git a/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay index 7885945015b516..a4bac9fffc2f9d 100644 --- a/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay +++ b/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay @@ -15,6 +15,10 @@ */ / { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + /* * In some default configurations within the nRF Connect SDK, * e.g. on nRF52840, the chosen zephyr,entropy node is &cryptocell. diff --git a/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index 6984cad3ead2db..330f40f03f8f29 100644 --- a/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -15,6 +15,10 @@ */ / { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + soc { /* Add a flash controller which has the compatible * 'zephyr,sim-flash'. This will ensure that the flash diff --git a/examples/lock-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf b/examples/lock-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf index 33b31f28a28561..de4023efbc3c52 100644 --- a/examples/lock-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf +++ b/examples/lock-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf @@ -22,13 +22,6 @@ CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 CONFIG_MULTITHREADING=y CONFIG_BOOT_MAX_IMG_SECTORS=256 -# External flash memory configuration -CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y -CONFIG_PM_EXTERNAL_FLASH=y -CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64" -CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000 -CONFIG_PM_EXTERNAL_FLASH_BASE=0 - # The following configurations are required to support simultaneous multi image update CONFIG_PCD_APP=y CONFIG_UPDATEABLE_IMAGE_NUMBER=2 diff --git a/examples/lock-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf b/examples/lock-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf index 3c1c6ccdfe7564..09e708c4e4dfff 100644 --- a/examples/lock-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf +++ b/examples/lock-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf @@ -21,10 +21,3 @@ CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 CONFIG_MULTITHREADING=y CONFIG_BOOT_MAX_IMG_SECTORS=256 - -# External flash memory configuration -CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y -CONFIG_PM_EXTERNAL_FLASH=y -CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64" -CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000 -CONFIG_PM_EXTERNAL_FLASH_BASE=0 diff --git a/examples/lock-app/nxp/k32w/k32w0/args.gni b/examples/lock-app/nxp/k32w/k32w0/args.gni index 9e95d3b8f5a79c..0f921756420fce 100644 --- a/examples/lock-app/nxp/k32w/k32w0/args.gni +++ b/examples/lock-app/nxp/k32w/k32w0/args.gni @@ -15,5 +15,5 @@ import("//build_overrides/chip.gni") import("${chip_root}/examples/platform/nxp/k32w/k32w0/args.gni") -# SDK target. This is overriden to add our SDK app_config.h & defines. +# SDK target. This is overridden to add our SDK app_config.h & defines. k32w0_sdk_target = get_label_info(":sdk", "label_no_toolchain") diff --git a/examples/log-source-app/log-source-common/log-source-app.zap b/examples/log-source-app/log-source-common/log-source-app.zap index d273688696c242..e5c802716f69ce 100644 --- a/examples/log-source-app/log-source-common/log-source-app.zap +++ b/examples/log-source-app/log-source-common/log-source-app.zap @@ -3408,6 +3408,5 @@ "endpointVersion": 1, "deviceIdentifier": null } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/minimal-mdns/advertiser.cpp b/examples/minimal-mdns/advertiser.cpp index dc20c195537a7b..78b811f6ee64cd 100644 --- a/examples/minimal-mdns/advertiser.cpp +++ b/examples/minimal-mdns/advertiser.cpp @@ -48,7 +48,7 @@ struct Options Optional deviceType; Optional deviceName; - // commisionable node params + // commissionable node params uint8_t shortDiscriminator = 52; uint16_t longDiscriminator = 840; Dnssd::CommissioningMode commissioningMode = Dnssd::CommissioningMode::kDisabled; @@ -68,16 +68,16 @@ using namespace chip::ArgParser; constexpr uint16_t kOptionEnableIpV4 = '4'; constexpr uint16_t kOptionAdvertisingMode = 'm'; -constexpr uint16_t kOptionCommisioningShordDiscriminator = 's'; -constexpr uint16_t kOptionCommisioningLongDiscriminaotr = 'l'; -constexpr uint16_t kOptionCommisioningVendorId = 0x100; // v is used by 'version' -constexpr uint16_t kOptionCommisioningProductId = 'p'; -constexpr uint16_t kOptionCommisioningPairingInstr = 0x200; // Just use the long format -constexpr uint16_t kOptionCommisioningPairingHint = 0x300; -constexpr uint16_t kOptionCommisioningDeviceType = 0x400; -constexpr uint16_t kOptionCommisioningDeviceName = 0x500; -constexpr uint16_t kOptionCommisioningMode = 0x600; -constexpr uint16_t kOptionCommisioningRotatingId = 0x700; +constexpr uint16_t kOptionCommissioningShortDiscriminator = 's'; +constexpr uint16_t kOptionCommissioningLongDiscriminaotr = 'l'; +constexpr uint16_t kOptionCommissioningVendorId = 0x100; // v is used by 'version' +constexpr uint16_t kOptionCommissioningProductId = 'p'; +constexpr uint16_t kOptionCommissioningPairingInstr = 0x200; // Just use the long format +constexpr uint16_t kOptionCommissioningPairingHint = 0x300; +constexpr uint16_t kOptionCommissioningDeviceType = 0x400; +constexpr uint16_t kOptionCommissioningDeviceName = 0x500; +constexpr uint16_t kOptionCommissioningMode = 0x600; +constexpr uint16_t kOptionCommissioningRotatingId = 0x700; constexpr uint16_t kOptionOperationalFabricId = 'f'; constexpr uint16_t kOptionOperationalNodeId = 'n'; @@ -110,19 +110,19 @@ bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, return false; } return true; - case kOptionCommisioningShordDiscriminator: + case kOptionCommissioningShortDiscriminator: gOptions.shortDiscriminator = static_cast(atoi(aValue)); return true; - case kOptionCommisioningLongDiscriminaotr: + case kOptionCommissioningLongDiscriminaotr: gOptions.longDiscriminator = static_cast(atoi(aValue)); return true; - case kOptionCommisioningVendorId: + case kOptionCommissioningVendorId: gOptions.vendorId = Optional::Value(static_cast(atoi(aValue))); return true; - case kOptionCommisioningProductId: + case kOptionCommissioningProductId: gOptions.productId = Optional::Value(static_cast(atoi(aValue))); return true; - case kOptionCommisioningMode: + case kOptionCommissioningMode: cm = static_cast(atoi(aValue)); if (cm == 1) { @@ -133,19 +133,19 @@ bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, gOptions.commissioningMode = Dnssd::CommissioningMode::kEnabledEnhanced; } return true; - case kOptionCommisioningDeviceType: + case kOptionCommissioningDeviceType: gOptions.deviceType = Optional::Value(static_cast(atoi(aValue))); return true; - case kOptionCommisioningDeviceName: + case kOptionCommissioningDeviceName: gOptions.deviceName = Optional::Value(static_cast(aValue)); return true; - case kOptionCommisioningRotatingId: + case kOptionCommissioningRotatingId: gOptions.rotatingId = Optional::Value(static_cast(aValue)); return true; - case kOptionCommisioningPairingInstr: + case kOptionCommissioningPairingInstr: gOptions.pairingInstr = Optional::Value(static_cast(aValue)); return true; - case kOptionCommisioningPairingHint: + case kOptionCommissioningPairingHint: gOptions.pairingHint = Optional::Value(static_cast(atoi(aValue))); return true; case kOptionOperationalFabricId: @@ -174,16 +174,16 @@ OptionDef cmdLineOptionsDef[] = { #endif { "advertising-mode", kArgumentRequired, kOptionAdvertisingMode }, - { "short-discriminator", kArgumentRequired, kOptionCommisioningShordDiscriminator }, - { "long-discriminator", kArgumentRequired, kOptionCommisioningLongDiscriminaotr }, - { "vendor-id", kArgumentRequired, kOptionCommisioningVendorId }, - { "product-id", kArgumentRequired, kOptionCommisioningProductId }, - { "commissioning-mode", kNoArgument, kOptionCommisioningMode }, - { "device-type", kArgumentRequired, kOptionCommisioningDeviceType }, - { "device-name", kArgumentRequired, kOptionCommisioningDeviceName }, - { "rotating-id", kArgumentRequired, kOptionCommisioningRotatingId }, - { "pairing-instruction", kArgumentRequired, kOptionCommisioningPairingInstr }, - { "pairing-hint", kArgumentRequired, kOptionCommisioningPairingHint }, + { "short-discriminator", kArgumentRequired, kOptionCommissioningShortDiscriminator }, + { "long-discriminator", kArgumentRequired, kOptionCommissioningLongDiscriminaotr }, + { "vendor-id", kArgumentRequired, kOptionCommissioningVendorId }, + { "product-id", kArgumentRequired, kOptionCommissioningProductId }, + { "commissioning-mode", kNoArgument, kOptionCommissioningMode }, + { "device-type", kArgumentRequired, kOptionCommissioningDeviceType }, + { "device-name", kArgumentRequired, kOptionCommissioningDeviceName }, + { "rotating-id", kArgumentRequired, kOptionCommissioningRotatingId }, + { "pairing-instruction", kArgumentRequired, kOptionCommissioningPairingInstr }, + { "pairing-hint", kArgumentRequired, kOptionCommissioningPairingHint }, { "fabric-id", kArgumentRequired, kOptionOperationalFabricId }, { "node-id", kArgumentRequired, kOptionOperationalNodeId }, @@ -201,15 +201,15 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS" " Advertise in this mode (operational or commissionable-node or commissioner).\n" " --short-discriminator \n" " -s \n" - " Commisioning/commisionable short discriminator.\n" + " Commissioning/commissionable short discriminator.\n" " --long-discriminator \n" " -l \n" - " Commisioning/commisionable long discriminator.\n" + " Commissioning/commissionable long discriminator.\n" " --vendor-id \n" - " Commisioning/commisionable vendor id.\n" + " Commissioning/commissionable vendor id.\n" " --product-id \n" " -p \n" - " Commisioning/commisionable product id.\n" + " Commissioning/commissionable product id.\n" " --commissioning-mode \n" " Commissioning Mode (0=disabled, 1=basic, 2=enhanced).\n" " --device-type \n" @@ -219,9 +219,9 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS" " --rotating-id \n" " Rotating Id.\n" " --pairing-instruction \n" - " Commisionable pairing instruction.\n" + " Commissionable pairing instruction.\n" " --pairing-hint \n" - " Commisionable pairing hint.\n" + " Commissionable pairing hint.\n" " --fabric-id \n" " -f \n" " Operational fabric id.\n" @@ -277,8 +277,8 @@ int main(int argc, char ** args) .SetCommissioningMode(gOptions.commissioningMode) .SetDeviceType(gOptions.deviceType) .SetDeviceName(gOptions.deviceName) - .SetRotatingId(gOptions.rotatingId) - .SetPairingInstr(gOptions.pairingInstr) + .SetRotatingDeviceId(gOptions.rotatingId) + .SetPairingInstruction(gOptions.pairingInstr) .SetPairingHint(gOptions.pairingHint)); } else if (gOptions.advertisingMode == AdvertisingMode::kOperational) diff --git a/examples/ota-provider-app/esp32/README.md b/examples/ota-provider-app/esp32/README.md index 7ae2797c93b959..c849db6afd95d6 100644 --- a/examples/ota-provider-app/esp32/README.md +++ b/examples/ota-provider-app/esp32/README.md @@ -38,27 +38,10 @@ idf.py -p flash - Commissioning the OTA Provider ``` -./out/debug/chip-tool pairing ble-wifi 12345 0 20202021 3841 +./out/debug/chip-tool pairing ble-wifi 12345 20202021 3841 ``` --- -Please note down the IP Address and Node ID of OTA Provider, these are required -for [OTA Requestor Example](../../ota-requestor-app/esp32). Once OTA provider is -commissioned then head over to +Once OTA provider is commissioned then head over to [OTA Requestor Example](../../ota-requestor-app/esp32). - ---- - -## Features - -- Can complete full BDX transfer -- Provide the full OTA image to Requestor - -## Limitations - -- Synchronous BDX transfer only -- Does not check VID/PID -- Only one transfer at a time -- Does not check incoming UpdateTokens -- Does not support the header defined in Matter Specification. diff --git a/examples/ota-provider-app/esp32/main/CMakeLists.txt b/examples/ota-provider-app/esp32/main/CMakeLists.txt index a25dde36db364e..ee8077e9c8ff7a 100644 --- a/examples/ota-provider-app/esp32/main/CMakeLists.txt +++ b/examples/ota-provider-app/esp32/main/CMakeLists.txt @@ -39,9 +39,11 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-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/general-commissioning-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-provider" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common" 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 0e83a9e108bcbe..87d608abc236eb 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 @@ -979,7 +979,7 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, + "code": 2, "mfgCode": null, "source": "client", "incoming": 1, @@ -987,11 +987,11 @@ }, { "name": "NotifyUpdateApplied", - "code": 2, + "code": 4, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 } ], "attributes": [ @@ -1022,15 +1022,15 @@ "commands": [ { "name": "QueryImageResponse", - "code": 3, + "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -1454,7 +1454,7 @@ "reportableChange": 0 }, { - "name": "NetworkDisabled", + "name": "InterfaceEnabled", "code": 4, "mfgCode": null, "side": "server", diff --git a/examples/ota-requestor-app/efr32/.gn b/examples/ota-requestor-app/efr32/.gn new file mode 100644 index 00000000000000..3d48789e30ab3d --- /dev/null +++ b/examples/ota-requestor-app/efr32/.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + + import("//args.gni") +} diff --git a/examples/ota-requestor-app/efr32/BUILD.gn b/examples/ota-requestor-app/efr32/BUILD.gn new file mode 100644 index 00000000000000..aba10e91819dc6 --- /dev/null +++ b/examples/ota-requestor-app/efr32/BUILD.gn @@ -0,0 +1,190 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") +import("//build_overrides/efr32_sdk.gni") +import("//build_overrides/pigweed.gni") + +import("${build_root}/config/defaults.gni") +import("${efr32_sdk_build_root}/efr32_executable.gni") +import("${efr32_sdk_build_root}/efr32_sdk.gni") + +import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/device.gni") + +if (chip_enable_pw_rpc) { + import("//build_overrides/pigweed.gni") + import("$dir_pw_build/target_types.gni") +} + +assert(current_os == "freertos") + +efr32_project_dir = "${chip_root}/examples/ota-requestor-app/efr32" +examples_plat_dir = "${chip_root}/examples/platform/efr32" + +declare_args() { + # Dump memory usage at link time. + chip_print_memory_usage = false + + # PIN code for PASE session establishment. + setupPinCode = 73141520 + setupDiscriminator = 3840 + + # Monitor & log memory usage at runtime. + enable_heap_monitoring = false +} + +show_qr_code = true + +# BRD4166A --> ThunderBoard Sense 2 (No LCD) +if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") { + show_qr_code = false +} + +efr32_sdk("sdk") { + sources = [ + "${efr32_project_dir}/include/CHIPProjectConfig.h", + "${efr32_project_dir}/include/FreeRTOSConfig.h", + ] + + include_dirs = [ + "${chip_root}/src/platform/EFR32", + "${efr32_project_dir}/include", + "${examples_plat_dir}", + ] + + defines = [ + "BOARD_ID=${efr32_board}", + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setupPinCode}", + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setupDiscriminator}", + ] + + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } +} + +efr32_executable("ota_requestor_app") { + output_name = "chip-efr32-ota-requestor-example.out" + + sources = [ + "${examples_plat_dir}/LEDWidget.cpp", + "${examples_plat_dir}/heap_4_silabs.c", + "${examples_plat_dir}/init_efrPlatform.cpp", + "${examples_plat_dir}/uart.cpp", + "src/AppTask.cpp", + "src/LightingManager.cpp", + "src/ZclCallbacks.cpp", + "src/main.cpp", + ] + + deps = [ + ":sdk", + "${chip_root}/examples/common/QRCode", + "${chip_root}/examples/ota-requestor-app/ota-requestor-common", + "${chip_root}/src/lib", + "${chip_root}/src/setup_payload", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", + "${examples_plat_dir}:efr-matter-shell", + ] + + if (chip_openthread_ftd) { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } + + include_dirs = [ "include" ] + + defines = [] + + if (show_qr_code) { + sources += [ "${examples_plat_dir}/display/lcd.c" ] + defines += [ "DISPLAY_ENABLED" ] + } + + if (chip_enable_pw_rpc) { + defines += [ + "PW_RPC_ENABLED", + "PW_RPC_ATTRIBUTE_SERVICE=1", + "PW_RPC_BUTTON_SERVICE=1", + "PW_RPC_DEVICE_SERVICE=1", + "PW_RPC_LIGHTING_SERVICE=1", + ] + + sources += [ + "${chip_root}/examples/common/pigweed/RpcService.cpp", + "${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp", + "${examples_plat_dir}/PigweedLogger.cpp", + "${examples_plat_dir}/Rpc.cpp", + ] + + deps += [ + "$dir_pw_hdlc:rpc_channel_output", + "$dir_pw_stream:sys_io_stream", + "${chip_root}/config/efr32/lib/pw_rpc:pw_rpc", + "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", + "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32", + ] + + deps += pw_build_LINK_DEPS + + include_dirs += [ + "${chip_root}/examples/common", + "${chip_root}/examples/common/pigweed/efr32", + ] + } + + if (enable_heap_monitoring) { + sources += [ "${examples_plat_dir}/MemMonitoring.cpp" ] + defines += [ "HEAP_MONITORING" ] + } + + ldscript = "${examples_plat_dir}/ldscripts/${efr32_family}.ld" + + inputs = [ ldscript ] + + ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] + + if (chip_print_memory_usage) { + ldflags += [ + "-Wl,--print-memory-usage", + "-fstack-usage", + ] + } + + output_dir = root_out_dir +} + +group("efr32") { + deps = [ ":ota_requestor_app" ] +} + +group("default") { + deps = [ ":efr32" ] +} diff --git a/examples/ota-requestor-app/efr32/README.md b/examples/ota-requestor-app/efr32/README.md new file mode 100644 index 00000000000000..b36f7606d37f81 --- /dev/null +++ b/examples/ota-requestor-app/efr32/README.md @@ -0,0 +1,100 @@ +#CHIP EFR32 OTA Requestor Example + +An example showing the use of the Matter OTA Requestor functionality on the +Silicon Labs EFR32 MG12. + + + +## Introduction + +The EFR32 OTA Requestor example provides a baseline demonstration the Matter OTA +Requestor functionality built with the Silicon Labs gecko SDK. It can be +controlled by a Chip controller over Openthread network.. + + + +## Building + +For initial setup steps please see the CHIP EFR32 Lighting Example README at +examples/lighting-app/efr32/README.md + +- Supported hardware: + + MG12 boards: + + - BRD4161A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@19dBm + - BRD4164A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@19dBm + - BRD4166A / SLTB004A / Thunderboard Sense 2 / 2.4GHz@10dBm + - BRD4170A / SLWSTK6000B / Multiband Wireless Starter Kit / 2.4GHz@19dBm, + 915MHz@19dBm + - BRD4304A / SLWSTK6000B / MGM12P Module / 2.4GHz@19dBm + + MG21 boards: Currently not supported due to RAM limitation. + + - BRD4180A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + + MG24 boards : + + - BRD4186A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4187A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + +* Build the example application: + + cd ~/connectedhomeip + ./scripts/examples/gn_efr32_example.sh  ./examples/ota-requestor-app/efr32/ ./out/ota-requestor-app BRD4161A + +- To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip + $ rm -rf ./out/ + +## Flashing the Application + +- On the command line: + + $ cd ~/connectedhomeip/out/ota-requestor-app/BRD4161A + $ python3 chip-efr32-ota-requestor-example.flash.py + +- Or with the Ozone debugger, just load the .out file. + + + +## Viewing Logging Output + +See examples/lighting-app/efr32/README.md + +## Running the OTA Download scenario + +- Bring up the Open Thread Border Router as discussed in + examples/lighting-app/efr32/README.md and get its operational dataset. + +- On a Linux or Darwin platform build the chip-tool and the ota-provider-app + as follows: + + scripts/examples/gn_build_example.sh examples/chip-tool out/ + scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false + +- In a terminal start the provider app passing to it the path to the image + file that the Requestor is supposed to download (for example /tmp/ota.out): + + ./out/debug/chip-ota-provider-app -f /tmp/ota.out + +- In a separate terminal run the chip-tool commands to provision the Provider: + + rm -r /tmp/chip_* + ./out/chip-tool pairing onnetwork 1 20202021 + +- If the Requestor had been previously commissioned hold Button 0 for six + seconds to factory-reset the device. + +- In the chip-tool terminal enter: + + ./out/chip-tool pairing ble-thread 2 hex: 73141520 3840 + +where operationalDataset is obtained from the Open Thread Border Router. + +- Once the commissioning process completes enter: + + ./out/chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 2 0 + +- The Requestor will connect to the Provider and start the image download. diff --git a/config/nrfconnect/chip-gn/lib/pw_rpc/pw_rpc.gni b/examples/ota-requestor-app/efr32/args.gni similarity index 61% rename from config/nrfconnect/chip-gn/lib/pw_rpc/pw_rpc.gni rename to examples/ota-requestor-app/efr32/args.gni index 5732dca57cd060..e0bc6e99507b2d 100644 --- a/config/nrfconnect/chip-gn/lib/pw_rpc/pw_rpc.gni +++ b/examples/ota-requestor-app/efr32/args.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# 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. @@ -14,17 +14,15 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") +import("${chip_root}/src/platform/EFR32/args.gni") -pw_log_BACKEND = "$dir_pw_log_basic" -pw_assert_BACKEND = "$dir_pw_assert_log" -pw_sys_io_BACKEND = - "${chip_root}/examples/platform/nrfconnect/pw_sys_io:pw_sys_io_nrfconnect" -pw_rpc_system_server_BACKEND = - "${chip_root}/examples/common/pigweed:system_rpc_server" +efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") -pw_build_LINK_DEPS = [ - "$dir_pw_assert:impl", - "$dir_pw_log:impl", -] +pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" +pw_assert_BACKEND = "$dir_pw_assert_log" +chip_enable_openthread = true +chip_openthread_ftd = false -dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo" +declare_args() { + chip_enable_ota_requestor = true +} diff --git a/examples/ota-requestor-app/efr32/build_overrides b/examples/ota-requestor-app/efr32/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/ota-requestor-app/efr32/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/ota-requestor-app/efr32/include/AppConfig.h b/examples/ota-requestor-app/efr32/include/AppConfig.h new file mode 100644 index 00000000000000..efe17b3b39288f --- /dev/null +++ b/examples/ota-requestor-app/efr32/include/AppConfig.h @@ -0,0 +1,46 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// ---- Lighting Example App Config ---- + +#define APP_TASK_NAME "APP" + +// Time it takes in ms for the simulated actuator to move from one +// state to another. +#define ACTUATOR_MOVEMENT_PERIOS_MS 10 + +// EFR Logging +#ifdef __cplusplus +extern "C" { +#endif + +void efr32LogInit(void); + +void efr32Log(const char * aFormat, ...); +#define EFR32_LOG(...) efr32Log(__VA_ARGS__); +void appError(int err); + +#ifdef __cplusplus +} + +#include +void appError(CHIP_ERROR error); +#endif diff --git a/examples/ota-requestor-app/efr32/include/AppEvent.h b/examples/ota-requestor-app/efr32/include/AppEvent.h new file mode 100644 index 00000000000000..7a19b719edad25 --- /dev/null +++ b/examples/ota-requestor-app/efr32/include/AppEvent.h @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2018 Nest Labs, Inc. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventTypes + { + kEventType_Button = 0, + kEventType_Timer, + kEventType_Light, + kEventType_Install, + }; + + uint16_t Type; + + union + { + struct + { + uint8_t Action; + } ButtonEvent; + struct + { + void * Context; + } TimerEvent; + struct + { + uint8_t Action; + int32_t Actor; + } LightEvent; + }; + + EventHandler Handler; +}; diff --git a/examples/ota-requestor-app/efr32/include/AppTask.h b/examples/ota-requestor-app/efr32/include/AppTask.h new file mode 100644 index 00000000000000..8c43d3a0a2c828 --- /dev/null +++ b/examples/ota-requestor-app/efr32/include/AppTask.h @@ -0,0 +1,95 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "AppEvent.h" +#include "LightingManager.h" +#include "sl_simple_button_instances.h" + +#include "FreeRTOS.h" +#include "timers.h" // provides FreeRTOS timer support +#include +#include + +// Application-defined error codes in the CHIP_ERROR space. +#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01) +#define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02) +#define APP_ERROR_UNHANDLED_EVENT CHIP_APPLICATION_ERROR(0x03) +#define APP_ERROR_CREATE_TIMER_FAILED CHIP_APPLICATION_ERROR(0x04) +#define APP_ERROR_START_TIMER_FAILED CHIP_APPLICATION_ERROR(0x05) +#define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06) + +class AppTask +{ + +public: + CHIP_ERROR StartAppTask(); + static void AppTaskMain(void * pvParameter); + + void PostLightActionRequest(int32_t aActor, LightingManager::Action_t aAction); + void PostEvent(const AppEvent * event); + + void ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAction); + +private: + friend AppTask & GetAppTask(void); + + CHIP_ERROR Init(); + + static void ActionInitiated(LightingManager::Action_t aAction, int32_t aActor); + static void ActionCompleted(LightingManager::Action_t aAction); + + void CancelTimer(void); + + void DispatchEvent(AppEvent * event); + + static void FunctionTimerEventHandler(AppEvent * aEvent); + static void FunctionHandler(AppEvent * aEvent); + static void LightActionEventHandler(AppEvent * aEvent); + static void TimerEventHandler(TimerHandle_t xTimer); + + static void UpdateClusterState(void); + + void StartTimer(uint32_t aTimeoutMs); + + enum Function_t + { + kFunction_NoneSelected = 0, + kFunction_SoftwareUpdate = 0, + kFunction_StartBleAdv = 1, + kFunction_FactoryReset = 2, + + kFunction_Invalid + } Function; + + Function_t mFunction; + bool mFunctionTimerActive; + bool mSyncClusterToButtonAction; + + static AppTask sAppTask; +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} diff --git a/examples/ota-requestor-app/efr32/include/CHIPProjectConfig.h b/examples/ota-requestor-app/efr32/include/CHIPProjectConfig.h new file mode 100644 index 00000000000000..e2bfb2d63d60a3 --- /dev/null +++ b/examples/ota-requestor-app/efr32/include/CHIPProjectConfig.h @@ -0,0 +1,131 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// Use a default pairing code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +// For convenience, Chip Security Test Mode can be enabled and the +// requirement for authentication in various protocols can be disabled. +// +// WARNING: These options make it possible to circumvent basic Chip security functionality, +// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. +// +#define CHIP_CONFIG_SECURITY_TEST_MODE 0 +#define CHIP_CONFIG_REQUIRE_AUTH 1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0x235A: Chip's Vendor Id. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0x235A + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + * 0x534C: EFR32 lighting-app + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x534C + +/** + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION + * + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software versions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING + * + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" +#endif +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for Chip-over-BLE (CHIPoBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC + * + * Enables synchronizing the device's real time clock with a remote Chip Time service + * using the Chip Time Sync protocol. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in Chip NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +/** + * CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS + * + * Enable recording UTC timestamps. + */ +#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 + +/** + * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE + * + * A size, in bytes, of the individual debug event logging buffer. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) + +/** + * @def CHIP_CONFIG_MRP_DEFAULT_ACTIVE_RETRY_INTERVAL + * + * @brief + * Active retransmit interval, or time to wait before retransmission after + * subsequent failures in milliseconds. + * + * This is the default value, that might be adjusted by end device depending on its + * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. + * + */ +#define CHIP_CONFIG_MRP_DEFAULT_ACTIVE_RETRY_INTERVAL (2000_ms32) diff --git a/examples/ota-requestor-app/efr32/include/FreeRTOSConfig.h b/examples/ota-requestor-app/efr32/include/FreeRTOSConfig.h new file mode 100644 index 00000000000000..3d241f9a24ce0e --- /dev/null +++ b/examples/ota-requestor-app/efr32/include/FreeRTOSConfig.h @@ -0,0 +1,299 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*************************************************************************** + * # License + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is Third Party Software licensed by Silicon Labs from a third party + * and is governed by the sections of the MSLA applicable to Third Party + * Software and the additional terms set forth below. + * + ******************************************************************************/ +/* + FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. + All rights reserved + + VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. + + *************************************************************************** + >>! NOTE: The modification to the GPL is included to allow you to !<< + >>! distribute a combined work that includes FreeRTOS without being !<< + >>! obliged to provide the source code for proprietary components !<< + >>! outside of the FreeRTOS kernel. !<< + *************************************************************************** + + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. Full license text is available on the following + link: http://www.freertos.org/a00114.html + + *************************************************************************** + * * + * FreeRTOS provides completely free yet professionally developed, * + * robust, strictly quality controlled, supported, and cross * + * platform software that is more than just the market leader, it * + * is the industry's de facto standard. * + * * + * Help yourself get started quickly while simultaneously helping * + * to support the FreeRTOS project by purchasing a FreeRTOS * + * tutorial book, reference manual, or both: * + * http://www.FreeRTOS.org/Documentation * + * * + *************************************************************************** + + http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading + the FAQ page "My application does not run, what could be wrong?". Have you + defined configASSERT()? + + http://www.FreeRTOS.org/support - In return for receiving this top quality + embedded software for free we request you assist our global community by + participating in the support forum. + + http://www.FreeRTOS.org/training - Investing in training allows your team to + be as productive as possible as early as possible. Now you can receive + FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers + Ltd, and the world's leading authority on the world's leading RTOS. + + http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, + including FreeRTOS+Trace - an indispensable productivity tool, a DOS + compatible FAT file system, and our tiny thread aware UDP/IP stack. + + http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. + Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. + + http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High + Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS + licenses offer ticketed support, indemnification and commercial middleware. + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and + mission critical applications that require provable dependability. + + 1 tab == 4 spaces! +*/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include "RTE_Components.h" +#include CMSIS_device_header + +#include "em_assert.h" +#include "em_device.h" + +#if defined(SL_COMPONENT_CATALOG_PRESENT) +#include "sl_component_catalog.h" +#endif + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +/* Set configCREATE_LOW_POWER_DEMO as follows: + * + * 0: Build the full test and demo application. + * 1: Build the simple blinky tickless low power demo, generating the tick + * interrupt from the RTCC. EM2 will be entered. The LXFO clock is used. + * See the comments at the top of main.c, main_full.c and main_low_power.c for + * more information. + */ + +#define configCREATE_LOW_POWER_DEMO (0) + +/* Some configuration is dependent on the demo being built. */ +#if (configCREATE_LOW_POWER_DEMO == 0) + +/* Tickless mode is not used. */ + +/* Some of the standard demo test tasks assume a tick rate of 1KHz, even +though that is faster than would normally be warranted by a real +application. */ +#define configTICK_RATE_HZ (1000) + +/* Energy saving modes. */ +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#define configUSE_TICKLESS_IDLE 1 +#else +#define configUSE_TICKLESS_IDLE 0 +#endif + +/* Definition used by Keil to replace default system clock source. */ +#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 + +/* Hook function related definitions. */ +#define configUSE_TICK_HOOK (1) +#define configCHECK_FOR_STACK_OVERFLOW (2) +#define configUSE_MALLOC_FAILED_HOOK (1) +#define configUSE_IDLE_HOOK (1) + +#define configENERGY_MODE (sleepEM1) + +#else + +/* Tickless idle mode, generating RTOS tick interrupts from the RTC, fed +by the LXFO clock. */ + +/* The slow clock used to generate the tick interrupt in the low power demo +runs at 32768/8=4096Hz. Ensure the tick rate is a multiple of the clock. */ +#define configTICK_RATE_HZ (128) + +/* The low power demo uses the tickless idle feature. */ +#define configUSE_TICKLESS_IDLE (1) +#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION (1) + +/* Hook function related definitions. */ +#define configUSE_TICK_HOOK (0) +#define configCHECK_FOR_STACK_OVERFLOW (0) +#define configUSE_MALLOC_FAILED_HOOK (0) +#define configUSE_IDLE_HOOK (1) + +#define configENERGY_MODE (sleepEM3) +#endif + +/* Main functions*/ +/* Run time stats gathering related definitions. */ +#define configGENERATE_RUN_TIME_STATS (0) + +/* Co-routine related definitions. */ +#define configUSE_CO_ROUTINES (0) +#define configMAX_CO_ROUTINE_PRIORITIES (1) + +/* Software timer related definitions. */ +#define configUSE_TIMERS (1) +#define configTIMER_TASK_PRIORITY (40) /* Highest priority */ +#define configTIMER_QUEUE_LENGTH (10) +#define configTIMER_TASK_STACK_DEPTH (1024) + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY (255) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY 48 +#define configENABLE_FPU 0 +#define configENABLE_MPU 0 +/* FreeRTOS Secure Side Only and TrustZone Security Extension */ +#define configRUN_FREERTOS_SECURE_ONLY 1 +#define configENABLE_TRUSTZONE 0 +/* FreeRTOS MPU specific definitions. */ +#define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS (0) + +#define configCPU_CLOCK_HZ (SystemCoreClock) +#define configUSE_PREEMPTION (1) +#define configUSE_TIME_SLICING (1) +#define configUSE_PORT_OPTIMISED_TASK_SELECTION (0) +#define configUSE_TICKLESS_IDLE_SIMPLE_DEBUG (1) /* See into vPortSuppressTicksAndSleep source code for explanation */ +#define configMAX_PRIORITIES (56) +#define configMINIMAL_STACK_SIZE (140) /* Number of words to use for Idle and Timer stacks */ +#define configMAX_TASK_NAME_LEN (10) +#define configUSE_16_BIT_TICKS (0) +#define configIDLE_SHOULD_YIELD (1) +#define configUSE_MUTEXES (1) +#define configUSE_RECURSIVE_MUTEXES (1) +#define configUSE_COUNTING_SEMAPHORES (1) +#define configUSE_TASK_NOTIFICATIONS 1 +#define configUSE_TRACE_FACILITY 1 +#define configQUEUE_REGISTRY_SIZE (10) +#define configUSE_QUEUE_SETS (0) +#define configUSE_NEWLIB_REENTRANT (1) +#define configENABLE_BACKWARD_COMPATIBILITY (1) +#define configSUPPORT_STATIC_ALLOCATION (1) +#define configSUPPORT_DYNAMIC_ALLOCATION (1) +#define configTOTAL_HEAP_SIZE ((size_t)(20 * 1024)) + +/* Optional functions - most linkers will remove unused functions anyway. */ +#define INCLUDE_vTaskPrioritySet (1) +#define INCLUDE_uxTaskPriorityGet (1) +#define INCLUDE_vTaskDelete (1) +#define INCLUDE_vTaskSuspend (1) +#define INCLUDE_xResumeFromISR (1) +#define INCLUDE_vTaskDelayUntil (1) +#define INCLUDE_vTaskDelay (1) +#define INCLUDE_xTaskGetSchedulerState (1) +#define INCLUDE_xTaskGetCurrentTaskHandle (1) +#define INCLUDE_uxTaskGetStackHighWaterMark (1) +#define INCLUDE_xTaskGetIdleTaskHandle (1) +#define INCLUDE_xTimerGetTimerDaemonTaskHandle (1) +#define INCLUDE_pcTaskGetTaskName (1) +#define INCLUDE_eTaskGetState (1) +#define INCLUDE_xEventGroupSetBitFromISR (1) +#define INCLUDE_xEventGroupSetBitsFromISR (1) +#define INCLUDE_xSemaphoreGetMutexHolder (1) +#define INCLUDE_xTimerPendFunctionCall (1) +#define INCLUDE_xTaskGetHandle (1) + +/* Stop if an assertion fails. */ +#define configASSERT(x) \ + if ((x) == 0) \ + { \ + taskDISABLE_INTERRUPTS(); \ + printf("\nFREERTOS ASSERT ( %s )\n", #x); \ + for (;;) \ + ; \ + } +#define configASSERTNULL(x) \ + if ((x) == NULL) \ + { \ + taskDISABLE_INTERRUPTS(); \ + for (;;) \ + ; \ + } + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler +/* Ensure Cortex-M port compatibility. */ +#define SysTick_Handler xPortSysTickHandler + +/* Thread local storage pointers used by the SDK */ +#ifndef configNUM_SDK_THREAD_LOCAL_STORAGE_POINTERS +#define configNUM_SDK_THREAD_LOCAL_STORAGE_POINTERS 0 +#endif + +#if defined(__GNUC__) +/* For the linker. */ +#define fabs __builtin_fabs +#endif + +#ifdef __cplusplus +} +#endif diff --git a/examples/ota-requestor-app/efr32/include/LightingManager.h b/examples/ota-requestor-app/efr32/include/LightingManager.h new file mode 100644 index 00000000000000..3aa9871e919074 --- /dev/null +++ b/examples/ota-requestor-app/efr32/include/LightingManager.h @@ -0,0 +1,85 @@ +/* + * + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "AppEvent.h" + +#include "FreeRTOS.h" +#include "timers.h" // provides FreeRTOS timer support + +#include + +class LightingManager +{ +public: + enum Action_t + { + ON_ACTION = 0, + OFF_ACTION, + + INVALID_ACTION + } Action; + + enum State_t + { + kState_OffInitiated = 0, + kState_OffCompleted, + kState_OnInitiated, + kState_OnCompleted, + } State; + + CHIP_ERROR Init(); + bool IsLightOn(); + void EnableAutoTurnOff(bool aOn); + void SetAutoTurnOffDuration(uint32_t aDurationInSecs); + bool IsActionInProgress(); + bool InitiateAction(int32_t aActor, Action_t aAction); + + typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor); + typedef void (*Callback_fn_completed)(Action_t); + void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); + +private: + friend LightingManager & LightMgr(void); + State_t mState; + + Callback_fn_initiated mActionInitiated_CB; + Callback_fn_completed mActionCompleted_CB; + + bool mAutoTurnOff; + uint32_t mAutoTurnOffDuration; + bool mAutoTurnOffTimerArmed; + + void CancelTimer(void); + void StartTimer(uint32_t aTimeoutMs); + + static void TimerEventHandler(TimerHandle_t xTimer); + static void AutoTurnOffTimerEventHandler(AppEvent * aEvent); + static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); + + static LightingManager sLight; +}; + +inline LightingManager & LightMgr(void) +{ + return LightingManager::sLight; +} diff --git a/examples/ota-requestor-app/efr32/src/AppTask.cpp b/examples/ota-requestor-app/efr32/src/AppTask.cpp new file mode 100644 index 00000000000000..2b6d5e39bd2c2c --- /dev/null +++ b/examples/ota-requestor-app/efr32/src/AppTask.cpp @@ -0,0 +1,513 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppTask.h" +#include "AppConfig.h" +#include "AppEvent.h" +#include "LEDWidget.h" +#include "lcd.h" +#include "qrcodegen.h" +#include "sl_simple_led_instances.h" +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include + +#include + +#include +#if CHIP_ENABLE_OPENTHREAD +#include +#include +#include +#endif + +#define FACTORY_RESET_TRIGGER_TIMEOUT 3000 +#define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 +#define APP_TASK_STACK_SIZE (4096) +#define APP_TASK_PRIORITY 2 +#define APP_EVENT_QUEUE_SIZE 10 +#define EXAMPLE_VENDOR_ID 0xcafe + +#define SYSTEM_STATE_LED &sl_led_led0 +#define LIGHT_LED &sl_led_led1 +#define APP_FUNCTION_BUTTON &sl_button_btn0 +#define APP_LIGHT_SWITCH &sl_button_btn1 + +namespace { +TimerHandle_t sFunctionTimer; // FreeRTOS app sw timer. + +TaskHandle_t sAppTaskHandle; +QueueHandle_t sAppEventQueue; + +LEDWidget sStatusLED; +LEDWidget sLightLED; + +bool sIsThreadProvisioned = false; +bool sIsThreadEnabled = false; +bool sHaveBLEConnections = false; + +// EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; + +uint8_t sAppEventQueueBuffer[APP_EVENT_QUEUE_SIZE * sizeof(AppEvent)]; +StaticQueue_t sAppEventQueueStruct; + +StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; +StaticTask_t appTaskStruct; + +} // namespace + +using namespace chip::TLV; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceLayer; + +AppTask AppTask::sAppTask; + +CHIP_ERROR AppTask::StartAppTask() +{ + sAppEventQueue = xQueueCreateStatic(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent), sAppEventQueueBuffer, &sAppEventQueueStruct); + if (sAppEventQueue == NULL) + { + EFR32_LOG("Failed to allocate app event queue"); + appError(APP_ERROR_EVENT_QUEUE_FAILED); + } + + // Start App task. + sAppTaskHandle = xTaskCreateStatic(AppTaskMain, APP_TASK_NAME, ArraySize(appStack), NULL, 1, appStack, &appTaskStruct); + return (sAppTaskHandle == nullptr) ? APP_ERROR_CREATE_TASK_FAILED : CHIP_NO_ERROR; +} + +CHIP_ERROR AppTask::Init() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Init ZCL Data Model + chip::Server::GetInstance().Init(); + + // Initialize device attestation config + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + + // Create FreeRTOS sw timer for Function Selection. + sFunctionTimer = xTimerCreate("FnTmr", // Just a text name, not used by the RTOS kernel + 1, // == default timer period (mS) + false, // no timer reload (==one-shot) + (void *) this, // init timer id = app task obj context + TimerEventHandler // timer callback handler + ); + if (sFunctionTimer == NULL) + { + EFR32_LOG("funct timer create failed"); + appError(APP_ERROR_CREATE_TIMER_FAILED); + } + + EFR32_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); + err = LightMgr().Init(); + if (err != CHIP_NO_ERROR) + { + EFR32_LOG("LightMgr().Init() failed"); + appError(err); + } + + LightMgr().SetCallbacks(ActionInitiated, ActionCompleted); + + // Initialize LEDs + LEDWidget::InitGpio(); + sStatusLED.Init(SYSTEM_STATE_LED); + sLightLED.Init(LIGHT_LED); + sLightLED.Set(LightMgr().IsLightOn()); + UpdateClusterState(); + + ConfigurationMgr().LogDeviceConfig(); + +// Print setup info on LCD if available +#ifdef DISPLAY_ENABLED + std::string QRCode; + + if (GetQRCode(QRCode, chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)) == CHIP_NO_ERROR) + { + LCDWriteQRCode((uint8_t *) QRCode.c_str()); + } + else + { + EFR32_LOG("Getting QR code failed!"); + } +#else + PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); +#endif + + return err; +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppEvent event; + + CHIP_ERROR err = sAppTask.Init(); + if (err != CHIP_NO_ERROR) + { + EFR32_LOG("AppTask.Init() failed"); + appError(err); + } + + EFR32_LOG("App Task started"); + + while (true) + { + BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, pdMS_TO_TICKS(10)); + while (eventReceived == pdTRUE) + { + sAppTask.DispatchEvent(&event); + eventReceived = xQueueReceive(sAppEventQueue, &event, 0); + } + + // Collect connectivity and configuration state from the CHIP stack. Because + // the CHIP event loop is being run in a separate task, the stack must be + // locked while these values are queried. However we use a non-blocking + // lock request (TryLockCHIPStack()) to avoid blocking other UI activities + // when the CHIP task is busy (e.g. with a long crypto operation). + if (PlatformMgr().TryLockChipStack()) + { + sIsThreadProvisioned = ConnectivityMgr().IsThreadProvisioned(); + sIsThreadEnabled = ConnectivityMgr().IsThreadEnabled(); + sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); + PlatformMgr().UnlockChipStack(); + } + + // Update the status LED if factory reset has not been initiated. + // + // If system has "full connectivity", keep the LED On constantly. + // + // If thread and service provisioned, but not attached to the thread network + // yet OR no connectivity to the service OR subscriptions are not fully + // established THEN blink the LED Off for a short period of time. + // + // If the system has ble connection(s) uptill the stage above, THEN blink + // the LEDs at an even rate of 100ms. + // + // Otherwise, blink the LED ON for a very short time. + if (sAppTask.mFunction != kFunction_FactoryReset) + { + if (sIsThreadProvisioned && sIsThreadEnabled) + { + sStatusLED.Blink(950, 50); + } + else if (sHaveBLEConnections) + { + sStatusLED.Blink(100, 100); + } + else + { + sStatusLED.Blink(50, 950); + } + } + + sStatusLED.Animate(); + } +} + +void AppTask::LightActionEventHandler(AppEvent * aEvent) +{ + bool initiated = false; + LightingManager::Action_t action; + int32_t actor; + CHIP_ERROR err = CHIP_NO_ERROR; + + if (aEvent->Type == AppEvent::kEventType_Light) + { + action = static_cast(aEvent->LightEvent.Action); + actor = aEvent->LightEvent.Actor; + } + else if (aEvent->Type == AppEvent::kEventType_Button) + { + if (LightMgr().IsLightOn()) + { + action = LightingManager::OFF_ACTION; + } + else + { + action = LightingManager::ON_ACTION; + } + actor = AppEvent::kEventType_Button; + } + else + { + err = APP_ERROR_UNHANDLED_EVENT; + } + + if (err == CHIP_NO_ERROR) + { + initiated = LightMgr().InitiateAction(actor, action); + + if (!initiated) + { + EFR32_LOG("Action is already in progress or active."); + } + } +} + +void AppTask::ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAction) +{ + if (buttonHandle == NULL) + { + return; + } + + AppEvent button_event = {}; + button_event.Type = AppEvent::kEventType_Button; + button_event.ButtonEvent.Action = btnAction; + + if (buttonHandle == APP_LIGHT_SWITCH && btnAction == SL_SIMPLE_BUTTON_PRESSED) + { + button_event.Handler = LightActionEventHandler; + sAppTask.PostEvent(&button_event); + } + else if (buttonHandle == APP_FUNCTION_BUTTON) + { + button_event.Handler = FunctionHandler; + sAppTask.PostEvent(&button_event); + } +} + +void AppTask::TimerEventHandler(TimerHandle_t xTimer) +{ + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.TimerEvent.Context = (void *) xTimer; + event.Handler = FunctionTimerEventHandler; + sAppTask.PostEvent(&event); +} + +void AppTask::FunctionTimerEventHandler(AppEvent * aEvent) +{ + if (aEvent->Type != AppEvent::kEventType_Timer) + { + return; + } + + // If we reached here, the button was held past FACTORY_RESET_TRIGGER_TIMEOUT, + // initiate factory reset + if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_StartBleAdv) + { + EFR32_LOG("Factory Reset Triggered. Release button within %ums to cancel.", FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); + + // Start timer for FACTORY_RESET_CANCEL_WINDOW_TIMEOUT to allow user to + // cancel, if required. + sAppTask.StartTimer(FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); + + sAppTask.mFunction = kFunction_FactoryReset; + + // Turn off all LEDs before starting blink to make sure blink is + // co-ordinated. + sStatusLED.Set(false); + + sStatusLED.Blink(500); + } + else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset) + { + // Actually trigger Factory Reset + sAppTask.mFunction = kFunction_NoneSelected; + ConfigurationMgr().InitiateFactoryReset(); + } +} + +void AppTask::FunctionHandler(AppEvent * aEvent) +{ + // To trigger software update: press the APP_FUNCTION_BUTTON button briefly (< + // FACTORY_RESET_TRIGGER_TIMEOUT) To initiate factory reset: press the + // APP_FUNCTION_BUTTON for FACTORY_RESET_TRIGGER_TIMEOUT + + // FACTORY_RESET_CANCEL_WINDOW_TIMEOUT All LEDs start blinking after + // FACTORY_RESET_TRIGGER_TIMEOUT to signal factory reset has been initiated. + // To cancel factory reset: release the APP_FUNCTION_BUTTON once all LEDs + // start blinking within the FACTORY_RESET_CANCEL_WINDOW_TIMEOUT + if (aEvent->ButtonEvent.Action == SL_SIMPLE_BUTTON_PRESSED) + { + if (!sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_NoneSelected) + { + sAppTask.StartTimer(FACTORY_RESET_TRIGGER_TIMEOUT); + sAppTask.mFunction = kFunction_StartBleAdv; + } + } + else + { + // If the button was released before factory reset got initiated, start BLE advertissement in fast mode + if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_StartBleAdv) + { + sAppTask.CancelTimer(); + sAppTask.mFunction = kFunction_NoneSelected; + + if (!ConnectivityMgr().IsThreadProvisioned()) + { + // Enable BLE advertisements + ConnectivityMgr().SetBLEAdvertisingEnabled(true); + ConnectivityMgr().SetBLEAdvertisingMode(ConnectivityMgr().kFastAdvertising); + } + else + { + EFR32_LOG("Network is already provisioned, Ble advertissement not enabled"); + } + } + else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset) + { + sAppTask.CancelTimer(); + + // Change the function to none selected since factory reset has been + // canceled. + sAppTask.mFunction = kFunction_NoneSelected; + + EFR32_LOG("Factory Reset has been Canceled"); + } + } +} + +void AppTask::CancelTimer() +{ + if (xTimerStop(sFunctionTimer, 0) == pdFAIL) + { + EFR32_LOG("app timer stop() failed"); + appError(APP_ERROR_STOP_TIMER_FAILED); + } + + mFunctionTimerActive = false; +} + +void AppTask::StartTimer(uint32_t aTimeoutInMs) +{ + if (xTimerIsTimerActive(sFunctionTimer)) + { + EFR32_LOG("app timer already started!"); + CancelTimer(); + } + + // timer is not active, change its period to required value (== restart). + // FreeRTOS- Block for a maximum of 100 ticks if the change period command + // cannot immediately be sent to the timer command queue. + if (xTimerChangePeriod(sFunctionTimer, aTimeoutInMs / portTICK_PERIOD_MS, 100) != pdPASS) + { + EFR32_LOG("app timer start() failed"); + appError(APP_ERROR_START_TIMER_FAILED); + } + + mFunctionTimerActive = true; +} + +void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor) +{ + // Action initiated, update the light led + if (aAction == LightingManager::ON_ACTION) + { + EFR32_LOG("Turning light ON") + } + else if (aAction == LightingManager::OFF_ACTION) + { + EFR32_LOG("Turning light OFF") + } + + if (aActor == AppEvent::kEventType_Button) + { + sAppTask.mSyncClusterToButtonAction = true; + } +} + +void AppTask::ActionCompleted(LightingManager::Action_t aAction) +{ + // action has been completed bon the light + if (aAction == LightingManager::ON_ACTION) + { + EFR32_LOG("Light ON") + } + else if (aAction == LightingManager::OFF_ACTION) + { + EFR32_LOG("Light OFF") + } + + if (sAppTask.mSyncClusterToButtonAction) + { + UpdateClusterState(); + sAppTask.mSyncClusterToButtonAction = false; + } +} + +void AppTask::PostLightActionRequest(int32_t aActor, LightingManager::Action_t aAction) +{ + AppEvent event; + event.Type = AppEvent::kEventType_Light; + event.LightEvent.Actor = aActor; + event.LightEvent.Action = aAction; + event.Handler = LightActionEventHandler; + PostEvent(&event); +} + +void AppTask::PostEvent(const AppEvent * aEvent) +{ + if (sAppEventQueue != NULL) + { + BaseType_t status; + if (xPortIsInsideInterrupt()) + { + BaseType_t higherPrioTaskWoken = pdFALSE; + status = xQueueSendFromISR(sAppEventQueue, aEvent, &higherPrioTaskWoken); + +#ifdef portYIELD_FROM_ISR + portYIELD_FROM_ISR(higherPrioTaskWoken); +#elif portEND_SWITCHING_ISR // portYIELD_FROM_ISR or portEND_SWITCHING_ISR + portEND_SWITCHING_ISR(higherPrioTaskWoken); +#else // portYIELD_FROM_ISR or portEND_SWITCHING_ISR +#error "Must have portYIELD_FROM_ISR or portEND_SWITCHING_ISR" +#endif // portYIELD_FROM_ISR or portEND_SWITCHING_ISR + } + else + { + status = xQueueSend(sAppEventQueue, aEvent, 1); + } + + if (!status) + EFR32_LOG("Failed to post event to app task event queue"); + } + else + { + EFR32_LOG("Event Queue is NULL should never happen"); + } +} + +void AppTask::DispatchEvent(AppEvent * aEvent) +{ + if (aEvent->Handler) + { + aEvent->Handler(aEvent); + } + else + { + EFR32_LOG("Event received with no handler. Dropping event."); + } +} + +void AppTask::UpdateClusterState(void) {} diff --git a/examples/ota-requestor-app/efr32/src/LightingManager.cpp b/examples/ota-requestor-app/efr32/src/LightingManager.cpp new file mode 100644 index 00000000000000..7b206fd1ab6f37 --- /dev/null +++ b/examples/ota-requestor-app/efr32/src/LightingManager.cpp @@ -0,0 +1,225 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "LightingManager.h" + +#include "AppConfig.h" +#include "AppTask.h" +#include + +LightingManager LightingManager::sLight; + +TimerHandle_t sLightTimer; + +CHIP_ERROR LightingManager::Init() +{ + // Create FreeRTOS sw timer for light timer. + sLightTimer = xTimerCreate("lightTmr", // Just a text name, not used by the RTOS kernel + 1, // == default timer period (mS) + false, // no timer reload (==one-shot) + (void *) this, // init timer id = light obj context + TimerEventHandler // timer callback handler + ); + + if (sLightTimer == NULL) + { + EFR32_LOG("sLightTimer timer create failed"); + return APP_ERROR_CREATE_TIMER_FAILED; + } + + mState = kState_OffCompleted; + mAutoTurnOffTimerArmed = false; + mAutoTurnOff = false; + mAutoTurnOffDuration = 0; + + return CHIP_NO_ERROR; +} + +void LightingManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB) +{ + mActionInitiated_CB = aActionInitiated_CB; + mActionCompleted_CB = aActionCompleted_CB; +} + +bool LightingManager::IsActionInProgress() +{ + return (mState == kState_OffInitiated || mState == kState_OnInitiated); +} + +bool LightingManager::IsLightOn() +{ + return (mState == kState_OnCompleted); +} + +void LightingManager::EnableAutoTurnOff(bool aOn) +{ + mAutoTurnOff = aOn; +} + +void LightingManager::SetAutoTurnOffDuration(uint32_t aDurationInSecs) +{ + mAutoTurnOffDuration = aDurationInSecs; +} + +bool LightingManager::InitiateAction(int32_t aActor, Action_t aAction) +{ + bool action_initiated = false; + State_t new_state; + + // Initiate Turn On/Off Action only when the previous one is complete. + if (mState == kState_OffCompleted && aAction == ON_ACTION) + { + action_initiated = true; + + new_state = kState_OnInitiated; + } + else if (mState == kState_OnCompleted && aAction == OFF_ACTION) + { + action_initiated = true; + + new_state = kState_OffInitiated; + } + + if (action_initiated) + { + if (mAutoTurnOffTimerArmed && new_state == kState_OffInitiated) + { + // If auto turn off timer has been armed and someone initiates turning off, + // cancel the timer and continue as normal. + mAutoTurnOffTimerArmed = false; + + CancelTimer(); + } + + StartTimer(ACTUATOR_MOVEMENT_PERIOS_MS); + + // Since the timer started successfully, update the state and trigger callback + mState = new_state; + + if (mActionInitiated_CB) + { + mActionInitiated_CB(aAction, aActor); + } + } + + return action_initiated; +} + +void LightingManager::StartTimer(uint32_t aTimeoutMs) +{ + if (xTimerIsTimerActive(sLightTimer)) + { + EFR32_LOG("app timer already started!"); + CancelTimer(); + } + + // timer is not active, change its period to required value (== restart). + // FreeRTOS- Block for a maximum of 100 ticks if the change period command + // cannot immediately be sent to the timer command queue. + if (xTimerChangePeriod(sLightTimer, (aTimeoutMs / portTICK_PERIOD_MS), 100) != pdPASS) + { + EFR32_LOG("sLightTimer timer start() failed"); + appError(APP_ERROR_START_TIMER_FAILED); + } +} + +void LightingManager::CancelTimer(void) +{ + if (xTimerStop(sLightTimer, 0) == pdFAIL) + { + EFR32_LOG("sLightTimer stop() failed"); + appError(APP_ERROR_STOP_TIMER_FAILED); + } +} + +void LightingManager::TimerEventHandler(TimerHandle_t xTimer) +{ + // Get light obj context from timer id. + LightingManager * light = static_cast(pvTimerGetTimerID(xTimer)); + + // The timer event handler will be called in the context of the timer task + // once sLightTimer expires. Post an event to apptask queue with the actual handler + // so that the event can be handled in the context of the apptask. + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.TimerEvent.Context = light; + if (light->mAutoTurnOffTimerArmed) + { + event.Handler = AutoTurnOffTimerEventHandler; + } + else + { + event.Handler = ActuatorMovementTimerEventHandler; + } + GetAppTask().PostEvent(&event); +} + +void LightingManager::AutoTurnOffTimerEventHandler(AppEvent * aEvent) +{ + LightingManager * light = static_cast(aEvent->TimerEvent.Context); + int32_t actor = 0; + + // Make sure auto turn off timer is still armed. + if (!light->mAutoTurnOffTimerArmed) + { + return; + } + + light->mAutoTurnOffTimerArmed = false; + + EFR32_LOG("Auto Turn Off has been triggered!"); + + light->InitiateAction(actor, OFF_ACTION); +} + +void LightingManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) +{ + Action_t actionCompleted = INVALID_ACTION; + + LightingManager * light = static_cast(aEvent->TimerEvent.Context); + + if (light->mState == kState_OffInitiated) + { + light->mState = kState_OffCompleted; + actionCompleted = OFF_ACTION; + } + else if (light->mState == kState_OnInitiated) + { + light->mState = kState_OnCompleted; + actionCompleted = ON_ACTION; + } + + if (actionCompleted != INVALID_ACTION) + { + if (light->mActionCompleted_CB) + { + light->mActionCompleted_CB(actionCompleted); + } + + if (light->mAutoTurnOff && actionCompleted == ON_ACTION) + { + // Start the timer for auto turn off + light->StartTimer(light->mAutoTurnOffDuration * 1000); + + light->mAutoTurnOffTimerArmed = true; + + EFR32_LOG("Auto Turn off enabled. Will be triggered in %u seconds", light->mAutoTurnOffDuration); + } + } +} diff --git a/examples/ota-requestor-app/efr32/src/ZclCallbacks.cpp b/examples/ota-requestor-app/efr32/src/ZclCallbacks.cpp new file mode 100644 index 00000000000000..419ea954d67bbc --- /dev/null +++ b/examples/ota-requestor-app/efr32/src/ZclCallbacks.cpp @@ -0,0 +1,95 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file implements the handler for data model messages. + */ + +#include "AppConfig.h" +#include "LightingManager.h" + +#include +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::app::Clusters; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t mask, uint8_t type, + uint16_t size, uint8_t * value) +{ + ClusterId clusterId = attributePath.mClusterId; + AttributeId attributeId = attributePath.mAttributeId; + ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + + if (clusterId == OnOff::Id && attributeId == OnOff::Attributes::OnOff::Id) + { + LightMgr().InitiateAction(AppEvent::kEventType_Light, *value ? LightingManager::ON_ACTION : LightingManager::OFF_ACTION); + } + else if (clusterId == LevelControl::Id) + { + ChipLogProgress(Zcl, + "Level Control attribute ID: " ChipLogFormatMEI " Type: %" PRIu8 " Value: %" PRIu16 ", length %" PRIu16, + ChipLogValueMEI(attributeId), type, *value, size); + + // WIP Apply attribute change to Light + } + else if (clusterId == ColorControl::Id) + { + ChipLogProgress(Zcl, + "Color Control attribute ID: " ChipLogFormatMEI " Type: %" PRIu8 " Value: %" PRIu16 ", length %" PRIu16, + ChipLogValueMEI(attributeId), type, *value, size); + + // WIP Apply attribute change to Light + } + else if (clusterId == OnOffSwitchConfiguration::Id) + { + ChipLogProgress(Zcl, + "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %" PRIu8 " Value: %" PRIu16 + ", length %" PRIu16, + ChipLogValueMEI(attributeId), type, *value, size); + + // WIP Apply attribute change to Light + } + else if (clusterId == Identify::Id) + { + ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %" PRIu8 " Value: %" PRIu16 ", length %" PRIu16, + ChipLogValueMEI(attributeId), type, *value, size); + } +} + +/** @brief OnOff Cluster Init + * + * This function is called when a specific cluster is initialized. It gives the + * application an opportunity to take care of cluster initialization procedures. + * It is called exactly once for each endpoint where cluster is present. + * + * @param endpoint Ver.: always + * + * TODO Issue #3841 + * emberAfOnOffClusterInitCallback happens before the stack initialize the cluster + * attributes to the default value. + * The logic here expects something similar to the deprecated Plugins callback + * emberAfPluginOnOffClusterServerPostInitCallback. + * + */ +void emberAfOnOffClusterInitCallback(EndpointId endpoint) +{ + // TODO: implement any additional Cluster Server init actions +} diff --git a/examples/ota-requestor-app/efr32/src/main.cpp b/examples/ota-requestor-app/efr32/src/main.cpp new file mode 100644 index 00000000000000..4e54e423633fbb --- /dev/null +++ b/examples/ota-requestor-app/efr32/src/main.cpp @@ -0,0 +1,238 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include "AppConfig.h" +#include "init_efrPlatform.h" +#include "sl_simple_button_instances.h" +#include "sl_system_kernel.h" +#include + +#include "app/clusters/ota-requestor/BDXDownloader.h" +#include "app/clusters/ota-requestor/OTARequestor.h" +#include "platform/EFR32/OTAImageProcessorImpl.h" +#include "platform/GenericOTARequestorDriver.h" + +#ifdef HEAP_MONITORING +#include "MemMonitoring.h" +#endif + +#if DISPLAY_ENABLED +#include "lcd.h" +#endif + +#if CHIP_ENABLE_OPENTHREAD +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif // CHIP_ENABLE_OPENTHREAD + +#if PW_RPC_ENABLED +#include "Rpc.h" +#endif + +#ifdef ENABLE_CHIP_SHELL +#include "matter_shell.h" +#endif + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::DeviceLayer; + +#define UNUSED_PARAMETER(a) (a = a) + +// Global OTA objects +OTARequestor gRequestorCore; +DeviceLayer::GenericOTARequestorDriver gRequestorUser; +BDXDownloader gDownloader; +OTAImageProcessorImpl gImageProcessor; + +volatile int apperror_cnt; +// ================================================================================ +// App Error +//================================================================================= +void appError(int err) +{ + EFR32_LOG("!!!!!!!!!!!! App Critical Error: %d !!!!!!!!!!!", err); + portDISABLE_INTERRUPTS(); + while (1) + ; +} + +void appError(CHIP_ERROR error) +{ + appError(static_cast(error.AsInteger())); +} + +// ================================================================================ +// FreeRTOS Callbacks +// ================================================================================ +extern "C" void vApplicationIdleHook(void) +{ + // FreeRTOS Idle callback + + // Check CHIP Config nvm3 and repack flash if necessary. + Internal::EFR32Config::RepackNvm3Flash(); +} + +// ================================================================================ +// Main Code +// ================================================================================ +int main(void) +{ + init_efrPlatform(); + mbedtls_platform_set_calloc_free(CHIPPlatformMemoryCalloc, CHIPPlatformMemoryFree); + +#if PW_RPC_ENABLED + chip::rpc::Init(); +#endif + +#ifdef HEAP_MONITORING + MemMonitoring::startHeapMonitoring(); +#endif + + EFR32_LOG("=================================================="); + EFR32_LOG("chip-efr32-ota-requestor-example starting"); + EFR32_LOG("=================================================="); + + EFR32_LOG("Init CHIP Stack"); + // Init Chip memory management before the stack + chip::Platform::MemoryInit(); + chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().Init(); + + CHIP_ERROR ret = PlatformMgr().InitChipStack(); + if (ret != CHIP_NO_ERROR) + { + EFR32_LOG("PlatformMgr().InitChipStack() failed"); + appError(ret); + } + chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName("EFR32_OTA_REQUESTOR"); +#if CHIP_ENABLE_OPENTHREAD + EFR32_LOG("Initializing OpenThread stack"); + ret = ThreadStackMgr().InitThreadStack(); + if (ret != CHIP_NO_ERROR) + { + EFR32_LOG("ThreadStackMgr().InitThreadStack() failed"); + appError(ret); + } + +#if CHIP_DEVICE_CONFIG_THREAD_FTD + ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router); +#else + ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); +#endif // CHIP_DEVICE_CONFIG_THREAD_FTD + + if (ret != CHIP_NO_ERROR) + { + EFR32_LOG("ConnectivityMgr().SetThreadDeviceType() failed"); + appError(ret); + } +#endif // CHIP_ENABLE_OPENTHREAD + + // Initialize and interconnect the Requestor and Image Processor objects -- START + SetRequestorInstance(&gRequestorCore); + + // Set server instance used for session establishment + chip::Server * server = &(chip::Server::GetInstance()); + gRequestorCore.SetServerInstance(server); + + // Connect the Requestor and Requestor Driver objects + gRequestorCore.SetOtaRequestorDriver(&gRequestorUser); + + OTAImageProcessorParams ipParams; + ipParams.imageFile = CharSpan("test.txt"); + gImageProcessor.SetOTAImageProcessorParams(ipParams); + gImageProcessor.SetOTADownloader(&gDownloader); + + // Connect the Downloader and Image Processor objects + gDownloader.SetImageProcessorDelegate(&gImageProcessor); + + gRequestorCore.SetBDXDownloader(&gDownloader); + // Initialize and interconnect the Requestor and Image Processor objects -- END + + EFR32_LOG("Starting Platform Manager Event Loop"); + ret = PlatformMgr().StartEventLoopTask(); + if (ret != CHIP_NO_ERROR) + { + EFR32_LOG("PlatformMgr().StartEventLoopTask() failed"); + appError(ret); + } + +#if CHIP_ENABLE_OPENTHREAD + EFR32_LOG("Starting OpenThread task"); + + // Start OpenThread task + ret = ThreadStackMgrImpl().StartThreadTask(); + if (ret != CHIP_NO_ERROR) + { + EFR32_LOG("ThreadStackMgr().StartThreadTask() failed"); + appError(ret); + } +#endif // CHIP_ENABLE_OPENTHREAD + + EFR32_LOG("Starting App Task"); + ret = GetAppTask().StartAppTask(); + if (ret != CHIP_NO_ERROR) + { + EFR32_LOG("GetAppTask().Init() failed"); + appError(ret); + } + +#ifdef ENABLE_CHIP_SHELL + chip::startShellTask(); +#endif + + EFR32_LOG("Starting FreeRTOS scheduler"); + sl_system_kernel_start(); + + chip::Platform::MemoryShutdown(); + + // Should never get here. + EFR32_LOG("vTaskStartScheduler() failed"); + appError(ret); +} + +void sl_button_on_change(const sl_button_t * handle) +{ + GetAppTask().ButtonEventHandler(handle, sl_button_get_state(handle)); +} diff --git a/examples/ota-requestor-app/efr32/third_party/connectedhomeip b/examples/ota-requestor-app/efr32/third_party/connectedhomeip new file mode 120000 index 00000000000000..c866b86874994d --- /dev/null +++ b/examples/ota-requestor-app/efr32/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/examples/ota-requestor-app/efr32/with_pw_rpc.gni b/examples/ota-requestor-app/efr32/with_pw_rpc.gni new file mode 100644 index 00000000000000..d0a8f2c0485f06 --- /dev/null +++ b/examples/ota-requestor-app/efr32/with_pw_rpc.gni @@ -0,0 +1,28 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# add this gni as import in your build args to use pigweed in the example +# 'import("//with_pw_rpc.gni")' + +import("//build_overrides/chip.gni") +import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") +import("${chip_root}/examples/platform/efr32/args.gni") + +efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +chip_enable_pw_rpc = true +chip_enable_openthread = true +chip_openthread_ftd = true + +cpp_standard = "gnu++17" diff --git a/examples/ota-requestor-app/esp32/README.md b/examples/ota-requestor-app/esp32/README.md index bcea1698862d97..3fa1a299b5e53a 100644 --- a/examples/ota-requestor-app/esp32/README.md +++ b/examples/ota-requestor-app/esp32/README.md @@ -31,67 +31,41 @@ idf.py -p flash monitor - Commissioning the OTA Requestor ``` -./out/debug/chip-tool pairing ble-wifi 12346 0 20202021 3840 +./out/debug/chip-tool pairing ble-wifi 12346 20202021 3840 ``` ## Query for an OTA Image -After commissioning is successful, query for OTA image. Head over to ESP32 -console and fire the following command. This command creates a CASE session with -OTA Provider and start the OTA image transfer using BDX protocol. +After commissioning is successful, announce OTA provider's presence using +chip-tool. On receiving this command OTA requestor will query for OTA image. ``` -esp32> QueryImage -``` - -OTA image transfer takes some time and once done it prints following log - -``` -I (322620) OTARequesterImpl: Transfer complete! +./out/debug/chip-tool otasoftwareupdaterequestor announce-ota-provider 12345 0 0 12346 0 ``` ## Apply update request Once transfer is complete OTA Requestor should take permission from the OTA -Provider for applying the OTA image. +Provider for applying the OTA image. Use the following command from OTA +requestor prompt ``` -esp32> ApplyUpdateRequest +esp32> ApplyUpdateRequest ``` -After this step device should reboot and start running hello world example. +Then reboot the device manually to boot from upgraded OTA image. ## ESP32 OTA Requestor with Linux OTA Provider - Build the [Linux OTA Provider](../../ota-provider-app/linux) -- Run the Linux OTA Provider with - [hello world OTA image](http://shubhamdp.github.io/esp_ota/esp32/hello-world-for-linux-provider.bin). - This OTA image is built for ESP32, it will not work on other devices. +- Run the Linux OTA Provider with OTA image. ``` -./out/debug/chip-ota-provider-app -f hello-world-for-linux-provider.bin +./out/debug/chip-ota-provider-app -f hello-world.bin ``` - Provision the Linux OTA Provider using chip-tool ``` -./out/debug/chip-tool pairing 12345 20202021 +./out/debug/chip-tool pairing onnetwork 12345 20202021 ``` - -- Note down the OTA Provider IP address and Node Id and repeat the steps for - ESP32 OTA Requestor app - ---- - -## Features - -- Can perform the actual OTA if the image provided is valid -- Code for running a full BDX download exists in BDX -- Can send QueryImage and ApplyUpdateRequest commands triggered from console -- Downloads a file over BDX served by an OTA Provider server - -## Limitations - -- Does not verify QueryImageResponse status -- Does not support AnnounceOTAProvider command or OTA Requestor attributes -- Does not support the header defined in Matter Specification. diff --git a/examples/ota-requestor-app/esp32/main/BDXDownloader.cpp b/examples/ota-requestor-app/esp32/main/BDXDownloader.cpp deleted file mode 100644 index db1f08f1f40f25..00000000000000 --- a/examples/ota-requestor-app/esp32/main/BDXDownloader.cpp +++ /dev/null @@ -1,155 +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. - */ - -#include "BDXDownloader.h" - -#include -#include -#include -#include - -using namespace chip::bdx; - -void BdxDownloader::SetInitialExchange(chip::Messaging::ExchangeContext * ec) -{ - mExchangeCtx = ec; -} - -void BdxDownloader::SetCallbacks(BdxDownloaderCallbacks callbacks) -{ - mOnBlockReceivedCallback = callbacks.onBlockReceived; - mOnTransferCompleteCallback = callbacks.onTransferComplete; - mOnTransferFailedCallback = callbacks.onTransferFailed; -} - -void BdxDownloader::HandleTransferSessionOutput(TransferSession::OutputEvent & event) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - if (event.EventType != TransferSession::OutputEventType::kNone) - { - ChipLogDetail(BDX, "OutputEvent type: %s", event.ToString(event.EventType)); - } - - switch (event.EventType) - { - case TransferSession::OutputEventType::kNone: - if (mIsTransferComplete) - { - if (mOnTransferCompleteCallback != nullptr && mOnTransferCompleteCallback->mCall != nullptr) - { - mOnTransferCompleteCallback->mCall(mOnTransferCompleteCallback->mContext); - } - else - { - ChipLogError(BDX, "onTransferComplete Callback not set"); - } - mTransfer.Reset(); - mIsTransferComplete = false; - } - break; - case TransferSession::OutputEventType::kMsgToSend: { - chip::Messaging::SendFlags sendFlags; - VerifyOrReturn(mExchangeCtx != nullptr, ChipLogError(BDX, "mExchangeContext is null, cannot proceed")); - if (event.msgTypeData.MessageType == static_cast(MessageType::ReceiveInit)) - { - sendFlags.Set(chip::Messaging::SendMessageFlags::kFromInitiator); - } - if (event.msgTypeData.MessageType != static_cast(MessageType::BlockAckEOF)) - { - sendFlags.Set(chip::Messaging::SendMessageFlags::kExpectResponse); - } - err = mExchangeCtx->SendMessage(event.msgTypeData.ProtocolId, event.msgTypeData.MessageType, std::move(event.MsgData), - sendFlags); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(BDX, "SendMessage failed: %" CHIP_ERROR_FORMAT, err.Format())); - break; - } - case TransferSession::OutputEventType::kAcceptReceived: - VerifyOrReturn(CHIP_NO_ERROR == mTransfer.PrepareBlockQuery(), ChipLogError(BDX, "PrepareBlockQuery failed")); - break; - case TransferSession::OutputEventType::kBlockReceived: { - ChipLogDetail(BDX, "Got block length %zu", event.blockdata.Length); - - // TODO: while convenient, we should not do a synchronous block write in our example application - this is bad practice - if (mOnBlockReceivedCallback != nullptr && mOnBlockReceivedCallback->mCall != nullptr) - { - mOnBlockReceivedCallback->mCall(mOnBlockReceivedCallback->mContext, event.blockdata); - } - else - { - ChipLogError(BDX, "onBlockReceived Callback not set"); - } - if (event.blockdata.IsEof) - { - err = mTransfer.PrepareBlockAck(); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(BDX, "PrepareBlockAck failed: %" CHIP_ERROR_FORMAT, err.Format())); - mIsTransferComplete = true; - } - else - { - err = mTransfer.PrepareBlockQuery(); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(BDX, "PrepareBlockQuery failed: %" CHIP_ERROR_FORMAT, err.Format())); - } - break; - } - case TransferSession::OutputEventType::kStatusReceived: - ChipLogError(BDX, "Got StatusReport %x", static_cast(event.statusData.statusCode)); - if (mOnTransferFailedCallback != nullptr && mOnTransferFailedCallback->mCall != nullptr) - { - mOnTransferFailedCallback->mCall(mOnTransferFailedCallback->mContext, kErrorBdxDownloaderStatusReceived); - } - else - { - ChipLogError(BDX, "onTransferFailed Callback not set"); - } - mTransfer.Reset(); - mExchangeCtx->Close(); - break; - case TransferSession::OutputEventType::kInternalError: - ChipLogError(BDX, "InternalError"); - if (mOnTransferFailedCallback != nullptr && mOnTransferFailedCallback->mCall != nullptr) - { - mOnTransferFailedCallback->mCall(mOnTransferFailedCallback->mContext, kErrorBdxDownloaderInternal); - } - else - { - ChipLogError(BDX, "onTransferFailed Callback not set"); - } - mTransfer.Reset(); - mExchangeCtx->Close(); - break; - case TransferSession::OutputEventType::kTransferTimeout: - ChipLogError(BDX, "Transfer timed out"); - if (mOnTransferFailedCallback != nullptr && mOnTransferFailedCallback->mCall != nullptr) - { - mOnTransferFailedCallback->mCall(mOnTransferFailedCallback->mContext, kErrorBdxDownloaderTimeOut); - } - else - { - ChipLogError(BDX, "onTransferFailed Callback not set"); - } - mTransfer.Reset(); - mExchangeCtx->Close(); - break; - case TransferSession::OutputEventType::kInitReceived: - case TransferSession::OutputEventType::kAckReceived: - case TransferSession::OutputEventType::kQueryReceived: - case TransferSession::OutputEventType::kAckEOFReceived: - default: - ChipLogError(BDX, "Unexpected BDX event type: %" PRIu16, static_cast(event.EventType)); - } -} diff --git a/examples/ota-requestor-app/esp32/main/CMakeLists.txt b/examples/ota-requestor-app/esp32/main/CMakeLists.txt index 8fb4bddfe2c230..4b65e80c847aba 100644 --- a/examples/ota-requestor-app/esp32/main/CMakeLists.txt +++ b/examples/ota-requestor-app/esp32/main/CMakeLists.txt @@ -18,8 +18,8 @@ # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-requestor-app/" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-requestor-app/ota-requestor-common" SRC_DIRS "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-requestor-app/zap-generated" @@ -39,13 +39,13 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-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/general-commissioning-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-requestor-app/ota-requestor-common" - EXCLUDE_SRCS - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/ota-requestor-app/ota-requestor-common/BDXDownloader.cpp" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor" PRIV_REQUIRES chip QRCode bt console app_update) set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) diff --git a/examples/ota-requestor-app/esp32/main/OTARequesterImpl.cpp b/examples/ota-requestor-app/esp32/main/OTARequesterImpl.cpp deleted file mode 100644 index b6c84742019da4..00000000000000 --- a/examples/ota-requestor-app/esp32/main/OTARequesterImpl.cpp +++ /dev/null @@ -1,325 +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. - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include "BDXDownloader.h" -#include "OTARequesterImpl.h" -#include "OTAUpdater.h" - -#define TAG "OTARequesterImpl" - -using chip::ByteSpan; -using chip::CharSpan; -using chip::EndpointId; -using chip::FabricIndex; -using chip::NodeId; -using chip::OnDeviceConnected; -using chip::OnDeviceConnectionFailure; -using chip::OperationalDeviceProxy; -using chip::Optional; -using chip::PeerId; -using chip::Server; -using chip::VendorId; -using chip::bdx::TransferSession; -using chip::Callback::Callback; -using chip::Inet::IPAddress; -using chip::System::Layer; -using chip::Transport::PeerAddress; -using namespace chip::Messaging; -using namespace chip::app::Clusters::OtaSoftwareUpdateProvider::Commands; - -void OnQueryImageResponse(void * context, const QueryImageResponse::DecodableType & response); -void OnQueryImageFailure(void * context, EmberAfStatus status); -void OnApplyUpdateResponse(void * context, const ApplyUpdateResponse::DecodableType & response); -void OnApplyUpdateRequestFailure(void * context, EmberAfStatus status); - -void OnConnected(void * context, chip::OperationalDeviceProxy * deviceProxy); -void OnConnectionFailure(void * context, NodeId deviceId, CHIP_ERROR error); - -void OnBlockReceived(void * context, const chip::bdx::TransferSession::BlockData & blockdata); -void OnTransferComplete(void * context); -void OnTransferFailed(void * context, BdxDownloaderErrorTypes status); - -enum OTARequestorCommands -{ - kCommandQueryImage = 0, - kCommandApplyUpdateRequest, - kCommandNotifyUpdateApplied, -}; - -namespace { -// TODO: Encapsulate these globals and the callbacks in some class -ExchangeContext * exchangeCtx = nullptr; -BdxDownloader bdxDownloader; -enum OTARequestorCommands operationalDeviceContext; - -constexpr uint8_t kMaxUpdateTokenLen = 32; // must be between 8 and 32 -uint8_t otaUpdateToken[kMaxUpdateTokenLen] = { 0 }; -uint8_t otaUpdateTokenLen = 0; - -/* Callbacks for operational device proxy connect response */ -Callback onConnectedCallback(OnConnected, &operationalDeviceContext); -Callback onConnectionFailureCallback(OnConnectionFailure, nullptr); - -/* Callbacks for BDX data transfer */ -Callback onBlockReceivedCallback(OnBlockReceived, nullptr); -Callback onTransferCompleteCallback(OnTransferComplete, nullptr); -Callback onTransferFailedCallback(OnTransferFailed, nullptr); - -FabricIndex providerFabricIndex = 1; -} // namespace - -void OnQueryImageResponse(void * context, const QueryImageResponse::DecodableType & response) -{ - ChipLogDetail(SoftwareUpdate, "QueryImageResponse responded with action %" PRIu8, response.status); - - if (response.updateToken.HasValue()) - { - otaUpdateTokenLen = response.updateToken.Value().size(); - memcpy(otaUpdateToken, response.updateToken.Value().data(), otaUpdateTokenLen); - } - if (response.imageURI.HasValue() == false) - { - ChipLogError(BDX, "OTA image URI missing"); - return; - } - - // TODO: Handle image URI for protocol other than bdx - // Ignore the first 23 "bdx:///" - char fileDesignator[128]; // 128 is arbitrary value - memset(fileDesignator, 0, sizeof(fileDesignator)); - size_t fileDesignatorLength = response.imageURI.Value().size() - 23 + 1; // + 1 for \0 - if ((response.imageURI.Value().size() - 23) > sizeof(fileDesignator)) - { - fileDesignatorLength = sizeof(fileDesignator); - } - strlcpy(fileDesignator, response.imageURI.Value().data() + 23, fileDesignatorLength); - - TransferSession::TransferInitData initOptions; - initOptions.TransferCtlFlags = chip::bdx::TransferControlFlags::kReceiverDrive; - initOptions.MaxBlockSize = 1024; - initOptions.FileDesLength = static_cast(fileDesignatorLength); - initOptions.FileDesignator = reinterpret_cast(fileDesignator); - - chip::OperationalDeviceProxy * operationalDeviceProxy = Server::GetInstance().GetOperationalDeviceProxy(); - if (operationalDeviceProxy != nullptr) - { - chip::Messaging::ExchangeManager * exchangeMgr = operationalDeviceProxy->GetExchangeManager(); - chip::Optional session = operationalDeviceProxy->GetSecureSession(); - if (exchangeMgr != nullptr && session.HasValue()) - { - exchangeCtx = exchangeMgr->NewContext(session.Value(), &bdxDownloader); - } - if (exchangeCtx == nullptr) - { - ChipLogError(BDX, "unable to allocate ec: exchangeMgr=%p sessionExists? %u", exchangeMgr, session.HasValue()); - return; - } - } - else - { - ChipLogError(BDX, "Failed to get OperationalDeviceProxy"); - return; - } - - bdxDownloader.SetInitialExchange(exchangeCtx); - - BdxDownloaderCallbacks bdxCallbacks; - bdxCallbacks.onBlockReceived = &onBlockReceivedCallback; - bdxCallbacks.onTransferComplete = &onTransferCompleteCallback; - bdxCallbacks.onTransferFailed = &onTransferFailedCallback; - bdxDownloader.SetCallbacks(bdxCallbacks); - - // This will kick of a timer which will regularly check for updates to the bdx::TransferSession state machine. - bdxDownloader.InitiateTransfer(&chip::DeviceLayer::SystemLayer(), chip::bdx::TransferRole::kReceiver, initOptions, - chip::System::Clock::Seconds16(20)); -} - -void OnApplyUpdateResponse(void * context, const ApplyUpdateResponse::DecodableType & response) -{ - ChipLogDetail(SoftwareUpdate, "ApplyUpdateResponse responded with action %" PRIu8, response.action); - // Providing arbitrary value - OTAUpdater::GetInstance().Apply(3); -} - -void OnQueryImageFailure(void * context, EmberAfStatus status) -{ - ChipLogDetail(SoftwareUpdate, "QueryImage failure response %" PRIu8, status); -} - -void OnApplyUpdateRequestFailure(void * context, EmberAfStatus status) -{ - ChipLogDetail(SoftwareUpdate, "ApplyUpdateRequest failure response %" PRIu8, status); -} - -void OnConnected(void * context, chip::OperationalDeviceProxy * deviceProxy) -{ - ChipLogDetail(SoftwareUpdate, "Callback OnConnected"); - uint8_t * command = reinterpret_cast(context); - - chip::Controller::OtaSoftwareUpdateProviderCluster cluster; - constexpr EndpointId kOtaProviderEndpoint = 0; - - CHIP_ERROR err = cluster.Associate(deviceProxy, kOtaProviderEndpoint); - if (err != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "Associate() failed: %s", chip::ErrorStr(err)); - return; - } - - switch (*command) - { - case kCommandQueryImage: { - // These parameters are chosen arbitrarily - constexpr VendorId kExampleVendorId = VendorId::Common; - constexpr uint16_t kExampleProductId = CONFIG_DEVICE_PRODUCT_ID; - constexpr uint16_t kExampleHWVersion = 0; - constexpr uint16_t kExampleSoftwareVersion = 0; - constexpr EmberAfOTADownloadProtocol kExampleProtocolsSupported[] = { EMBER_ZCL_OTA_DOWNLOAD_PROTOCOL_BDX_SYNCHRONOUS }; - const char locationBuf[] = { 'U', 'S' }; - CharSpan exampleLocation(locationBuf); - constexpr bool kExampleClientCanConsent = false; - ByteSpan metadata; - - QueryImage::Type args; - args.vendorId = kExampleVendorId; - args.productId = kExampleProductId; - args.softwareVersion = kExampleSoftwareVersion; - args.protocolsSupported = kExampleProtocolsSupported; - args.hardwareVersion.Emplace(kExampleHWVersion); - args.location.Emplace(exampleLocation); - args.requestorCanConsent.Emplace(kExampleClientCanConsent); - args.metadataForProvider.Emplace(metadata); - - err = cluster.InvokeCommand(args, nullptr, OnQueryImageResponse, OnQueryImageFailure); - if (err != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "QueryImage() failed: %" CHIP_ERROR_FORMAT, err.Format()); - } - break; - } - case kCommandApplyUpdateRequest: { - constexpr uint32_t kNewVersion = 1; - - ApplyUpdateRequest::Type args; - args.updateToken = ByteSpan(otaUpdateToken, otaUpdateTokenLen); - args.newVersion = kNewVersion; - - err = cluster.InvokeCommand(args, nullptr, OnApplyUpdateResponse, OnApplyUpdateRequestFailure); - if (err != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "ApplyUpdateRequest() failed: %s", chip::ErrorStr(err)); - } - break; - } - default: - break; - } -} - -void OnConnectionFailure(void * context, NodeId deviceId, CHIP_ERROR error) -{ - ChipLogError(SoftwareUpdate, "failed to connect to 0x%" PRIX64 ": %" CHIP_ERROR_FORMAT, deviceId, error.Format()); -} - -void OnBlockReceived(void * context, const chip::bdx::TransferSession::BlockData & blockdata) -{ - if (OTAUpdater::GetInstance().IsInProgress() == false) - { - OTAUpdater::GetInstance().Begin(); - } - // TODO: Process/skip the Matter OTA header - OTAUpdater::GetInstance().Write(reinterpret_cast(blockdata.Data), blockdata.Length); -} - -void OnTransferComplete(void * context) -{ - ESP_LOGI(TAG, "Transfer complete!"); - OTAUpdater::GetInstance().End(); -} - -void OnTransferFailed(void * context, BdxDownloaderErrorTypes status) -{ - ESP_LOGI(TAG, "Transfer Failed, status:%x", status); - OTAUpdater::GetInstance().Abort(); -} - -void ConnectToProvider(const char * ipAddress, uint32_t nodeId) -{ - NodeId providerNodeId = nodeId; - - chip::OperationalDeviceProxy * operationalDeviceProxy = Server::GetInstance().GetOperationalDeviceProxy(); - if (operationalDeviceProxy != nullptr && operationalDeviceProxy->GetDeviceId() != providerNodeId) - { - operationalDeviceProxy->Disconnect(); - delete operationalDeviceProxy; - operationalDeviceProxy = nullptr; - } - - if (operationalDeviceProxy == nullptr) - { - Server * server = &(Server::GetInstance()); - chip::FabricInfo * fabric = server->GetFabricTable().FindFabricWithIndex(providerFabricIndex); - - chip::DeviceProxyInitParams initParams = { - .sessionManager = &(server->GetSecureSessionManager()), - .exchangeMgr = &(server->GetExchangeManager()), - .idAllocator = &(server->GetSessionIDAllocator()), - .fabricInfo = fabric, - // TODO: Determine where this should be instantiated - .imDelegate = chip::Platform::New(), - }; - - PeerId peerID = fabric->GetPeerId(); - peerID.SetNodeId(providerNodeId); - operationalDeviceProxy = new chip::OperationalDeviceProxy(initParams, peerID); - server->SetOperationalDeviceProxy(operationalDeviceProxy); - - // Explicitly calling UpdateDeviceData() should not be needed once OperationalDeviceProxy can resolve IP address from node - // ID and fabric index - IPAddress ipAddr; - IPAddress::FromString(ipAddress, ipAddr); - PeerAddress addr = PeerAddress::UDP(ipAddr, CHIP_PORT); - operationalDeviceProxy->UpdateDeviceData(addr, operationalDeviceProxy->GetMRPConfig()); - } - - CHIP_ERROR err = operationalDeviceProxy->Connect(&onConnectedCallback, &onConnectionFailureCallback); - if (err != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "Cannot establish connection to peer device: %" CHIP_ERROR_FORMAT, err.Format()); - } -} - -void OTARequesterImpl::SendQueryImageCommand(const char * ipAddress, uint32_t nodeId) -{ - operationalDeviceContext = kCommandQueryImage; - ConnectToProvider(ipAddress, nodeId); -} - -void OTARequesterImpl::SendApplyUpdateRequestCommand(const char * ipAddress, uint32_t nodeId) -{ - operationalDeviceContext = kCommandApplyUpdateRequest; - ConnectToProvider(ipAddress, nodeId); -} diff --git a/examples/ota-requestor-app/esp32/main/OTAUpdater.cpp b/examples/ota-requestor-app/esp32/main/OTAUpdater.cpp deleted file mode 100644 index 82156fee97a10c..00000000000000 --- a/examples/ota-requestor-app/esp32/main/OTAUpdater.cpp +++ /dev/null @@ -1,155 +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. - */ -#include -#include -#include -#include - -#include - -using namespace ::chip; -using namespace ::chip::System; -using namespace ::chip::DeviceLayer; - -namespace { - -const char * TAG = "OTAUpdate"; -bool otaUpdateInProgress = false; -const esp_partition_t * otaUpdatePartition = nullptr; -esp_ota_handle_t otaUpdateHandle; -uint32_t otaUpdateImageLen = 0; - -} // namespace - -bool OTAUpdater::IsInProgress(void) -{ - return otaUpdateInProgress; -} - -esp_err_t OTAUpdater::Begin(void) -{ - if (otaUpdateInProgress == true) - { - ESP_LOGW(TAG, "Already in progress"); - return ESP_ERR_INVALID_STATE; - } - - ESP_LOGI(TAG, "Begin"); - otaUpdatePartition = esp_ota_get_next_update_partition(NULL); - if (otaUpdatePartition == NULL) - { - ESP_LOGE(TAG, "Partition not found"); - return ESP_ERR_NOT_FOUND; - } - ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%x", otaUpdatePartition->subtype, otaUpdatePartition->address); - - esp_err_t err = esp_ota_begin(otaUpdatePartition, OTA_WITH_SEQUENTIAL_WRITES, &otaUpdateHandle); - if (err != ESP_OK) - { - ESP_LOGE(TAG, "esp_ota_begin failed (%s)", esp_err_to_name(err)); - return err; - } - otaUpdateImageLen = 0; - otaUpdateInProgress = true; - return ESP_OK; -} - -esp_err_t OTAUpdater::Write(const void * data, size_t length) -{ - if (otaUpdateInProgress == false) - { - return ESP_ERR_INVALID_STATE; - } - - esp_err_t err = esp_ota_write(otaUpdateHandle, data, length); - if (err != ESP_OK) - { - ESP_LOGE(TAG, "esp_ota_write failed (%s)", esp_err_to_name(err)); - Abort(); - return err; - } - - otaUpdateImageLen += length; - ESP_LOGI(TAG, "Written image length %d", otaUpdateImageLen); - return ESP_OK; -} - -esp_err_t OTAUpdater::Abort(void) -{ - if (otaUpdateInProgress == false) - { - return ESP_ERR_INVALID_STATE; - } - - ESP_LOGI(TAG, "Abort"); - otaUpdateInProgress = false; - otaUpdateImageLen = 0; - return esp_ota_abort(otaUpdateHandle); -} - -esp_err_t OTAUpdater::End(void) -{ - if (otaUpdateInProgress == false) - { - return ESP_ERR_INVALID_STATE; - } - - ESP_LOGI(TAG, "OTA image length %d bytes", otaUpdateImageLen); - esp_err_t err = esp_ota_end(otaUpdateHandle); - if (err != ESP_OK) - { - if (err == ESP_ERR_OTA_VALIDATE_FAILED) - { - ESP_LOGE(TAG, "Image validation failed, image is corrupted"); - } - else - { - ESP_LOGE(TAG, "esp_ota_end failed (%s)!", esp_err_to_name(err)); - } - } - otaUpdateInProgress = false; - return err; -} - -void RestartTimerHandler(Layer * systemLayer, void * appState) -{ - ESP_LOGI(TAG, "Prepare to restart system!"); - esp_restart(); -} - -// TODO: Apply update after delayed action time -// TODO: Handle applying update after reboot -esp_err_t OTAUpdater::Apply(uint32_t delayedActionTime) -{ - if (otaUpdateInProgress == true) - { - return ESP_ERR_INVALID_STATE; - } - - esp_err_t err = esp_ota_set_boot_partition(otaUpdatePartition); - if (err != ESP_OK) - { - ESP_LOGE(TAG, "esp_ota_set_boot_partition failed (%s)!", esp_err_to_name(err)); - return err; - } - - ESP_LOGI(TAG, "Applying, Boot partition set offset:0x%x", otaUpdatePartition->address); - // Allow requestor to send the Ack for the previous message - chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(delayedActionTime * 1000), RestartTimerHandler, - nullptr); - return ESP_OK; -} diff --git a/examples/ota-requestor-app/esp32/main/include/BDXDownloader.h b/examples/ota-requestor-app/esp32/main/include/BDXDownloader.h deleted file mode 100644 index a05b772cea0008..00000000000000 --- a/examples/ota-requestor-app/esp32/main/include/BDXDownloader.h +++ /dev/null @@ -1,85 +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. - */ - -#include -#include -#include -#include - -#pragma once - -enum BdxDownloaderErrorTypes -{ - kErrorBdxDownloaderNoError = 0, - kErrorBdxDownloaderStatusReceived, - kErrorBdxDownloaderInternal, - kErrorBdxDownloaderTimeOut, -}; - -/** - * @brief - * This callback is called when bdx transfer receives Block or BlockEOF message - * - * @param[in] context User context - * @param[in] blockData BlockData structure which contains pointer to data, length of data and IsEof flag - */ -typedef void (*OnBdxBlockReceived)(void * context, const chip::bdx::TransferSession::BlockData & blockdata); - -/** - * @brief - * This callback is called after BlockEOF message is processed - * - * @param[in] context User context - */ -typedef void (*OnBdxTransferComplete)(void * context); - -/** - * @brief - * This callback is called when bdx transfer receives StatusReport messages, - * if there is any internal error, or transfer timed out - * - * @param[in] context User context - * @param[in] status Error code - */ -typedef void (*OnBdxTransferFailed)(void * context, BdxDownloaderErrorTypes status); - -// TODO: With this approach we might end up adding callback for every bdx event/message. -// Can be refactored into a single callback with events -struct BdxDownloaderCallbacks -{ - chip::Callback::Callback * onBlockReceived = nullptr; - chip::Callback::Callback * onTransferComplete = nullptr; - chip::Callback::Callback * onTransferFailed = nullptr; -}; - -class BdxDownloader : public chip::bdx::Initiator -{ -public: - void SetInitialExchange(chip::Messaging::ExchangeContext * ec); - - void SetCallbacks(BdxDownloaderCallbacks callbacks); - -private: - // inherited from bdx::Endpoint - void HandleTransferSessionOutput(chip::bdx::TransferSession::OutputEvent & event); - - bool mIsTransferComplete = false; - - chip::Callback::Callback * mOnBlockReceivedCallback = nullptr; - chip::Callback::Callback * mOnTransferCompleteCallback = nullptr; - chip::Callback::Callback * mOnTransferFailedCallback = nullptr; -}; diff --git a/examples/ota-requestor-app/esp32/main/include/OTAUpdater.h b/examples/ota-requestor-app/esp32/main/include/OTAUpdater.h deleted file mode 100644 index 725ea7bbcd62ba..00000000000000 --- a/examples/ota-requestor-app/esp32/main/include/OTAUpdater.h +++ /dev/null @@ -1,105 +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. - */ -#include - -#pragma once - -/** - * @class OTAUpdater - * - * @brief This is a helper class to perform OTA on ESP devices. - * It supports preparing the flash region for new OTA image, - * writing OTA data to the flash region, successfully ending an OTA, - * aborting the OTA process, and booting from the new OTA image. - */ -class OTAUpdater -{ -public: - static OTAUpdater & GetInstance(void) - { - static OTAUpdater instance; - return instance; - } - - /** - * @brief - * Test if OTA is in progress or not. - * - * @return \c true if OTA is in progress; - * return \c false if OTA is not in progress; - */ - bool IsInProgress(void); - - /** - * @brief - * Begins an OTA data writing. - * This function finds the available flash region to write the OTA data and erase the region. - * - * @return \c ESP_OK on success; - * return \c ESP_ERR_INVALID_STATE if OTA is in progress; - * return appropriate error code otherwise; - */ - esp_err_t Begin(void); - - /** - * @brief - * Finish OTA update and validate newly written OTA image. - * - * @return \c ESP_OK on success; - * return \c ESP_ERR_INVALID_STATE if OTA is not in progress; - * return \c ESP_ERR_OTA_VALIDATE_FAILED if OTA image is invalid; - * return appropriate error code otherwise; - */ - esp_err_t End(void); - - /** - * @brief - * Write OTA data. This function can be called multiple times as data is received during the OTA operation. - * Data is written sequentially to the partition. - * - * @param[in] data OTA data - * @param[in] length Length of OTA data - * - * @return \c ESP_OK on success; - * return \c ESP_ERR_OTA_VALIDATE_FAILED First byte of image contains invalid app image magic byte; - * return appropriate error code otherwise; - */ - esp_err_t Write(const void * data, size_t length); - - /** - * @brief - * Abort the OTA. - * - * @return \c ESP_OK on success; - * return appropriate error code otherwise; - */ - esp_err_t Abort(void); - - /** - * @brief - * Apply an OTA update. - * Configures the boot partition to newly written OTA partition and restart device to boot from new app. - * - * @return \c ESP_OK on success; - * return appropriate error code otherwise; - */ - esp_err_t Apply(uint32_t delayedActionTime); - -private: - OTAUpdater(void) {} - ~OTAUpdater() {} -}; diff --git a/examples/ota-requestor-app/esp32/main/main.cpp b/examples/ota-requestor-app/esp32/main/main.cpp index 71f5e3b491b95b..cc6d417ad4d0f8 100644 --- a/examples/ota-requestor-app/esp32/main/main.cpp +++ b/examples/ota-requestor-app/esp32/main/main.cpp @@ -28,6 +28,8 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "nvs_flash.h" +#include +#include #include #include @@ -40,7 +42,9 @@ #include -#include "OTARequesterImpl.h" +#include "OTAImageProcessorImpl.h" +#include "platform/GenericOTARequestorDriver.h" +#include "platform/OTARequestorInterface.h" #include #include @@ -52,57 +56,24 @@ using namespace ::chip::DeviceLayer; struct CmdArgs { - struct arg_str * ipAddr; - struct arg_int * nodeId; struct arg_end * end; }; namespace { const char * TAG = "ota-requester-app"; static DeviceCallbacks EchoCallbacks; -CmdArgs queryImageCmdArgs, applyUpdateCmdArgs; -} // namespace - -void QueryImageTimerHandler(Layer * systemLayer, void * appState) -{ - ESP_LOGI(TAG, "Calling SendQueryImageCommand()"); - OTARequesterImpl::GetInstance().SendQueryImageCommand(queryImageCmdArgs.ipAddr->sval[0], queryImageCmdArgs.nodeId->ival[0]); -} - -void ApplyUpdateTimerHandler(Layer * systemLayer, void * appState) -{ - ESP_LOGI(TAG, "Calling SendApplyUpdateRequestCommand()"); - OTARequesterImpl::GetInstance().SendApplyUpdateRequestCommand(queryImageCmdArgs.ipAddr->sval[0], - queryImageCmdArgs.nodeId->ival[0]); -} - -int ESPQueryImageCmdHandler(int argc, char ** argv) -{ - int nerrors = arg_parse(argc, argv, (void **) &queryImageCmdArgs); - if (nerrors != 0) - { - arg_print_errors(stderr, queryImageCmdArgs.end, argv[0]); - return 1; - } - ESP_LOGI(TAG, "ipAddr:%s nodeId:%x", queryImageCmdArgs.ipAddr->sval[0], queryImageCmdArgs.nodeId->ival[0]); +CmdArgs applyUpdateCmdArgs; - /* Start one shot timer with 1 second timeout to send ApplyUpdateRequest command */ - chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(1 * 1000), QueryImageTimerHandler, nullptr); - return 0; -} +OTARequestor gRequestorCore; +GenericOTARequestorDriver gRequestorUser; +BDXDownloader gDownloader; +OTAImageProcessorImpl gImageProcessor; +} // namespace int ESPApplyUpdateCmdHandler(int argc, char ** argv) { - int nerrors = arg_parse(argc, argv, (void **) &applyUpdateCmdArgs); - if (nerrors != 0) - { - arg_print_errors(stderr, applyUpdateCmdArgs.end, argv[0]); - return 1; - } - ESP_LOGI(TAG, "ipAddr:%s nodeId:%x", applyUpdateCmdArgs.ipAddr->sval[0], applyUpdateCmdArgs.nodeId->ival[0]); - - /* Start one shot timer with 1 second timeout to Query for OTA image */ - chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(1 * 1000), ApplyUpdateTimerHandler, nullptr); + gRequestorCore.ApplyUpdate(); + ESP_LOGI(TAG, "Apply the Update"); return 0; } @@ -118,25 +89,14 @@ void ESPInitConsole(void) esp_console_register_help_command(); - esp_console_cmd_t queryImageCommand, applyUpdateCommand; - memset(&queryImageCommand, 0, sizeof(queryImageCommand)); + esp_console_cmd_t applyUpdateCommand; memset(&applyUpdateCommand, 0, sizeof(applyUpdateCommand)); - queryImageCmdArgs.ipAddr = arg_str0(NULL, NULL, "", "OTA Provider IP Address"); - queryImageCmdArgs.nodeId = arg_int0(NULL, NULL, "", "OTA Provider Node ID in decimal"); - queryImageCmdArgs.end = arg_end(1); - - queryImageCommand.command = "QueryImage", queryImageCommand.help = "Query for OTA image", - queryImageCommand.func = &ESPQueryImageCmdHandler, queryImageCommand.argtable = &queryImageCmdArgs; - - applyUpdateCmdArgs.ipAddr = arg_str0(NULL, NULL, "", "OTA Provider IP Address"); - applyUpdateCmdArgs.nodeId = arg_int0(NULL, NULL, "", "OTA Provider Node ID in decimal"); - applyUpdateCmdArgs.end = arg_end(1); + applyUpdateCmdArgs.end = arg_end(1); applyUpdateCommand.command = "ApplyUpdateRequest", applyUpdateCommand.help = "Request to OTA update image", applyUpdateCommand.func = &ESPApplyUpdateCmdHandler, applyUpdateCommand.argtable = &applyUpdateCmdArgs; - esp_console_cmd_register(&queryImageCommand); esp_console_cmd_register(&applyUpdateCommand); esp_console_new_repl_uart(&uartConfig, &replConfig, &repl); @@ -181,15 +141,15 @@ extern "C" void app_main() SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); ESPInitConsole(); -} + SetRequestorInstance(&gRequestorCore); -// TODO: We should use the function definition in /src/app/clusters/ota-requestor/ClusterInterface.cpp -// Temporarily add this function. + Server * server = &(Server::GetInstance()); + gRequestorCore.SetServerInstance(server); + gRequestorCore.SetOtaRequestorDriver(&gRequestorUser); -bool emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::DecodableType & commandData) -{ - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); - return true; + gImageProcessor.SetOTADownloader(&gDownloader); + gDownloader.SetImageProcessorDelegate(&gImageProcessor); + gRequestorUser.Init(&gRequestorCore, &gImageProcessor); + + gRequestorCore.SetBDXDownloader(&gDownloader); } diff --git a/examples/ota-requestor-app/esp32/sdkconfig.defaults b/examples/ota-requestor-app/esp32/sdkconfig.defaults index aa3e6cb62047a6..ac8d7d38f4e065 100644 --- a/examples/ota-requestor-app/esp32/sdkconfig.defaults +++ b/examples/ota-requestor-app/esp32/sdkconfig.defaults @@ -52,3 +52,6 @@ CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096 # Serial Flasher config CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_ESPTOOLPY_FLASHSIZE="4MB" + +# Enable OTA Requestor +CONFIG_ENABLE_OTA_REQUESTOR=y diff --git a/examples/ota-requestor-app/linux/BUILD.gn b/examples/ota-requestor-app/linux/BUILD.gn index 2fa7cad7391c49..2d698377703640 100644 --- a/examples/ota-requestor-app/linux/BUILD.gn +++ b/examples/ota-requestor-app/linux/BUILD.gn @@ -16,11 +16,7 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") executable("chip-ota-requestor-app") { - sources = [ - "LinuxOTAImageProcessor.cpp", - "LinuxOTARequestorDriver.cpp", - "main.cpp", - ] + sources = [ "main.cpp" ] deps = [ "${chip_root}/examples/ota-requestor-app/ota-requestor-common", diff --git a/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.cpp b/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.cpp deleted file mode 100644 index ad3d0c814525eb..00000000000000 --- a/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* This file contains the Linux implementation of the OTAImageProcessorDriver - * interface class - */ - -#include "LinuxOTARequestorDriver.h" - -using namespace chip; - -// A call into the application logic to give it a chance to allow or stop the Requestor -// from proceeding with actual image download. Returning TRUE will allow the download -// to proceed, returning FALSE will abort the download process. -bool LinuxOTARequestorDriver::CheckImageDownloadAllowed() -{ - return true; -} - -// Notify the application that the download is complete and the image can be applied -void LinuxOTARequestorDriver::ImageDownloadComplete() {} - -UserConsentAction LinuxOTARequestorDriver::RequestUserConsent() -{ - return ImmediateYes; -} diff --git a/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.h b/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.h deleted file mode 100644 index f039d32c1ae980..00000000000000 --- a/examples/ota-requestor-app/linux/LinuxOTARequestorDriver.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* This file contains the decalarions for the Linux implementation of the - * the OTARequestorDriver interface class - */ -#include - -namespace chip { - -class LinuxOTARequestorDriver : public OTARequestorDriver -{ - - // Virtual functions from OTARequestorDriver -- start - - // A call into the application logic to give it a chance to allow or stop the Requestor - // from proceeding with actual image download. Returning TRUE will allow the download - // to proceed, returning FALSE will abort the download process. - bool CheckImageDownloadAllowed(); - - // Notify the application that the download is complete and the image can be applied - void ImageDownloadComplete(); - - // Application is directed to complete user consent: either return ImmediateYes/ImmediateNo - // without blocking or return Requested and call OTARequestor::OnUserConsent() later. - virtual UserConsentAction RequestUserConsent(); - - // Virtual functions from OTARequestorDriver -- end -}; - -} // namespace chip diff --git a/examples/ota-requestor-app/linux/args.gni b/examples/ota-requestor-app/linux/args.gni index a6463ca2c05fae..bbf4dd22e611c7 100644 --- a/examples/ota-requestor-app/linux/args.gni +++ b/examples/ota-requestor-app/linux/args.gni @@ -15,3 +15,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") + +declare_args() { + chip_enable_ota_requestor = true +} diff --git a/examples/ota-requestor-app/linux/main.cpp b/examples/ota-requestor-app/linux/main.cpp index 3c7181ca8052a6..01126907c6174a 100644 --- a/examples/ota-requestor-app/linux/main.cpp +++ b/examples/ota-requestor-app/linux/main.cpp @@ -22,10 +22,10 @@ #include #include -#include "LinuxOTAImageProcessor.h" -#include "LinuxOTARequestorDriver.h" #include "app/clusters/ota-requestor/BDXDownloader.h" #include "app/clusters/ota-requestor/OTARequestor.h" +#include "platform/GenericOTARequestorDriver.h" +#include "platform/Linux/OTAImageProcessorImpl.h" using chip::BDXDownloader; using chip::ByteSpan; @@ -33,11 +33,11 @@ using chip::CharSpan; using chip::EndpointId; using chip::FabricIndex; using chip::GetRequestorInstance; -using chip::LinuxOTAImageProcessor; using chip::NodeId; using chip::OnDeviceConnected; using chip::OnDeviceConnectionFailure; using chip::OTADownloader; +using chip::OTAImageProcessorImpl; using chip::OTAImageProcessorParams; using chip::OTARequestor; using chip::PeerId; @@ -52,9 +52,9 @@ using namespace chip::Messaging; using namespace chip::app::Clusters::OtaSoftwareUpdateProvider::Commands; OTARequestor gRequestorCore; -LinuxOTARequestorDriver gRequestorUser; +DeviceLayer::GenericOTARequestorDriver gRequestorUser; BDXDownloader gDownloader; -LinuxOTAImageProcessor gImageProcessor; +OTAImageProcessorImpl gImageProcessor; bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, const char * aName, const char * aValue); void OnStartDelayTimerHandler(Layer * systemLayer, void * appState); @@ -201,6 +201,7 @@ int main(int argc, char * argv[]) // Connect the Requestor and Requestor Driver objects gRequestorCore.SetOtaRequestorDriver(&gRequestorUser); + gRequestorUser.Init(&gRequestorCore, &gImageProcessor); // WARNING: this is probably not realistic to know such details of the image or to even have an OTADownloader instantiated at // the beginning of program execution. We're using hardcoded values here for now since this is a reference application. diff --git a/examples/ota-requestor-app/ota-requestor-common/BUILD.gn b/examples/ota-requestor-app/ota-requestor-common/BUILD.gn index 44b115461860d4..1d5d7bf413cd30 100644 --- a/examples/ota-requestor-app/ota-requestor-common/BUILD.gn +++ b/examples/ota-requestor-app/ota-requestor-common/BUILD.gn @@ -33,8 +33,8 @@ chip_data_model("ota-requestor-common") { sources = [ "${chip_root}/src/app/clusters/ota-requestor/BDXDownloader.cpp", "${chip_root}/src/app/clusters/ota-requestor/BDXDownloader.h", - "${chip_root}/src/app/clusters/ota-requestor/ClusterInterface.cpp", "${chip_root}/src/app/clusters/ota-requestor/OTARequestor.cpp", + "${chip_root}/src/app/clusters/ota-requestor/ota-requestor-server.cpp", ] is_server = true 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 562c31df99298c..9cb1e4a6837e87 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 @@ -979,7 +979,7 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, + "code": 2, "mfgCode": null, "source": "client", "incoming": 0, @@ -987,7 +987,7 @@ }, { "name": "NotifyUpdateApplied", - "code": 2, + "code": 4, "mfgCode": null, "source": "client", "incoming": 0, @@ -1022,7 +1022,7 @@ "commands": [ { "name": "QueryImageResponse", - "code": 3, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -1030,7 +1030,7 @@ }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -1100,7 +1100,22 @@ "commands": [], "attributes": [ { - "name": "default ota provider", + "name": "DefaultOtaProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", "code": 1, "mfgCode": null, "side": "server", @@ -1108,14 +1123,14 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "update possible", + "name": "UpdateState", "code": 2, "mfgCode": null, "side": "server", @@ -1123,12 +1138,57 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1477,7 +1537,7 @@ "reportableChange": 0 }, { - "name": "NetworkDisabled", + "name": "InterfaceEnabled", "code": 4, "mfgCode": null, "side": "server", @@ -3852,6 +3912,5 @@ "endpointVersion": 1, "deviceIdentifier": 22 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/persistent-storage/esp32/README.md b/examples/persistent-storage/esp32/README.md index 887eacaad66a20..6fdc6f213fb7a8 100644 --- a/examples/persistent-storage/esp32/README.md +++ b/examples/persistent-storage/esp32/README.md @@ -42,14 +42,14 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout branch - [release/v4.4](https://github.com/espressif/esp-idf/tree/release/v4.4) +- Clone the Espressif ESP-IDF and checkout + [v4.4-beta1 pre-release](https://github.com/espressif/esp-idf/releases/tag/v4.4-beta1) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.4 + $ git checkout v4.4-beta1 $ git submodule update --init $ ./install.sh diff --git a/examples/pigweed-app/ameba/README.md b/examples/pigweed-app/ameba/README.md new file mode 100644 index 00000000000000..e84d5b50c5eaa3 --- /dev/null +++ b/examples/pigweed-app/ameba/README.md @@ -0,0 +1,83 @@ +# CHIP Ameba Pigweed Example Application + +This example demonstrates the usage of Pigweed module functionalities in an +application. + +The example is based on [CHIP](https://github.com/project-chip/connectedhomeip), +the [Pigweed](https://pigweed.googlesource.com/pigweed/pigweed) module, which is +a collection of libraries that provide different functionalities for embedded +systems, and the Ameba platform. + +You can use this example as a training ground for making experiments, testing +Pigweed module features and checking what actions are necessary to fully +integrate Pigweed in a CHIP project. + +Pigweed functionalities are being gradually integrated into CHIP. Currently, the +following features are available: + +- **Echo RPC** - Creates a Remote Procedure Call server and allows sending + commands through the serial port to the device, which makes echo and sends + the received commands back. + +--- + +- [CHIP Ameba Pigweed Example Application](#chip-ameba-pigweed-example-application) + - [Building the Example Application](#building-the-example-application) + - [Testing the Example Application](#testing-the-example-application) + +--- + +## Building the Example Application + +- Pull docker image: + + $ docker pull pankore/chip-build-ameba:latest + +- Run docker container: + + $ docker run -it -v ${CHIP_DIR}:/root/chip pankore/chip-build-ameba:latest + +- Setup build environment: + + $ source ./scripts/bootstrap.sh + +- To build the demo application: + + $ ./scripts/build/build_examples.py --target ameba-amebad-pigweed build + + The output image files are stored in `out/ameba-amebad-pigweed/asdk/image` + folder. + + The bootloader image files are stored in + `out/ameba-amebad-pigweed/asdk/bootloader` folder. + +- After building the application, **Ameba Image Tool** is used to flash it to + Ameba board. + +1. Connect your device via USB and open Ameba Image Tool. +2. Select correct serial port and set baudrate as **115200**. +3. Browse and add the corresponding image files in the Flash Download list to + the correct locations +4. Click **Download** button. + +## Testing the Example Application + +Connect a USB-TTL Adapter as shown below + + Ameba USB-TTL + A19 TX + A18 RX + GND GND + +Build the +[chip-rpc console](https://github.com/project-chip/connectedhomeip/tree/master/examples/common/pigweed/rpc_console) + +Input `ATS$` command, then launch the chip-rpc console, where the Echo RPC +commands can be invoked + + python -m pw_hdlc.rpc_console --device /dev/tty -b 115200 + +To send an Echo RPC message, type the following command, where the actual +message is the text in quotation marks after the `msg=` phrase: + + rpcs.pw.rpc.EchoService.Echo(msg="hi") diff --git a/examples/pigweed-app/ameba/chip_main.cmake b/examples/pigweed-app/ameba/chip_main.cmake new file mode 100644 index 00000000000000..95af00c585f1de --- /dev/null +++ b/examples/pigweed-app/ameba/chip_main.cmake @@ -0,0 +1,101 @@ +cmake_minimum_required(VERSION 3.6) + +project(chip_main) + +set(chip_dir "${ameba_matter_root}") +set(chip_dir_output "${matter_output_path}/chip") +set(dir "${sdk_root}/component/common/api") +set(chip_main chip_main) +set(list_chip_main_sources chip_main_sources) +set(pigweed_dir "${chip_dir}/third_party/pigweed/repo") + +include(${prj_root}/GCC-RELEASE/project_hp/asdk/includepath.cmake) + +include(${pigweed_dir}/pw_build/pigweed.cmake) +include(${pigweed_dir}/pw_protobuf_compiler/proto.cmake) + +set(dir_pw_third_party_nanopb "${chip_dir}/third_party/nanopb/repo" CACHE STRING "" FORCE) + +pw_set_backend(pw_log pw_log_basic) +pw_set_backend(pw_assert pw_assert_log) +pw_set_backend(pw_sys_io pw_sys_io.ameba) + +add_subdirectory(${chip_dir}/third_party/pigweed/repo ${chip_dir}/examples/pigweed-app/ameba/out/pigweed) +add_subdirectory(${chip_dir}/third_party/nanopb/repo ${chip_dir}/examples/pigweed-app/ameba/out/nanopb) +add_subdirectory(${chip_dir}/examples/platform/ameba/pw_sys_io ${chip_dir}/examples/pigweed-app/ameba/out/pw_sys_io) + +list( + APPEND ${list_chip_main_sources} + + #chip app + ${chip_dir}/examples/pigweed-app/ameba/main/main.cpp + ${chip_dir}/examples/platform/ameba/PigweedLogger.cpp + ${chip_dir}/examples/common/pigweed/RpcService.cpp + ${chip_dir}/examples/common/pigweed/ameba/PigweedLoggerMutex.cpp +) + +add_library( + ${chip_main} + STATIC + ${chip_main_sources} +) + +target_include_directories( + ${chip_main} + PUBLIC + ${inc_path} + ${chip_dir}/examples/platform/ameba + ${chip_dir}/examples/platform/ameba/pw_sys_io/public + ${chip_dir}/examples/common + ${chip_dir}/examples/common/pigweed + ${chip_dir}/examples/common/pigweed/ameba + ${chip_dir}/src + ${chip_dir}/src/lib/support + ${pigweed_dir}/pw_rpc/nanopb/public + + ${chip_dir_output}/gen/include +) + +target_link_libraries(${chip_main} PUBLIC + pw_checksum + pw_hdlc + pw_log + pw_rpc.nanopb.echo_service + pw_rpc.server + PwRpc +) + +link_directories( + ${chip_dir_output}/lib +) + +list( + APPEND chip_main_flags + + -DINET_CONFIG_ENABLE_IPV4=1 + -DCHIP_PROJECT=1 + -DCHIP_DEVICE_LAYER_TARGET=Ameba + -DUSE_ZAP_CONFIG + -DCHIP_HAVE_CONFIG_H + -DMBEDTLS_CONFIG_FILE= + -DCONFIG_ENABLE_PW_RPC=1 +) + +list( + APPEND chip_main_cpp_flags + + -Wno-unused-parameter + -std=gnu++17 + -fno-rtti + -fno-use-cxa-atexit +) +target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} ) +target_compile_options(${chip_main} PRIVATE ${chip_main_cpp_flags}) + +# move static library post build command +add_custom_command( + TARGET ${chip_main} + POST_BUILD + COMMAND cp lib${chip_main}.a ${CMAKE_CURRENT_SOURCE_DIR}/lib/application +) + diff --git a/examples/pigweed-app/ameba/main/main.cpp b/examples/pigweed-app/ameba/main/main.cpp new file mode 100644 index 00000000000000..7a215e32a790a3 --- /dev/null +++ b/examples/pigweed-app/ameba/main/main.cpp @@ -0,0 +1,57 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "pw_rpc/echo_service_nanopb.h" +#include "pw_sys_io/sys_io.h" +#include "pw_sys_io_ameba/init.h" + +#include "PigweedLoggerMutex.h" +#include "pigweed/RpcService.h" +#include +#include + +namespace { +using std::byte; + +#define RPC_TASK_STACK_SIZE 4096 +#define RPC_TASK_PRIORITY 2 +static TaskHandle_t sRpcTaskHandle; + +pw::rpc::EchoService echo_service; + +void RegisterServices(pw::rpc::Server & server) +{ + server.RegisterService(echo_service); +} + +void RunRpcService(void *) +{ + Start(RegisterServices, &::chip::rpc::logger_mutex); +} + +} // namespace + +extern "C" void ChipTest(void) +{ + PigweedLogger::init(); + + printf("***** CHIP ameba pigweed example *****\r\n"); + + // pw_sys_io_Init(); + + xTaskCreate(RunRpcService, "RPC_Task", RPC_TASK_STACK_SIZE / sizeof(StackType_t), nullptr, RPC_TASK_PRIORITY, &sRpcTaskHandle); +} diff --git a/examples/pigweed-app/ameba/third_party/connectedhomeip b/examples/pigweed-app/ameba/third_party/connectedhomeip new file mode 100644 index 00000000000000..9ecdeae07e93e3 --- /dev/null +++ b/examples/pigweed-app/ameba/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. diff --git a/examples/pigweed-app/esp32/README.md b/examples/pigweed-app/esp32/README.md index fcbcc4011debab..80333a72da5a86 100644 --- a/examples/pigweed-app/esp32/README.md +++ b/examples/pigweed-app/esp32/README.md @@ -35,14 +35,14 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout branch - [release/v4.4](https://github.com/espressif/esp-idf/tree/release/v4.4) +- Clone the Espressif ESP-IDF and checkout + [v4.4-beta1 pre-release](https://github.com/espressif/esp-idf/releases/tag/v4.4-beta1) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.4 + $ git checkout v4.4-beta1 $ git submodule update --init $ ./install.sh diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index d58279debf6ab0..7cdef1c2604da8 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -1,5 +1,5 @@ { - "featureLevel": 63, + "featureLevel": 67, "creator": "zap", "keyValuePairs": [ { @@ -32,9 +32,9 @@ "endpointTypes": [ { "name": "Anonymous Endpoint Type", - "deviceTypeName": "Base Application Example", - "deviceTypeCode": 65280, - "deviceTypeProfileId": 259, + "deviceTypeName": null, + "deviceTypeCode": null, + "deviceTypeProfileId": null, "clusters": [ { "name": "Descriptor", @@ -181,32 +181,7 @@ "define": "BASIC_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "StartUp", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ShutDown", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "Leave", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "InteractionModelVersion", @@ -343,6 +318,36 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ManufacturingDate", "code": 11, @@ -358,7 +363,7 @@ "maxInterval": 65344, "reportableChange": 0 }, - { + { "name": "PartNumber", "code": 12, "mfgCode": null, @@ -388,7 +393,7 @@ "maxInterval": 65344, "reportableChange": 0 }, - { + { "name": "ProductLabel", "code": 14, "mfgCode": null, @@ -463,36 +468,6 @@ "maxInterval": 65344, "reportableChange": 0 }, - { - "name": "SoftwareVersion", - "code": 9, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "SoftwareVersionString", - "code": 10, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "ClusterRevision", "code": 65533, @@ -1630,32 +1605,7 @@ "define": "BASIC_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "StartUp", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ShutDown", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "Leave", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "InteractionModelVersion", @@ -1837,7 +1787,7 @@ "maxInterval": 65344, "reportableChange": 0 }, - { + { "name": "PartNumber", "code": 12, "mfgCode": null, @@ -1867,7 +1817,7 @@ "maxInterval": 65344, "reportableChange": 0 }, - { + { "name": "ProductLabel", "code": 14, "mfgCode": null, @@ -2178,6 +2128,5 @@ "endpointVersion": 1, "deviceIdentifier": 258 } - ], - "log": [] -} + ] +} \ No newline at end of file diff --git a/examples/placeholder/linux/apps/app1/include/CHIPProjectConfig.h b/examples/placeholder/linux/apps/app1/include/CHIPProjectConfig.h index 39c726c4005419..fb211fc25f4d95 100644 --- a/examples/placeholder/linux/apps/app1/include/CHIPProjectConfig.h +++ b/examples/placeholder/linux/apps/app1/include/CHIPProjectConfig.h @@ -31,3 +31,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF02 #define CHIP_PORT 5542 + +// Allows app options (ports) to be configured on launch of app. +#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 6d656d803b0a6e..161d30b1248cb4 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -1,5 +1,5 @@ { - "featureLevel": 63, + "featureLevel": 67, "creator": "zap", "keyValuePairs": [ { @@ -32,9 +32,9 @@ "endpointTypes": [ { "name": "Anonymous Endpoint Type", - "deviceTypeName": "Base Application Example", - "deviceTypeCode": 65280, - "deviceTypeProfileId": 259, + "deviceTypeName": null, + "deviceTypeCode": null, + "deviceTypeProfileId": null, "clusters": [ { "name": "Descriptor", @@ -181,32 +181,7 @@ "define": "BASIC_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "StartUp", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ShutDown", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "Leave", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "InteractionModelVersion", @@ -343,126 +318,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "ManufacturingDate", - "code": 11, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PartNumber", - "code": 12, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductURL", - "code": 13, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductLabel", - "code": 14, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SerialNumber", - "code": 15, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "LocalConfigDisabled", - "code": 16, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Reachable", - "code": 17, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "UniqueID", - "code": 18, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "SoftwareVersion", "code": 9, @@ -493,6 +348,126 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1614,32 +1589,7 @@ "define": "BASIC_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "StartUp", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ShutDown", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "Leave", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], + "commands": [], "attributes": [ { "name": "InteractionModelVersion", @@ -1776,126 +1726,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "ManufacturingDate", - "code": 11, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "PartNumber", - "code": 12, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductURL", - "code": 13, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductLabel", - "code": 14, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SerialNumber", - "code": 15, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "LocalConfigDisabled", - "code": 16, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Reachable", - "code": 17, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "UniqueID", - "code": 18, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "SoftwareVersion", "code": 9, @@ -1926,6 +1756,126 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -1965,6 +1915,5 @@ "endpointVersion": 1, "deviceIdentifier": 257 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/placeholder/linux/main.cpp b/examples/placeholder/linux/main.cpp index 78744a6849ec67..74f4fb5ac3de38 100644 --- a/examples/placeholder/linux/main.cpp +++ b/examples/placeholder/linux/main.cpp @@ -19,6 +19,8 @@ #include "AppMain.h" #include "MatterCallbacks.h" +void ApplicationInit() {} + int main(int argc, char * argv[]) { VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0); diff --git a/examples/platform/ameba/PigweedLogger.cpp b/examples/platform/ameba/PigweedLogger.cpp new file mode 100644 index 00000000000000..625c6c4a901586 --- /dev/null +++ b/examples/platform/ameba/PigweedLogger.cpp @@ -0,0 +1,91 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "FreeRTOS.h" +#include "pw_sys_io_ameba/init.h" +#include "semphr.h" +#include +#include +#include + +#include +#include + +namespace PigweedLogger { +namespace { + +constexpr uint8_t kLogHdlcAddress = 1; // Send log messages to HDLC address 1 (other than RPC communication) +constexpr size_t kWriteBufferSize = 128; // Buffer for constructing HDLC frames + +SemaphoreHandle_t ameba_log_mutex; + +pw::stream::SysIoWriter sWriter; +size_t sWriteBufferPos; +char sWriteBuffer[kWriteBufferSize]; + +bool uartInitialised; + +void send() +{ + pw::hdlc::WriteUIFrame(kLogHdlcAddress, std::as_bytes(std::span(sWriteBuffer, sWriteBufferPos)), sWriter); + sWriteBufferPos = 0; +} + +} // namespace + +void init() +{ + ameba_log_mutex = xSemaphoreCreateMutex(); + assert(ameba_log_mutex != NULL); + pw_sys_io_Init(); + uartInitialised = true; +} + +int putString(const char * buffer, size_t size) +{ + xSemaphoreTake(ameba_log_mutex, portMAX_DELAY); + + assert(sWriteBufferPos < kWriteBufferSize); + + for (size_t i = 0; i < size; ++i) + { + + if (buffer[i] == '\r') + continue; + + if (buffer[i] == '\n') + { + send(); + continue; + } + + sWriteBuffer[sWriteBufferPos++] = buffer[i]; + + if (sWriteBufferPos == kWriteBufferSize) + send(); + } + + xSemaphoreGive(ameba_log_mutex); + return size; +} + +SemaphoreHandle_t * getSemaphore() +{ + return &ameba_log_mutex; +} + +} // namespace PigweedLogger diff --git a/examples/platform/ameba/PigweedLogger.h b/examples/platform/ameba/PigweedLogger.h new file mode 100644 index 00000000000000..f666fdcf62606e --- /dev/null +++ b/examples/platform/ameba/PigweedLogger.h @@ -0,0 +1,29 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "FreeRTOS.h" +#include "semphr.h" + +namespace PigweedLogger { + +void init(); +int putString(const char * buffer, size_t size); +SemaphoreHandle_t * getSemaphore(); + +} // namespace PigweedLogger diff --git a/examples/platform/ameba/Rpc.cpp b/examples/platform/ameba/Rpc.cpp new file mode 100644 index 00000000000000..c9caba3f504eb0 --- /dev/null +++ b/examples/platform/ameba/Rpc.cpp @@ -0,0 +1,161 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if CONFIG_ENABLE_PW_RPC +#include "FreeRTOS.h" +#include "PigweedLoggerMutex.h" +#include "RpcService.h" +#include "pw_sys_io_ameba/init.h" +#include "sys_api.h" +#include "task.h" +//#include "esp_log.h" +//#include "freertos/FreeRTOS.h" +//#include "freertos/event_groups.h" +//#include "freertos/semphr.h" +//#include "freertos/task.h" +#include "pw_log/log.h" +#include "pw_rpc/server.h" +#include "pw_sys_io/sys_io.h" +#include "support/CodeUtils.h" + +#if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE +#include "pigweed/rpc_services/Attributes.h" +#endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE + +#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE +//#include "ScreenManager.h" +#include "pigweed/rpc_services/Button.h" +#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE + +#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +#include "pigweed/rpc_services/Device.h" +#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE + +#if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE +#include "pigweed/rpc_services/Lighting.h" +#endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE + +#if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +#include "pigweed/rpc_services/Locking.h" +#endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE + +namespace chip { +namespace rpc { + +#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE +class AmebaButton final : public Button +{ +public: + pw::Status Event(const chip_rpc_ButtonEvent & request, pw_protobuf_Empty & response) override + { + return pw::Status::Unimplemented(); + } +}; +#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE + +#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +class AmebaDevice final : public Device +{ +public: + pw::Status Reboot(const pw_protobuf_Empty & request, pw_protobuf_Empty & response) override + { + mRebootTimer = xTimerCreateStatic("Reboot", kRebootTimerPeriodTicks, false, nullptr, RebootHandler, &mRebootTimerBuffer); + xTimerStart(mRebootTimer, 0); + return pw::OkStatus(); + } + +private: + static constexpr TickType_t kRebootTimerPeriodTicks = 1000; + TimerHandle_t mRebootTimer; + StaticTimer_t mRebootTimerBuffer; + + static void RebootHandler(TimerHandle_t) { sys_reset(); } +}; +#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE + +namespace { + +#define RPC_TASK_STACK_SIZE (8 * 1024) +#define RPC_TASK_PRIORITY 1 +static TaskHandle_t sRpcTaskHandle; +StaticTask_t sRpcTaskBuffer; +StackType_t sRpcTaskStack[RPC_TASK_STACK_SIZE]; + +#if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE +Attributes attributes_service; +#endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE + +#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE +AmebaButton button_service; +#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE + +#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE +AmebaDevice device_service; +#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE + +#if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE +Lighting lighting_service; +#endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE + +#if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +Locking locking; +#endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE + +void RegisterServices(pw::rpc::Server & server) +{ +#if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE + server.RegisterService(attributes_service); +#endif // defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE + +#if defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE + server.RegisterService(button_service); +#endif // defined(PW_RPC_BUTTON_SERVICE) && PW_RPC_BUTTON_SERVICE + +#if defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE + server.RegisterService(device_service); +#endif // defined(PW_RPC_DEVICE_SERVICE) && PW_RPC_DEVICE_SERVICE + +#if defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE + server.RegisterService(lighting_service); +#endif // defined(PW_RPC_LIGHTING_SERVICE) && PW_RPC_LIGHTING_SERVICE + +#if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE + server.RegisterService(locking); +#endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +} + +} // namespace + +void RunRpcService(void *) +{ + Start(RegisterServices, &logger_mutex); +} + +void Init() +{ + PigweedLogger::init(); + + // Start App task. + sRpcTaskHandle = xTaskCreateStatic(RunRpcService, "RPC_TASK", ArraySize(sRpcTaskStack), nullptr, RPC_TASK_PRIORITY, + sRpcTaskStack, &sRpcTaskBuffer); +} + +} // namespace rpc +} // namespace chip + +#endif // CONFIG_ENABLE_PW_RPCC diff --git a/zzz_generated/ota-provider-app/zap-generated/chip-zcl-zpro-codec-api.h b/examples/platform/ameba/Rpc.h similarity index 86% rename from zzz_generated/ota-provider-app/zap-generated/chip-zcl-zpro-codec-api.h rename to examples/platform/ameba/Rpc.h index 759d13c5028d26..9b73e5cafca96b 100644 --- a/zzz_generated/ota-provider-app/zap-generated/chip-zcl-zpro-codec-api.h +++ b/examples/platform/ameba/Rpc.h @@ -15,4 +15,12 @@ * limitations under the License. */ -// THIS FILE IS GENERATED BY ZAP +#pragma once + +namespace chip { +namespace rpc { + +void Init(); + +} // namespace rpc +} // namespace chip diff --git a/examples/platform/ameba/pw_sys_io/BUILD.gn b/examples/platform/ameba/pw_sys_io/BUILD.gn new file mode 100644 index 00000000000000..82b6452095ea52 --- /dev/null +++ b/examples/platform/ameba/pw_sys_io/BUILD.gn @@ -0,0 +1,34 @@ +# 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("//build_overrides/pigweed.gni") + +import("$dir_pw_build/target_types.gni") + +config("default_config") { + include_dirs = [ "public" ] +} + +pw_source_set("pw_sys_io_ameba") { + sources = [ "sys_io_ameba.cc" ] + + deps = [ + "$dir_pw_sys_io:default_putget_bytes", + "$dir_pw_sys_io:facade", + ] + + cflags = [ "-Wconversion" ] + + public_configs = [ ":default_config" ] +} diff --git a/examples/platform/ameba/pw_sys_io/CMakeLists.txt b/examples/platform/ameba/pw_sys_io/CMakeLists.txt new file mode 100644 index 00000000000000..c0ff32a9f695cb --- /dev/null +++ b/examples/platform/ameba/pw_sys_io/CMakeLists.txt @@ -0,0 +1,11 @@ +include($ENV{PW_ROOT}/pw_build/pigweed.cmake) + +# This is compiled in gn build, just provide headers and let linker sort it out. +pw_add_module_library(pw_sys_io.ameba + SOURCES + PRIVATE_DEPS + pw_sys_io + HEADERS + public +) + diff --git a/examples/platform/ameba/pw_sys_io/public/pw_sys_io_ameba/init.h b/examples/platform/ameba/pw_sys_io/public/pw_sys_io_ameba/init.h new file mode 100644 index 00000000000000..f11f5e928f3e14 --- /dev/null +++ b/examples/platform/ameba/pw_sys_io/public/pw_sys_io_ameba/init.h @@ -0,0 +1,27 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "pw_preprocessor/util.h" + +PW_EXTERN_C_START + +// The actual implement of PreMainInit() in sys_io_BACKEND. +void pw_sys_io_Init(); + +PW_EXTERN_C_END diff --git a/examples/platform/ameba/pw_sys_io/sys_io_ameba.cc b/examples/platform/ameba/pw_sys_io/sys_io_ameba.cc new file mode 100644 index 00000000000000..a57880bc4780f9 --- /dev/null +++ b/examples/platform/ameba/pw_sys_io/sys_io_ameba.cc @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "pw_sys_io/sys_io.h" +#include +#include +#include +#include + +#include "serial_api.h" + +#define UART_TX PA_18 +#define UART_RX PA_19 + +serial_t sobj; +int console_getchar(uint8_t * chr) +{ + *chr = (uint8_t) serial_getc(&sobj); + return 1; +} + +int console_putchar(const char * chr) +{ + serial_putc(&sobj, *chr); + return 1; +} + +void console_init(void) +{ + serial_init(&sobj, UART_TX, UART_RX); + serial_baud(&sobj, 115200); + serial_format(&sobj, 8, ParityNone, 1); +} + +extern "C" void pw_sys_io_Init() +{ + console_init(); +} + +namespace pw::sys_io { + +Status ReadByte(std::byte * dest) +{ + if (!dest) + return Status::InvalidArgument(); + + int ret = console_getchar(reinterpret_cast(dest)); + return ret < 0 ? Status::FailedPrecondition() : OkStatus(); +} + +Status WriteByte(std::byte b) +{ + int ret = console_putchar(reinterpret_cast(&b)); + return ret < 0 ? Status::FailedPrecondition() : OkStatus(); +} + +// Writes a string using pw::sys_io, and add newline characters at the end. +StatusWithSize WriteLine(const std::string_view & s) +{ + size_t chars_written = 0; + StatusWithSize result = WriteBytes(std::as_bytes(std::span(s))); + if (!result.ok()) + { + return result; + } + chars_written += result.size(); + result = WriteBytes(std::as_bytes(std::span("\r\n", 2))); + chars_written += result.size(); + + return StatusWithSize(result.status(), chars_written); +} + +} // namespace pw::sys_io diff --git a/examples/platform/efr32/uart.cpp b/examples/platform/efr32/uart.cpp index 0fed6bde861c8c..9d3cbc2b1d966d 100644 --- a/examples/platform/efr32/uart.cpp +++ b/examples/platform/efr32/uart.cpp @@ -97,7 +97,7 @@ static uint16_t AvailableDataCount(Fifo_t * fifo) // if equal there is no data return 0 directly if (fifo->Tail != fifo->Head) { - // determine if a wrap around occured to get the right data size avalaible. + // determine if a wrap around occurred to get the right data size avalaible. size = (fifo->Tail < fifo->Head) ? (fifo->MaxSize - fifo->Head + fifo->Tail) : (fifo->Tail - fifo->Head); } diff --git a/examples/platform/esp32/Rpc.cpp b/examples/platform/esp32/Rpc.cpp index 3cfe0070e815b6..9286191dc4eeca 100644 --- a/examples/platform/esp32/Rpc.cpp +++ b/examples/platform/esp32/Rpc.cpp @@ -52,6 +52,23 @@ #include "pigweed/rpc_services/Locking.h" #endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +#if defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE +#include "pw_trace/trace.h" +#include "pw_trace_tokenized/trace_rpc_service_nanopb.h" + +// Define trace time for pw_trace +PW_TRACE_TIME_TYPE pw_trace_GetTraceTime() +{ + return (PW_TRACE_TIME_TYPE) chip::System::SystemClock().GetMonotonicMicroseconds64().count(); +} +// Microsecond time source +size_t pw_trace_GetTraceTimeTicksPerSecond() +{ + return 1000000; +} + +#endif // defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE + namespace chip { namespace rpc { @@ -122,6 +139,10 @@ Lighting lighting_service; Locking locking; #endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +#if defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE +pw::trace::TraceService trace_service; +#endif // defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE + void RegisterServices(pw::rpc::Server & server) { #if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE @@ -143,6 +164,10 @@ void RegisterServices(pw::rpc::Server & server) #if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE server.RegisterService(locking); #endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE + +#if defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE + server.RegisterService(trace_service); +#endif // defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE } } // namespace diff --git a/examples/platform/linux/AppMain.cpp b/examples/platform/linux/AppMain.cpp index 9030459ed7d7b9..302f4a1df1f30e 100644 --- a/examples/platform/linux/AppMain.cpp +++ b/examples/platform/linux/AppMain.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -54,6 +55,7 @@ #include #endif +#include "AppMain.h" #include "Options.h" using namespace chip; @@ -401,7 +403,7 @@ void ChipLinuxAppMainLoop() uint16_t securePort = CHIP_PORT; uint16_t unsecurePort = CHIP_UDC_PORT; -#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE +#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE || CHIP_DEVICE_ENABLE_PORT_PARAMS // use a different service port to make testing possible with other sample devices running on same host securePort = LinuxDeviceOptions::GetInstance().securedDevicePort; unsecurePort = LinuxDeviceOptions::GetInstance().unsecuredCommissionerPort; @@ -427,6 +429,8 @@ void ChipLinuxAppMainLoop() #endif // defined(ENABLE_CHIP_SHELL) #endif // CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE + ApplicationInit(); + chip::DeviceLayer::PlatformMgr().RunEventLoop(); #if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE diff --git a/examples/platform/linux/AppMain.h b/examples/platform/linux/AppMain.h index 520cd3af514147..914499e4f851eb 100644 --- a/examples/platform/linux/AppMain.h +++ b/examples/platform/linux/AppMain.h @@ -41,3 +41,6 @@ CHIP_ERROR CommissionerPairUDC(uint32_t pincode, size_t index); DeviceCommissioner * GetDeviceCommissioner(); #endif // CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE + +// For extra init calls, the function will be called right before running Matter main loop. +void ApplicationInit(); diff --git a/examples/platform/nrfconnect/Rpc.cpp b/examples/platform/nrfconnect/Rpc.cpp index 89af172327e4fc..580c925d883465 100644 --- a/examples/platform/nrfconnect/Rpc.cpp +++ b/examples/platform/nrfconnect/Rpc.cpp @@ -45,6 +45,23 @@ LOG_MODULE_DECLARE(app); #include "pigweed/rpc_services/Locking.h" #endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +#if defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE +#include "pw_trace/trace.h" +#include "pw_trace_tokenized/trace_rpc_service_nanopb.h" + +// Define trace time for pw_trace +PW_TRACE_TIME_TYPE pw_trace_GetTraceTime() +{ + return (PW_TRACE_TIME_TYPE) chip::System::SystemClock().GetMonotonicMicroseconds64().count(); +} +// Microsecond time source +size_t pw_trace_GetTraceTimeTicksPerSecond() +{ + return 1000000; +} + +#endif // defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE + namespace chip { namespace rpc { @@ -110,6 +127,10 @@ Lighting lighting_service; Locking locking; #endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE +#if defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE +pw::trace::TraceService trace_service; +#endif // defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE + void RegisterServices(pw::rpc::Server & server) { #if defined(PW_RPC_ATTRIBUTE_SERVICE) && PW_RPC_ATTRIBUTE_SERVICE @@ -131,6 +152,10 @@ void RegisterServices(pw::rpc::Server & server) #if defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE server.RegisterService(locking); #endif // defined(PW_RPC_LOCKING_SERVICE) && PW_RPC_LOCKING_SERVICE + +#if defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE + server.RegisterService(trace_service); +#endif // defined(PW_RPC_TRACING_SERVICE) && PW_RPC_TRACING_SERVICE } } // namespace diff --git a/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt b/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt index 84b78c3ebd31ed..e71fbd808e29dc 100644 --- a/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt +++ b/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt @@ -4,6 +4,7 @@ add_library(suppress_zephyr_warnings INTERFACE) target_compile_options(suppress_zephyr_warnings INTERFACE -Wno-redundant-decls -Wno-missing-field-initializers + -Wno-cast-qual ) pw_add_module_library(pw_sys_io.nrfconnect diff --git a/examples/platform/qpg/project_include/OpenThreadConfig.h b/examples/platform/qpg/project_include/OpenThreadConfig.h index 44610cc1ee5b96..d4c29a26b7c43d 100644 --- a/examples/platform/qpg/project_include/OpenThreadConfig.h +++ b/examples/platform/qpg/project_include/OpenThreadConfig.h @@ -86,4 +86,4 @@ // NB: This file gets included during the build of OpenThread. Hence // it cannot use "openthread" in the path to the included file. // -#include "openthread-core-qpg6100-config.h" +#include "openthread-core-qpg6105-config.h" diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp index 745949c9f30b56..5fddaf9d326123 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -20,6 +20,7 @@ #include "AppTask.h" #include "AppConfig.h" #include "AppEvent.h" +#include #include #include @@ -31,6 +32,7 @@ #include #include +#include #include #include @@ -52,10 +54,13 @@ #define PCC_CLUSTER_ENDPOINT 1 #define ONOFF_CLUSTER_ENDPOINT 1 +#define EXTENDED_DISCOVERY_TIMEOUT_SEC 20 -using namespace ::chip::Credentials; -using namespace ::chip::DeviceLayer; -using namespace ::chip::app::Clusters; +using namespace chip; +using namespace chip::app; +using namespace chip::Credentials; +using namespace chip::DeviceLayer; +using namespace chip::app::Clusters; static TaskHandle_t sAppTaskHandle; static QueueHandle_t sAppEventQueue; @@ -140,6 +145,10 @@ int AppTask::Init() ; } +#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY + chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(EXTENDED_DISCOVERY_TIMEOUT_SEC); +#endif + // Init ZCL Data Model and start server PLAT_LOG("Initialize Server"); chip::Server::GetInstance().Init(); @@ -319,12 +328,15 @@ void AppTask::DispatchEvent(AppEvent * aEvent) case AppEvent::kEventType_ButtonLeft: if (AppEvent::kAppEventButtonType_Clicked == aEvent->ButtonEvent.Type) { + // Post event for demonstration purposes + sAppTask.PostEvents(); + // Toggle BLE advertisements if (!ConnectivityMgr().IsBLEAdvertisingEnabled()) { if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() == CHIP_NO_ERROR) { - PLAT_LOG("Enabled BLE Advertisement"); + PLAT_LOG("Enabled BLE Advertisements"); } else { @@ -357,6 +369,23 @@ void AppTask::DispatchEvent(AppEvent * aEvent) } } +void AppTask::InitOnOffClusterState() +{ + + EmberStatus status; + + ChipLogProgress(NotSpecified, "Init On/Off clusterstate"); + + // Write false as pump always boots in stopped mode + status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, false); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Init On/Off state %" PRIx8, status); + } +} + +void AppTask::InitPCCClusterState() {} + void AppTask::UpdateClusterState() { EmberStatus status; @@ -364,10 +393,8 @@ void AppTask::UpdateClusterState() ChipLogProgress(NotSpecified, "UpdateClusterState"); // Write the new values - bool onOffState = !PumpMgr().IsStopped(); - - status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, onOffState); + status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, onOffState); if (status != EMBER_ZCL_STATUS_SUCCESS) { ChipLogError(NotSpecified, "ERR: Updating On/Off state %" PRIx8, status); @@ -464,3 +491,20 @@ void AppTask::UpdateClusterState() ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %" PRIx8, status); } } + +void AppTask::PostEvents() +{ + // Example on posting events - here we post the general fault event on endpoints with PCC Server enabled + for (auto endpoint : EnabledEndpointsWithServerCluster(PumpConfigurationAndControl::Id)) + { + PumpConfigurationAndControl::Events::GeneralFault::Type event; + EventNumber eventNumber; + + ChipLogProgress(Zcl, "AppTask: Post PCC GeneralFault event"); + // Using default priority for the event + if (CHIP_NO_ERROR != LogEvent(event, endpoint, eventNumber)) + { + ChipLogError(Zcl, "AppTask: Failed to record GeneralFault event"); + } + } +} diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp index 4d97751ad0a190..f8dbde9662b73c 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp @@ -65,11 +65,10 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & */ void emberAfOnOffClusterInitCallback(EndpointId endpoint) { - GetAppTask().UpdateClusterState(); + GetAppTask().InitOnOffClusterState(); } void emberAfPumpConfigurationAndControlClusterInitCallback(chip::EndpointId endpoint) { - // TODO: Setup the default values in the cluster for this specific application - GetAppTask().UpdateClusterState(); + GetAppTask().InitPCCClusterState(); } diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/include/AppTask.h b/examples/pump-app/cc13x2x7_26x2x7/main/include/AppTask.h index 11e402ebe3bcb9..dfe9f4a7ecf6fc 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/include/AppTask.h +++ b/examples/pump-app/cc13x2x7_26x2x7/main/include/AppTask.h @@ -40,6 +40,8 @@ class AppTask void PostStartActionRequest(int32_t aActor, PumpManager::Action_t aAction); void PostEvent(const AppEvent * event); void UpdateClusterState(); + void InitOnOffClusterState(); + void InitPCCClusterState(); private: friend AppTask & GetAppTask(void); @@ -54,6 +56,7 @@ class AppTask static void ButtonLeftEventHandler(Button_Handle handle, Button_EventMask events); static void ButtonRightEventHandler(Button_Handle handle, Button_EventMask events); static void TimerEventHandler(void * p_context); + static void PostEvents(); enum Function_t { diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp index 76db456fda3999..e68bab7cb1fad4 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp @@ -39,7 +39,7 @@ #include #include -#define TOTAL_ICALL_HEAP_SIZE (0xE000) +#define TOTAL_ICALL_HEAP_SIZE (0xCB00) using namespace ::chip; using namespace ::chip::Inet; diff --git a/examples/pump-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/pump-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay index e3716a4a9248e9..174d2d6a9ef3ce 100644 --- a/examples/pump-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay +++ b/examples/pump-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay @@ -15,6 +15,10 @@ */ / { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + /* * In some default configurations within the nRF Connect SDK, * e.g. on nRF52840, the chosen zephyr,entropy node is &cryptocell. diff --git a/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index e7e363e23d5998..0d142802009fe3 100644 --- a/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -15,6 +15,10 @@ */ / { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + soc { /* Add a flash controller which has the compatible * 'zephyr,sim-flash'. This will ensure that the flash diff --git a/examples/pump-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf b/examples/pump-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf index 33b31f28a28561..de4023efbc3c52 100644 --- a/examples/pump-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf +++ b/examples/pump-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf @@ -22,13 +22,6 @@ CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 CONFIG_MULTITHREADING=y CONFIG_BOOT_MAX_IMG_SECTORS=256 -# External flash memory configuration -CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y -CONFIG_PM_EXTERNAL_FLASH=y -CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64" -CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000 -CONFIG_PM_EXTERNAL_FLASH_BASE=0 - # The following configurations are required to support simultaneous multi image update CONFIG_PCD_APP=y CONFIG_UPDATEABLE_IMAGE_NUMBER=2 diff --git a/examples/pump-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf b/examples/pump-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf index 3c1c6ccdfe7564..09e708c4e4dfff 100644 --- a/examples/pump-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf +++ b/examples/pump-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf @@ -21,10 +21,3 @@ CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 CONFIG_MULTITHREADING=y CONFIG_BOOT_MAX_IMG_SECTORS=256 - -# External flash memory configuration -CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y -CONFIG_PM_EXTERNAL_FLASH=y -CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64" -CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000 -CONFIG_PM_EXTERNAL_FLASH_BASE=0 diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index fd0115915980d8..724aa5e0b7b721 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -2906,7 +2906,7 @@ "mfgCode": null, "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [], "attributes": [ { @@ -3177,7 +3177,7 @@ "mfgCode": null, "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [], "attributes": [ { @@ -6202,6 +6202,5 @@ "endpointVersion": 1, "deviceIdentifier": 771 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-controller-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/pump-controller-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay index e3716a4a9248e9..174d2d6a9ef3ce 100644 --- a/examples/pump-controller-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay +++ b/examples/pump-controller-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay @@ -15,6 +15,10 @@ */ / { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + /* * In some default configurations within the nRF Connect SDK, * e.g. on nRF52840, the chosen zephyr,entropy node is &cryptocell. diff --git a/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index e7e363e23d5998..0d142802009fe3 100644 --- a/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -15,6 +15,10 @@ */ / { + chosen { + nordic,pm-ext-flash = &mx25r64; + }; + soc { /* Add a flash controller which has the compatible * 'zephyr,sim-flash'. This will ensure that the flash diff --git a/examples/pump-controller-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf b/examples/pump-controller-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf index 33b31f28a28561..de4023efbc3c52 100644 --- a/examples/pump-controller-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf +++ b/examples/pump-controller-app/nrfconnect/configuration/mcuboot_multi_image_dfu.conf @@ -22,13 +22,6 @@ CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 CONFIG_MULTITHREADING=y CONFIG_BOOT_MAX_IMG_SECTORS=256 -# External flash memory configuration -CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y -CONFIG_PM_EXTERNAL_FLASH=y -CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64" -CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000 -CONFIG_PM_EXTERNAL_FLASH_BASE=0 - # The following configurations are required to support simultaneous multi image update CONFIG_PCD_APP=y CONFIG_UPDATEABLE_IMAGE_NUMBER=2 diff --git a/examples/pump-controller-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf b/examples/pump-controller-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf index 3c1c6ccdfe7564..09e708c4e4dfff 100644 --- a/examples/pump-controller-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf +++ b/examples/pump-controller-app/nrfconnect/configuration/mcuboot_single_image_dfu.conf @@ -21,10 +21,3 @@ CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16 CONFIG_MULTITHREADING=y CONFIG_BOOT_MAX_IMG_SECTORS=256 - -# External flash memory configuration -CONFIG_PM_EXTERNAL_FLASH_SUPPORT_LEGACY=y -CONFIG_PM_EXTERNAL_FLASH=y -CONFIG_PM_EXTERNAL_FLASH_DEV_NAME="MX25R64" -CONFIG_PM_EXTERNAL_FLASH_SIZE=0x800000 -CONFIG_PM_EXTERNAL_FLASH_BASE=0 diff --git a/examples/pump-controller-app/nrfconnect/prj.conf b/examples/pump-controller-app/nrfconnect/prj.conf index ddb6056e80fc43..0811b93095ab23 100644 --- a/examples/pump-controller-app/nrfconnect/prj.conf +++ b/examples/pump-controller-app/nrfconnect/prj.conf @@ -28,7 +28,7 @@ CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread" CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" # Bluetooth overrides -CONFIG_BT_DEVICE_NAME="MatterPumpController" +CONFIG_BT_DEVICE_NAME="MatterPumpCtrl" # Additional configs for debbugging experience. CONFIG_THREAD_NAME=y 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 704e347a2bc1c8..9f86d51aaeba81 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 @@ -5947,6 +5947,5 @@ "endpointVersion": 1, "deviceIdentifier": 772 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/shell/mbed/main/main.cpp b/examples/shell/mbed/main/main.cpp index 7865283deda515..1ab85f2a196e7a 100644 --- a/examples/shell/mbed/main/main.cpp +++ b/examples/shell/mbed/main/main.cpp @@ -48,7 +48,7 @@ int main() err = chip::Platform::MemoryInit(); if (err != CHIP_NO_ERROR) { - ChipLogError(Shell, "Memory initalization failed: %s", err.AsString()); + ChipLogError(Shell, "Memory initialization failed: %s", err.AsString()); ret = EXIT_FAILURE; goto exit; } @@ -56,7 +56,7 @@ int main() err = PlatformMgr().InitChipStack(); if (err != CHIP_NO_ERROR) { - ChipLogError(Shell, "Chip stack initalization failed: %s", err.AsString()); + ChipLogError(Shell, "Chip stack initialization failed: %s", err.AsString()); ret = EXIT_FAILURE; goto exit; } diff --git a/examples/temperature-measurement-app/esp32/README.md b/examples/temperature-measurement-app/esp32/README.md index 15741da9d3621d..b8f1ccad190394 100644 --- a/examples/temperature-measurement-app/esp32/README.md +++ b/examples/temperature-measurement-app/esp32/README.md @@ -23,14 +23,14 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout branch - [release/v4.4](https://github.com/espressif/esp-idf/tree/release/v4.4) +- Clone the Espressif ESP-IDF and checkout + [v4.4-beta1 pre-release](https://github.com/espressif/esp-idf/releases/tag/v4.4-beta1) $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.4 + $ git checkout v4.4-beta1 $ git submodule update --init $ ./install.sh diff --git a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt index 6d8637cd18caf2..47439a37fe78a9 100644 --- a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt +++ b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt @@ -39,9 +39,11 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-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/general-commissioning-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning-old" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/route_hook" PRIV_REQUIRES chip QRCode bt) diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap b/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap index b60856faaa8232..ce9e32d49f441e 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap @@ -1114,7 +1114,7 @@ "reportableChange": 0 }, { - "name": "NetworkDisabled", + "name": "InterfaceEnabled", "code": 4, "mfgCode": null, "side": "server", diff --git a/examples/thermostat/linux/include/low-power/LowPowerManager.cpp b/examples/thermostat/linux/include/low-power/LowPowerManager.cpp index 97016d4b01a74f..57399c0ba1de5c 100644 --- a/examples/thermostat/linux/include/low-power/LowPowerManager.cpp +++ b/examples/thermostat/linux/include/low-power/LowPowerManager.cpp @@ -18,7 +18,7 @@ #include "LowPowerManager.h" -bool lowPowerClusterSleep() +bool LowPowerManager::HandleSleep() { // TODO: Insert code here return true; diff --git a/examples/thermostat/linux/include/low-power/LowPowerManager.h b/examples/thermostat/linux/include/low-power/LowPowerManager.h index 75d500ca12de74..92bb1417be514d 100644 --- a/examples/thermostat/linux/include/low-power/LowPowerManager.h +++ b/examples/thermostat/linux/include/low-power/LowPowerManager.h @@ -18,9 +18,10 @@ #pragma once -#include +#include -class LowPowerManager +class LowPowerManager : public chip::app::Clusters::LowPower::Delegate { public: + bool HandleSleep() override; }; diff --git a/examples/thermostat/linux/main.cpp b/examples/thermostat/linux/main.cpp index 8ad5cb5033d1af..68598a48ad8c47 100644 --- a/examples/thermostat/linux/main.cpp +++ b/examples/thermostat/linux/main.cpp @@ -87,6 +87,8 @@ static Identify gIdentify1 = { chip::EndpointId{ 1 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, }; +void ApplicationInit() {} + int main(int argc, char * argv[]) { VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0); diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index 063efbc6075ea5..9df9f49d2c2020 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -1280,7 +1280,7 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, + "code": 2, "mfgCode": null, "source": "client", "incoming": 1, @@ -1288,11 +1288,11 @@ }, { "name": "NotifyUpdateApplied", - "code": 2, + "code": 4, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 } ], "attributes": [ @@ -1323,15 +1323,15 @@ "commands": [ { "name": "QueryImageResponse", - "code": 3, + "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -1703,7 +1703,7 @@ "reportableChange": 0 }, { - "name": "NetworkDisabled", + "name": "InterfaceEnabled", "code": 4, "mfgCode": null, "side": "server", @@ -4068,7 +4068,7 @@ "commands": [], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", @@ -4083,7 +4083,7 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", @@ -8164,14 +8164,6 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "NotifyUpdateApplied", "code": 2, "mfgCode": null, "source": "client", @@ -8205,17 +8197,9 @@ "side": "server", "enabled": 0, "commands": [ - { - "name": "QueryImageResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -8954,7 +8938,7 @@ "commands": [], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", @@ -8969,7 +8953,7 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", @@ -12398,10 +12382,10 @@ ] }, { - "name": "TV Channel", + "name": "Channel", "code": 1284, "mfgCode": null, - "define": "TV_CHANNEL_CLUSTER", + "define": "CHANNEL_CLUSTER", "side": "client", "enabled": 0, "commands": [ @@ -12449,10 +12433,10 @@ ] }, { - "name": "TV Channel", + "name": "Channel", "code": 1284, "mfgCode": null, - "define": "TV_CHANNEL_CLUSTER", + "define": "CHANNEL_CLUSTER", "side": "server", "enabled": 0, "commands": [ @@ -12537,7 +12521,7 @@ "enabled": 0, "commands": [ { - "name": "NavigateTarget", + "name": "NavigateTargetRequest", "code": 0, "mfgCode": null, "source": "client", @@ -13136,7 +13120,7 @@ ], "attributes": [ { - "name": "accepts header list", + "name": "accept header list", "code": 0, "mfgCode": null, "side": "server", @@ -13971,6 +13955,5 @@ "endpointVersion": 1, "deviceIdentifier": 769 } - ], - "log": [] -} \ No newline at end of file + ] +} diff --git a/examples/tv-app/android/App/app/src/main/java/com/tcl/chip/chiptvserver/service/MatterServant.java b/examples/tv-app/android/App/app/src/main/java/com/tcl/chip/chiptvserver/service/MatterServant.java index aa1cf46ec00903..e6637744ab9dd3 100644 --- a/examples/tv-app/android/App/app/src/main/java/com/tcl/chip/chiptvserver/service/MatterServant.java +++ b/examples/tv-app/android/App/app/src/main/java/com/tcl/chip/chiptvserver/service/MatterServant.java @@ -9,13 +9,13 @@ import chip.platform.NsdManagerServiceResolver; import chip.platform.PreferencesConfigurationManager; import chip.platform.PreferencesKeyValueStoreManager; +import com.tcl.chip.tvapp.ChannelManagerStub; import com.tcl.chip.tvapp.ContentLaunchManagerStub; import com.tcl.chip.tvapp.KeypadInputManagerStub; import com.tcl.chip.tvapp.LowPowerManagerStub; import com.tcl.chip.tvapp.MediaInputManagerStub; import com.tcl.chip.tvapp.MediaPlaybackManagerStub; import com.tcl.chip.tvapp.TvApp; -import com.tcl.chip.tvapp.TvChannelManagerStub; import com.tcl.chip.tvapp.WakeOnLanManagerStub; public class MatterServant { @@ -38,7 +38,7 @@ public void init(@NonNull Context context) { tvApp.setContentLaunchManager(new ContentLaunchManagerStub()); tvApp.setLowPowerManager(new LowPowerManagerStub()); tvApp.setMediaPlaybackManager(new MediaPlaybackManagerStub()); - tvApp.setTvChannelManager(new TvChannelManagerStub()); + tvApp.setChannelManager(new ChannelManagerStub()); Context applicationContext = context.getApplicationContext(); AndroidChipPlatform chipPlatform = diff --git a/examples/tv-app/android/BUILD.gn b/examples/tv-app/android/BUILD.gn index 5be448221c55dc..d77831c649d5fa 100644 --- a/examples/tv-app/android/BUILD.gn +++ b/examples/tv-app/android/BUILD.gn @@ -38,6 +38,8 @@ shared_library("jni") { "include/endpoint-configuration/EndpointConfigurationStorage.h", "include/target-navigator/TargetNavigatorManager.cpp", "include/target-navigator/TargetNavigatorManager.h", + "java/ChannelManager.cpp", + "java/ChannelManager.h", "java/ContentLauncherManager.cpp", "java/ContentLauncherManager.h", "java/KeypadInputManager.cpp", @@ -49,8 +51,6 @@ shared_library("jni") { "java/MediaPlaybackManager.cpp", "java/MediaPlaybackManager.h", "java/TVApp-JNI.cpp", - "java/TvChannelManager.cpp", - "java/TvChannelManager.h", "java/WakeOnLanManager.cpp", "java/WakeOnLanManager.h", ] @@ -83,6 +83,10 @@ android_library("java") { ] sources = [ + "java/src/com/tcl/chip/tvapp/ChannelInfo.java", + "java/src/com/tcl/chip/tvapp/ChannelLineupInfo.java", + "java/src/com/tcl/chip/tvapp/ChannelManager.java", + "java/src/com/tcl/chip/tvapp/ChannelManagerStub.java", "java/src/com/tcl/chip/tvapp/ContentLaunchBrandingInformation.java", "java/src/com/tcl/chip/tvapp/ContentLaunchManager.java", "java/src/com/tcl/chip/tvapp/ContentLaunchManagerStub.java", @@ -98,10 +102,6 @@ android_library("java") { "java/src/com/tcl/chip/tvapp/MediaPlaybackManager.java", "java/src/com/tcl/chip/tvapp/MediaPlaybackManagerStub.java", "java/src/com/tcl/chip/tvapp/TvApp.java", - "java/src/com/tcl/chip/tvapp/TvChannelInfo.java", - "java/src/com/tcl/chip/tvapp/TvChannelLineupInfo.java", - "java/src/com/tcl/chip/tvapp/TvChannelManager.java", - "java/src/com/tcl/chip/tvapp/TvChannelManagerStub.java", "java/src/com/tcl/chip/tvapp/WakeOnLanManager.java", "java/src/com/tcl/chip/tvapp/WakeOnLanManagerStub.java", ] diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp index ed816f72f3648d..f391901e136e32 100644 --- a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp +++ b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp @@ -17,75 +17,35 @@ */ #include "AccountLoginManager.h" -#include -#include -#include -#include -#include #include #include using namespace std; +using namespace chip::app::Clusters::AccountLogin; -bool AccountLoginManager::isUserLoggedIn(string requestTempAccountIdentifier, string requestSetupPin) +bool AccountLoginManager::HandleLogin(const chip::CharSpan & tempAccountIdentifier, const chip::CharSpan & setupPin) { - // TODO: Fix hardcoding length of strings - requestTempAccountIdentifier = requestTempAccountIdentifier.substr(0, 4); - requestSetupPin = requestSetupPin.substr(0, 10); - for (auto it = accounts.cbegin(); it != accounts.cend(); ++it) - { - ChipLogProgress(Zcl, "temporary account id: %s", it->first.c_str()); - ChipLogProgress(Zcl, "setup pin %s", it->second.c_str()); - } + string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size()); + string setupPinString(setupPin.data(), setupPin.size()); + ChipLogProgress(Zcl, "temporary account id: %s", tempAccountIdentifierString.c_str()); + ChipLogProgress(Zcl, "setup pin %s", setupPinString.c_str()); - if (accounts.find(requestTempAccountIdentifier) != accounts.end()) - { - bool found = accounts[requestTempAccountIdentifier] == requestSetupPin; - if (!found) - { - ChipLogError(Zcl, "User is not logged in, failed to match request setup pin."); - } - return found; - } - else - { - ChipLogError(Zcl, "User is not logged in, failed to find temp account identifier."); - return false; - } -} - -void AccountLoginManager::setTempAccountIdentifierForPin(string tempAccountIdentifier, string setupPin) -{ - // TODO: Fix hardcoding length of strings - string tempId = tempAccountIdentifier.substr(0, 4); - accounts[tempId] = setupPin; -} - -string AccountLoginManager::proxySetupPinRequest(string requestTempAccountIdentifier, chip::EndpointId endpoint) -{ - // TODO: Insert your code here to send temp account identifier request - return "tempPin123"; + // TODO: Insert your code here to handle login request + return true; } -bool AccountLoginManager::proxyLogout() +bool AccountLoginManager::HandleLogout() { // TODO: Insert your code here to send logout request return true; } -bool accountLoginClusterIsUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin) -{ - return AccountLoginManager().GetInstance().isUserLoggedIn(requestTempAccountIdentifier, requestSetupPin); -} - -bool accountLoginClusterLogout() -{ - return AccountLoginManager().GetInstance().proxyLogout(); -} - -std::string accountLoginClusterGetSetupPin(std::string requestTempAccountIdentifier, chip::EndpointId endpoint) +Commands::GetSetupPINResponse::Type AccountLoginManager::HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifier) { - string responseSetupPin = AccountLoginManager().proxySetupPinRequest(requestTempAccountIdentifier, endpoint); - AccountLoginManager().GetInstance().setTempAccountIdentifierForPin(requestTempAccountIdentifier, responseSetupPin); - return responseSetupPin; + string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size()); + ChipLogProgress(Zcl, "temporary account id: %s", tempAccountIdentifierString.c_str()); + // TODO: Insert your code here to handle get setup pin + Commands::GetSetupPINResponse::Type response; + response.setupPIN = chip::CharSpan("tempPin123", strlen("tempPin123")); + return response; } diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.h b/examples/tv-app/android/include/account-login/AccountLoginManager.h index 7377d95b18e0bf..68584ae6ec7bd5 100644 --- a/examples/tv-app/android/include/account-login/AccountLoginManager.h +++ b/examples/tv-app/android/include/account-login/AccountLoginManager.h @@ -18,25 +18,15 @@ #pragma once +#include + #include -#include -#include -#include -class AccountLoginManager +class AccountLoginManager : public chip::app::Clusters::AccountLogin::Delegate { public: - bool isUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin); - bool proxyLogout(); - std::string proxySetupPinRequest(std::string requestTempAccountIdentifier, chip::EndpointId endpoint); - void setTempAccountIdentifierForPin(std::string requestTempAccountIdentifier, std::string requestSetupPin); - - static AccountLoginManager & GetInstance() - { - static AccountLoginManager instance; - return instance; - } - -private: - std::map accounts; + bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString) override; + bool HandleLogout() override; + chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type + HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifierString) override; }; diff --git a/examples/tv-app/android/include/application-basic/ApplicationBasicManager.cpp b/examples/tv-app/android/include/application-basic/ApplicationBasicManager.cpp index 74347e45261bc7..1a979da92efcc7 100644 --- a/examples/tv-app/android/include/application-basic/ApplicationBasicManager.cpp +++ b/examples/tv-app/android/include/application-basic/ApplicationBasicManager.cpp @@ -17,139 +17,49 @@ */ #include "ApplicationBasicManager.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +using namespace std; +using namespace chip::app::Clusters::ApplicationBasic; -using namespace chip; - -CHIP_ERROR ApplicationBasicManager::Init() +chip::CharSpan ApplicationBasicManager::HandleGetVendorName() { - CHIP_ERROR err = CHIP_NO_ERROR; - EndpointConfigurationStorage & endpointConfiguration = EndpointConfigurationStorage::GetInstance(); - err = endpointConfiguration.Init(); - SuccessOrExit(err); - es = &endpointConfiguration; -exit: - return err; + return chip::CharSpan("exampleVendorName1", strlen("exampleVendorName1")); } -void ApplicationBasicManager::store(chip::EndpointId endpoint, Application * application) +uint16_t ApplicationBasicManager::HandleGetVendorId() { - uint8_t bufferMemory[64]; - MutableByteSpan zclString(bufferMemory); - - MakeZclCharString(zclString, application->vendorName); - EmberAfStatus vendorNameStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_VENDOR_NAME_ATTRIBUTE_ID, - zclString.data(), ZCL_CHAR_STRING_ATTRIBUTE_TYPE); - if (vendorNameStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store vendor name attribute."); - } - - EmberAfStatus vendorIdStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_VENDOR_ID_ATTRIBUTE_ID, - (uint8_t *) &application->vendorId, ZCL_INT16U_ATTRIBUTE_TYPE); - if (vendorIdStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store vendor id attribute."); - } - - MakeZclCharString(zclString, application->name); - EmberAfStatus nameStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_NAME_ATTRIBUTE_ID, zclString.data(), - ZCL_CHAR_STRING_ATTRIBUTE_TYPE); - if (nameStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store name attribute."); - } - - MakeZclCharString(zclString, application->version); - EmberAfStatus versionStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_VERSION_ATTRIBUTE_ID, - zclString.data(), ZCL_CHAR_STRING_ATTRIBUTE_TYPE); - if (versionStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store version attribute."); - } - - EmberAfStatus productIdStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_PRODUCT_ID_ATTRIBUTE_ID, - (uint8_t *) &application->productId, ZCL_INT16U_ATTRIBUTE_TYPE); - if (productIdStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store product id attribute."); - } - - EmberAfStatus applicationStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_STATUS_ATTRIBUTE_ID, - (uint8_t *) &application->status, ZCL_ENUM8_ATTRIBUTE_TYPE); - if (applicationStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store status attribute."); - } + return 1; } -Application ApplicationBasicManager::getApplicationForEndpoint(chip::EndpointId endpoint) +chip::CharSpan ApplicationBasicManager::HandleGetApplicationName() { - Application app = {}; - uint16_t size = static_cast(sizeof(app.name)); - - std::string section = "endpoint" + std::to_string(endpoint); - - CHIP_ERROR err = es->get(section, "name", app.name, size); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app name. Error:%s", chip::ErrorStr(err)); - } - - err = es->get(section, "vendorName", app.vendorName, size); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app vendor name. Error:%s", chip::ErrorStr(err)); - } - - err = es->get(section, "id", app.id, size); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app id. Error:%s", chip::ErrorStr(err)); - } + return chip::CharSpan("exampleName1", strlen("exampleName1")); +} - err = es->get(section, "catalogVendorId", app.catalogVendorId); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app catalog vendor id. Error:%s", chip::ErrorStr(err)); - } +uint16_t ApplicationBasicManager::HandleGetProductId() +{ + return 1; +} - err = es->get(section, "productId", app.productId); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app product id. Error:%s", chip::ErrorStr(err)); - } +chip::app::Clusters::ApplicationBasic::Structs::Application::Type ApplicationBasicManager::HandleGetApplication() +{ + chip::app::Clusters::ApplicationBasic::Structs::Application::Type application; + application.catalogVendorId = 123; + application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); + return application; +} - err = es->get(section, "vendorId", app.vendorId); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app vendor id. Error:%s", chip::ErrorStr(err)); - } +ApplicationStatusEnum ApplicationBasicManager::HandleGetStatus() +{ + return ApplicationStatusEnum::kStopped; +} - return app; +chip::CharSpan ApplicationBasicManager::HandleGetApplicationVersion() +{ + return chip::CharSpan("exampleVersion", strlen("exampleVersion")); } -bool applicationBasicClusterChangeApplicationStatus(chip::EndpointId endpoint, - app::Clusters::ApplicationBasic::ApplicationBasicStatus status) +std::list ApplicationBasicManager::HandleGetAllowedVendorList() { - // TODO: Insert code here - ChipLogProgress(Zcl, "Sent an application status change request %d for endpoint %d", to_underlying(status), endpoint); - return true; + return { 123, 456 }; } diff --git a/examples/tv-app/android/include/application-basic/ApplicationBasicManager.h b/examples/tv-app/android/include/application-basic/ApplicationBasicManager.h index d8c8d21a51031a..e907fc8891861e 100644 --- a/examples/tv-app/android/include/application-basic/ApplicationBasicManager.h +++ b/examples/tv-app/android/include/application-basic/ApplicationBasicManager.h @@ -18,26 +18,17 @@ #pragma once -#include -#include +#include -#include "../endpoint-configuration/EndpointConfigurationStorage.h" -#include "Application.h" -#include - -class ApplicationBasicManager +class ApplicationBasicManager : public chip::app::Clusters::ApplicationBasic::Delegate { public: - CHIP_ERROR Init(); - void store(chip::EndpointId endpoint, Application * application); - Application getApplicationForEndpoint(chip::EndpointId endpoint); - - static ApplicationBasicManager & GetInstance() - { - static ApplicationBasicManager instance; - return instance; - } - -private: - EndpointConfigurationStorage * es = nullptr; + chip::CharSpan HandleGetVendorName() override; + uint16_t HandleGetVendorId() override; + chip::CharSpan HandleGetApplicationName() override; + uint16_t HandleGetProductId() override; + chip::app::Clusters::ApplicationBasic::Structs::Application::Type HandleGetApplication() override; + chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum HandleGetStatus() override; + chip::CharSpan HandleGetApplicationVersion() override; + std::list HandleGetAllowedVendorList() override; }; diff --git a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp index 7fb9299c68b271..f6a8afc0ae8ee7 100644 --- a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp +++ b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp @@ -17,67 +17,50 @@ */ #include "ApplicationLauncherManager.h" -#include -#include -#include -#include -#include using namespace std; +using namespace chip::app::Clusters::ApplicationLauncher; -CHIP_ERROR ApplicationLauncherManager::Init() +Structs::ApplicationEP::Type ApplicationLauncherManager::HandleGetCurrentApp() { - CHIP_ERROR err = CHIP_NO_ERROR; - - SuccessOrExit(err); -exit: - return err; + Structs::ApplicationEP::Type currentApp; + currentApp.application.catalogVendorId = 123; + currentApp.application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); + currentApp.endpoint = chip::CharSpan("endpointId", strlen("endpointId")); + return currentApp; } -CHIP_ERROR ApplicationLauncherManager::proxyGetApplicationList(chip::app::AttributeValueEncoder & aEncoder) +std::list ApplicationLauncherManager::HandleGetCatalogList() { - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { - ReturnErrorOnFailure(encoder.Encode(123u)); - ReturnErrorOnFailure(encoder.Encode(456u)); - return CHIP_NO_ERROR; - }); + return { 123, 456 }; } -ApplicationLauncherResponse applicationLauncherClusterLaunchApp(chip::EndpointId endpoint, ApplicationLauncherApp application, - std::string data) +Commands::LauncherResponse::Type ApplicationLauncherManager::HandleLaunchApp( + const chip::CharSpan & data, const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { - // TODO: Insert your code - ApplicationLauncherResponse response; - const char * testData = "data"; - response.data = (uint8_t *) testData; - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS; - // TODO: Update once storing a structure attribute is supported - // emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_LAUNCH_CLUSTER_ID, ZCL_APPLICATION_LAUNCHER_CURRENT_APP_APPLICATION_ID, - // (uint8_t *) &application, ZCL_STRUCT_ATTRIBUTE_TYPE); - + // TODO: Insert code here + Commands::LauncherResponse::Type response; + response.data = chip::CharSpan("data", strlen("data")); + response.status = StatusEnum::kSuccess; return response; } -ApplicationLauncherResponse applicationLauncherClusterStopApp(chip::EndpointId endpoint, ApplicationLauncherApp application, - std::string data) +Commands::LauncherResponse::Type +ApplicationLauncherManager::HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { - ChipLogProgress(Zcl, "ApplicationLauncherManager::applicationLauncherClusterStopApp"); - - ApplicationLauncherResponse response; - const char * testData = "data"; - response.data = (uint8_t *) testData; - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS; + // TODO: Insert code here + Commands::LauncherResponse::Type response; + response.data = chip::CharSpan("data", strlen("data")); + response.status = StatusEnum::kSuccess; return response; } -ApplicationLauncherResponse applicationLauncherClusterHideApp(chip::EndpointId endpoint, ApplicationLauncherApp application, - std::string data) +Commands::LauncherResponse::Type +ApplicationLauncherManager::HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { - ChipLogProgress(Zcl, "ApplicationLauncherManager::applicationLauncherClusterHideApp"); - - ApplicationLauncherResponse response; - const char * testData = "data"; - response.data = (uint8_t *) testData; - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS; + // TODO: Insert code here + Commands::LauncherResponse::Type response; + response.data = chip::CharSpan("data", strlen("data")); + response.status = StatusEnum::kSuccess; return response; } diff --git a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h index 718321e16b5ce0..c01c3e243d66d1 100644 --- a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h +++ b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.h @@ -18,15 +18,20 @@ #pragma once -#include -#include +#include +#include -#include -#include - -class ApplicationLauncherManager +class ApplicationLauncherManager : public chip::app::Clusters::ApplicationLauncher::Delegate { public: - CHIP_ERROR Init(); - CHIP_ERROR proxyGetApplicationList(chip::app::AttributeValueEncoder & aEncoder); + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type HandleGetCurrentApp() override; + std::list HandleGetCatalogList() override; + + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleLaunchApp(const chip::CharSpan & data, + const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; }; diff --git a/examples/tv-app/android/include/audio-output/AudioOutputManager.cpp b/examples/tv-app/android/include/audio-output/AudioOutputManager.cpp index f34c779b468f5d..e3eccf8afa2232 100644 --- a/examples/tv-app/android/include/audio-output/AudioOutputManager.cpp +++ b/examples/tv-app/android/include/audio-output/AudioOutputManager.cpp @@ -18,53 +18,38 @@ #include "AudioOutputManager.h" -#include -#include -#include -#include -#include - -#include -#include - using namespace std; +using namespace chip::app::Clusters::AudioOutput; -CHIP_ERROR AudioOutputManager::Init() +uint8_t AudioOutputManager::HandleGetCurrentOutput() { - CHIP_ERROR err = CHIP_NO_ERROR; - - // TODO: Store feature map once it is supported - map featureMap; - featureMap["NU"] = true; - - return err; + return 0; } -CHIP_ERROR AudioOutputManager::proxyGetListOfAudioOutputInfo(chip::app::AttributeValueEncoder & aEncoder) +std::list AudioOutputManager::HandleGetOutputList() { - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { - // TODO: Insert code here - int maximumVectorSize = 3; - char name[] = "exampleName"; - - for (int i = 0; i < maximumVectorSize; ++i) - { - chip::app::Clusters::AudioOutput::Structs::AudioOutputInfo::Type audioOutputInfo; - audioOutputInfo.outputType = EMBER_ZCL_AUDIO_OUTPUT_TYPE_HDMI; - audioOutputInfo.name = chip::CharSpan(name, sizeof(name) - 1); - audioOutputInfo.index = static_cast(1 + i); - ReturnErrorOnFailure(encoder.Encode(audioOutputInfo)); - } - return CHIP_NO_ERROR; - }); + std::list list; + // TODO: Insert code here + int maximumVectorSize = 3; + + for (int i = 0; i < maximumVectorSize; ++i) + { + chip::app::Clusters::AudioOutput::Structs::OutputInfo::Type outputInfo; + outputInfo.outputType = chip::app::Clusters::AudioOutput::OutputTypeEnum::kHdmi; + outputInfo.name = chip::CharSpan("exampleName", strlen("exampleName")); + outputInfo.index = static_cast(1 + i); + list.push_back(outputInfo); + } + return list; } -bool audioOutputClusterSelectOutput(uint8_t index) +bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) { // TODO: Insert code here return true; } -bool audioOutputClusterRenameOutput(uint8_t index, const chip::CharSpan & name) + +bool AudioOutputManager::HandleSelectOutput(const uint8_t & index) { // TODO: Insert code here return true; diff --git a/examples/tv-app/android/include/audio-output/AudioOutputManager.h b/examples/tv-app/android/include/audio-output/AudioOutputManager.h index 63d455427e68ae..8dcd3ed344fc9a 100644 --- a/examples/tv-app/android/include/audio-output/AudioOutputManager.h +++ b/examples/tv-app/android/include/audio-output/AudioOutputManager.h @@ -18,13 +18,13 @@ #pragma once -#include +#include -#include -#include -class AudioOutputManager +class AudioOutputManager : public chip::app::Clusters::AudioOutput::Delegate { public: - CHIP_ERROR Init(); - CHIP_ERROR proxyGetListOfAudioOutputInfo(chip::app::AttributeValueEncoder & aEncoder); + uint8_t HandleGetCurrentOutput() override; + std::list HandleGetOutputList() override; + bool HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) override; + bool HandleSelectOutput(const uint8_t & index) override; }; diff --git a/examples/tv-app/android/include/cluster-init.cpp b/examples/tv-app/android/include/cluster-init.cpp index 287c7c23cb020c..87eff6e1928a8a 100644 --- a/examples/tv-app/android/include/cluster-init.cpp +++ b/examples/tv-app/android/include/cluster-init.cpp @@ -32,24 +32,11 @@ using namespace chip; namespace { -template -class TvAttrAccess : public app::AttributeAccessInterface -{ -public: - TvAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), AttrTypeInfo::GetClusterId()) {} - - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override - { - if (aPath.mAttributeId == AttrTypeInfo::GetAttributeId()) - { - return (Manager().*Getter)(aEncoder); - } - - return CHIP_NO_ERROR; - } -}; - -} // anonymous namespace +static ApplicationBasicManager applicationBasicManager; +static ApplicationLauncherManager applicationLauncherManager; +static AudioOutputManager audioOutputManager; +static TargetNavigatorManager targetNavigatorManager; +} // namespace /** @brief Application Basic Cluster Init * @@ -62,28 +49,10 @@ class TvAttrAccess : public app::AttributeAccessInterface */ void emberAfApplicationBasicClusterInitCallback(chip::EndpointId endpoint) { - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationBasicManager & aManager = ApplicationBasicManager::GetInstance(); - err = aManager.Init(); - if (CHIP_NO_ERROR == err) - { - Application application = aManager.getApplicationForEndpoint(endpoint); - aManager.store(endpoint, &application); - } - else - { - ChipLogError(Zcl, "Failed to store application for endpoint: %d. Error:%s", endpoint, chip::ErrorStr(err)); - } + ChipLogProgress(Zcl, "TV Linux App: ApplicationBasic::SetDefaultDelegate"); + chip::app::Clusters::ApplicationBasic::SetDefaultDelegate(endpoint, &applicationBasicManager); } -namespace { - -TvAttrAccess - gApplicationLauncherAttrAccess; - -} // anonymous namespace - /** @brief Application Launcher Cluster Init * * This function is called when a specific cluster is initialized. It gives the @@ -95,22 +64,10 @@ TvAttrAccess - gAudioOutputAttrAccess; - -} // anonymous namespace - /** @brief Audio Output Cluster Init * * This function is called when a specific cluster is initialized. It gives the @@ -122,22 +79,10 @@ TvAttrAccess - gTargetNavigatorAttrAccess; - -} // anonymous namespace - /** @brief Target Navigator Cluster Init * * This function is called when a specific cluster is initialized. It gives the @@ -149,10 +94,6 @@ TvAttrAccess -#include -#include -#include -#include -#include - -#include -#include using namespace std; +using namespace chip::app::Clusters::TargetNavigator; -CHIP_ERROR TargetNavigatorManager::Init() +std::list TargetNavigatorManager::HandleGetTargetList() { - CHIP_ERROR err = CHIP_NO_ERROR; - - SuccessOrExit(err); -exit: - return err; + std::list list; + // TODO: Insert code here + int maximumVectorSize = 2; + + for (int i = 0; i < maximumVectorSize; ++i) + { + Structs::TargetInfo::Type outputInfo; + outputInfo.identifier = static_cast(i + 1); + outputInfo.name = chip::CharSpan("exampleName", strlen("exampleName")); + list.push_back(outputInfo); + } + return list; } -CHIP_ERROR TargetNavigatorManager::proxyGetTargetInfoList(chip::app::AttributeValueEncoder & aEncoder) +uint8_t TargetNavigatorManager::HandleGetCurrentTarget() { - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { - // TODO: Insert code here - int maximumVectorSize = 2; - char name[] = "exampleName"; - - for (int i = 0; i < maximumVectorSize; ++i) - { - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::Type targetInfo; - targetInfo.name = chip::CharSpan(name, sizeof(name) - 1); - targetInfo.identifier = static_cast(1 + i); - ReturnErrorOnFailure(encoder.Encode(targetInfo)); - } - return CHIP_NO_ERROR; - }); + return 0; } -TargetNavigatorResponse targetNavigatorClusterNavigateTarget(chip::EndpointId endpointId, uint8_t target, std::string data) +Commands::NavigateTargetResponse::Type TargetNavigatorManager::HandleNavigateTarget(const uint64_t & target, + const chip::CharSpan & data) { // TODO: Insert code here - TargetNavigatorResponse response; - const char * testData = "data response"; - response.data = (uint8_t *) testData; - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS; + Commands::NavigateTargetResponse::Type response; + response.data = chip::CharSpan("data response", strlen("data response")); + response.status = chip::app::Clusters::TargetNavigator::StatusEnum::kSuccess; return response; } diff --git a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h index 2aa604611f740d..7da10ea51448f5 100644 --- a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h +++ b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h @@ -17,15 +17,13 @@ #pragma once -#include +#include -#include -#include -#include - -class TargetNavigatorManager +class TargetNavigatorManager : public chip::app::Clusters::TargetNavigator::Delegate { public: - CHIP_ERROR Init(); - CHIP_ERROR proxyGetTargetInfoList(chip::app::AttributeValueEncoder & aEncoder); + std::list HandleGetTargetList() override; + uint8_t HandleGetCurrentTarget() override; + chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type + HandleNavigateTarget(const uint64_t & target, const chip::CharSpan & data) override; }; diff --git a/examples/tv-app/android/java/TvChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp similarity index 55% rename from examples/tv-app/android/java/TvChannelManager.cpp rename to examples/tv-app/android/java/ChannelManager.cpp index 2115716518b5c5..cd0b2f79fd4a0c 100644 --- a/examples/tv-app/android/java/TvChannelManager.cpp +++ b/examples/tv-app/android/java/ChannelManager.cpp @@ -15,157 +15,37 @@ * limitations under the License. */ -#include "TvChannelManager.h" -#include -#include -#include -#include -#include +#include "ChannelManager.h" #include #include -#include #include #include -#include - -#include -#include -#include using namespace chip; +using namespace chip::app::Clusters::Channel; -TvChannelManager TvChannelManager::sInstance; - -class ChannelInfoAttrAccess : public app::AttributeAccessInterface -{ -public: - ChannelInfoAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), app::Clusters::TvChannel::Id) {} - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override - { - if (aPath.mAttributeId == app::Clusters::TvChannel::Attributes::ChannelList::Id) - { - return TvChannelMgr().getTvChannelList(aEncoder); - } - else if (aPath.mAttributeId == app::Clusters::TvChannel::Attributes::ChannelLineup::Id) - { - return TvChannelMgr().getTvChannelLineup(aEncoder); - } - else if (aPath.mAttributeId == app::Clusters::TvChannel::Attributes::CurrentChannel::Id) - { - return TvChannelMgr().getCurrentTvChannel(aEncoder); - } - - return CHIP_NO_ERROR; - } -}; - -ChannelInfoAttrAccess gTvChannelAttrAccess; - -/** @brief Tv Channel Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ -void emberAfTvChannelClusterInitCallback(EndpointId endpoint) -{ - static bool attrAccessRegistered = false; - if (!attrAccessRegistered) - { - registerAttributeAccessOverride(&gTvChannelAttrAccess); - attrAccessRegistered = true; - } -} - -TvChannelInfo tvChannelClusterChangeChannel(std::string match) -{ - return TvChannelMgr().ChangeChannelByMatch(match); -} - -bool tvChannelClusterChangeChannelByNumber(uint16_t majorNumber, uint16_t minorNumber) -{ - return TvChannelMgr().changeChannelByNumber(majorNumber, minorNumber); -} - -bool tvChannelClusterSkipChannel(uint16_t count) -{ - return TvChannelMgr().skipChannnel(count); -} - -void TvChannelManager::InitializeWithObjects(jobject managerObject) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Failed to GetEnvForCurrentThread for TvChannelManager")); - - mTvChannelManagerObject = env->NewGlobalRef(managerObject); - VerifyOrReturn(mTvChannelManagerObject != nullptr, ChipLogError(Zcl, "Failed to NewGlobalRef TvChannelManager")); - - jclass managerClass = env->GetObjectClass(mTvChannelManagerObject); - VerifyOrReturn(managerClass != nullptr, ChipLogError(Zcl, "Failed to get TvChannelManager Java class")); - - mGetChannelListMethod = env->GetMethodID(managerClass, "getChannelList", "()[Lcom/tcl/chip/tvapp/TvChannelInfo;"); - if (mGetChannelListMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access TvChannelManager 'getChannelList' method"); - env->ExceptionClear(); - } - - mGetLineupMethod = env->GetMethodID(managerClass, "getLineup", "()Lcom/tcl/chip/tvapp/TvChannelLineupInfo;"); - if (mGetLineupMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access TvChannelManager 'getLineup' method"); - env->ExceptionClear(); - } - - mGetCurrentChannelMethod = env->GetMethodID(managerClass, "getCurrentChannel", "()Lcom/tcl/chip/tvapp/TvChannelInfo;"); - if (mGetCurrentChannelMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access TvChannelManager 'getCurrentChannel' method"); - env->ExceptionClear(); - } - - mChangeChannelMethod = - env->GetMethodID(managerClass, "changeChannel", "(Ljava/lang/String;)Lcom/tcl/chip/tvapp/TvChannelInfo;"); - if (mChangeChannelMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access TvChannelManager 'changeChannel' method"); - env->ExceptionClear(); - } - - mchangeChannelByNumberMethod = env->GetMethodID(managerClass, "changeChannelByNumber", "(II)Z"); - if (mchangeChannelByNumberMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access TvChannelManager 'changeChannelByNumber' method"); - env->ExceptionClear(); - } - - mskipChannelMethod = env->GetMethodID(managerClass, "skipChannel", "(I)Z"); - if (mskipChannelMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access TvChannelManager 'skipChannel' method"); - env->ExceptionClear(); - } -} +namespace { +static ChannelManager channelManager; +} // namespace -CHIP_ERROR TvChannelManager::getTvChannelList(chip::app::AttributeValueEncoder & aEncoder) +std::list ChannelManager::HandleGetChannelList() { + std::list list; CHIP_ERROR err = CHIP_NO_ERROR; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received TvChannelManager::getTvChannelList"); - VerifyOrExit(mTvChannelManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + ChipLogProgress(Zcl, "Received ChannelManager::HandleGetChannelList"); + VerifyOrExit(mChannelManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(mGetChannelListMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); - return aEncoder.EncodeList([env, this](const auto & encoder) -> CHIP_ERROR { - jobjectArray channelInfoList = (jobjectArray) env->CallObjectMethod(mTvChannelManagerObject, mGetChannelListMethod); + { + jobjectArray channelInfoList = (jobjectArray) env->CallObjectMethod(mChannelManagerObject, mGetChannelListMethod); jint length = env->GetArrayLength(channelInfoList); + for (jint i = 0; i < length; i++) { - chip::app::Clusters::TvChannel::Structs::TvChannelInfo::Type channelInfo; + chip::app::Clusters::Channel::Structs::ChannelInfo::Type channelInfo; jobject channelObject = env->GetObjectArrayElement(channelInfoList, i); jclass channelClass = env->GetObjectClass(channelObject); @@ -200,33 +80,32 @@ CHIP_ERROR TvChannelManager::getTvChannelList(chip::app::AttributeValueEncoder & jfieldID minorNumField = env->GetFieldID(channelClass, "minorNumber", "I"); jint jminorNum = env->GetIntField(channelObject, minorNumField); channelInfo.majorNumber = static_cast(jminorNum); - ReturnErrorOnFailure(encoder.Encode(channelInfo)); + list.push_back(channelInfo); } - return CHIP_NO_ERROR; - }); + } + exit: if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "TvChannelManager::getTVChannelList status error: %s", err.AsString()); + ChipLogError(Zcl, "ChannelManager::getChannelList status error: %s", err.AsString()); } - return err; + return list; } -CHIP_ERROR TvChannelManager::getTvChannelLineup(chip::app::AttributeValueEncoder & aEncoder) +chip::app::Clusters::Channel::Structs::LineupInfo::Type ChannelManager::HandleGetLineup() { + chip::app::Clusters::Channel::Structs::LineupInfo::Type lineupInfo; CHIP_ERROR err = CHIP_NO_ERROR; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received TvChannelManager::getTvChannelLineup"); - VerifyOrExit(mTvChannelManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + ChipLogProgress(Zcl, "Received ChannelManager::HandleGetLineup"); + VerifyOrExit(mChannelManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(mGetLineupMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); { - chip::app::Clusters::TvChannel::Structs::TvChannelLineupInfo::Type channelLineupInfo; - - jobject channelLineupObject = env->CallObjectMethod(mTvChannelManagerObject, mGetLineupMethod); + jobject channelLineupObject = env->CallObjectMethod(mChannelManagerObject, mGetLineupMethod); jclass channelLineupClazz = env->GetObjectClass(channelLineupObject); jfieldID operatorNameFild = env->GetFieldID(channelLineupClazz, "operatorName", "Ljava/lang/String;"); @@ -234,7 +113,7 @@ CHIP_ERROR TvChannelManager::getTvChannelLineup(chip::app::AttributeValueEncoder if (joperatorName != NULL) { JniUtfString operatorName(env, joperatorName); - channelLineupInfo.operatorName = operatorName.charSpan(); + lineupInfo.operatorName = operatorName.charSpan(); } jfieldID lineupNameFild = env->GetFieldID(channelLineupClazz, "lineupName", "Ljava/lang/String;"); @@ -242,7 +121,7 @@ CHIP_ERROR TvChannelManager::getTvChannelLineup(chip::app::AttributeValueEncoder if (jlineupName != NULL) { JniUtfString lineupName(env, jlineupName); - channelLineupInfo.lineupName = lineupName.charSpan(); + lineupInfo.lineupName = lineupName.charSpan(); } jfieldID postalCodeFild = env->GetFieldID(channelLineupClazz, "postalCode", "Ljava/lang/String;"); @@ -250,40 +129,35 @@ CHIP_ERROR TvChannelManager::getTvChannelLineup(chip::app::AttributeValueEncoder if (jpostalCode != NULL) { JniUtfString postalCode(env, jpostalCode); - channelLineupInfo.postalCode = postalCode.charSpan(); + lineupInfo.postalCode = postalCode.charSpan(); } - jfieldID lineupInfoTypeFild = env->GetFieldID(channelLineupClazz, "lineupInfoType", "I"); - jint jlineupInfoType = (env->GetIntField(channelLineupObject, lineupInfoTypeFild)); - channelLineupInfo.lineupInfoType = static_cast(jlineupInfoType); - - ReturnErrorOnFailure(aEncoder.Encode(channelLineupInfo)); - - return CHIP_NO_ERROR; + jfieldID lineupInfoTypeFild = env->GetFieldID(channelLineupClazz, "lineupInfoTypeEnum", "I"); + jint jlineupInfoType = (env->GetIntField(channelLineupObject, lineupInfoTypeFild)); + lineupInfo.lineupInfoType = static_cast(jlineupInfoType); } exit: if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "TvChannelManager::getTvChannelLineup status error: %s", err.AsString()); + ChipLogError(Zcl, "ChannelManager::getChannelLineup status error: %s", err.AsString()); } - return err; + return lineupInfo; } -CHIP_ERROR TvChannelManager::getCurrentTvChannel(chip::app::AttributeValueEncoder & aEncoder) +chip::app::Clusters::Channel::Structs::ChannelInfo::Type ChannelManager::HandleGetCurrentChannel() { + chip::app::Clusters::Channel::Structs::ChannelInfo::Type channelInfo; CHIP_ERROR err = CHIP_NO_ERROR; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received TvChannelManager::getCurrentTvChannel"); - VerifyOrExit(mTvChannelManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + ChipLogProgress(Zcl, "Received ChannelManager::HandleGetCurrentChannel"); + VerifyOrExit(mChannelManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(mGetCurrentChannelMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); { - chip::app::Clusters::TvChannel::Structs::TvChannelInfo::Type channelInfo; - - jobject channelInfoObject = env->CallObjectMethod(mTvChannelManagerObject, mGetCurrentChannelMethod); + jobject channelInfoObject = env->CallObjectMethod(mChannelManagerObject, mGetCurrentChannelMethod); jclass channelClass = env->GetObjectClass(channelInfoObject); jfieldID getCallSignField = env->GetFieldID(channelClass, "callSign", "Ljava/lang/String;"); @@ -317,40 +191,41 @@ CHIP_ERROR TvChannelManager::getCurrentTvChannel(chip::app::AttributeValueEncode jfieldID minorNumField = env->GetFieldID(channelClass, "minorNumber", "I"); jint jminorNum = env->GetIntField(channelInfoObject, minorNumField); channelInfo.majorNumber = static_cast(jminorNum); - - ReturnErrorOnFailure(aEncoder.Encode(channelInfo)); - return CHIP_NO_ERROR; } exit: if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "TvChannelManager::getTVChannel status error: %s", err.AsString()); + ChipLogError(Zcl, "ChannelManager::HandleGetCurrentChannel status error: %s", err.AsString()); } - return err; + return channelInfo; } -TvChannelInfo TvChannelManager::ChangeChannelByMatch(std::string name) +Commands::ChangeChannelResponse::Type ChannelManager::HandleChangeChannel(const chip::CharSpan & match) { + std::string name(match.data(), match.size()); JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - TvChannelInfo channelInfo{ 0, 0 }; - ChipLogProgress(Zcl, "Received TvChannelManager::ChangeChannelByMatch name %s", name.c_str()); - VerifyOrExit(mTvChannelManagerObject != nullptr, ChipLogError(Zcl, "mTvChannelManagerObject null")); + Commands::ChangeChannelResponse::Type response; + response.channelMatch.majorNumber = 0; + response.channelMatch.minorNumber = 0; + + ChipLogProgress(Zcl, "Received ChannelManager::HandleChangeChannel name %s", name.c_str()); + VerifyOrExit(mChannelManagerObject != nullptr, ChipLogError(Zcl, "mChannelManagerObject null")); VerifyOrExit(mChangeChannelMethod != nullptr, ChipLogError(Zcl, "mChangeChannelMethod null")); VerifyOrExit(env != NULL, ChipLogError(Zcl, "env null")); { UtfString jniname(env, name.c_str()); env->ExceptionClear(); - jobject channelObject = env->CallObjectMethod(mTvChannelManagerObject, mChangeChannelMethod, jniname.jniValue()); + jobject channelObject = env->CallObjectMethod(mChannelManagerObject, mChangeChannelMethod, jniname.jniValue()); if (env->ExceptionCheck()) { - ChipLogError(DeviceLayer, "Java exception in TvChannelManager::ChangeChannelByMatch"); + ChipLogError(DeviceLayer, "Java exception in ChannelManager::HandleChangeChannel"); env->ExceptionDescribe(); env->ExceptionClear(); - return channelInfo; + return response; } jclass channelClass = env->GetObjectClass(channelObject); @@ -360,7 +235,7 @@ TvChannelInfo TvChannelManager::ChangeChannelByMatch(std::string name) if (jcallSign != NULL) { JniUtfString callsign(env, jcallSign); - channelInfo.callSign = callsign.charSpan(); + response.channelMatch.callSign = callsign.charSpan(); } jfieldID getNameField = env->GetFieldID(channelClass, "name", "Ljava/lang/String;"); @@ -368,47 +243,48 @@ TvChannelInfo TvChannelManager::ChangeChannelByMatch(std::string name) if (jname != NULL) { JniUtfString junitname(env, jname); - channelInfo.callSign = junitname.charSpan(); + response.channelMatch.callSign = junitname.charSpan(); } jfieldID getJaffiliateCallSignField = env->GetFieldID(channelClass, "affiliateCallSign", "Ljava/lang/String;"); jstring jaffiliateCallSign = static_cast(env->GetObjectField(channelObject, getJaffiliateCallSignField)); if (jaffiliateCallSign != NULL) { JniUtfString affiliateCallSign(env, jaffiliateCallSign); - channelInfo.callSign = affiliateCallSign.charSpan(); + response.channelMatch.callSign = affiliateCallSign.charSpan(); } - jfieldID majorNumField = env->GetFieldID(channelClass, "majorNumber", "I"); - jint jmajorNum = env->GetIntField(channelObject, majorNumField); - channelInfo.majorNumber = static_cast(jmajorNum); + jfieldID majorNumField = env->GetFieldID(channelClass, "majorNumber", "I"); + jint jmajorNum = env->GetIntField(channelObject, majorNumField); + response.channelMatch.majorNumber = static_cast(jmajorNum); - jfieldID minorNumField = env->GetFieldID(channelClass, "minorNumber", "I"); - jint jminorNum = env->GetIntField(channelObject, minorNumField); - channelInfo.majorNumber = static_cast(jminorNum); + jfieldID minorNumField = env->GetFieldID(channelClass, "minorNumber", "I"); + jint jminorNum = env->GetIntField(channelObject, minorNumField); + response.channelMatch.majorNumber = static_cast(jminorNum); } exit: - return channelInfo; + + return response; } -bool TvChannelManager::changeChannelByNumber(uint16_t majorNumber, uint16_t minorNumber) +bool ChannelManager::HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received TvChannelManager::tvChannelClusterChangeChannelByNumber majorNumber %d, minorNumber %d", - majorNumber, minorNumber); - VerifyOrExit(mTvChannelManagerObject != nullptr, ChipLogError(Zcl, "mTvChannelManagerObject null")); - VerifyOrExit(mchangeChannelByNumberMethod != nullptr, ChipLogError(Zcl, "mchangeChannelByNumberMethod null")); + ChipLogProgress(Zcl, "Received ChannelManager::HandleChangeChannelByNumber majorNumber %d, minorNumber %d", majorNumber, + minorNumber); + VerifyOrExit(mChannelManagerObject != nullptr, ChipLogError(Zcl, "mChannelManagerObject null")); + VerifyOrExit(mChangeChannelByNumberMethod != nullptr, ChipLogError(Zcl, "mChangeChannelByNumberMethod null")); VerifyOrExit(env != NULL, ChipLogError(Zcl, "env null")); env->ExceptionClear(); - ret = env->CallBooleanMethod(mTvChannelManagerObject, mchangeChannelByNumberMethod, static_cast(majorNumber), + ret = env->CallBooleanMethod(mChannelManagerObject, mChangeChannelByNumberMethod, static_cast(majorNumber), static_cast(minorNumber)); if (env->ExceptionCheck()) { - ChipLogError(DeviceLayer, "Java exception in TvChannelManager::changeChannelByNumber"); + ChipLogError(DeviceLayer, "Java exception in ChannelManager::changeChannelByNumber"); env->ExceptionDescribe(); env->ExceptionClear(); return false; @@ -418,22 +294,22 @@ bool TvChannelManager::changeChannelByNumber(uint16_t majorNumber, uint16_t mino return static_cast(ret); } -bool TvChannelManager::skipChannnel(uint16_t count) +bool ChannelManager::HandleSkipChannel(const uint16_t & count) { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received TvChannelManager::skipChannnel count %d", count); - VerifyOrExit(mTvChannelManagerObject != nullptr, ChipLogError(Zcl, "mTvChannelManagerObject null")); - VerifyOrExit(mskipChannelMethod != nullptr, ChipLogError(Zcl, "mskipChannelMethod null")); + ChipLogProgress(Zcl, "Received ChannelManager::HandleSkipChannel count %d", count); + VerifyOrExit(mChannelManagerObject != nullptr, ChipLogError(Zcl, "mChannelManagerObject null")); + VerifyOrExit(mSkipChannelMethod != nullptr, ChipLogError(Zcl, "mSkipChannelMethod null")); VerifyOrExit(env != NULL, ChipLogError(Zcl, "env null")); env->ExceptionClear(); - ret = env->CallBooleanMethod(mTvChannelManagerObject, mskipChannelMethod, static_cast(count)); + ret = env->CallBooleanMethod(mChannelManagerObject, mSkipChannelMethod, static_cast(count)); if (env->ExceptionCheck()) { - ChipLogError(DeviceLayer, "Java exception in TvChannelManager::SkipChannel"); + ChipLogError(DeviceLayer, "Java exception in ChannelManager::HandleSkipChannel"); env->ExceptionDescribe(); env->ExceptionClear(); return false; @@ -442,3 +318,74 @@ bool TvChannelManager::skipChannnel(uint16_t count) exit: return static_cast(ret); } + +void ChannelManager::InitializeWithObjects(jobject managerObject) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Failed to GetEnvForCurrentThread for ChannelManager")); + + mChannelManagerObject = env->NewGlobalRef(managerObject); + VerifyOrReturn(mChannelManagerObject != nullptr, ChipLogError(Zcl, "Failed to NewGlobalRef ChannelManager")); + + jclass managerClass = env->GetObjectClass(mChannelManagerObject); + VerifyOrReturn(managerClass != nullptr, ChipLogError(Zcl, "Failed to get ChannelManager Java class")); + + mGetChannelListMethod = env->GetMethodID(managerClass, "getChannelList", "()[Lcom/tcl/chip/tvapp/ChannelInfo;"); + if (mGetChannelListMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access ChannelManager 'getChannelList' method"); + env->ExceptionClear(); + } + + mGetLineupMethod = env->GetMethodID(managerClass, "getLineup", "()Lcom/tcl/chip/tvapp/ChannelLineupInfo;"); + if (mGetLineupMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access ChannelManager 'getLineup' method"); + env->ExceptionClear(); + } + + mGetCurrentChannelMethod = env->GetMethodID(managerClass, "getCurrentChannel", "()Lcom/tcl/chip/tvapp/ChannelInfo;"); + if (mGetCurrentChannelMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access ChannelManager 'getCurrentChannel' method"); + env->ExceptionClear(); + } + + mChangeChannelMethod = env->GetMethodID(managerClass, "changeChannel", "(Ljava/lang/String;)Lcom/tcl/chip/tvapp/ChannelInfo;"); + if (mChangeChannelMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access ChannelManager 'changeChannel' method"); + env->ExceptionClear(); + } + + mChangeChannelByNumberMethod = env->GetMethodID(managerClass, "changeChannelByNumber", "(II)Z"); + if (mChangeChannelByNumberMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access ChannelManager 'changeChannelByNumber' method"); + env->ExceptionClear(); + } + + mSkipChannelMethod = env->GetMethodID(managerClass, "skipChannel", "(I)Z"); + if (mSkipChannelMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access ChannelManager 'skipChannel' method"); + env->ExceptionClear(); + } +} + +ChannelManager ChannelManager::sInstance; + +/** @brief Channel Cluster Init + * + * This function is called when a specific cluster is initialized. It gives the + * application an opportunity to take care of cluster initialization procedures. + * It is called exactly once for each endpoint where cluster is present. + * + * @param endpoint Ver.: always + * + */ +void emberAfChannelClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Android App: Channel::SetDefaultDelegate"); + chip::app::Clusters::Channel::SetDefaultDelegate(endpoint, &channelManager); +} diff --git a/examples/tv-app/android/java/ChannelManager.h b/examples/tv-app/android/java/ChannelManager.h new file mode 100644 index 00000000000000..0ed1659d7e51e8 --- /dev/null +++ b/examples/tv-app/android/java/ChannelManager.h @@ -0,0 +1,53 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +class ChannelManager : public chip::app::Clusters::Channel::Delegate +{ +public: + void InitializeWithObjects(jobject managerObject); + + std::list HandleGetChannelList() override; + chip::app::Clusters::Channel::Structs::LineupInfo::Type HandleGetLineup() override; + chip::app::Clusters::Channel::Structs::ChannelInfo::Type HandleGetCurrentChannel() override; + + chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Type HandleChangeChannel(const chip::CharSpan & match) override; + bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) override; + bool HandleSkipChannel(const uint16_t & count) override; + +private: + friend ChannelManager & ChannelMgr(); + + static ChannelManager sInstance; + jobject mChannelManagerObject = nullptr; + jmethodID mGetChannelListMethod = nullptr; + jmethodID mGetLineupMethod = nullptr; + jmethodID mGetCurrentChannelMethod = nullptr; + + jmethodID mChangeChannelMethod = nullptr; + jmethodID mChangeChannelByNumberMethod = nullptr; + jmethodID mSkipChannelMethod = nullptr; +}; + +inline class ChannelManager & ChannelMgr() +{ + return ChannelManager::sInstance; +} diff --git a/examples/tv-app/android/java/ContentLauncherManager.cpp b/examples/tv-app/android/java/ContentLauncherManager.cpp index 9f7233f50c961b..4298fe24c1d364 100644 --- a/examples/tv-app/android/java/ContentLauncherManager.cpp +++ b/examples/tv-app/android/java/ContentLauncherManager.cpp @@ -18,235 +18,33 @@ #include "ContentLauncherManager.h" -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include #include #include #include -#include -#include #include #include -#include using namespace std; using namespace chip; +using namespace chip::app::Clusters::ContentLauncher; ContentLauncherManager ContentLauncherManager::sInstance; namespace { +static ContentLauncherManager contentLauncherManager; +} // namespace -class ContentLauncherAttrAccess : public app::AttributeAccessInterface -{ -public: - ContentLauncherAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), app::Clusters::ContentLauncher::Id) - {} - - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override - { - if (aPath.mAttributeId == app::Clusters::ContentLauncher::Attributes::AcceptsHeaderList::Id) - { - return ContentLauncherMgr().GetAcceptsHeader(aEncoder); - } - else if (aPath.mAttributeId == app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::Id) - { - return ContentLauncherMgr().GetSupportedStreamingTypes(aEncoder); - } - - return CHIP_NO_ERROR; - } -}; - -ContentLauncherAttrAccess gContentLauncherAttrAccess; - -} // anonymous namespace - -/** @brief Content Launch Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ void emberAfContentLauncherClusterInitCallback(EndpointId endpoint) { - static bool attrAccessRegistered = false; - if (!attrAccessRegistered) - { - registerAttributeAccessOverride(&gContentLauncherAttrAccess); - attrAccessRegistered = true; - } -} - -ContentLaunchResponse contentLauncherClusterLaunchContent(chip::EndpointId endpointId, - std::list parameterList, bool autoplay, - const chip::CharSpan & data) -{ - return ContentLauncherMgr().LaunchContent(endpointId, parameterList, autoplay, data); -} - -ContentLaunchResponse contentLauncherClusterLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, - ContentLaunchBrandingInformation & brandingInformation) -{ - return ContentLauncherMgr().LaunchUrl(contentUrl, displayString, brandingInformation); + ChipLogProgress(Zcl, "TV Linux App: ContentLauncher::SetDelegate"); + chip::app::Clusters::ContentLauncher::SetDelegate(endpoint, &contentLauncherManager); } -void ContentLauncherManager::InitializeWithObjects(jobject managerObject) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Failed to GetEnvForCurrentThread for ContentLauncherManager")); - - mContentLauncherManagerObject = env->NewGlobalRef(managerObject); - VerifyOrReturn(mContentLauncherManagerObject != nullptr, ChipLogError(Zcl, "Failed to NewGlobalRef ContentLauncherManager")); - - jclass ContentLauncherClass = env->GetObjectClass(managerObject); - VerifyOrReturn(ContentLauncherClass != nullptr, ChipLogError(Zcl, "Failed to get ContentLauncherManager Java class")); - - mGetAcceptsHeaderMethod = env->GetMethodID(ContentLauncherClass, "getAcceptsHeader", "()[Ljava/lang/String;"); - if (mGetAcceptsHeaderMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access MediaInputManager 'getInputList' method"); - env->ExceptionClear(); - } - - mGetSupportedStreamingTypesMethod = env->GetMethodID(ContentLauncherClass, "getSupportedStreamingTypes", "()[I"); - if (mGetSupportedStreamingTypesMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access MediaInputManager 'getSupportedStreamingTypes' method"); - env->ExceptionClear(); - } - - mLaunchContentMethod = env->GetMethodID( - ContentLauncherClass, "launchContent", - "([Lcom/tcl/chip/tvapp/ContentLaunchSearchParameter;ZLjava/lang/String;)Lcom/tcl/chip/tvapp/ContentLaunchResponse;"); - if (mLaunchContentMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access MediaInputManager 'launchContent' method"); - env->ExceptionClear(); - } - - mLaunchUrlMethod = env->GetMethodID(ContentLauncherClass, "launchUrl", - "(Ljava/lang/String;Ljava/lang/String;Lcom/tcl/chip/tvapp/" - "ContentLaunchBrandingInformation;)Lcom/tcl/chip/tvapp/ContentLaunchResponse;"); - if (mLaunchUrlMethod == nullptr) - { - ChipLogError(AppServer, "Failed to access 'launchUrl' method"); - env->ExceptionClear(); - } -} - -CHIP_ERROR ContentLauncherManager::GetAcceptsHeader(chip::app::AttributeValueEncoder & aEncoder) +Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchContent(chip::EndpointId endpointId, + const std::list & parameterList, + bool autoplay, const chip::CharSpan & data) { - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - ChipLogProgress(Zcl, "Received ContentLauncherManager::GetAcceptsHeader"); - VerifyOrExit(mContentLauncherManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mGetAcceptsHeaderMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); - - return aEncoder.EncodeList([this, env](const auto & encoder) -> CHIP_ERROR { - jobjectArray headersArray = (jobjectArray) env->CallObjectMethod(mContentLauncherManagerObject, mGetAcceptsHeaderMethod); - if (env->ExceptionCheck()) - { - ChipLogError(Zcl, "Java exception in ContentLauncherManager::GetAcceptsHeader"); - env->ExceptionDescribe(); - env->ExceptionClear(); - return CHIP_ERROR_INCORRECT_STATE; - } - - jint size = env->GetArrayLength(headersArray); - for (int i = 0; i < size; i++) - { - jstring acceptsheader = (jstring) env->GetObjectArrayElement(headersArray, i); - if (acceptsheader != nullptr) - { - JniUtfString header(env, acceptsheader); - - chip::ByteSpan bHeader((const uint8_t *) (header.c_str()), (size_t)(header.size())); - ReturnErrorOnFailure(encoder.Encode(bHeader)); - - // Todo: should be chanSpan? - // ReturnErrorOnFailure(encoder.Encode(header.charSpan())); - } - } - - return CHIP_NO_ERROR; - }); - -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "ContentLauncherManager::GetAcceptsHeader status error: %s", err.AsString()); - } - - return err; -} - -CHIP_ERROR ContentLauncherManager::GetSupportedStreamingTypes(chip::app::AttributeValueEncoder & aEncoder) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - - ChipLogProgress(Zcl, "Received ContentLauncherManager::GetSupportedStreamingTypes"); - VerifyOrExit(mContentLauncherManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mGetSupportedStreamingTypesMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); - - return aEncoder.EncodeList([this, env](const auto & encoder) -> CHIP_ERROR { - jintArray typesArray = (jintArray) env->CallObjectMethod(mContentLauncherManagerObject, mGetSupportedStreamingTypesMethod); - if (env->ExceptionCheck()) - { - ChipLogError(Zcl, "Java exception in ContentLauncherManager::GetSupportedStreamingTypes"); - env->ExceptionDescribe(); - env->ExceptionClear(); - return CHIP_ERROR_INCORRECT_STATE; - } - - jboolean isCopy = JNI_FALSE; - jint * ptypes = env->GetIntArrayElements(typesArray, &isCopy); - jint size = env->GetArrayLength(typesArray); - - CHIP_ERROR err = CHIP_NO_ERROR; - for (int i = 0; i < size; i++) - { - err = encoder.Encode(static_cast(ptypes[i])); - if (err != CHIP_NO_ERROR) - { - break; - } - } - env->ReleaseIntArrayElements(typesArray, ptypes, 0); - return err; - }); - -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "ContentLauncherManager::GetAcceptsHeader status error: %s", err.AsString()); - } - - return err; -} - -ContentLaunchResponse ContentLauncherManager::LaunchContent(chip::EndpointId endpointId, - std::list parameterList, bool autoplay, - const chip::CharSpan & data) -{ - ContentLaunchResponse response; + Commands::LaunchResponse::Type response; CHIP_ERROR err = CHIP_NO_ERROR; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -283,12 +81,11 @@ ContentLaunchResponse ContentLauncherManager::LaunchContent(chip::EndpointId end jstring jdataStr = (jstring) env->GetObjectField(resp, dataFid); JniUtfString dataStr(env, jdataStr); - response.status = static_cast(status); + response.status = static_cast(status); response.data = dataStr.charSpan(); } exit: - response.err = err; if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "ContentLauncherManager::LaunchContent status error: %s", err.AsString()); @@ -297,10 +94,11 @@ ContentLaunchResponse ContentLauncherManager::LaunchContent(chip::EndpointId end return response; } -ContentLaunchResponse ContentLauncherManager::LaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, - ContentLaunchBrandingInformation & brandingInformation) +Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl, + const chip::CharSpan & displayString, + const std::list & brandingInformation) { - ContentLaunchResponse response; + Commands::LaunchResponse::Type response; CHIP_ERROR err = CHIP_NO_ERROR; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -338,12 +136,11 @@ ContentLaunchResponse ContentLauncherManager::LaunchUrl(const chip::CharSpan & c jstring jdataStr = (jstring) env->GetObjectField(resp, dataFid); JniUtfString dataStr(env, jdataStr); - response.status = static_cast(status); + response.status = static_cast(status); response.data = dataStr.charSpan(); } exit: - response.err = err; if (err != CHIP_NO_ERROR) { ChipLogError(Zcl, "ContentLauncherManager::LaunchUrl status error: %s", err.AsString()); @@ -351,3 +148,124 @@ ContentLaunchResponse ContentLauncherManager::LaunchUrl(const chip::CharSpan & c return response; } + +std::list ContentLauncherManager::HandleGetAcceptHeaderList() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + std::list acceptedHeadersList; + + ChipLogProgress(Zcl, "Received ContentLauncherManager::GetAcceptHeader"); + VerifyOrExit(mContentLauncherManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrExit(mGetAcceptHeaderMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); + + { + jobjectArray acceptedHeadersArray = + (jobjectArray) env->CallObjectMethod(mContentLauncherManagerObject, mGetAcceptHeaderMethod); + if (env->ExceptionCheck()) + { + ChipLogError(Zcl, "Java exception in ContentLauncherManager::GetAcceptHeader"); + env->ExceptionDescribe(); + env->ExceptionClear(); + err = CHIP_ERROR_INCORRECT_STATE; + goto exit; + } + + jint size = env->GetArrayLength(acceptedHeadersArray); + for (int i = 0; i < size; i++) + { + + jstring jAcceptedHeader = (jstring) env->GetObjectArrayElement(acceptedHeadersArray, i); + const char * convertedValue = (env)->GetStringUTFChars(jAcceptedHeader, JNI_FALSE); + std::string acceptedHeader = std::string(convertedValue, strlen(convertedValue)); + acceptedHeadersList.push_front(acceptedHeader); + } + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "ContentLauncherManager::GetAcceptHeader status error: %s", err.AsString()); + } + + return acceptedHeadersList; +} + +uint32_t ContentLauncherManager::HandleGetSupportedStreamingProtocols() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + uint32_t supportedStreamingProtocols = 0; + + ChipLogProgress(Zcl, "Received ContentLauncherManager::GetSupportedStreamingProtocols"); + VerifyOrExit(mContentLauncherManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrExit(mGetSupportedStreamingProtocolsMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); + + { + jint jSupportedStreamingProtocols = + env->CallIntMethod(mContentLauncherManagerObject, mGetSupportedStreamingProtocolsMethod); + supportedStreamingProtocols = (uint32_t) jSupportedStreamingProtocols; + if (env->ExceptionCheck()) + { + ChipLogError(Zcl, "Java exception in ContentLauncherManager::GetAcceptHeader"); + env->ExceptionDescribe(); + env->ExceptionClear(); + err = CHIP_ERROR_INCORRECT_STATE; + goto exit; + } + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "ContentLauncherManager::GetSupportedStreamingProtocols status error: %s", err.AsString()); + } + + return supportedStreamingProtocols; +} + +void ContentLauncherManager::InitializeWithObjects(jobject managerObject) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Failed to GetEnvForCurrentThread for ContentLauncherManager")); + + mContentLauncherManagerObject = env->NewGlobalRef(managerObject); + VerifyOrReturn(mContentLauncherManagerObject != nullptr, ChipLogError(Zcl, "Failed to NewGlobalRef ContentLauncherManager")); + + jclass ContentLauncherClass = env->GetObjectClass(managerObject); + VerifyOrReturn(ContentLauncherClass != nullptr, ChipLogError(Zcl, "Failed to get ContentLauncherManager Java class")); + + mGetAcceptHeaderMethod = env->GetMethodID(ContentLauncherClass, "getAcceptHeader", "()[Ljava/lang/String;"); + if (mGetAcceptHeaderMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access ContentLauncherManager 'getInputList' method"); + env->ExceptionClear(); + } + + mGetSupportedStreamingProtocolsMethod = env->GetMethodID(ContentLauncherClass, "getSupportedStreamingProtocols", "()[I"); + if (mGetSupportedStreamingProtocolsMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access ContentLauncherManager 'getSupportedStreamingProtocols' method"); + env->ExceptionClear(); + } + + mLaunchContentMethod = env->GetMethodID( + ContentLauncherClass, "launchContent", + "([Lcom/tcl/chip/tvapp/ContentLaunchSearchParameter;ZLjava/lang/String;)Lcom/tcl/chip/tvapp/LaunchResponse;"); + if (mLaunchContentMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access ContentLauncherManager 'launchContent' method"); + env->ExceptionClear(); + } + + mLaunchUrlMethod = env->GetMethodID(ContentLauncherClass, "launchUrl", + "(Ljava/lang/String;Ljava/lang/String;Lcom/tcl/chip/tvapp/" + "ContentLaunchBrandingInformation;)Lcom/tcl/chip/tvapp/LaunchResponse;"); + if (mLaunchUrlMethod == nullptr) + { + ChipLogError(AppServer, "Failed to access 'launchUrl' method"); + env->ExceptionClear(); + } +} diff --git a/examples/tv-app/android/java/ContentLauncherManager.h b/examples/tv-app/android/java/ContentLauncherManager.h index 01b843530a2e77..8ef2bc0fa8287d 100644 --- a/examples/tv-app/android/java/ContentLauncherManager.h +++ b/examples/tv-app/android/java/ContentLauncherManager.h @@ -26,26 +26,29 @@ #include #include -class ContentLauncherManager +class ContentLauncherManager : public chip::app::Clusters::ContentLauncher::Delegate { public: void InitializeWithObjects(jobject managerObject); - CHIP_ERROR GetAcceptsHeader(chip::app::AttributeValueEncoder & aEncoder); - CHIP_ERROR GetSupportedStreamingTypes(chip::app::AttributeValueEncoder & aEncoder); - ContentLaunchResponse LaunchContent(chip::EndpointId endpointId, std::list parameterList, bool autoplay, - const chip::CharSpan & data); - ContentLaunchResponse LaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, - ContentLaunchBrandingInformation & brandingInformation); + + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type + HandleLaunchContent(chip::EndpointId endpointId, const std::list & parameterList, bool autoplay, + const chip::CharSpan & data) override; + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type + HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, + const std::list & brandingInformation) override; + std::list HandleGetAcceptHeaderList() override; + uint32_t HandleGetSupportedStreamingProtocols() override; private: friend ContentLauncherManager & ContentLauncherMgr(); static ContentLauncherManager sInstance; - jobject mContentLauncherManagerObject = nullptr; - jmethodID mGetAcceptsHeaderMethod = nullptr; - jmethodID mGetSupportedStreamingTypesMethod = nullptr; - jmethodID mLaunchContentMethod = nullptr; - jmethodID mLaunchUrlMethod = nullptr; + jobject mContentLauncherManagerObject = nullptr; + jmethodID mGetAcceptHeaderMethod = nullptr; + jmethodID mGetSupportedStreamingProtocolsMethod = nullptr; + jmethodID mLaunchContentMethod = nullptr; + jmethodID mLaunchUrlMethod = nullptr; }; inline ContentLauncherManager & ContentLauncherMgr() diff --git a/examples/tv-app/android/java/KeypadInputManager.cpp b/examples/tv-app/android/java/KeypadInputManager.cpp index acb6878ff20d37..40dc3a31132ad2 100644 --- a/examples/tv-app/android/java/KeypadInputManager.cpp +++ b/examples/tv-app/android/java/KeypadInputManager.cpp @@ -17,29 +17,28 @@ */ #include "KeypadInputManager.h" -#include -#include -#include + #include -#include #include using namespace chip; +using namespace chip::app::Clusters::KeypadInput; KeypadInputManager KeypadInputManager::sInstance; -EmberAfKeypadInputStatus keypadInputClusterSendKey(EmberAfKeypadInputCecKeyCode keyCode) -{ - return KeypadInputMgr().SendKey(keyCode); -} +namespace { +static KeypadInputManager keypadInputManager; +} // namespace -EmberAfKeypadInputStatus KeypadInputManager::SendKey(EmberAfKeypadInputCecKeyCode keyCode) +Commands::SendKeyResponse::Type KeypadInputManager::HandleSendKey(const CecKeyCode & keyCode) { + Commands::SendKeyResponse::Type response; + jint ret = -1; CHIP_ERROR err = CHIP_NO_ERROR; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received keypadInputClusterSendKey: %d", keyCode); + ChipLogProgress(Zcl, "Received keypadInputClusterSendKey: %c", to_underlying(keyCode)); VerifyOrExit(mKeypadInputManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(mSendKeyMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); @@ -51,10 +50,13 @@ EmberAfKeypadInputStatus KeypadInputManager::SendKey(EmberAfKeypadInputCecKeyCod exit: if (err != CHIP_NO_ERROR) { - return EMBER_ZCL_KEYPAD_INPUT_STATUS_SUCCESS; + response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess; } - - return static_cast(ret); + else + { + response.status = static_cast(ret); + } + return response; } void KeypadInputManager::InitializeWithObjects(jobject managerObject) @@ -75,3 +77,9 @@ void KeypadInputManager::InitializeWithObjects(jobject managerObject) env->ExceptionClear(); } } + +void emberAfKeypadInputClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Android App: KeypadInput::SetDefaultDelegate"); + chip::app::Clusters::KeypadInput::SetDefaultDelegate(endpoint, &keypadInputManager); +} diff --git a/examples/tv-app/android/java/KeypadInputManager.h b/examples/tv-app/android/java/KeypadInputManager.h index 44a91cea66180d..cb90df01c04e28 100644 --- a/examples/tv-app/android/java/KeypadInputManager.h +++ b/examples/tv-app/android/java/KeypadInputManager.h @@ -18,15 +18,15 @@ #pragma once -#include +#include #include -#include -class KeypadInputManager +class KeypadInputManager : public chip::app::Clusters::KeypadInput::Delegate { public: void InitializeWithObjects(jobject managerObject); - EmberAfKeypadInputStatus SendKey(EmberAfKeypadInputCecKeyCode keyCode); + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Type + HandleSendKey(const chip::app::Clusters::KeypadInput::CecKeyCode & keyCode) override; private: friend KeypadInputManager & KeypadInputMgr(); diff --git a/examples/tv-app/android/java/LowPowerManager.cpp b/examples/tv-app/android/java/LowPowerManager.cpp index 52dd0b7586d5a8..741c0e6437d82e 100644 --- a/examples/tv-app/android/java/LowPowerManager.cpp +++ b/examples/tv-app/android/java/LowPowerManager.cpp @@ -24,13 +24,13 @@ #include using namespace chip; +using namespace chip::app::Clusters::LowPower; LowPowerManager LowPowerManager::sInstance; -bool lowPowerClusterSleep() -{ - return LowPowerMgr().Sleep(); -} +namespace { +static LowPowerManager lowPowerManager; +} // namespace void LowPowerManager::InitializeWithObjects(jobject managerObject) { @@ -51,7 +51,7 @@ void LowPowerManager::InitializeWithObjects(jobject managerObject) } } -bool LowPowerManager::Sleep() +bool LowPowerManager::HandleSleep() { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -74,3 +74,9 @@ bool LowPowerManager::Sleep() exit: return static_cast(ret); } + +void emberAfLowPowerClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Android App: LowPower::SetDefaultDelegate"); + chip::app::Clusters::LowPower::SetDefaultDelegate(endpoint, &lowPowerManager); +} diff --git a/examples/tv-app/android/java/LowPowerManager.h b/examples/tv-app/android/java/LowPowerManager.h index 6602136b914428..24e00fe8f2bd54 100644 --- a/examples/tv-app/android/java/LowPowerManager.h +++ b/examples/tv-app/android/java/LowPowerManager.h @@ -18,14 +18,16 @@ #pragma once +#include + #include #include -class LowPowerManager +class LowPowerManager : public chip::app::Clusters::LowPower::Delegate { public: void InitializeWithObjects(jobject managerObject); - bool Sleep(); + bool HandleSleep() override; private: friend LowPowerManager & LowPowerMgr(); diff --git a/examples/tv-app/android/java/MediaInputManager.cpp b/examples/tv-app/android/java/MediaInputManager.cpp index 2a8ad6402be785..6ee85c2e259074 100644 --- a/examples/tv-app/android/java/MediaInputManager.cpp +++ b/examples/tv-app/android/java/MediaInputManager.cpp @@ -16,43 +16,20 @@ */ #include "MediaInputManager.h" -#include -#include -#include -#include + +#include #include -#include #include #include -#include -#include -#include using namespace chip; +using namespace chip::app::Clusters::MediaInput; MediaInputManager MediaInputManager::sInstance; -class MediaInputAttrAccess : public app::AttributeAccessInterface -{ -public: - MediaInputAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), app::Clusters::MediaInput::Id) {} - - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override - { - if (aPath.mAttributeId == app::Clusters::MediaInput::Attributes::MediaInputList::Id) - { - return MediaInputMgr().GetInputList(aEncoder); - } - else if (aPath.mAttributeId == app::Clusters::MediaInput::Attributes::CurrentMediaInput::Id) - { - return MediaInputMgr().GetCurrentInput(aEncoder); - } - - return CHIP_NO_ERROR; - } -}; - -MediaInputAttrAccess gMediaInputAttrAccess; +namespace { +static MediaInputManager mediaInputManager; +} // namespace /** @brief Media Input Cluster Init * @@ -65,58 +42,35 @@ MediaInputAttrAccess gMediaInputAttrAccess; */ void emberAfMediaInputClusterInitCallback(EndpointId endpoint) { - static bool attrAccessRegistered = false; - if (!attrAccessRegistered) - { - registerAttributeAccessOverride(&gMediaInputAttrAccess); - attrAccessRegistered = true; - } -} - -bool mediaInputClusterSelectInput(uint8_t input) -{ - return MediaInputMgr().SelectInput(input); + ChipLogProgress(Zcl, "TV Android App: MediaInput::SetDefaultDelegate"); + chip::app::Clusters::MediaInput::SetDefaultDelegate(endpoint, &mediaInputManager); } -bool mediaInputClusterShowInputStatus() -{ - return MediaInputMgr().ShowInputStatus(); -} - -bool mediaInputClusterHideInputStatus() -{ - return MediaInputMgr().HideInputStatus(); -} - -bool mediaInputClusterRenameInput(uint8_t input, std::string name) -{ - return MediaInputMgr().RenameInput(input, name); -} - -CHIP_ERROR MediaInputManager::GetInputList(app::AttributeValueEncoder & aEncoder) +std::list MediaInputManager::HandleGetInputList() { + std::list list; CHIP_ERROR err = CHIP_NO_ERROR; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received MediaInputManager::GetInputList"); + ChipLogProgress(Zcl, "Received MediaInputManager::HandleGetInputList"); VerifyOrExit(mMediaInputManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(mGetInputListMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); - return aEncoder.EncodeList([this, env](const auto & encoder) -> CHIP_ERROR { + { jobjectArray inputArray = (jobjectArray) env->CallObjectMethod(mMediaInputManagerObject, mGetInputListMethod); if (env->ExceptionCheck()) { - ChipLogError(AppServer, "Java exception in MediaInputManager::GetInputList"); + ChipLogError(AppServer, "Java exception in MediaInputManager::HandleGetInputList"); env->ExceptionDescribe(); env->ExceptionClear(); - return CHIP_ERROR_INCORRECT_STATE; + return list; } jint size = env->GetArrayLength(inputArray); for (int i = 0; i < size; i++) { - app::Clusters::MediaInput::Structs::MediaInputInfo::Type mediaInput; + app::Clusters::MediaInput::Structs::InputInfo::Type mediaInput; jobject inputObj = env->GetObjectArrayElement(inputArray, i); jclass inputClass = env->GetObjectClass(inputObj); @@ -127,7 +81,7 @@ CHIP_ERROR MediaInputManager::GetInputList(app::AttributeValueEncoder & aEncoder jfieldID typeId = env->GetFieldID(inputClass, "type", "I"); jint type = env->GetIntField(inputObj, typeId); - mediaInput.inputType = static_cast(type); + mediaInput.inputType = static_cast(type); jfieldID nameId = env->GetFieldID(inputClass, "name", "Ljava/lang/String;"); jstring jname = static_cast(env->GetObjectField(inputObj, nameId)); @@ -147,62 +101,56 @@ CHIP_ERROR MediaInputManager::GetInputList(app::AttributeValueEncoder & aEncoder mediaInput.description = description.charSpan(); } - ReturnErrorOnFailure(encoder.Encode(mediaInput)); + list.push_back(mediaInput); } - - return CHIP_NO_ERROR; - }); + } exit: if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "MediaInputManager::GetInputList status error: %s", err.AsString()); + ChipLogError(Zcl, "MediaInputManager::HandleGetInputList status error: %s", err.AsString()); } - return err; + return list; } -CHIP_ERROR MediaInputManager::GetCurrentInput(chip::app::AttributeValueEncoder & aEncoder) +uint8_t MediaInputManager::HandleGetCurrentInput() { CHIP_ERROR err = CHIP_NO_ERROR; jint index = -1; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received MediaInputManager::GetInputList"); + ChipLogProgress(Zcl, "Received MediaInputManager::HandleGetCurrentInput"); VerifyOrExit(mMediaInputManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(mGetCurrentInputMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); - index = env->CallIntMethod(mMediaInputManagerObject, mGetCurrentInputMethod); - if (env->ExceptionCheck()) { - ChipLogError(AppServer, "Java exception in MediaInputManager::GetCurrentInput"); - env->ExceptionDescribe(); - env->ExceptionClear(); - return CHIP_ERROR_INCORRECT_STATE; - } - - ChipLogProgress(Zcl, "GetCurrentInput = %d", index); - if (index >= 0) - { - err = aEncoder.Encode(uint8_t(index)); + index = env->CallIntMethod(mMediaInputManagerObject, mGetCurrentInputMethod); + if (env->ExceptionCheck()) + { + ChipLogError(AppServer, "Java exception in MediaInputManager::HandleGetCurrentInput"); + env->ExceptionDescribe(); + env->ExceptionClear(); + err = CHIP_ERROR_INCORRECT_STATE; + } } exit: if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "MediaInputManager::GetCurrentInput status error: %s", err.AsString()); + ChipLogError(Zcl, "MediaInputManager::HandleGetCurrentInput status error: %s", err.AsString()); } - return err; + return uint8_t(index); } -bool MediaInputManager::SelectInput(uint8_t index) +bool MediaInputManager::HandleSelectInput(const uint8_t index) { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received MediaInputManager::SelectInput %d", index); + ChipLogProgress(Zcl, "Received MediaInputManager::HandleSelectInput %d", index); VerifyOrExit(mMediaInputManagerObject != nullptr, ChipLogError(Zcl, "mMediaInputManagerObject null")); VerifyOrExit(mSelectInputMethod != nullptr, ChipLogError(Zcl, "mSelectInputMethod null")); VerifyOrExit(env != NULL, ChipLogError(Zcl, "env null")); @@ -211,7 +159,7 @@ bool MediaInputManager::SelectInput(uint8_t index) ret = env->CallBooleanMethod(mMediaInputManagerObject, mSelectInputMethod, static_cast(index)); if (env->ExceptionCheck()) { - ChipLogError(DeviceLayer, "Java exception in MediaInputManager::selectInput"); + ChipLogError(DeviceLayer, "Java exception in MediaInputManager::HandleSelectInput"); env->ExceptionDescribe(); env->ExceptionClear(); return false; @@ -221,12 +169,12 @@ bool MediaInputManager::SelectInput(uint8_t index) return static_cast(ret); } -bool MediaInputManager::ShowInputStatus() +bool MediaInputManager::HandleShowInputStatus() { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received MediaInputManager::ShowInputStatus"); + ChipLogProgress(Zcl, "Received MediaInputManager::HandleShowInputStatus"); VerifyOrExit(mMediaInputManagerObject != nullptr, ChipLogError(Zcl, "mMediaInputManagerObject null")); VerifyOrExit(mShowInputStatusMethod != nullptr, ChipLogError(Zcl, "mShowInputStatusMethod null")); VerifyOrExit(env != NULL, ChipLogError(Zcl, "env null")); @@ -235,7 +183,7 @@ bool MediaInputManager::ShowInputStatus() ret = env->CallBooleanMethod(mMediaInputManagerObject, mShowInputStatusMethod); if (env->ExceptionCheck()) { - ChipLogError(DeviceLayer, "Java exception in MediaInputManager::showInputStatus"); + ChipLogError(DeviceLayer, "Java exception in MediaInputManager::HandleShowInputStatus"); env->ExceptionDescribe(); env->ExceptionClear(); return false; @@ -245,12 +193,12 @@ bool MediaInputManager::ShowInputStatus() return static_cast(ret); } -bool MediaInputManager::HideInputStatus() +bool MediaInputManager::HandleHideInputStatus() { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received MediaInputManager::HideInputStatus"); + ChipLogProgress(Zcl, "Received MediaInputManager::HandleHideInputStatus"); VerifyOrExit(mMediaInputManagerObject != nullptr, ChipLogError(Zcl, "mMediaInputManagerObject null")); VerifyOrExit(mHideInputStatusMethod != nullptr, ChipLogError(Zcl, "mHideInputStatusMethod null")); VerifyOrExit(env != NULL, ChipLogError(Zcl, "env null")); @@ -259,7 +207,7 @@ bool MediaInputManager::HideInputStatus() ret = env->CallBooleanMethod(mMediaInputManagerObject, mHideInputStatusMethod); if (env->ExceptionCheck()) { - ChipLogError(DeviceLayer, "Java exception in MediaInputManager::HideInputStatus"); + ChipLogError(DeviceLayer, "Java exception in MediaInputManager::HandleHideInputStatus"); env->ExceptionDescribe(); env->ExceptionClear(); return false; @@ -269,24 +217,24 @@ bool MediaInputManager::HideInputStatus() return static_cast(ret); } -bool MediaInputManager::RenameInput(uint8_t index, std::string name) +bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharSpan & name) { jboolean ret = JNI_FALSE; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received MediaInputManager::RenameInput %d to %s", index, name.c_str()); + ChipLogProgress(Zcl, "Received MediaInputManager::HandleRenameInput %d to %s", index, name.data()); VerifyOrExit(mMediaInputManagerObject != nullptr, ChipLogError(Zcl, "mMediaInputManagerObject null")); VerifyOrExit(mRenameInputMethod != nullptr, ChipLogError(Zcl, "mHideInputStatusMethod null")); VerifyOrExit(env != NULL, ChipLogError(Zcl, "env null")); { - UtfString jniInputname(env, name.c_str()); + UtfString jniInputname(env, name.data()); env->ExceptionClear(); ret = env->CallBooleanMethod(mMediaInputManagerObject, mRenameInputMethod, static_cast(index), jniInputname.jniValue()); if (env->ExceptionCheck()) { - ChipLogError(DeviceLayer, "Java exception in MediaInputManager::RenameInput"); + ChipLogError(DeviceLayer, "Java exception in MediaInputManager::HandleRenameInput"); env->ExceptionDescribe(); env->ExceptionClear(); return false; @@ -308,7 +256,7 @@ void MediaInputManager::InitializeWithObjects(jobject managerObject) jclass MediaInputManagerClass = env->GetObjectClass(managerObject); VerifyOrReturn(MediaInputManagerClass != nullptr, ChipLogError(Zcl, "Failed to get MediaInputManager Java class")); - mGetInputListMethod = env->GetMethodID(MediaInputManagerClass, "getInputList", "()[Lcom/tcl/chip/tvapp/MediaInputInfo;"); + mGetInputListMethod = env->GetMethodID(MediaInputManagerClass, "getInputList", "()[Lcom/tcl/chip/tvapp/InputInfo;"); if (mGetInputListMethod == nullptr) { ChipLogError(Zcl, "Failed to access MediaInputManager 'getInputList' method"); diff --git a/examples/tv-app/android/java/MediaInputManager.h b/examples/tv-app/android/java/MediaInputManager.h index 8a031fa0efcd57..8651e3321cecc6 100644 --- a/examples/tv-app/android/java/MediaInputManager.h +++ b/examples/tv-app/android/java/MediaInputManager.h @@ -18,20 +18,19 @@ #pragma once -#include +#include #include -#include -class MediaInputManager +class MediaInputManager : public chip::app::Clusters::MediaInput::Delegate { public: void InitializeWithObjects(jobject managerObject); - CHIP_ERROR GetInputList(chip::app::AttributeValueEncoder & aEncoder); - CHIP_ERROR GetCurrentInput(chip::app::AttributeValueEncoder & aEncoder); - bool SelectInput(uint8_t index); - bool ShowInputStatus(); - bool HideInputStatus(); - bool RenameInput(uint8_t index, std::string name); + std::list HandleGetInputList() override; + uint8_t HandleGetCurrentInput() override; + bool HandleSelectInput(const uint8_t index) override; + bool HandleShowInputStatus() override; + bool HandleHideInputStatus() override; + bool HandleRenameInput(const uint8_t index, const chip::CharSpan & name) override; private: friend MediaInputManager & MediaInputMgr(); diff --git a/examples/tv-app/android/java/MediaPlaybackManager.cpp b/examples/tv-app/android/java/MediaPlaybackManager.cpp index df6ff8e878f34a..70aa77a1bf28c3 100644 --- a/examples/tv-app/android/java/MediaPlaybackManager.cpp +++ b/examples/tv-app/android/java/MediaPlaybackManager.cpp @@ -16,68 +16,20 @@ */ #include "MediaPlaybackManager.h" -#include -#include -#include #include -#include #include +#include + +#include "MediaPlaybackManager.h" using namespace chip; +using namespace chip::app::Clusters::MediaPlayback; MediaPlaybackManager MediaPlaybackManager::sInstance; -class MediaPlayBackAttrAccess : public app::AttributeAccessInterface -{ -public: - MediaPlayBackAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), app::Clusters::MediaPlayback::Id) {} - - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override - { - int attrId = -1; - - switch (aPath.mAttributeId) - { - case app::Clusters::MediaPlayback::Attributes::PlaybackState::Id: { - attrId = ZCL_MEDIA_PLAYBACK_STATE_ATTRIBUTE_ID; - break; - } - case app::Clusters::MediaPlayback::Attributes::StartTime::Id: { - attrId = ZCL_MEDIA_PLAYBACK_START_TIME_ATTRIBUTE_ID; - break; - } - case app::Clusters::MediaPlayback::Attributes::Duration::Id: { - attrId = ZCL_MEDIA_PLAYBACK_DURATION_ATTRIBUTE_ID; - break; - } - case app::Clusters::MediaPlayback::Attributes::Position::Id: { - attrId = ZCL_MEDIA_PLAYBACK_PLAYBACK_POSITION_ATTRIBUTE_ID; - break; - } - case app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::Id: { - attrId = ZCL_MEDIA_PLAYBACK_PLAYBACK_SPEED_ATTRIBUTE_ID; - break; - } - case app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id: { - attrId = ZCL_MEDIA_PLAYBACK_PLAYBACK_SEEK_RANGE_END_ATTRIBUTE_ID; - break; - } - case app::Clusters::MediaPlayback::Attributes::SeekRangeStart::Id: { - attrId = ZCL_MEDIA_PLAYBACK_PLAYBACK_SEEK_RANGE_START_ATTRIBUTE_ID; - break; - } - } - - if (attrId >= 0) - { - return MediaPlaybackMgr().GetAttribute(aEncoder, attrId); - } - - return CHIP_NO_ERROR; - } -}; - -MediaPlayBackAttrAccess gMediaPlayBackAttrAccess; +namespace { +static MediaPlaybackManager mediaPlaybackManager; +} // namespace /** @brief Media PlayBack Cluster Init * @@ -88,101 +40,110 @@ MediaPlayBackAttrAccess gMediaPlayBackAttrAccess; * @param endpoint Ver.: always * */ -void emberAfMediaPlaybackClusterInitCallback(EndpointId endpoint) +void emberAfMediaPlaybackClusterInitCallback(chip::EndpointId endpoint) { - static bool attrAccessRegistered = false; - if (!attrAccessRegistered) - { - registerAttributeAccessOverride(&gMediaPlayBackAttrAccess); - attrAccessRegistered = true; - } + ChipLogProgress(Zcl, "TV Android App: MediaPlayback::SetDefaultDelegate"); + chip::app::Clusters::MediaPlayback::SetDefaultDelegate(endpoint, &mediaPlaybackManager); } -EmberAfMediaPlaybackStatus mediaPlaybackClusterSendMediaPlaybackRequest(MediaPlaybackRequest mediaPlaybackRequest, - uint64_t deltaPositionMilliseconds) +PlaybackStateEnum MediaPlaybackManager::HandleGetCurrentState() { - return MediaPlaybackMgr().Request(mediaPlaybackRequest, deltaPositionMilliseconds); + return PlaybackStateEnum::kPlaying; } -void MediaPlaybackManager::InitializeWithObjects(jobject managerObject) +uint64_t MediaPlaybackManager::HandleGetStartTime() { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Failed to GetEnvForCurrentThread for MediaPlaybackManager")); + return 0; +} - mMediaPlaybackManagerObject = env->NewGlobalRef(managerObject); - VerifyOrReturn(mMediaPlaybackManagerObject != nullptr, ChipLogError(Zcl, "Failed to NewGlobalRef MediaPlaybackManager")); +uint64_t MediaPlaybackManager::HandleGetDuration() +{ + return 0; +} - jclass mMediaPlaybackManagerClass = env->GetObjectClass(managerObject); - VerifyOrReturn(mMediaPlaybackManagerClass != nullptr, ChipLogError(Zcl, "Failed to get MediaPlaybackManager Java class")); +Structs::PlaybackPosition::Type MediaPlaybackManager::HandleGetSampledPosition() +{ + Structs::PlaybackPosition::Type sampledPosition; + sampledPosition.updatedAt = 0; + sampledPosition.position = 0; + return sampledPosition; +} - mGetAttributeMethod = env->GetMethodID(mMediaPlaybackManagerClass, "getAttributes", "(I)J"); - if (mGetAttributeMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access MediaPlaybackManager 'getMediaPlaybackAttribute' method"); - env->ExceptionClear(); - } +float MediaPlaybackManager::HandleGetPlaybackSpeed() +{ + return 0; +} - mRequestMethod = env->GetMethodID(mMediaPlaybackManagerClass, "request", "(IJ)I"); - if (mRequestMethod == nullptr) - { - ChipLogError(Zcl, "Failed to access MediaPlaybackManager 'proxyMediaPlaybackRequest' method"); - env->ExceptionClear(); - } +uint64_t MediaPlaybackManager::HandleGetSeekRangeStart() +{ + return 0; } -CHIP_ERROR MediaPlaybackManager::GetAttribute(chip::app::AttributeValueEncoder & aEncoder, int attributeId) +uint64_t MediaPlaybackManager::HandleGetSeekRangeEnd() { - jlong jAttributeValue = -1; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + return 0; +} - ChipLogProgress(Zcl, "Received MediaPlaybackManager::GetAttribute:%d", attributeId); - VerifyOrExit(mMediaPlaybackManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mGetAttributeMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); +Commands::PlaybackResponse::Type MediaPlaybackManager::HandlePlay() +{ + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_PLAY, 0); +} - jAttributeValue = env->CallLongMethod(mMediaPlaybackManagerObject, mGetAttributeMethod, static_cast(attributeId)); - if (env->ExceptionCheck()) - { - ChipLogError(AppServer, "Java exception in MediaPlaybackManager::GetAttribute"); - env->ExceptionDescribe(); - env->ExceptionClear(); - return CHIP_ERROR_INCORRECT_STATE; - } +Commands::PlaybackResponse::Type MediaPlaybackManager::HandlePause() +{ + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_PAUSE, 0); +} - if (jAttributeValue >= 0) - { - switch (attributeId) - { - case ZCL_MEDIA_PLAYBACK_PLAYBACK_SPEED_ATTRIBUTE_ID: { - // TODO: Convert to single once it is supported - // float speed = static_cast(jAttributeValue) / 10000.0f; - err = aEncoder.Encode(static_cast(jAttributeValue)); - break; - } - - default: { - err = aEncoder.Encode(static_cast(jAttributeValue)); - } - } - } - else - { - err = CHIP_ERROR_INCORRECT_STATE; - } +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleStop() +{ + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_STOP, 0); +} -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "MediaPlaybackManager::GetAttribute status error: %s", err.AsString()); - } +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleFastForward() +{ + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_FAST_FORWARD, 0); +} - return err; +Commands::PlaybackResponse::Type MediaPlaybackManager::HandlePrevious() +{ + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_PREVIOUS, 0); +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleRewind() +{ + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_REWIND, 0); +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleSkipBackward(const uint64_t & deltaPositionMilliseconds) +{ + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD, deltaPositionMilliseconds); } -EmberAfMediaPlaybackStatus MediaPlaybackManager::Request(MediaPlaybackRequest mediaPlaybackRequest, - uint64_t deltaPositionMilliseconds) +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleSkipForward(const uint64_t & deltaPositionMilliseconds) { + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD, deltaPositionMilliseconds); +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleSeekRequest(const uint64_t & positionMilliseconds) +{ + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_SEEK, positionMilliseconds); +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleNext() +{ + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_NEXT, 0); +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleStartOverRequest() +{ + return MediaPlaybackMgr().HandleMediaRequest(MEDIA_PLAYBACK_REQUEST_START_OVER, 0); +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleMediaRequest(MediaPlaybackRequest mediaPlaybackRequest, + uint64_t deltaPositionMilliseconds) +{ + Commands::PlaybackResponse::Type response; + jint ret = -1; CHIP_ERROR err = CHIP_NO_ERROR; JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -198,17 +159,43 @@ EmberAfMediaPlaybackStatus MediaPlaybackManager::Request(MediaPlaybackRequest me static_cast(deltaPositionMilliseconds)); if (env->ExceptionCheck()) { - ChipLogError(AppServer, "Java exception in MediaPlaybackManager::GetAttribute"); + ChipLogError(AppServer, "Java exception in MediaPlaybackManager::Request %d", mediaPlaybackRequest); env->ExceptionDescribe(); env->ExceptionClear(); - return EMBER_ZCL_MEDIA_PLAYBACK_STATUS_INVALID_STATE_FOR_COMMAND; + response.status = StatusEnum::kInvalidStateForCommand; } exit: if (err != CHIP_NO_ERROR) { - return EMBER_ZCL_MEDIA_PLAYBACK_STATUS_INVALID_STATE_FOR_COMMAND; + response.status = StatusEnum::kInvalidStateForCommand; } - return static_cast(ret); + return response; +} + +void MediaPlaybackManager::InitializeWithObjects(jobject managerObject) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Failed to GetEnvForCurrentThread for MediaPlaybackManager")); + + mMediaPlaybackManagerObject = env->NewGlobalRef(managerObject); + VerifyOrReturn(mMediaPlaybackManagerObject != nullptr, ChipLogError(Zcl, "Failed to NewGlobalRef MediaPlaybackManager")); + + jclass mMediaPlaybackManagerClass = env->GetObjectClass(managerObject); + VerifyOrReturn(mMediaPlaybackManagerClass != nullptr, ChipLogError(Zcl, "Failed to get MediaPlaybackManager Java class")); + + mGetAttributeMethod = env->GetMethodID(mMediaPlaybackManagerClass, "getAttributes", "(I)J"); + if (mGetAttributeMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access MediaPlaybackManager 'getMediaPlaybackAttribute' method"); + env->ExceptionClear(); + } + + mRequestMethod = env->GetMethodID(mMediaPlaybackManagerClass, "request", "(IJ)I"); + if (mRequestMethod == nullptr) + { + ChipLogError(Zcl, "Failed to access MediaPlaybackManager 'proxyMediaPlaybackRequest' method"); + env->ExceptionClear(); + } } diff --git a/examples/tv-app/android/java/MediaPlaybackManager.h b/examples/tv-app/android/java/MediaPlaybackManager.h index 018c9cba8c8041..12aaeab077bfa0 100644 --- a/examples/tv-app/android/java/MediaPlaybackManager.h +++ b/examples/tv-app/android/java/MediaPlaybackManager.h @@ -18,19 +18,52 @@ #pragma once -#include #include -#include -#include #include -#include -class MediaPlaybackManager +enum MediaPlaybackRequest : uint8_t +{ + MEDIA_PLAYBACK_REQUEST_PLAY = 0, + MEDIA_PLAYBACK_REQUEST_PAUSE = 1, + MEDIA_PLAYBACK_REQUEST_STOP = 2, + MEDIA_PLAYBACK_REQUEST_START_OVER = 3, + MEDIA_PLAYBACK_REQUEST_PREVIOUS = 4, + MEDIA_PLAYBACK_REQUEST_NEXT = 5, + MEDIA_PLAYBACK_REQUEST_REWIND = 6, + MEDIA_PLAYBACK_REQUEST_FAST_FORWARD = 7, + MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD = 8, + MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD = 9, + MEDIA_PLAYBACK_REQUEST_SEEK = 10, +}; + +class MediaPlaybackManager : public chip::app::Clusters::MediaPlayback::Delegate { public: void InitializeWithObjects(jobject managerObject); - CHIP_ERROR GetAttribute(chip::app::AttributeValueEncoder & aEncoder, int attributeId); - EmberAfMediaPlaybackStatus Request(MediaPlaybackRequest mediaPlaybackRequest, uint64_t deltaPositionMilliseconds); + chip::app::Clusters::MediaPlayback::PlaybackStateEnum HandleGetCurrentState() override; + uint64_t HandleGetStartTime() override; + uint64_t HandleGetDuration() override; + chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::Type HandleGetSampledPosition() override; + float HandleGetPlaybackSpeed() override; + uint64_t HandleGetSeekRangeStart() override; + uint64_t HandleGetSeekRangeEnd() override; + + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandlePlay() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandlePause() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleStop() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleFastForward() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandlePrevious() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleRewind() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSkipBackward(const uint64_t & deltaPositionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSkipForward(const uint64_t & deltaPositionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSeekRequest(const uint64_t & positionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleNext() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleStartOverRequest() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleMediaRequest(MediaPlaybackRequest mediaPlaybackRequest, uint64_t deltaPositionMilliseconds); private: friend MediaPlaybackManager & MediaPlaybackMgr(); diff --git a/examples/tv-app/android/java/TVApp-JNI.cpp b/examples/tv-app/android/java/TVApp-JNI.cpp index accd4a0ccc5cb0..6a637c0e168688 100644 --- a/examples/tv-app/android/java/TVApp-JNI.cpp +++ b/examples/tv-app/android/java/TVApp-JNI.cpp @@ -16,12 +16,12 @@ * */ +#include "ChannelManager.h" #include "ContentLauncherManager.h" #include "KeypadInputManager.h" #include "LowPowerManager.h" #include "MediaInputManager.h" #include "MediaPlaybackManager.h" -#include "TvChannelManager.h" #include "WakeOnLanManager.h" #include #include @@ -70,7 +70,7 @@ JNI_METHOD(void, setMediaPlaybackManager)(JNIEnv *, jobject, jobject manager) MediaPlaybackMgr().InitializeWithObjects(manager); } -JNI_METHOD(void, setTvChannelManager)(JNIEnv *, jobject, jobject manager) +JNI_METHOD(void, setChannelManager)(JNIEnv *, jobject, jobject manager) { - TvChannelMgr().InitializeWithObjects(manager); + ChannelMgr().InitializeWithObjects(manager); } diff --git a/examples/tv-app/android/java/TvChannelManager.h b/examples/tv-app/android/java/TvChannelManager.h deleted file mode 100644 index 7d9ad650066626..00000000000000 --- a/examples/tv-app/android/java/TvChannelManager.h +++ /dev/null @@ -1,57 +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. - */ - -#pragma once - -#include -#include - -#include -#include -#include -#include - -class TvChannelManager -{ -public: - void InitializeWithObjects(jobject managerObject); - CHIP_ERROR getTvChannelList(chip::app::AttributeValueEncoder & aEncoder); - CHIP_ERROR getTvChannelLineup(chip::app::AttributeValueEncoder & aEncoder); - CHIP_ERROR getCurrentTvChannel(chip::app::AttributeValueEncoder & aEncoder); - - TvChannelInfo ChangeChannelByMatch(std::string name); - bool changeChannelByNumber(uint16_t majorNumber, uint16_t minorNumber); - bool skipChannnel(uint16_t count); - -private: - friend TvChannelManager & TvChannelMgr(); - - static TvChannelManager sInstance; - jobject mTvChannelManagerObject = nullptr; - jmethodID mGetChannelListMethod = nullptr; - jmethodID mGetLineupMethod = nullptr; - jmethodID mGetCurrentChannelMethod = nullptr; - - jmethodID mChangeChannelMethod = nullptr; - jmethodID mchangeChannelByNumberMethod = nullptr; - jmethodID mskipChannelMethod = nullptr; -}; - -inline class TvChannelManager & TvChannelMgr() -{ - return TvChannelManager::sInstance; -} diff --git a/examples/tv-app/android/java/WakeOnLanManager.cpp b/examples/tv-app/android/java/WakeOnLanManager.cpp index 60b59c957b134d..8c9c7f26bbace1 100644 --- a/examples/tv-app/android/java/WakeOnLanManager.cpp +++ b/examples/tv-app/android/java/WakeOnLanManager.cpp @@ -18,26 +18,19 @@ #include "WakeOnLanManager.h" -#include -#include -#include -#include -#include -#include -#include - -#include - #include -#include #include #include using namespace chip; -using namespace chip::app::Clusters; +using namespace chip::app::Clusters::WakeOnLan; WakeOnLanManager WakeOnLanManager::sInstance; +namespace { +static WakeOnLanManager wakeOnLanManager; +} // namespace + /** @brief Wake On LAN Cluster Init * * This function is called when a specific cluster is initialized. It gives the @@ -49,39 +42,43 @@ WakeOnLanManager WakeOnLanManager::sInstance; */ void emberAfWakeOnLanClusterInitCallback(chip::EndpointId endpoint) { - WakeOnLanMgr().InitWakeOnLanCluster(endpoint); + ChipLogProgress(Zcl, "TV Android App: WakeOnLan::SetDefaultDelegate"); + chip::app::Clusters::WakeOnLan::SetDefaultDelegate(endpoint, &wakeOnLanManager); } -void WakeOnLanManager::InitWakeOnLanCluster(chip::EndpointId endpoint) +chip::CharSpan WakeOnLanManager::HandleGetMacAddress() { - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - ChipLogProgress(Zcl, "Received WakeOnLanManager::InitWakeOnLanCluster %d", endpoint); - VerifyOrReturn(mWakeOnLanManagerObject != nullptr, ChipLogError(Zcl, "mWakeOnLanManagerObject null")); - VerifyOrReturn(mGetMacMethod != nullptr, ChipLogError(Zcl, "mGetMacMethod null")); - VerifyOrReturn(env != NULL, ChipLogError(Zcl, "env null")); + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + chip::CharSpan macValue; + + ChipLogProgress(Zcl, "Received WakeOnLanManager::HandleGetMacAddress"); + VerifyOrExit(mWakeOnLanManagerObject != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrExit(mGetMacMethod != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrExit(env != NULL, err = CHIP_JNI_ERROR_NO_ENV); - env->ExceptionClear(); - jobject javaMac = env->CallObjectMethod(mWakeOnLanManagerObject, mGetMacMethod, static_cast(endpoint)); - if (env->ExceptionCheck()) { - ChipLogError(DeviceLayer, "Java exception in WakeOnLanManager::getMac"); - env->ExceptionDescribe(); env->ExceptionClear(); - return; + jobject javaMac = env->CallObjectMethod(mWakeOnLanManagerObject, mGetMacMethod, static_cast(1)); + if (env->ExceptionCheck()) + { + ChipLogError(DeviceLayer, "Java exception in WakeOnLanManager::getMac"); + env->ExceptionDescribe(); + env->ExceptionClear(); + return macValue; + } + + macValue = chip::JniUtfString(env, static_cast(javaMac)).charSpan(); } - chip::JniUtfString macValue(env, static_cast(javaMac)); - - uint8_t bufferMemory[32]; - MutableByteSpan zclString(bufferMemory); - MakeZclCharString(zclString, macValue.c_str()); - EmberAfStatus macAddressStatus = emberAfWriteServerAttribute( - endpoint, WakeOnLan::Id, WakeOnLan::Attributes::WakeOnLanMacAddress::Id, zclString.data(), ZCL_CHAR_STRING_ATTRIBUTE_TYPE); - if (macAddressStatus != EMBER_ZCL_STATUS_SUCCESS) +exit: + if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Failed to store mac address attribute."); + ChipLogError(Zcl, "WakeOnLanManager::HandleGetMacAddress status error: %s", err.AsString()); } + + return macValue; } void WakeOnLanManager::InitializeWithObjects(jobject managerObject) diff --git a/examples/tv-app/android/java/WakeOnLanManager.h b/examples/tv-app/android/java/WakeOnLanManager.h index da622a8f54e873..69327737a45335 100644 --- a/examples/tv-app/android/java/WakeOnLanManager.h +++ b/examples/tv-app/android/java/WakeOnLanManager.h @@ -18,15 +18,14 @@ #pragma once -#include +#include #include -#include -class WakeOnLanManager +class WakeOnLanManager : public chip::app::Clusters::WakeOnLan::Delegate { public: void InitializeWithObjects(jobject managerObject); - void InitWakeOnLanCluster(chip::EndpointId endpoint); + chip::CharSpan HandleGetMacAddress() override; private: friend WakeOnLanManager & WakeOnLanMgr(); diff --git a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelInfo.java b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelInfo.java similarity index 92% rename from examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelInfo.java rename to examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelInfo.java index da087c9fa87ead..b383b789a9d78c 100644 --- a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelInfo.java +++ b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelInfo.java @@ -17,16 +17,16 @@ */ package com.tcl.chip.tvapp; -public class TvChannelInfo { +public class ChannelInfo { public int majorNumber; public int minorNumber; public String name; public String callSign; public String affiliateCallSign; - public TvChannelInfo() {} + public ChannelInfo() {} - public TvChannelInfo( + public ChannelInfo( int majorNumber, int minorNumber, String name, String callSign, String affiliateCallSign) { this.majorNumber = majorNumber; this.minorNumber = minorNumber; @@ -37,7 +37,7 @@ public TvChannelInfo( @Override public String toString() { - return "TvChannelInfo{" + return "ChannelInfo{" + "majorNumber=" + majorNumber + ", minorNumber=" diff --git a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelLineupInfo.java b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelLineupInfo.java similarity index 88% rename from examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelLineupInfo.java rename to examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelLineupInfo.java index 0a8dffe9876036..d04662d6c2f93e 100644 --- a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelLineupInfo.java +++ b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelLineupInfo.java @@ -17,7 +17,7 @@ */ package com.tcl.chip.tvapp; -public class TvChannelLineupInfo { +public class ChannelLineupInfo { public static final int LINEUP_INFO_TYPE_MSO = 0x00; public String operatorName; @@ -25,11 +25,11 @@ public class TvChannelLineupInfo { public String postalCode; public int lineupInfoType; - public TvChannelLineupInfo(String operatorName, String lineupName, String postalCode) { + public ChannelLineupInfo(String operatorName, String lineupName, String postalCode) { this(operatorName, lineupName, postalCode, LINEUP_INFO_TYPE_MSO); } - public TvChannelLineupInfo( + public ChannelLineupInfo( String operatorName, String lineupName, String postalCode, int lineupInfoType) { this.operatorName = operatorName; this.lineupName = lineupName; @@ -39,7 +39,7 @@ public TvChannelLineupInfo( @Override public String toString() { - return "TvChannelLineupInfo{" + return "ChannelLineupInfo{" + "operatorName='" + operatorName + '\'' diff --git a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelManager.java b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelManager.java similarity index 80% rename from examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelManager.java rename to examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelManager.java index 3eedb1afbd6b1b..69cfc39c92a946 100644 --- a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelManager.java +++ b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelManager.java @@ -17,15 +17,15 @@ */ package com.tcl.chip.tvapp; -public interface TvChannelManager { +public interface ChannelManager { - TvChannelInfo[] getChannelList(); + ChannelInfo[] getChannelList(); - TvChannelLineupInfo getLineup(); + ChannelLineupInfo getLineup(); - TvChannelInfo getCurrentChannel(); + ChannelInfo getCurrentChannel(); - TvChannelInfo changeChannel(String match); + ChannelInfo changeChannel(String match); boolean changeChannelByNumber(int majorNumber, int minorNumber); diff --git a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelManagerStub.java b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelManagerStub.java similarity index 57% rename from examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelManagerStub.java rename to examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelManagerStub.java index c72ab4fe8605d2..2b76098750595b 100644 --- a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvChannelManagerStub.java +++ b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ChannelManagerStub.java @@ -19,36 +19,34 @@ import android.util.Log; -public class TvChannelManagerStub implements TvChannelManager { +public class ChannelManagerStub implements ChannelManager { private static final String TAG = "ChannelManagerStub"; @Override - public TvChannelInfo[] getChannelList() { - TvChannelInfo tvChannelInfo1 = - new TvChannelInfo(1, 1, "HDMI1", "callSign1", "affiliateCallSign1"); - TvChannelInfo tvChannelInfo2 = - new TvChannelInfo(2, 2, "HDMI2", "callSign2", "affiliateCallSign2"); - Log.d(TAG, "getTVChannelList"); - return new TvChannelInfo[] {tvChannelInfo1, tvChannelInfo2}; + public ChannelInfo[] getChannelList() { + ChannelInfo ChannelInfo1 = new ChannelInfo(1, 1, "HDMI1", "callSign1", "affiliateCallSign1"); + ChannelInfo ChannelInfo2 = new ChannelInfo(2, 2, "HDMI2", "callSign2", "affiliateCallSign2"); + Log.d(TAG, "getChannelList"); + return new ChannelInfo[] {ChannelInfo1, ChannelInfo2}; } @Override - public TvChannelLineupInfo getLineup() { - TvChannelLineupInfo lineupInfo = new TvChannelLineupInfo("operator", "lineup", "postalCode"); - Log.d(TAG, "getTVChannelLineup: " + lineupInfo); + public ChannelLineupInfo getLineup() { + ChannelLineupInfo lineupInfo = new ChannelLineupInfo("operator", "lineup", "postalCode"); + Log.d(TAG, "getChannelLineup: " + lineupInfo); return lineupInfo; } @Override - public TvChannelInfo getCurrentChannel() { - Log.d(TAG, "getCurrentTVChannel: "); - return new TvChannelInfo(1, 1, "HDMI", "callSign", "affiliateCallSign"); + public ChannelInfo getCurrentChannel() { + Log.d(TAG, "getCurrentChannel: "); + return new ChannelInfo(1, 1, "HDMI", "callSign", "affiliateCallSign"); } @Override - public TvChannelInfo changeChannel(String match) { + public ChannelInfo changeChannel(String match) { Log.d(TAG, "changeChannel: " + match); - return new TvChannelInfo(1, 1, "HDMI", "callSign", "affiliateCallSign"); + return new ChannelInfo(1, 1, "HDMI", "callSign", "affiliateCallSign"); } @Override diff --git a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ContentLaunchManager.java b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ContentLaunchManager.java index ba8b209ad1e709..fe50a7a8420d0d 100755 --- a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ContentLaunchManager.java +++ b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ContentLaunchManager.java @@ -27,10 +27,10 @@ public interface ContentLaunchManager { * @return The list of content types supported by the Video Player or Content App in the form of * entries in the HTTP "Accept" request header. */ - String[] getAcceptsHeader(); + String[] getAcceptHeader(); /** @return The list information about supported streaming protocols in STREAMING_TYPE_XXX. */ - int[] getSupportedStreamingTypes(); + int[] getSupportedStreamingProtocols(); /** * Launch the specified content with optional search criteria. diff --git a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ContentLaunchManagerStub.java b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ContentLaunchManagerStub.java index cf95fa807b31a3..347b670cc58acf 100644 --- a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ContentLaunchManagerStub.java +++ b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/ContentLaunchManagerStub.java @@ -7,7 +7,7 @@ public class ContentLaunchManagerStub implements ContentLaunchManager { private final String TAG = ContentLaunchManagerStub.class.getSimpleName(); @Override - public String[] getAcceptsHeader() { + public String[] getAcceptHeader() { String[] headers = new String[] { "application/dash+xml", "application/vnd.apple.mpegurl", "text/html", @@ -17,7 +17,7 @@ public String[] getAcceptsHeader() { } @Override - public int[] getSupportedStreamingTypes() { + public int[] getSupportedStreamingProtocols() { int[] types = new int[] {STREAMING_TYPE_DASH, STREAMING_TYPE_HLS}; return types; } diff --git a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/MediaPlaybackManager.java b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/MediaPlaybackManager.java index abfb8032708781..7972a49d93bffd 100755 --- a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/MediaPlaybackManager.java +++ b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/MediaPlaybackManager.java @@ -115,7 +115,7 @@ public interface MediaPlaybackManager { long getAttributes(int attributesId); /** - * Request for cmd in REQUEST_XXX, the paramters for request is defined in REQUEST_XXX + * Request for cmd in REQUEST_XXX, the parameters for request is defined in REQUEST_XXX * * @param parameter The means of parameter is defined in RESPONSE_STATUS_XXX or meaningless if not * defined. diff --git a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvApp.java b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvApp.java index f41b974a82d090..521a1c1dee70d7 100644 --- a/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvApp.java +++ b/examples/tv-app/android/java/src/com/tcl/chip/tvapp/TvApp.java @@ -32,7 +32,7 @@ public TvApp() {} public native void setMediaPlaybackManager(MediaPlaybackManager manager); - public native void setTvChannelManager(TvChannelManager manager); + public native void setChannelManager(ChannelManager manager); static { System.loadLibrary("TvApp"); diff --git a/examples/tv-app/linux/AppImpl.cpp b/examples/tv-app/linux/AppImpl.cpp index 6b667967bf28ac..dd2d2569ef641e 100644 --- a/examples/tv-app/linux/AppImpl.cpp +++ b/examples/tv-app/linux/AppImpl.cpp @@ -57,7 +57,6 @@ static const int kNameSize = 32; // Current ZCL implementation of Struct uses a max-size array of 254 bytes static const int kDescriptorAttributeArraySize = 254; -static const int kFixedLabelAttributeArraySize = 254; // Device types for dynamic endpoints: TODO Need a generated file from ZAP to define these! // (taken from chip-devices.xml) @@ -103,7 +102,7 @@ DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); // Declare Content Launcher cluster attributes DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(contentLauncherAttrs) -DECLARE_DYNAMIC_ATTRIBUTE(ZCL_CONTENT_LAUNCHER_ACCEPTS_HEADER_ATTRIBUTE_ID, ARRAY, kDescriptorAttributeArraySize, +DECLARE_DYNAMIC_ATTRIBUTE(ZCL_CONTENT_LAUNCHER_ACCEPT_HEADER_ATTRIBUTE_ID, ARRAY, kDescriptorAttributeArraySize, 0), /* accept header list */ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_CONTENT_LAUNCHER_SUPPORTED_STREAMING_PROTOCOLS_ATTRIBUTE_ID, BITMAP32, 1, 0), /* streaming protocols */ @@ -128,9 +127,9 @@ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_TARGET_NAVIGATOR_LIST_ATTRIBUTE_ID, ARRAY, kDescri // Declare Channel cluster attributes DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(channelAttrs) -DECLARE_DYNAMIC_ATTRIBUTE(ZCL_TV_CHANNEL_LIST_ATTRIBUTE_ID, ARRAY, kDescriptorAttributeArraySize, 0), /* channel list */ - DECLARE_DYNAMIC_ATTRIBUTE(ZCL_TV_CHANNEL_LINEUP_ATTRIBUTE_ID, STRUCT, 1, 0), /* lineup */ - DECLARE_DYNAMIC_ATTRIBUTE(ZCL_TV_CHANNEL_CURRENT_CHANNEL_ATTRIBUTE_ID, STRUCT, 1, 0), /* current channel */ +DECLARE_DYNAMIC_ATTRIBUTE(ZCL_CHANNEL_LIST_ATTRIBUTE_ID, ARRAY, kDescriptorAttributeArraySize, 0), /* channel list */ + DECLARE_DYNAMIC_ATTRIBUTE(ZCL_CHANNEL_LINEUP_ATTRIBUTE_ID, STRUCT, 1, 0), /* lineup */ + DECLARE_DYNAMIC_ATTRIBUTE(ZCL_CHANNEL_CURRENT_CHANNEL_ATTRIBUTE_ID, STRUCT, 1, 0), /* current channel */ DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); // Declare Cluster List for Content App endpoint @@ -143,7 +142,7 @@ DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs), DECLARE_DYNAMIC_CLUSTER(ZCL_CONTENT_LAUNCH_CLUSTER_ID, contentLauncherAttrs), DECLARE_DYNAMIC_CLUSTER(ZCL_MEDIA_PLAYBACK_CLUSTER_ID, mediaPlaybackAttrs), DECLARE_DYNAMIC_CLUSTER(ZCL_TARGET_NAVIGATOR_CLUSTER_ID, targetNavigatorAttrs), - DECLARE_DYNAMIC_CLUSTER(ZCL_TV_CHANNEL_CLUSTER_ID, channelAttrs) DECLARE_DYNAMIC_CLUSTER_LIST_END; + DECLARE_DYNAMIC_CLUSTER(ZCL_CHANNEL_CLUSTER_ID, channelAttrs) DECLARE_DYNAMIC_CLUSTER_LIST_END; // Declare Content App endpoint DECLARE_DYNAMIC_ENDPOINT(contentAppEndpoint, contentAppClusters); @@ -191,7 +190,8 @@ uint32_t AccountLoginImpl::GetSetupPIN(const char * tempAccountId) return mSetupPIN; } -ApplicationLauncherResponse ApplicationLauncherImpl::LaunchApp(ApplicationLauncherApp application, std::string data) +chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type +ApplicationLauncherImpl::LaunchApp(Application application, std::string data) { std::string appId(application.applicationId.data(), application.applicationId.size()); ChipLogProgress(DeviceLayer, @@ -199,23 +199,21 @@ ApplicationLauncherResponse ApplicationLauncherImpl::LaunchApp(ApplicationLaunch "application.applicationId=%s data=%s", application.catalogVendorId, appId.c_str(), data.c_str()); - ApplicationLauncherResponse response; - const char * testData = "data"; - response.data = (uint8_t *) testData; - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type response; + response.data = chip::CharSpan("data", strlen("data")); + response.status = chip::app::Clusters::ApplicationLauncher::StatusEnum::kSuccess; return response; } -ContentLaunchResponse ContentLauncherImpl::LaunchContent(std::list parameterList, bool autoplay, - std::string data) +chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type +ContentLauncherImpl::LaunchContent(std::list parameterList, bool autoplay, std::string data) { ChipLogProgress(DeviceLayer, "ContentLauncherImpl: LaunchContent autoplay=%d data=\"%s\"", autoplay ? 1 : 0, data.c_str()); - ContentLaunchResponse response; - response.err = CHIP_NO_ERROR; - response.data = "Example app data"; - response.status = EMBER_ZCL_CONTENT_LAUNCH_STATUS_SUCCESS; + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type response; + response.data = chip::CharSpan("data", strlen("data")); + response.status = chip::app::Clusters::ContentLauncher::StatusEnum::kSuccess; return response; } @@ -241,7 +239,7 @@ ContentApp * ContentAppFactoryImpl::LoadContentAppByVendorId(uint16_t vendorId) return nullptr; } -ContentApp * ContentAppFactoryImpl::LoadContentAppByAppId(ApplicationLauncherApp application) +ContentApp * ContentAppFactoryImpl::LoadContentAppByAppId(Application application) { std::string appId(application.applicationId.data(), application.applicationId.size()); ChipLogProgress(DeviceLayer, diff --git a/examples/tv-app/linux/AppImpl.h b/examples/tv-app/linux/AppImpl.h index 201730c014e000..4512c514156409 100644 --- a/examples/tv-app/linux/AppImpl.h +++ b/examples/tv-app/linux/AppImpl.h @@ -44,10 +44,10 @@ class DLL_EXPORT ApplicationBasicImpl : public ApplicationBasic inline uint16_t GetVendorId() override { return mVendorId; }; inline const char * GetApplicationName() override { return mApplicationName; }; inline uint16_t GetProductId() override { return mProductId; }; - inline app::Clusters::ApplicationBasic::ApplicationBasicStatus GetApplicationStatus() override { return mApplicationStatus; }; + inline app::Clusters::ApplicationBasic::ApplicationStatusEnum GetApplicationStatus() override { return mApplicationStatus; }; inline const char * GetApplicationVersion() override { return mApplicationVersion; }; - inline void SetApplicationStatus(app::Clusters::ApplicationBasic::ApplicationBasicStatus applicationStatus) override + inline void SetApplicationStatus(app::Clusters::ApplicationBasic::ApplicationStatusEnum applicationStatus) override { mApplicationStatus = applicationStatus; }; @@ -67,8 +67,8 @@ class DLL_EXPORT ApplicationBasicImpl : public ApplicationBasic uint16_t mVendorId; char mApplicationName[kApplicationNameSize]; uint16_t mProductId; - app::Clusters::ApplicationBasic::ApplicationBasicStatus mApplicationStatus = - app::Clusters::ApplicationBasic::ApplicationBasicStatus::kStopped; + app::Clusters::ApplicationBasic::ApplicationStatusEnum mApplicationStatus = + app::Clusters::ApplicationBasic::ApplicationStatusEnum::kStopped; char mApplicationVersion[kApplicationVersionSize]; }; @@ -98,7 +98,8 @@ class DLL_EXPORT ApplicationLauncherImpl : public ApplicationLauncher public: virtual ~ApplicationLauncherImpl() {} - ApplicationLauncherResponse LaunchApp(ApplicationLauncherApp application, std::string data) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type LaunchApp(Application application, + std::string data) override; protected: }; @@ -108,7 +109,8 @@ class DLL_EXPORT ContentLauncherImpl : public ContentLauncher public: virtual ~ContentLauncherImpl() {} - ContentLaunchResponse LaunchContent(std::list parameterList, bool autoplay, std::string data) override; + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type LaunchContent(std::list parameterList, + bool autoplay, std::string data) override; protected: }; @@ -173,7 +175,7 @@ class DLL_EXPORT ContentAppFactoryImpl : public ContentAppFactory virtual ~ContentAppFactoryImpl() {} ContentApp * LoadContentAppByVendorId(uint16_t vendorId); - ContentApp * LoadContentAppByAppId(ApplicationLauncherApp application); + ContentApp * LoadContentAppByAppId(Application application); protected: ContentAppImpl mContentApps[APP_LIBRARY_SIZE] = { ContentAppImpl("Vendor1", 1, "App1", 11, "Version1"), diff --git a/examples/tv-app/linux/BUILD.gn b/examples/tv-app/linux/BUILD.gn index 98beeb571f033b..bbdaa76c154c84 100644 --- a/examples/tv-app/linux/BUILD.gn +++ b/examples/tv-app/linux/BUILD.gn @@ -34,6 +34,8 @@ executable("chip-tv-app") { "include/application-launcher/ApplicationLauncherManager.h", "include/audio-output/AudioOutputManager.cpp", "include/audio-output/AudioOutputManager.h", + "include/channel/ChannelManager.cpp", + "include/channel/ChannelManager.h", "include/cluster-change-attribute.cpp", "include/cluster-init.cpp", "include/content-launcher/ContentLauncherManager.cpp", @@ -50,8 +52,6 @@ executable("chip-tv-app") { "include/media-playback/MediaPlaybackManager.h", "include/target-navigator/TargetNavigatorManager.cpp", "include/target-navigator/TargetNavigatorManager.h", - "include/tv-channel/TvChannelManager.cpp", - "include/tv-channel/TvChannelManager.h", "include/wake-on-lan/WakeOnLanManager.cpp", "include/wake-on-lan/WakeOnLanManager.h", "main.cpp", diff --git a/examples/tv-app/linux/args.gni b/examples/tv-app/linux/args.gni index 1c8eb57e4d1e09..beb195669abda2 100644 --- a/examples/tv-app/linux/args.gni +++ b/examples/tv-app/linux/args.gni @@ -25,3 +25,5 @@ chip_project_config_include_dirs = chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] chip_build_libshell = true + +chip_enable_rotating_device_id = true diff --git a/examples/tv-app/linux/include/account-login/AccountLoginManager.cpp b/examples/tv-app/linux/include/account-login/AccountLoginManager.cpp index ed816f72f3648d..f391901e136e32 100644 --- a/examples/tv-app/linux/include/account-login/AccountLoginManager.cpp +++ b/examples/tv-app/linux/include/account-login/AccountLoginManager.cpp @@ -17,75 +17,35 @@ */ #include "AccountLoginManager.h" -#include -#include -#include -#include -#include #include #include using namespace std; +using namespace chip::app::Clusters::AccountLogin; -bool AccountLoginManager::isUserLoggedIn(string requestTempAccountIdentifier, string requestSetupPin) +bool AccountLoginManager::HandleLogin(const chip::CharSpan & tempAccountIdentifier, const chip::CharSpan & setupPin) { - // TODO: Fix hardcoding length of strings - requestTempAccountIdentifier = requestTempAccountIdentifier.substr(0, 4); - requestSetupPin = requestSetupPin.substr(0, 10); - for (auto it = accounts.cbegin(); it != accounts.cend(); ++it) - { - ChipLogProgress(Zcl, "temporary account id: %s", it->first.c_str()); - ChipLogProgress(Zcl, "setup pin %s", it->second.c_str()); - } + string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size()); + string setupPinString(setupPin.data(), setupPin.size()); + ChipLogProgress(Zcl, "temporary account id: %s", tempAccountIdentifierString.c_str()); + ChipLogProgress(Zcl, "setup pin %s", setupPinString.c_str()); - if (accounts.find(requestTempAccountIdentifier) != accounts.end()) - { - bool found = accounts[requestTempAccountIdentifier] == requestSetupPin; - if (!found) - { - ChipLogError(Zcl, "User is not logged in, failed to match request setup pin."); - } - return found; - } - else - { - ChipLogError(Zcl, "User is not logged in, failed to find temp account identifier."); - return false; - } -} - -void AccountLoginManager::setTempAccountIdentifierForPin(string tempAccountIdentifier, string setupPin) -{ - // TODO: Fix hardcoding length of strings - string tempId = tempAccountIdentifier.substr(0, 4); - accounts[tempId] = setupPin; -} - -string AccountLoginManager::proxySetupPinRequest(string requestTempAccountIdentifier, chip::EndpointId endpoint) -{ - // TODO: Insert your code here to send temp account identifier request - return "tempPin123"; + // TODO: Insert your code here to handle login request + return true; } -bool AccountLoginManager::proxyLogout() +bool AccountLoginManager::HandleLogout() { // TODO: Insert your code here to send logout request return true; } -bool accountLoginClusterIsUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin) -{ - return AccountLoginManager().GetInstance().isUserLoggedIn(requestTempAccountIdentifier, requestSetupPin); -} - -bool accountLoginClusterLogout() -{ - return AccountLoginManager().GetInstance().proxyLogout(); -} - -std::string accountLoginClusterGetSetupPin(std::string requestTempAccountIdentifier, chip::EndpointId endpoint) +Commands::GetSetupPINResponse::Type AccountLoginManager::HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifier) { - string responseSetupPin = AccountLoginManager().proxySetupPinRequest(requestTempAccountIdentifier, endpoint); - AccountLoginManager().GetInstance().setTempAccountIdentifierForPin(requestTempAccountIdentifier, responseSetupPin); - return responseSetupPin; + string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size()); + ChipLogProgress(Zcl, "temporary account id: %s", tempAccountIdentifierString.c_str()); + // TODO: Insert your code here to handle get setup pin + Commands::GetSetupPINResponse::Type response; + response.setupPIN = chip::CharSpan("tempPin123", strlen("tempPin123")); + return response; } diff --git a/examples/tv-app/linux/include/account-login/AccountLoginManager.h b/examples/tv-app/linux/include/account-login/AccountLoginManager.h index 7377d95b18e0bf..68584ae6ec7bd5 100644 --- a/examples/tv-app/linux/include/account-login/AccountLoginManager.h +++ b/examples/tv-app/linux/include/account-login/AccountLoginManager.h @@ -18,25 +18,15 @@ #pragma once +#include + #include -#include -#include -#include -class AccountLoginManager +class AccountLoginManager : public chip::app::Clusters::AccountLogin::Delegate { public: - bool isUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin); - bool proxyLogout(); - std::string proxySetupPinRequest(std::string requestTempAccountIdentifier, chip::EndpointId endpoint); - void setTempAccountIdentifierForPin(std::string requestTempAccountIdentifier, std::string requestSetupPin); - - static AccountLoginManager & GetInstance() - { - static AccountLoginManager instance; - return instance; - } - -private: - std::map accounts; + bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString) override; + bool HandleLogout() override; + chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Type + HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifierString) override; }; diff --git a/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp b/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp index 598b38e0ede5b2..1a979da92efcc7 100644 --- a/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp +++ b/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.cpp @@ -17,162 +17,49 @@ */ #include "ApplicationBasicManager.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +using namespace std; +using namespace chip::app::Clusters::ApplicationBasic; -using namespace chip; -using namespace chip::AppPlatform; - -CHIP_ERROR ApplicationBasicManager::Init() +chip::CharSpan ApplicationBasicManager::HandleGetVendorName() { - CHIP_ERROR err = CHIP_NO_ERROR; - EndpointConfigurationStorage & endpointConfiguration = EndpointConfigurationStorage::GetInstance(); - err = endpointConfiguration.Init(); - SuccessOrExit(err); - es = &endpointConfiguration; -exit: - return err; + return chip::CharSpan("exampleVendorName1", strlen("exampleVendorName1")); } -void ApplicationBasicManager::store(chip::EndpointId endpoint, Application * application) +uint16_t ApplicationBasicManager::HandleGetVendorId() { - uint8_t bufferMemory[64]; - MutableByteSpan zclString(bufferMemory); - - MakeZclCharString(zclString, application->vendorName); - EmberAfStatus vendorNameStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_VENDOR_NAME_ATTRIBUTE_ID, - zclString.data(), ZCL_CHAR_STRING_ATTRIBUTE_TYPE); - if (vendorNameStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store vendor name attribute."); - } - - EmberAfStatus vendorIdStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_VENDOR_ID_ATTRIBUTE_ID, - (uint8_t *) &application->vendorId, ZCL_INT16U_ATTRIBUTE_TYPE); - if (vendorIdStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store vendor id attribute."); - } - - MakeZclCharString(zclString, application->name); - EmberAfStatus nameStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_NAME_ATTRIBUTE_ID, zclString.data(), - ZCL_CHAR_STRING_ATTRIBUTE_TYPE); - if (nameStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store name attribute."); - } - - MakeZclCharString(zclString, application->version); - EmberAfStatus versionStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_VERSION_ATTRIBUTE_ID, - zclString.data(), ZCL_CHAR_STRING_ATTRIBUTE_TYPE); - if (versionStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store version attribute."); - } - - EmberAfStatus productIdStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_PRODUCT_ID_ATTRIBUTE_ID, - (uint8_t *) &application->productId, ZCL_INT16U_ATTRIBUTE_TYPE); - if (productIdStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store product id attribute."); - } - - EmberAfStatus applicationStatus = - emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_BASIC_CLUSTER_ID, ZCL_APPLICATION_STATUS_ATTRIBUTE_ID, - (uint8_t *) &application->status, ZCL_ENUM8_ATTRIBUTE_TYPE); - if (applicationStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store status attribute."); - } + return 1; } -Application ApplicationBasicManager::getApplicationForEndpoint(chip::EndpointId endpoint) +chip::CharSpan ApplicationBasicManager::HandleGetApplicationName() { - Application app = {}; - uint16_t size = static_cast(sizeof(app.name)); - - std::string section = "endpoint" + std::to_string(endpoint); - - CHIP_ERROR err = es->get(section, "name", app.name, size); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app name. Error:%s", chip::ErrorStr(err)); - } - - err = es->get(section, "vendorName", app.vendorName, size); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app vendor name. Error:%s", chip::ErrorStr(err)); - } - - err = es->get(section, "version", app.version, size); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get application version. Error:%s", chip::ErrorStr(err)); - } - - err = es->get(section, "id", app.id, size); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app id. Error:%s", chip::ErrorStr(err)); - } - - err = es->get(section, "catalogVendorId", app.catalogVendorId); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app catalog vendor id. Error:%s", chip::ErrorStr(err)); - } - - err = es->get(section, "productId", app.productId); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app product id. Error:%s", chip::ErrorStr(err)); - } + return chip::CharSpan("exampleName1", strlen("exampleName1")); +} - err = es->get(section, "vendorId", app.vendorId); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get app vendor id. Error:%s", chip::ErrorStr(err)); - } +uint16_t ApplicationBasicManager::HandleGetProductId() +{ + return 1; +} - return app; +chip::app::Clusters::ApplicationBasic::Structs::Application::Type ApplicationBasicManager::HandleGetApplication() +{ + chip::app::Clusters::ApplicationBasic::Structs::Application::Type application; + application.catalogVendorId = 123; + application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); + return application; } -bool applicationBasicClusterChangeApplicationStatus(chip::EndpointId endpoint, - app::Clusters::ApplicationBasic::ApplicationBasicStatus status) +ApplicationStatusEnum ApplicationBasicManager::HandleGetStatus() { - ChipLogProgress(Zcl, "Sent an application status change request %d for endpoint %d", to_underlying(status), endpoint); + return ApplicationStatusEnum::kStopped; +} -#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED - ContentApp * app = chip::AppPlatform::AppPlatform::GetInstance().GetContentAppByEndpointId(endpoint); - if (app == NULL) - { - if (endpoint == 3) - { - // TODO: Fix hardcoded app endpoints 3-5, fix test cases - return true; - } - ChipLogProgress(Zcl, "No app for endpoint %d", endpoint); - return false; - } - app->GetApplicationBasic()->SetApplicationStatus(status); -#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +chip::CharSpan ApplicationBasicManager::HandleGetApplicationVersion() +{ + return chip::CharSpan("exampleVersion", strlen("exampleVersion")); +} - return true; +std::list ApplicationBasicManager::HandleGetAllowedVendorList() +{ + return { 123, 456 }; } diff --git a/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.h b/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.h index d8c8d21a51031a..e907fc8891861e 100644 --- a/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.h +++ b/examples/tv-app/linux/include/application-basic/ApplicationBasicManager.h @@ -18,26 +18,17 @@ #pragma once -#include -#include +#include -#include "../endpoint-configuration/EndpointConfigurationStorage.h" -#include "Application.h" -#include - -class ApplicationBasicManager +class ApplicationBasicManager : public chip::app::Clusters::ApplicationBasic::Delegate { public: - CHIP_ERROR Init(); - void store(chip::EndpointId endpoint, Application * application); - Application getApplicationForEndpoint(chip::EndpointId endpoint); - - static ApplicationBasicManager & GetInstance() - { - static ApplicationBasicManager instance; - return instance; - } - -private: - EndpointConfigurationStorage * es = nullptr; + chip::CharSpan HandleGetVendorName() override; + uint16_t HandleGetVendorId() override; + chip::CharSpan HandleGetApplicationName() override; + uint16_t HandleGetProductId() override; + chip::app::Clusters::ApplicationBasic::Structs::Application::Type HandleGetApplication() override; + chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum HandleGetStatus() override; + chip::CharSpan HandleGetApplicationVersion() override; + std::list HandleGetAllowedVendorList() override; }; diff --git a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp index 7b0880ea99d6c5..f6a8afc0ae8ee7 100644 --- a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp +++ b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.cpp @@ -17,91 +17,50 @@ */ #include "ApplicationLauncherManager.h" -#include -#include -#include -#include -#include -#include using namespace std; -using namespace chip::AppPlatform; +using namespace chip::app::Clusters::ApplicationLauncher; -CHIP_ERROR ApplicationLauncherManager::Init() +Structs::ApplicationEP::Type ApplicationLauncherManager::HandleGetCurrentApp() { - CHIP_ERROR err = CHIP_NO_ERROR; - - SuccessOrExit(err); -exit: - return err; + Structs::ApplicationEP::Type currentApp; + currentApp.application.catalogVendorId = 123; + currentApp.application.applicationId = chip::CharSpan("applicationId", strlen("applicationId")); + currentApp.endpoint = chip::CharSpan("endpointId", strlen("endpointId")); + return currentApp; } -CHIP_ERROR ApplicationLauncherManager::proxyGetApplicationList(chip::EndpointId mEndpointId, - chip::app::AttributeValueEncoder & aEncoder) +std::list ApplicationLauncherManager::HandleGetCatalogList() { - ChipLogProgress(Zcl, "ApplicationLauncherManager::proxyGetApplicationList endpoint=%d", mEndpointId); - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { - ReturnErrorOnFailure(encoder.Encode(123u)); - ReturnErrorOnFailure(encoder.Encode(456u)); - return CHIP_NO_ERROR; - }); + return { 123, 456 }; } -ApplicationLauncherResponse applicationLauncherClusterLaunchApp(chip::EndpointId endpoint, ApplicationLauncherApp application, - std::string data) +Commands::LauncherResponse::Type ApplicationLauncherManager::HandleLaunchApp( + const chip::CharSpan & data, const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { - ChipLogProgress(Zcl, "ApplicationLauncherManager::applicationLauncherClusterLaunchApp endpoint=%d", emberAfCurrentEndpoint()); - -#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED - ContentApp * app = chip::AppPlatform::AppPlatform::GetInstance().GetContentAppByEndpointId(endpoint); - if (app != NULL) - { - return app->GetApplicationLauncher()->LaunchApp(application, data); - } - - app = chip::AppPlatform::AppPlatform::GetInstance().GetLoadContentAppByAppId(application); - if (app != NULL) - { - return app->GetApplicationLauncher()->LaunchApp(application, data); - } -#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED - - ChipLogProgress(Zcl, "ApplicationLauncherManager::applicationLauncherClusterLaunchApp app not found"); - - // TODO: Insert your code - ApplicationLauncherResponse response; - const char * testData = "data"; - response.data = (uint8_t *) testData; - // must return success for tests to pass - // response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_APP_NOT_AVAILABLE; - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS; - // TODO: Update once storing a structure attribute is supported - // emberAfWriteServerAttribute(endpoint, ZCL_APPLICATION_LAUNCH_CLUSTER_ID, ZCL_APPLICATION_LAUNCHER_CURRENT_APP_APPLICATION_ID, - // (uint8_t *) &application, ZCL_STRUCT_ATTRIBUTE_TYPE); - + // TODO: Insert code here + Commands::LauncherResponse::Type response; + response.data = chip::CharSpan("data", strlen("data")); + response.status = StatusEnum::kSuccess; return response; } -ApplicationLauncherResponse applicationLauncherClusterStopApp(chip::EndpointId endpoint, ApplicationLauncherApp application, - std::string data) +Commands::LauncherResponse::Type +ApplicationLauncherManager::HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { - ChipLogProgress(Zcl, "ApplicationLauncherManager::applicationLauncherClusterStopApp"); - - ApplicationLauncherResponse response; - const char * testData = "data"; - response.data = (uint8_t *) testData; - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS; + // TODO: Insert code here + Commands::LauncherResponse::Type response; + response.data = chip::CharSpan("data", strlen("data")); + response.status = StatusEnum::kSuccess; return response; } -ApplicationLauncherResponse applicationLauncherClusterHideApp(chip::EndpointId endpoint, ApplicationLauncherApp application, - std::string data) +Commands::LauncherResponse::Type +ApplicationLauncherManager::HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) { - ChipLogProgress(Zcl, "ApplicationLauncherManager::applicationLauncherClusterHideApp"); - - ApplicationLauncherResponse response; - const char * testData = "data"; - response.data = (uint8_t *) testData; - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS; + // TODO: Insert code here + Commands::LauncherResponse::Type response; + response.data = chip::CharSpan("data", strlen("data")); + response.status = StatusEnum::kSuccess; return response; } diff --git a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.h b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.h index c3944bcfa0740c..ece3bd36d69523 100644 --- a/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.h +++ b/examples/tv-app/linux/include/application-launcher/ApplicationLauncherManager.h @@ -18,15 +18,20 @@ #pragma once -#include -#include +#include +#include -#include -#include - -class ApplicationLauncherManager +class ApplicationLauncherManager : public chip::app::Clusters::ApplicationLauncher::Delegate { public: - CHIP_ERROR Init(); - CHIP_ERROR proxyGetApplicationList(chip::EndpointId mEndpointId, chip::app::AttributeValueEncoder & aEncoder); + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type HandleGetCurrentApp() override; + std::list HandleGetCatalogList() override; + + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleLaunchApp(const chip::CharSpan & data, + const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type + HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) override; }; diff --git a/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp b/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp index 1eb815b0e37a54..e3eccf8afa2232 100644 --- a/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp +++ b/examples/tv-app/linux/include/audio-output/AudioOutputManager.cpp @@ -18,54 +18,38 @@ #include "AudioOutputManager.h" -#include -#include -#include -#include -#include - -#include -#include - using namespace std; +using namespace chip::app::Clusters::AudioOutput; -CHIP_ERROR AudioOutputManager::Init() +uint8_t AudioOutputManager::HandleGetCurrentOutput() { - CHIP_ERROR err = CHIP_NO_ERROR; - - // TODO: Store feature map once it is supported - map featureMap; - featureMap["NU"] = true; - - return err; + return 0; } -CHIP_ERROR AudioOutputManager::proxyGetListOfAudioOutputInfo(chip::EndpointId mEndpointId, - chip::app::AttributeValueEncoder & aEncoder) +std::list AudioOutputManager::HandleGetOutputList() { - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { - // TODO: Insert code here - int maximumVectorSize = 3; - char name[] = "exampleName"; - - for (int i = 0; i < maximumVectorSize; ++i) - { - chip::app::Clusters::AudioOutput::Structs::AudioOutputInfo::Type audioOutputInfo; - audioOutputInfo.outputType = EMBER_ZCL_AUDIO_OUTPUT_TYPE_HDMI; - audioOutputInfo.name = chip::CharSpan(name, sizeof(name) - 1); - audioOutputInfo.index = static_cast(1 + i); - ReturnErrorOnFailure(encoder.Encode(audioOutputInfo)); - } - return CHIP_NO_ERROR; - }); + std::list list; + // TODO: Insert code here + int maximumVectorSize = 3; + + for (int i = 0; i < maximumVectorSize; ++i) + { + chip::app::Clusters::AudioOutput::Structs::OutputInfo::Type outputInfo; + outputInfo.outputType = chip::app::Clusters::AudioOutput::OutputTypeEnum::kHdmi; + outputInfo.name = chip::CharSpan("exampleName", strlen("exampleName")); + outputInfo.index = static_cast(1 + i); + list.push_back(outputInfo); + } + return list; } -bool audioOutputClusterSelectOutput(uint8_t index) +bool AudioOutputManager::HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) { // TODO: Insert code here return true; } -bool audioOutputClusterRenameOutput(uint8_t index, const chip::CharSpan & name) + +bool AudioOutputManager::HandleSelectOutput(const uint8_t & index) { // TODO: Insert code here return true; diff --git a/examples/tv-app/linux/include/audio-output/AudioOutputManager.h b/examples/tv-app/linux/include/audio-output/AudioOutputManager.h index 0aecc1ffe2d845..8dcd3ed344fc9a 100644 --- a/examples/tv-app/linux/include/audio-output/AudioOutputManager.h +++ b/examples/tv-app/linux/include/audio-output/AudioOutputManager.h @@ -18,13 +18,13 @@ #pragma once -#include +#include -#include -#include -class AudioOutputManager +class AudioOutputManager : public chip::app::Clusters::AudioOutput::Delegate { public: - CHIP_ERROR Init(); - CHIP_ERROR proxyGetListOfAudioOutputInfo(chip::EndpointId mEndpointId, chip::app::AttributeValueEncoder & aEncoder); + uint8_t HandleGetCurrentOutput() override; + std::list HandleGetOutputList() override; + bool HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) override; + bool HandleSelectOutput(const uint8_t & index) override; }; diff --git a/examples/tv-app/linux/include/channel/ChannelManager.cpp b/examples/tv-app/linux/include/channel/ChannelManager.cpp new file mode 100644 index 00000000000000..066476c57c759e --- /dev/null +++ b/examples/tv-app/linux/include/channel/ChannelManager.cpp @@ -0,0 +1,84 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ChannelManager.h" + +using namespace chip; +using namespace chip::app::Clusters::Channel; + +std::list ChannelManager::HandleGetChannelList() +{ + std::list list; + // TODO: Insert code here + int maximumVectorSize = 2; + + for (int i = 0; i < maximumVectorSize; ++i) + { + chip::app::Clusters::Channel::Structs::ChannelInfo::Type channelInfo; + channelInfo.affiliateCallSign = chip::CharSpan("exampleASign", strlen("exampleASign")); + channelInfo.callSign = chip::CharSpan("exampleCSign", strlen("exampleCSign")); + channelInfo.name = chip::CharSpan("exampleName", strlen("exampleName")); + channelInfo.majorNumber = static_cast(1 + i); + channelInfo.minorNumber = static_cast(2 + i); + list.push_back(channelInfo); + } + return list; +} + +chip::app::Clusters::Channel::Structs::LineupInfo::Type ChannelManager::HandleGetLineup() +{ + chip::app::Clusters::Channel::Structs::LineupInfo::Type lineup; + lineup.operatorName = chip::CharSpan("operatorName", strlen("operatorName")); + lineup.lineupName = chip::CharSpan("lineupName", strlen("lineupName")); + lineup.postalCode = chip::CharSpan("postalCode", strlen("postalCode")); + lineup.lineupInfoType = chip::app::Clusters::Channel::LineupInfoTypeEnum::kMso; + return lineup; +} + +chip::app::Clusters::Channel::Structs::ChannelInfo::Type ChannelManager::HandleGetCurrentChannel() +{ + chip::app::Clusters::Channel::Structs::ChannelInfo::Type currentChannel; + currentChannel.affiliateCallSign = chip::CharSpan("exampleASign", strlen("exampleASign")); + currentChannel.callSign = chip::CharSpan("exampleCSign", strlen("exampleCSign")); + currentChannel.name = chip::CharSpan("exampleName", strlen("exampleName")); + currentChannel.majorNumber = 1; + currentChannel.minorNumber = 0; + return currentChannel; +} + +Commands::ChangeChannelResponse::Type ChannelManager::HandleChangeChannel(const chip::CharSpan & match) +{ + Commands::ChangeChannelResponse::Type response; + response.channelMatch.majorNumber = 1; + response.channelMatch.minorNumber = 0; + response.channelMatch.name = chip::CharSpan("name", strlen("name")); + response.channelMatch.callSign = chip::CharSpan("callSign", strlen("callSign")); + response.channelMatch.affiliateCallSign = chip::CharSpan("affiliateCallSign", strlen("affiliateCallSign")); + response.errorType = chip::app::Clusters::Channel::ErrorTypeEnum::kMultipleMatches; + return response; +} + +bool ChannelManager::HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) +{ + // TODO: Insert code here + return true; +} +bool ChannelManager::HandleSkipChannel(const uint16_t & count) +{ + // TODO: Insert code here + return true; +} diff --git a/examples/tv-app/linux/include/channel/ChannelManager.h b/examples/tv-app/linux/include/channel/ChannelManager.h new file mode 100644 index 00000000000000..f090b18150de27 --- /dev/null +++ b/examples/tv-app/linux/include/channel/ChannelManager.h @@ -0,0 +1,32 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +class ChannelManager : public chip::app::Clusters::Channel::Delegate +{ +public: + std::list HandleGetChannelList() override; + chip::app::Clusters::Channel::Structs::LineupInfo::Type HandleGetLineup() override; + chip::app::Clusters::Channel::Structs::ChannelInfo::Type HandleGetCurrentChannel() override; + + chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Type HandleChangeChannel(const chip::CharSpan & match) override; + bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) override; + bool HandleSkipChannel(const uint16_t & count) override; +}; diff --git a/examples/tv-app/linux/include/cluster-init.cpp b/examples/tv-app/linux/include/cluster-init.cpp index 8ec354664ee23c..bbb889d264404d 100644 --- a/examples/tv-app/linux/include/cluster-init.cpp +++ b/examples/tv-app/linux/include/cluster-init.cpp @@ -19,10 +19,10 @@ #include "application-basic/ApplicationBasicManager.h" #include "application-launcher/ApplicationLauncherManager.h" #include "audio-output/AudioOutputManager.h" +#include "channel/ChannelManager.h" #include "content-launcher/ContentLauncherManager.h" #include "media-input/MediaInputManager.h" #include "target-navigator/TargetNavigatorManager.h" -#include "tv-channel/TvChannelManager.h" #include "wake-on-lan/WakeOnLanManager.h" #include @@ -54,231 +54,3 @@ class TvAttrAccess : public app::AttributeAccessInterface }; } // anonymous namespace - -/** @brief Application Basic Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ -void emberAfApplicationBasicClusterInitCallback(chip::EndpointId endpoint) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationBasicManager & aManager = ApplicationBasicManager::GetInstance(); - err = aManager.Init(); - if (CHIP_NO_ERROR == err) - { - Application application = aManager.getApplicationForEndpoint(endpoint); - aManager.store(endpoint, &application); - } - else - { - ChipLogError(Zcl, "Failed to store application for endpoint: %d. Error:%s", endpoint, chip::ErrorStr(err)); - } -} - -/** @brief Wake On LAN Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ -void emberAfWakeOnLanClusterInitCallback(chip::EndpointId endpoint) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - WakeOnLanManager & wolManager = WakeOnLanManager::GetInstance(); - err = wolManager.Init(); - if (CHIP_NO_ERROR == err) - { - char macAddress[32] = ""; - wolManager.setMacAddress(endpoint, macAddress); - wolManager.store(endpoint, macAddress); - } - else - { - ChipLogError(Zcl, "Failed to store mac address for endpoint: %d. Error:%s", endpoint, chip::ErrorStr(err)); - } -} - -namespace { - -TvAttrAccess - gTvChannelAttrAccess; - -} // anonymous namespace - -/** @brief Tv Channel Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ -void emberAfTvChannelClusterInitCallback(EndpointId endpoint) -{ - static bool attrAccessRegistered = false; - if (!attrAccessRegistered) - { - registerAttributeAccessOverride(&gTvChannelAttrAccess); - attrAccessRegistered = true; - } -} - -namespace { - -TvAttrAccess - gApplicationLauncherAttrAccess; - -} // anonymous namespace - -/** @brief Application Launcher Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ -void emberAfApplicationLauncherClusterInitCallback(EndpointId endpoint) -{ - static bool attrAccessRegistered = false; - if (!attrAccessRegistered) - { - registerAttributeAccessOverride(&gApplicationLauncherAttrAccess); - attrAccessRegistered = true; - } -} - -namespace { - -TvAttrAccess - gAudioOutputAttrAccess; - -} // anonymous namespace - -/** @brief Audio Output Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ -void emberAfAudioOutputClusterInitCallback(EndpointId endpoint) -{ - static bool attrAccessRegistered = false; - if (!attrAccessRegistered) - { - registerAttributeAccessOverride(&gAudioOutputAttrAccess); - attrAccessRegistered = true; - } -} - -namespace { - -class ContentLauncherAttrAccess : public app::AttributeAccessInterface -{ -public: - ContentLauncherAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), app::Clusters::ContentLauncher::Id) - {} - - CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override - { - if (aPath.mAttributeId == app::Clusters::ContentLauncher::Attributes::AcceptsHeaderList::Id) - { - return ContentLauncherManager().proxyGetAcceptsHeader(aEncoder); - } - - return CHIP_NO_ERROR; - } -}; - -ContentLauncherAttrAccess gContentLauncherAttrAccess; - -} // anonymous namespace - -/** @brief Content Launch Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ -void emberAfContentLauncherClusterInitCallback(EndpointId endpoint) -{ - static bool attrAccessRegistered = false; - if (!attrAccessRegistered) - { - registerAttributeAccessOverride(&gContentLauncherAttrAccess); - attrAccessRegistered = true; - } -} - -namespace { - -TvAttrAccess - gMediaInputAttrAccess; - -} // anonymous namespace - -/** @brief Media Input Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ -void emberAfMediaInputClusterInitCallback(EndpointId endpoint) -{ - static bool attrAccessRegistered = false; - if (!attrAccessRegistered) - { - registerAttributeAccessOverride(&gMediaInputAttrAccess); - attrAccessRegistered = true; - } -} - -namespace { - -TvAttrAccess - gTargetNavigatorAttrAccess; - -} // anonymous namespace - -/** @brief Target Navigator Cluster Init - * - * This function is called when a specific cluster is initialized. It gives the - * application an opportunity to take care of cluster initialization procedures. - * It is called exactly once for each endpoint where cluster is present. - * - * @param endpoint Ver.: always - * - */ -void emberAfTargetNavigatorClusterInitCallback(EndpointId endpoint) -{ - static bool attrAccessRegistered = false; - if (!attrAccessRegistered) - { - registerAttributeAccessOverride(&gTargetNavigatorAttrAccess); - attrAccessRegistered = true; - } -} diff --git a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp index 0bb0a9df4e3c1b..33891a9f9bbfa7 100644 --- a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp +++ b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.cpp @@ -17,112 +17,59 @@ */ #include "ContentLauncherManager.h" - -#include -#include -#include -#include -#include - -#include -#include #include -#include -#include -#include -#include - -#include -#include using namespace std; +using namespace chip::app::Clusters::ContentLauncher; using namespace chip::AppPlatform; -CHIP_ERROR ContentLauncherManager::Init() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - // TODO: Store feature map once it is supported - map featureMap; - featureMap["CS"] = true; - featureMap["UP"] = true; - featureMap["WA"] = true; - - SuccessOrExit(err); -exit: - return err; -} - -CHIP_ERROR ContentLauncherManager::proxyGetAcceptsHeader(chip::app::AttributeValueEncoder & aEncoder) -{ - ChipLogProgress(Zcl, "ContentLauncherManager::proxyGetAcceptsHeader "); - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { - std::list headerExample = { "image/*", "video/*" }; - - for (string entry : headerExample) - { - ReturnErrorOnFailure(encoder.Encode(chip::CharSpan(entry.c_str(), entry.length()))); - } - return CHIP_NO_ERROR; - }); -} - -CHIP_ERROR ContentLauncherManager::proxyGetSupportedStreamingTypes(chip::app::AttributeValueEncoder & aEncoder) +Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchContent(chip::EndpointId endpointId, + const std::list & parameterList, + bool autoplay, const chip::CharSpan & data) { - ChipLogProgress(Zcl, "ContentLauncherManager::proxyGetSupportedStreamingTypes "); - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { - // ReturnErrorOnFailure(encoder.Encode(EMBER_ZCL_CONTENT_LAUNCH_STREAMING_TYPE_DASH)); - // ReturnErrorOnFailure(encoder.Encode(EMBER_ZCL_CONTENT_LAUNCH_STREAMING_TYPE_HLS)); - return CHIP_NO_ERROR; - }); -} - -ContentLaunchResponse ContentLauncherManager::proxyLaunchContentRequest(chip::EndpointId endpointId, - list parameterList, bool autoplay, - string data) -{ - ChipLogProgress(Zcl, "ContentLauncherManager::proxyLaunchContentRequest endpoint=%d", endpointId); + ChipLogProgress(Zcl, "ContentLauncherManager::HandleLaunchContent"); + string dataString(data.data(), data.size()); #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED ContentApp * app = chip::AppPlatform::AppPlatform::GetInstance().GetContentAppByEndpointId(endpointId); if (app != NULL) { - return app->GetContentLauncher()->LaunchContent(parameterList, autoplay, data); + return app->GetContentLauncher()->LaunchContent(parameterList, autoplay, dataString); } #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED // TODO: Insert code here - ContentLaunchResponse response; - response.err = CHIP_NO_ERROR; - response.data = "Example data"; - response.status = EMBER_ZCL_CONTENT_LAUNCH_STATUS_SUCCESS; + Commands::LaunchResponse::Type response; + response.data = chip::CharSpan("exampleData", strlen("exampleData")); + response.status = chip::app::Clusters::ContentLauncher::StatusEnum::kSuccess; return response; } -ContentLaunchResponse ContentLauncherManager::proxyLaunchUrlRequest(string contentUrl, string displayString, - ContentLaunchBrandingInformation brandingInformation) + +Commands::LaunchResponse::Type ContentLauncherManager::HandleLaunchUrl(const chip::CharSpan & contentUrl, + const chip::CharSpan & displayString, + const std::list & brandingInformation) { - ChipLogProgress(Zcl, "ContentLauncherManager::proxyLaunchUrlRequest contentUrl=%s ", contentUrl.c_str()); + ChipLogProgress(Zcl, "ContentLauncherManager::HandleLaunchUrl"); + + string contentUrlString(contentUrl.data(), contentUrl.size()); + string displayStringString(displayString.data(), displayString.size()); // TODO: Insert code here - ContentLaunchResponse response; - response.err = CHIP_NO_ERROR; - response.data = "Example data"; - response.status = EMBER_ZCL_CONTENT_LAUNCH_STATUS_SUCCESS; + Commands::LaunchResponse::Type response; + response.data = chip::CharSpan("exampleData", strlen("exampleData")); + response.status = chip::app::Clusters::ContentLauncher::StatusEnum::kSuccess; return response; } -ContentLaunchResponse contentLauncherClusterLaunchContent(chip::EndpointId endpointId, - std::list parameterList, bool autoplay, - const chip::CharSpan & data) +std::list ContentLauncherManager::HandleGetAcceptHeaderList() { - string dataString(data.data(), data.size()); - return ContentLauncherManager().proxyLaunchContentRequest(endpointId, parameterList, autoplay, dataString); + ChipLogProgress(Zcl, "ContentLauncherManager::HandleGetAcceptHeaderList"); + return { "example", "example" }; } -ContentLaunchResponse contentLauncherClusterLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, - ContentLaunchBrandingInformation & brandingInformation) +uint32_t ContentLauncherManager::HandleGetSupportedStreamingProtocols() { - string contentUrlString(contentUrl.data(), contentUrl.size()); - string displayStringString(displayString.data(), displayString.size()); - return ContentLauncherManager().proxyLaunchUrlRequest(contentUrlString, displayStringString, brandingInformation); + ChipLogProgress(Zcl, "ContentLauncherManager::HandleGetSupportedStreamingProtocols"); + uint32_t streamingProtocols = 0; + return streamingProtocols; } diff --git a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.h b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.h index aedeb2cc134b98..132afeb37a9812 100644 --- a/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.h +++ b/examples/tv-app/linux/include/content-launcher/ContentLauncherManager.h @@ -18,23 +18,17 @@ #pragma once -#include -#include #include -#include -#include -#include -#include - -class ContentLauncherManager +class ContentLauncherManager : public chip::app::Clusters::ContentLauncher::Delegate { public: - CHIP_ERROR Init(); - CHIP_ERROR proxyGetAcceptsHeader(chip::app::AttributeValueEncoder & aEncoder); - CHIP_ERROR proxyGetSupportedStreamingTypes(chip::app::AttributeValueEncoder & aEncoder); - ContentLaunchResponse proxyLaunchContentRequest(chip::EndpointId endpointId, std::list parameterList, - bool autoplay, std::string data); - ContentLaunchResponse proxyLaunchUrlRequest(std::string contentUrl, std::string displayString, - ContentLaunchBrandingInformation brandingInformation); + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type + HandleLaunchContent(chip::EndpointId endpointId, const std::list & parameterList, bool autoplay, + const chip::CharSpan & data) override; + chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::Type + HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, + const std::list & brandingInformation) override; + std::list HandleGetAcceptHeaderList() override; + uint32_t HandleGetSupportedStreamingProtocols() override; }; diff --git a/examples/tv-app/linux/include/keypad-input/KeypadInputManager.cpp b/examples/tv-app/linux/include/keypad-input/KeypadInputManager.cpp index 58a39ab91bb6b4..32bcc0342cb36d 100644 --- a/examples/tv-app/linux/include/keypad-input/KeypadInputManager.cpp +++ b/examples/tv-app/linux/include/keypad-input/KeypadInputManager.cpp @@ -18,31 +18,13 @@ #include "KeypadInputManager.h" -#include -#include +using namespace chip; +using namespace chip::app::Clusters::KeypadInput; -#include -#include - -using namespace std; - -CHIP_ERROR KeypadInputManager::Init() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - // TODO: Store feature map once it is supported - map featureMap; - featureMap["NV"] = true; - featureMap["LK"] = true; - featureMap["NK"] = true; - - SuccessOrExit(err); -exit: - return err; -} - -EmberAfKeypadInputStatus keypadInputClusterSendKey(EmberAfKeypadInputCecKeyCode keyCode) +Commands::SendKeyResponse::Type KeypadInputManager::HandleSendKey(const CecKeyCode & keycCode) { // TODO: Insert code here - return EMBER_ZCL_KEYPAD_INPUT_STATUS_SUCCESS; + Commands::SendKeyResponse::Type response; + response.status = chip::app::Clusters::KeypadInput::StatusEnum::kSuccess; + return response; } diff --git a/examples/tv-app/linux/include/keypad-input/KeypadInputManager.h b/examples/tv-app/linux/include/keypad-input/KeypadInputManager.h index d55161a5e1cad4..93d3f66e8a003a 100644 --- a/examples/tv-app/linux/include/keypad-input/KeypadInputManager.h +++ b/examples/tv-app/linux/include/keypad-input/KeypadInputManager.h @@ -18,13 +18,11 @@ #pragma once -#include +#include -#include -#include - -class KeypadInputManager +class KeypadInputManager : public chip::app::Clusters::KeypadInput::Delegate { public: - CHIP_ERROR Init(); + chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Type + HandleSendKey(const chip::app::Clusters::KeypadInput::CecKeyCode & keyCode) override; }; diff --git a/examples/tv-app/linux/include/low-power/LowPowerManager.cpp b/examples/tv-app/linux/include/low-power/LowPowerManager.cpp index 97016d4b01a74f..57399c0ba1de5c 100644 --- a/examples/tv-app/linux/include/low-power/LowPowerManager.cpp +++ b/examples/tv-app/linux/include/low-power/LowPowerManager.cpp @@ -18,7 +18,7 @@ #include "LowPowerManager.h" -bool lowPowerClusterSleep() +bool LowPowerManager::HandleSleep() { // TODO: Insert code here return true; diff --git a/examples/tv-app/linux/include/low-power/LowPowerManager.h b/examples/tv-app/linux/include/low-power/LowPowerManager.h index 75d500ca12de74..92bb1417be514d 100644 --- a/examples/tv-app/linux/include/low-power/LowPowerManager.h +++ b/examples/tv-app/linux/include/low-power/LowPowerManager.h @@ -18,9 +18,10 @@ #pragma once -#include +#include -class LowPowerManager +class LowPowerManager : public chip::app::Clusters::LowPower::Delegate { public: + bool HandleSleep() override; }; diff --git a/examples/tv-app/linux/include/media-input/MediaInputManager.cpp b/examples/tv-app/linux/include/media-input/MediaInputManager.cpp index 0b42108cad384e..4b654d0b838d87 100644 --- a/examples/tv-app/linux/include/media-input/MediaInputManager.cpp +++ b/examples/tv-app/linux/include/media-input/MediaInputManager.cpp @@ -17,63 +17,51 @@ #include "MediaInputManager.h" -#include -#include -#include -#include -#include -#include +using namespace chip; +using namespace chip::app::Clusters::MediaInput; -CHIP_ERROR MediaInputManager::Init() +std::list MediaInputManager::HandleGetInputList() { - CHIP_ERROR err = CHIP_NO_ERROR; + std::list list; + // TODO: Insert code here + int maximumVectorSize = 2; - // TODO: Store feature map once it is supported - std::map featureMap; - featureMap["NU"] = true; - SuccessOrExit(err); -exit: - return err; + for (int i = 0; i < maximumVectorSize; ++i) + { + chip::app::Clusters::MediaInput::Structs::InputInfo::Type inputInfo; + inputInfo.description = chip::CharSpan("exampleDescription", strlen("exampleDescription")); + inputInfo.name = chip::CharSpan("exampleName", strlen("exampleName")); + inputInfo.inputType = chip::app::Clusters::MediaInput::InputTypeEnum::kHdmi; + inputInfo.index = static_cast(1 + i); + list.push_back(inputInfo); + } + return list; } -CHIP_ERROR MediaInputManager::proxyGetInputList(chip::EndpointId mEndpointId, chip::app::AttributeValueEncoder & aEncoder) +uint8_t MediaInputManager::HandleGetCurrentInput() { - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { - // TODO: Insert code here - int maximumVectorSize = 2; - char description[] = "exampleDescription"; - char name[] = "exampleName"; - - for (int i = 0; i < maximumVectorSize; ++i) - { - chip::app::Clusters::MediaInput::Structs::MediaInputInfo::Type mediaInput; - mediaInput.description = chip::CharSpan(description, sizeof(description) - 1); - mediaInput.name = chip::CharSpan(name, sizeof(name) - 1); - mediaInput.inputType = EMBER_ZCL_MEDIA_INPUT_TYPE_HDMI; - mediaInput.index = static_cast(1 + i); - ReturnErrorOnFailure(encoder.Encode(mediaInput)); - } - - return CHIP_NO_ERROR; - }); + return 0; } -bool mediaInputClusterSelectInput(uint8_t input) +bool MediaInputManager::HandleSelectInput(const uint8_t index) { // TODO: Insert code here return true; } -bool mediaInputClusterShowInputStatus() + +bool MediaInputManager::HandleShowInputStatus() { // TODO: Insert code here return true; } -bool mediaInputClusterHideInputStatus() + +bool MediaInputManager::HandleHideInputStatus() { // TODO: Insert code here return true; } -bool mediaInputClusterRenameInput(uint8_t input, std::string name) + +bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharSpan & name) { // TODO: Insert code here return true; diff --git a/examples/tv-app/linux/include/media-input/MediaInputManager.h b/examples/tv-app/linux/include/media-input/MediaInputManager.h index eb9fad3ead077e..84e0114f43c3f3 100644 --- a/examples/tv-app/linux/include/media-input/MediaInputManager.h +++ b/examples/tv-app/linux/include/media-input/MediaInputManager.h @@ -18,15 +18,15 @@ #pragma once -#include +#include -#include -#include -#include - -class MediaInputManager +class MediaInputManager : public chip::app::Clusters::MediaInput::Delegate { public: - CHIP_ERROR Init(); - CHIP_ERROR proxyGetInputList(chip::EndpointId mEndpointId, chip::app::AttributeValueEncoder & aEncoder); + std::list HandleGetInputList() override; + uint8_t HandleGetCurrentInput() override; + bool HandleSelectInput(const uint8_t index) override; + bool HandleShowInputStatus() override; + bool HandleHideInputStatus() override; + bool HandleRenameInput(const uint8_t index, const chip::CharSpan & name) override; }; diff --git a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp index 28dcf54a00c8c0..81e6872e14d83a 100644 --- a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp +++ b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.cpp @@ -16,64 +16,132 @@ */ #include "MediaPlaybackManager.h" -#include -#include -#include - -#include -#include using namespace std; +using namespace chip::app::Clusters::MediaPlayback; + +PlaybackStateEnum MediaPlaybackManager::HandleGetCurrentState() +{ + return PlaybackStateEnum::kPlaying; +} + +uint64_t MediaPlaybackManager::HandleGetStartTime() +{ + return 0; +} -CHIP_ERROR MediaPlaybackManager::Init() +uint64_t MediaPlaybackManager::HandleGetDuration() { - CHIP_ERROR err = CHIP_NO_ERROR; + return 0; +} - // TODO: Store feature map once it is supported - map featureMap; - featureMap["AS"] = true; +Structs::PlaybackPosition::Type MediaPlaybackManager::HandleGetSampledPosition() +{ + Structs::PlaybackPosition::Type sampledPosition; + sampledPosition.updatedAt = 0; + sampledPosition.position = 0; + return sampledPosition; +} - SuccessOrExit(err); -exit: - return err; +float MediaPlaybackManager::HandleGetPlaybackSpeed() +{ + return 0; } -EmberAfMediaPlaybackStatus MediaPlaybackManager::proxyMediaPlaybackRequest(MediaPlaybackRequest mediaPlaybackRequest, - uint64_t deltaPositionMilliseconds) +uint64_t MediaPlaybackManager::HandleGetSeekRangeStart() +{ + return 0; +} + +uint64_t MediaPlaybackManager::HandleGetSeekRangeEnd() +{ + return 0; +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandlePlay() { - switch (mediaPlaybackRequest) - { - case MEDIA_PLAYBACK_REQUEST_PLAY: // TODO: Insert code here - case MEDIA_PLAYBACK_REQUEST_PAUSE: + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandlePause() +{ // TODO: Insert code here - case MEDIA_PLAYBACK_REQUEST_STOP: + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleStop() +{ // TODO: Insert code here - case MEDIA_PLAYBACK_REQUEST_START_OVER: + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleFastForward() +{ // TODO: Insert code here - case MEDIA_PLAYBACK_REQUEST_PREVIOUS: + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandlePrevious() +{ // TODO: Insert code here - case MEDIA_PLAYBACK_REQUEST_NEXT: + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleRewind() +{ // TODO: Insert code here - case MEDIA_PLAYBACK_REQUEST_REWIND: + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleSkipBackward(const uint64_t & deltaPositionMilliseconds) +{ // TODO: Insert code here - case MEDIA_PLAYBACK_REQUEST_FAST_FORWARD: + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleSkipForward(const uint64_t & deltaPositionMilliseconds) +{ // TODO: Insert code here - case MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD: + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleSeekRequest(const uint64_t & positionMilliseconds) +{ // TODO: Insert code here - case MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD: + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; +} + +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleNext() +{ // TODO: Insert code here - case MEDIA_PLAYBACK_REQUEST_SEEK: - return EMBER_ZCL_MEDIA_PLAYBACK_STATUS_SUCCESS; - break; - default: { - return EMBER_ZCL_MEDIA_PLAYBACK_STATUS_SUCCESS; - } - } + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; } -EmberAfMediaPlaybackStatus mediaPlaybackClusterSendMediaPlaybackRequest(MediaPlaybackRequest mediaPlaybackRequest, - uint64_t deltaPositionMilliseconds) +Commands::PlaybackResponse::Type MediaPlaybackManager::HandleStartOverRequest() { - return MediaPlaybackManager().proxyMediaPlaybackRequest(mediaPlaybackRequest, deltaPositionMilliseconds); + // TODO: Insert code here + Commands::PlaybackResponse::Type response; + response.status = StatusEnum::kSuccess; + return response; } diff --git a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.h b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.h index e90601e6d6a99c..9bf4c6607cf2f9 100644 --- a/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.h +++ b/examples/tv-app/linux/include/media-playback/MediaPlaybackManager.h @@ -18,20 +18,31 @@ #pragma once -#include #include -#include -#include - -class MediaPlaybackManager +class MediaPlaybackManager : public chip::app::Clusters::MediaPlayback::Delegate { public: - CHIP_ERROR Init(); - void storeNewPlaybackState(chip::EndpointId endpoint, uint8_t newPlaybackState); - EmberAfMediaPlaybackStatus proxyMediaPlaybackRequest(MediaPlaybackRequest mediaPlaybackRequest, - uint64_t deltaPositionMilliseconds); + chip::app::Clusters::MediaPlayback::PlaybackStateEnum HandleGetCurrentState() override; + uint64_t HandleGetStartTime() override; + uint64_t HandleGetDuration() override; + chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::Type HandleGetSampledPosition() override; + float HandleGetPlaybackSpeed() override; + uint64_t HandleGetSeekRangeStart() override; + uint64_t HandleGetSeekRangeEnd() override; -private: - uint8_t oldPlaybackState; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandlePlay() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandlePause() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleStop() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleFastForward() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandlePrevious() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleRewind() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSkipBackward(const uint64_t & deltaPositionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSkipForward(const uint64_t & deltaPositionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type + HandleSeekRequest(const uint64_t & positionMilliseconds) override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleNext() override; + chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type HandleStartOverRequest() override; }; diff --git a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp index 489968c93f3176..ddfcb0d6fd723b 100644 --- a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp +++ b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.cpp @@ -16,82 +16,37 @@ */ #include "TargetNavigatorManager.h" -#include -#include -#include -#include -#include -#include -#include - -#include -#include using namespace std; -using namespace chip::AppPlatform; - -// index starts at 1 for -std::list gTargets = { "exampleName", "exampleName" }; -uint8_t gCurrentTarget = 1; +using namespace chip::app::Clusters::TargetNavigator; -CHIP_ERROR TargetNavigatorManager::Init() +std::list TargetNavigatorManager::HandleGetTargetList() { - CHIP_ERROR err = CHIP_NO_ERROR; - - SuccessOrExit(err); -exit: - return err; -} + std::list list; + // TODO: Insert code here + int maximumVectorSize = 2; -CHIP_ERROR TargetNavigatorManager::proxyGetTargetInfoList(chip::EndpointId endpointId, chip::app::AttributeValueEncoder & aEncoder) -{ -#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED - ContentApp * app = chip::AppPlatform::AppPlatform::GetInstance().GetContentAppByEndpointId(endpointId); - if (app != NULL) + for (int i = 0; i < maximumVectorSize; ++i) { - return app->GetTargetNavigator()->GetTargetInfoList(aEncoder); + Structs::TargetInfo::Type outputInfo; + outputInfo.identifier = static_cast(i + 1); + outputInfo.name = chip::CharSpan("exampleName", strlen("exampleName")); + list.push_back(outputInfo); } -#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED - - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { - int i = 1; // make sure TV_TargetNavigatorCluster.yaml test suite passes - assumes index starts at 1 - for (string entry : gTargets) - { - // ReturnErrorOnFailure(encoder.Encode(chip::CharSpan(entry.c_str(), entry.length()))); - - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::Type targetInfo; - targetInfo.name = chip::CharSpan(entry.c_str(), entry.length()); - targetInfo.identifier = static_cast(i++); - ReturnErrorOnFailure(encoder.Encode(targetInfo)); - } - return CHIP_NO_ERROR; - }); + return list; } -TargetNavigatorResponse targetNavigatorClusterNavigateTarget(chip::EndpointId endpointId, uint8_t target, std::string data) +uint8_t TargetNavigatorManager::HandleGetCurrentTarget() { - ChipLogProgress(Zcl, "targetNavigatorClusterNavigateTarget endpoint=%d", endpointId); - -#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED - ContentApp * app = chip::AppPlatform::AppPlatform::GetInstance().GetContentAppByEndpointId(endpointId); - if (app != NULL) - { - return app->GetTargetNavigator()->NavigateTarget(target, data); - } -#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + return 0; +} - TargetNavigatorResponse response; - const char * testData = "data response"; - response.data = (uint8_t *) testData; - // make sure TV_TargetNavigatorCluster.yaml test suite passes - assumes index starts at 1 - if (target == 0 || target > gTargets.size()) - { - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_APP_NOT_AVAILABLE; - } - else - { - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS; - gCurrentTarget = target; - } +Commands::NavigateTargetResponse::Type TargetNavigatorManager::HandleNavigateTarget(const uint64_t & target, + const chip::CharSpan & data) +{ + // TODO: Insert code here + Commands::NavigateTargetResponse::Type response; + response.data = chip::CharSpan("data response", strlen("data response")); + response.status = chip::app::Clusters::TargetNavigator::StatusEnum::kSuccess; return response; } diff --git a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.h b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.h index 4166f977dcdaaf..7da10ea51448f5 100644 --- a/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.h +++ b/examples/tv-app/linux/include/target-navigator/TargetNavigatorManager.h @@ -17,18 +17,13 @@ #pragma once -#include +#include -#include -#include -#include -#include - -class TargetNavigatorManager +class TargetNavigatorManager : public chip::app::Clusters::TargetNavigator::Delegate { public: - CHIP_ERROR Init(); - CHIP_ERROR proxyGetTargetInfoList(chip::EndpointId endpointId, chip::app::AttributeValueEncoder & aEncoder); - -protected: + std::list HandleGetTargetList() override; + uint8_t HandleGetCurrentTarget() override; + chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type + HandleNavigateTarget(const uint64_t & target, const chip::CharSpan & data) override; }; diff --git a/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp b/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp deleted file mode 100644 index 28ecf0e74d7814..00000000000000 --- a/examples/tv-app/linux/include/tv-channel/TvChannelManager.cpp +++ /dev/null @@ -1,84 +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. - */ - -#include "TvChannelManager.h" -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -using namespace chip; - -CHIP_ERROR TvChannelManager::Init() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - // TODO: Store feature map once it is supported - std::map featureMap; - featureMap["CL"] = true; - featureMap["LI"] = true; - - SuccessOrExit(err); -exit: - return err; -} - -CHIP_ERROR TvChannelManager::proxyGetTvChannelList(chip::EndpointId mEndpointId, chip::app::AttributeValueEncoder & aEncoder) -{ - return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { - // TODO: Insert code here - int maximumVectorSize = 2; - char affiliateCallSign[] = "exampleASign"; - char callSign[] = "exampleCSign"; - char name[] = "exampleName"; - - for (int i = 0; i < maximumVectorSize; ++i) - { - chip::app::Clusters::TvChannel::Structs::TvChannelInfo::Type channelInfo; - channelInfo.affiliateCallSign = CharSpan(affiliateCallSign, sizeof(affiliateCallSign) - 1); - channelInfo.callSign = CharSpan(callSign, sizeof(callSign) - 1); - channelInfo.name = CharSpan(name, sizeof(name) - 1); - channelInfo.majorNumber = static_cast(1 + i); - channelInfo.minorNumber = static_cast(2 + i); - ReturnErrorOnFailure(encoder.Encode(channelInfo)); - } - return CHIP_NO_ERROR; - }); -} - -TvChannelInfo tvChannelClusterChangeChannel(std::string match) -{ - // TODO: Insert code here - TvChannelInfo channel = {}; - return channel; -} -bool tvChannelClusterChangeChannelByNumber(uint16_t majorNumber, uint16_t minorNumber) -{ - // TODO: Insert code here - return true; -} -bool tvChannelClusterSkipChannel(uint16_t count) -{ - // TODO: Insert code here - return true; -} diff --git a/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.cpp b/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.cpp index 3072b0e3928f30..291c2951c221f8 100644 --- a/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.cpp +++ b/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.cpp @@ -18,56 +18,10 @@ #include "WakeOnLanManager.h" -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - using namespace chip; -using namespace chip::app::Clusters; - -CHIP_ERROR WakeOnLanManager::Init() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - EndpointConfigurationStorage & endpointConfiguration = EndpointConfigurationStorage::GetInstance(); - err = endpointConfiguration.Init(); - SuccessOrExit(err); - es = &endpointConfiguration; -exit: - return err; -} +using namespace chip::app::Clusters::WakeOnLan; -void WakeOnLanManager::store(chip::EndpointId endpoint, char macAddress[32]) +chip::CharSpan WakeOnLanManager::HandleGetMacAddress() { - uint8_t bufferMemory[32]; - MutableByteSpan zclString(bufferMemory); - MakeZclCharString(zclString, macAddress); - EmberAfStatus macAddressStatus = emberAfWriteServerAttribute( - endpoint, WakeOnLan::Id, WakeOnLan::Attributes::WakeOnLanMacAddress::Id, zclString.data(), ZCL_CHAR_STRING_ATTRIBUTE_TYPE); - if (macAddressStatus != EMBER_ZCL_STATUS_SUCCESS) - { - ChipLogError(Zcl, "Failed to store mac address attribute."); - } -} - -void WakeOnLanManager::setMacAddress(chip::EndpointId endpoint, char * macAddress) -{ - char address[18]; - uint16_t size = static_cast(sizeof(address)); - - std::string section = "endpoint" + std::to_string(endpoint); - CHIP_ERROR err = es->get(section, "macAddress", macAddress, size); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Failed to get mac address. Error:%s", chip::ErrorStr(err)); - } + return chip::CharSpan("00:00:00:00:00", strlen("00:00:00:00:00")); } diff --git a/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.h b/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.h index 2f0cca32df737e..ba4a6964a5bfc8 100644 --- a/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.h +++ b/examples/tv-app/linux/include/wake-on-lan/WakeOnLanManager.h @@ -18,24 +18,10 @@ #pragma once -#include -#include +#include -#include "../endpoint-configuration/EndpointConfigurationStorage.h" - -class WakeOnLanManager +class WakeOnLanManager : public chip::app::Clusters::WakeOnLan::Delegate { public: - CHIP_ERROR Init(); - void store(chip::EndpointId endpoint, char macAddress[32]); - void setMacAddress(chip::EndpointId endpoint, char * macAddress); - - static WakeOnLanManager & GetInstance() - { - static WakeOnLanManager instance; - return instance; - } - -private: - EndpointConfigurationStorage * es = nullptr; + chip::CharSpan HandleGetMacAddress() override; }; diff --git a/examples/tv-app/linux/main.cpp b/examples/tv-app/linux/main.cpp index 35ca1a8d5fabf2..e0549f20559cd9 100644 --- a/examples/tv-app/linux/main.cpp +++ b/examples/tv-app/linux/main.cpp @@ -28,14 +28,18 @@ #include +#include "include/account-login/AccountLoginManager.h" +#include "include/application-basic/ApplicationBasicManager.h" #include "include/application-launcher/ApplicationLauncherManager.h" #include "include/audio-output/AudioOutputManager.h" +#include "include/channel/ChannelManager.h" #include "include/content-launcher/ContentLauncherManager.h" #include "include/keypad-input/KeypadInputManager.h" +#include "include/low-power/LowPowerManager.h" #include "include/media-input/MediaInputManager.h" #include "include/media-playback/MediaPlaybackManager.h" #include "include/target-navigator/TargetNavigatorManager.h" -#include "include/tv-channel/TvChannelManager.h" +#include "include/wake-on-lan/WakeOnLanManager.h" #if defined(ENABLE_CHIP_SHELL) #include @@ -52,46 +56,30 @@ bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * comm return true; } +namespace { +static ContentLauncherManager contentLauncherManager; +static AccountLoginManager accountLoginManager; +static ApplicationBasicManager applicationBasicManager; +static ApplicationLauncherManager applicationLauncherManager; +static AudioOutputManager audioOutputManager; +static ChannelManager channelManager; +static KeypadInputManager keypadInputManager; +static LowPowerManager lowPowerManager; +static MediaInputManager mediaInputManager; +static MediaPlaybackManager mediaPlaybackManager; +static TargetNavigatorManager targetNavigatorManager; +static WakeOnLanManager wakeOnLanManager; +} // namespace + +void ApplicationInit() {} + int main(int argc, char * argv[]) { - CHIP_ERROR err = CHIP_NO_ERROR; #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED chip::AppPlatform::ContentAppFactoryImpl factory; #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED - // Init Keypad Input manager - err = KeypadInputManager().Init(); - SuccessOrExit(err); - - // Init Application Launcher Manager - err = ApplicationLauncherManager().Init(); - SuccessOrExit(err); - - // Init Audio Output Manager - err = AudioOutputManager().Init(); - SuccessOrExit(err); - - // Init Content Launcher Manager - err = ContentLauncherManager().Init(); - SuccessOrExit(err); - - // Init Media Input Manager - err = MediaInputManager().Init(); - SuccessOrExit(err); - - // Init Media Playback Manager - err = MediaPlaybackManager().Init(); - SuccessOrExit(err); - - // Init Target Navigator Manager - err = TargetNavigatorManager().Init(); - SuccessOrExit(err); - - // Init Tv Channel Manager - err = TvChannelManager().Init(); - SuccessOrExit(err); - VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0); #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED @@ -106,12 +94,78 @@ int main(int argc, char * argv[]) #endif ChipLinuxAppMainLoop(); -exit: - if (err != CHIP_NO_ERROR) - { - std::cerr << "Failed to run TV App: " << ErrorStr(err) << std::endl; - // End the program with non zero error code to indicate a error. - return 1; - } + return 0; } + +void emberAfContentLauncherClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: ContentLauncher::SetDelegate"); + chip::app::Clusters::ContentLauncher::SetDelegate(endpoint, &contentLauncherManager); +} + +void emberAfAccountLoginClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: AccountLogin::SetDefaultDelegate"); + chip::app::Clusters::AccountLogin::SetDefaultDelegate(endpoint, &accountLoginManager); +} + +void emberAfApplicationBasicClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: ApplicationBasic::SetDefaultDelegate"); + chip::app::Clusters::ApplicationBasic::SetDefaultDelegate(endpoint, &applicationBasicManager); +} + +void emberAfApplicationLauncherClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: ApplicationLauncher::SetDefaultDelegate"); + chip::app::Clusters::ApplicationLauncher::SetDefaultDelegate(endpoint, &applicationLauncherManager); +} + +void emberAfAudioOutputClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: AudioOutput::SetDefaultDelegate"); + chip::app::Clusters::AudioOutput::SetDefaultDelegate(endpoint, &audioOutputManager); +} + +void emberAfChannelClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: Channel::SetDefaultDelegate"); + chip::app::Clusters::Channel::SetDefaultDelegate(endpoint, &channelManager); +} + +void emberAfKeypadInputClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: KeypadInput::SetDefaultDelegate"); + chip::app::Clusters::KeypadInput::SetDefaultDelegate(endpoint, &keypadInputManager); +} + +void emberAfLowPowerClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: LowPower::SetDefaultDelegate"); + chip::app::Clusters::LowPower::SetDefaultDelegate(endpoint, &lowPowerManager); +} + +void emberAfMediaInputClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: MediaInput::SetDefaultDelegate"); + chip::app::Clusters::MediaInput::SetDefaultDelegate(endpoint, &mediaInputManager); +} + +void emberAfMediaPlaybackClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: MediaPlayback::SetDefaultDelegate"); + chip::app::Clusters::MediaPlayback::SetDefaultDelegate(endpoint, &mediaPlaybackManager); +} + +void emberAfTargetNavigatorClusterInitCallback(EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: TargetNavigator::SetDefaultDelegate"); + chip::app::Clusters::TargetNavigator::SetDefaultDelegate(endpoint, &targetNavigatorManager); +} + +void emberAfWakeOnLanClusterInitCallback(chip::EndpointId endpoint) +{ + ChipLogProgress(Zcl, "TV Linux App: WakeOnLanManager::SetDefaultDelegate"); + chip::app::Clusters::WakeOnLan::SetDefaultDelegate(endpoint, &wakeOnLanManager); +} diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 782c98d7fca93b..5a54331dc9496e 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -1265,7 +1265,7 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, + "code": 2, "mfgCode": null, "source": "client", "incoming": 1, @@ -1273,11 +1273,11 @@ }, { "name": "NotifyUpdateApplied", - "code": 2, + "code": 4, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 } ], "attributes": [ @@ -1308,15 +1308,15 @@ "commands": [ { "name": "QueryImageResponse", - "code": 3, + "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -4083,7 +4083,7 @@ "commands": [], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", @@ -4098,7 +4098,7 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", @@ -6945,15 +6945,15 @@ ] }, { - "name": "TV Channel", + "name": "Channel", "code": 1284, "mfgCode": null, - "define": "TV_CHANNEL_CLUSTER", + "define": "CHANNEL_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "ChangeChannel", + "name": "ChangeChannelRequest", "code": 0, "mfgCode": null, "source": "client", @@ -6961,20 +6961,20 @@ "outgoing": 1 }, { - "name": "ChangeChannelByNumber", - "code": 1, + "name": "ChangeChannelByNumberRequest", + "code": 2, "mfgCode": null, "source": "client", "incoming": 1, "outgoing": 1 }, { - "name": "SkipChannel", - "code": 2, + "name": "SkipChannelRequest", + "code": 3, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 } ], "attributes": [ @@ -6996,20 +6996,20 @@ ] }, { - "name": "TV Channel", + "name": "Channel", "code": 1284, "mfgCode": null, - "define": "TV_CHANNEL_CLUSTER", + "define": "CHANNEL_CLUSTER", "side": "server", "enabled": 1, "commands": [ { "name": "ChangeChannelResponse", - "code": 0, + "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 } ], "attributes": [ @@ -7058,6 +7058,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -7084,7 +7114,7 @@ "enabled": 0, "commands": [ { - "name": "NavigateTarget", + "name": "NavigateTargetRequest", "code": 0, "mfgCode": null, "source": "client", @@ -7120,11 +7150,11 @@ "commands": [ { "name": "NavigateTargetResponse", - "code": 0, + "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 } ], "attributes": [ @@ -7158,6 +7188,36 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -7184,7 +7244,7 @@ "enabled": 0, "commands": [ { - "name": "SelectInput", + "name": "SelectInputRequest", "code": 0, "mfgCode": null, "source": "client", @@ -7192,7 +7252,7 @@ "outgoing": 1 }, { - "name": "ShowInputStatus", + "name": "ShowInputStatusRequest", "code": 1, "mfgCode": null, "source": "client", @@ -7200,7 +7260,7 @@ "outgoing": 1 }, { - "name": "HideInputStatus", + "name": "HideInputStatusRequest", "code": 2, "mfgCode": null, "source": "client", @@ -7208,7 +7268,7 @@ "outgoing": 1 }, { - "name": "RenameInput", + "name": "RenameInputRequest", "code": 3, "mfgCode": null, "source": "client", @@ -7273,6 +7333,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -7360,7 +7450,7 @@ "enabled": 0, "commands": [ { - "name": "SendKey", + "name": "SendKeyRequest", "code": 0, "mfgCode": null, "source": "client", @@ -7393,17 +7483,38 @@ "define": "KEYPAD_INPUT_CLUSTER", "side": "server", "enabled": 1, - "commands": [ + "commands": [], + "attributes": [ { - "name": "SendKeyResponse", - "code": 0, + "name": "AttributeList", + "code": 65531, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -7430,7 +7541,7 @@ "enabled": 0, "commands": [ { - "name": "LaunchContent", + "name": "LaunchContentRequest", "code": 0, "mfgCode": null, "source": "client", @@ -7438,7 +7549,7 @@ "outgoing": 1 }, { - "name": "LaunchURL", + "name": "LaunchURLRequest", "code": 1, "mfgCode": null, "source": "client", @@ -7473,25 +7584,17 @@ "enabled": 1, "commands": [ { - "name": "LaunchContentResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "LaunchURLResponse", - "code": 1, + "name": "LaunchResponse", + "code": 2, "mfgCode": null, "source": "server", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 } ], "attributes": [ { - "name": "accepts header list", + "name": "accept header list", "code": 0, "mfgCode": null, "side": "server", @@ -7520,6 +7623,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -7546,7 +7679,7 @@ "enabled": 0, "commands": [ { - "name": "LaunchApp", + "name": "LaunchAppRequest", "code": 0, "mfgCode": null, "source": "client", @@ -7554,7 +7687,7 @@ "outgoing": 1 }, { - "name": "StopApp", + "name": "StopAppRequest", "code": 1, "mfgCode": null, "source": "client", @@ -7562,7 +7695,7 @@ "outgoing": 0 }, { - "name": "HideApp", + "name": "HideAppRequest", "code": 2, "mfgCode": null, "source": "client", @@ -7597,12 +7730,12 @@ "enabled": 1, "commands": [ { - "name": "LaunchAppResponse", - "code": 0, + "name": "LauncherResponse", + "code": 3, "mfgCode": null, "source": "server", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 } ], "attributes": [ @@ -7636,6 +7769,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -8602,7 +8765,7 @@ "enabled": 0, "commands": [ { - "name": "SelectOutput", + "name": "SelectOutputRequest", "code": 0, "mfgCode": null, "source": "client", @@ -8610,7 +8773,7 @@ "outgoing": 1 }, { - "name": "RenameOutput", + "name": "RenameOutputRequest", "code": 1, "mfgCode": null, "source": "client", @@ -8676,24 +8839,54 @@ "reportableChange": 0 }, { - "name": "ClusterRevision", - "code": 65533, + "name": "AttributeList", + "code": 65531, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 - } - ] - } - ] - }, + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + } + ] + }, { "name": "MA-contentapplication", "deviceTypeName": "MA-contentapplication", @@ -8821,7 +9014,7 @@ "enabled": 0, "commands": [ { - "name": "MediaPlay", + "name": "PlayRequest", "code": 0, "mfgCode": null, "source": "client", @@ -8829,7 +9022,7 @@ "outgoing": 1 }, { - "name": "MediaPause", + "name": "PauseRequest", "code": 1, "mfgCode": null, "source": "client", @@ -8837,7 +9030,7 @@ "outgoing": 1 }, { - "name": "MediaStop", + "name": "StopRequest", "code": 2, "mfgCode": null, "source": "client", @@ -8845,7 +9038,7 @@ "outgoing": 1 }, { - "name": "MediaStartOver", + "name": "StartOverRequest", "code": 3, "mfgCode": null, "source": "client", @@ -8853,7 +9046,7 @@ "outgoing": 1 }, { - "name": "MediaPrevious", + "name": "PreviousRequest", "code": 4, "mfgCode": null, "source": "client", @@ -8861,7 +9054,7 @@ "outgoing": 1 }, { - "name": "MediaNext", + "name": "NextRequest", "code": 5, "mfgCode": null, "source": "client", @@ -8869,7 +9062,7 @@ "outgoing": 1 }, { - "name": "MediaRewind", + "name": "RewindRequest", "code": 6, "mfgCode": null, "source": "client", @@ -8877,7 +9070,7 @@ "outgoing": 1 }, { - "name": "MediaFastForward", + "name": "FastForwardRequest", "code": 7, "mfgCode": null, "source": "client", @@ -8885,7 +9078,7 @@ "outgoing": 1 }, { - "name": "MediaSkipForward", + "name": "SkipForwardRequest", "code": 8, "mfgCode": null, "source": "client", @@ -8893,7 +9086,7 @@ "outgoing": 1 }, { - "name": "MediaSkipBackward", + "name": "SkipBackwardRequest", "code": 9, "mfgCode": null, "source": "client", @@ -8901,12 +9094,12 @@ "outgoing": 1 }, { - "name": "MediaSeek", - "code": 10, + "name": "SeekRequest", + "code": 11, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 } ], "attributes": [ @@ -8936,84 +9129,12 @@ "enabled": 1, "commands": [ { - "name": "MediaPlayResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaPauseResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaStopResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaStartOverResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaPreviousResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaNextResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaRewindResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaFastForwardResponse", - "code": 7, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaSkipForwardResponse", - "code": 8, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaSkipBackwardResponse", - "code": 9, + "name": "PlaybackResponse", + "code": 10, "mfgCode": null, "source": "server", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 } ], "attributes": [ @@ -9122,6 +9243,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -9148,7 +9299,7 @@ "enabled": 0, "commands": [ { - "name": "LaunchContent", + "name": "LaunchContentRequest", "code": 0, "mfgCode": null, "source": "client", @@ -9156,7 +9307,7 @@ "outgoing": 1 }, { - "name": "LaunchURL", + "name": "LaunchURLRequest", "code": 1, "mfgCode": null, "source": "client", @@ -9191,25 +9342,17 @@ "enabled": 1, "commands": [ { - "name": "LaunchContentResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "LaunchURLResponse", - "code": 1, + "name": "LaunchResponse", + "code": 2, "mfgCode": null, "source": "server", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 } ], "attributes": [ { - "name": "accepts header list", + "name": "accept header list", "code": 0, "mfgCode": null, "side": "server", @@ -9238,6 +9381,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -9262,16 +9435,7 @@ "define": "APPLICATION_BASIC_CLUSTER", "side": "client", "enabled": 0, - "commands": [ - { - "name": "ChangeStatus", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -9353,12 +9517,27 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x00", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "application app", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "application status", "code": 5, @@ -9398,10 +9577,40 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -9430,7 +9639,7 @@ "enabled": 0, "commands": [ { - "name": "GetSetupPIN", + "name": "GetSetupPINRequest", "code": 0, "mfgCode": null, "source": "client", @@ -9438,16 +9647,16 @@ "outgoing": 1 }, { - "name": "Login", - "code": 1, + "name": "LoginRequest", + "code": 2, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 }, { - "name": "Logout", - "code": 2, + "name": "LogoutRequest", + "code": 3, "mfgCode": null, "source": "client", "incoming": 1, @@ -9482,14 +9691,44 @@ "commands": [ { "name": "GetSetupPINResponse", - "code": 0, + "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 } ], "attributes": [ + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -9636,7 +9875,7 @@ "enabled": 0, "commands": [ { - "name": "LaunchContent", + "name": "LaunchContentRequest", "code": 0, "mfgCode": null, "source": "client", @@ -9644,7 +9883,7 @@ "outgoing": 1 }, { - "name": "LaunchURL", + "name": "LaunchURLRequest", "code": 1, "mfgCode": null, "source": "client", @@ -9679,25 +9918,17 @@ "enabled": 1, "commands": [ { - "name": "LaunchContentResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "LaunchURLResponse", - "code": 1, + "name": "LaunchResponse", + "code": 2, "mfgCode": null, "source": "server", - "incoming": 1, - "outgoing": 0 + "incoming": 0, + "outgoing": 1 } ], "attributes": [ { - "name": "accepts header list", + "name": "accept header list", "code": 0, "mfgCode": null, "side": "server", @@ -9726,6 +9957,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -9838,6 +10099,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "application app", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "application status", "code": 5, @@ -9877,10 +10153,40 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -10115,6 +10421,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "application app", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "application status", "code": 5, @@ -10150,14 +10471,44 @@ "code": 7, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { diff --git a/examples/tv-casting-app/linux/args.gni b/examples/tv-casting-app/linux/args.gni index 54b1b3bb30fabb..e0364467f6c10e 100644 --- a/examples/tv-casting-app/linux/args.gni +++ b/examples/tv-casting-app/linux/args.gni @@ -25,3 +25,5 @@ chip_project_config_include_dirs = chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] chip_build_libshell = true + +chip_enable_rotating_device_id = true diff --git a/examples/tv-casting-app/linux/main.cpp b/examples/tv-casting-app/linux/main.cpp index 7cd5934347e967..815b6409de7e53 100644 --- a/examples/tv-casting-app/linux/main.cpp +++ b/examples/tv-casting-app/linux/main.cpp @@ -16,6 +16,7 @@ * limitations under the License. */ +#include #include #include #include @@ -27,8 +28,13 @@ #include #include #include +#include #include #include +#include + +#include +#include using namespace chip; using namespace chip::Controller; @@ -36,6 +42,7 @@ using namespace chip::Credentials; using chip::ArgParser::HelpOptions; using chip::ArgParser::OptionDef; using chip::ArgParser::OptionSet; +using namespace chip::app::Clusters::ContentLauncher::Commands; struct TVExampleDeviceType { @@ -49,10 +56,17 @@ constexpr uint16_t kOptionDeviceType = 't'; constexpr uint16_t kCommissioningWindowTimeoutInSec = 3 * 60; constexpr uint32_t kCommissionerDiscoveryTimeoutInMs = 5 * 1000; +// TODO: Accept these values over CLI +const char * kContentUrl = "https://www.test.com/videoid"; +const char * kContentDisplayStr = "Test video"; +constexpr EndpointId kTvEndpoint = 1; + CommissionableNodeController gCommissionableNodeController; chip::System::SocketWatchToken gToken; Dnssd::DiscoveryFilter gDiscoveryFilter = Dnssd::DiscoveryFilter(); +CASEClientPool gCASEClientPool; + bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, const char * aName, const char * aValue) { switch (aIdentifier) @@ -185,6 +199,67 @@ void InitCommissioningFlow(intptr_t commandArg) } } +void OnContentLauncherSuccessResponse(void * context, const LaunchResponse::DecodableType & response) +{ + ChipLogProgress(AppServer, "ContentLauncher: Default Success Response"); +} + +void OnContentLauncherFailureResponse(void * context, EmberAfStatus status) +{ + ChipLogError(AppServer, "ContentLauncher: Default Failure Response: %" PRIu8, status); +} + +void DeviceEventCallback(const DeviceLayer::ChipDeviceEvent * event, intptr_t arg) +{ + if (event->Type == DeviceLayer::DeviceEventType::kCommissioningComplete) + { + chip::NodeId tvNodeId = chip::DeviceLayer::DeviceControlServer::DeviceControlSvr().GetPeerNodeId(); + chip::FabricIndex peerFabricIndex = chip::DeviceLayer::DeviceControlServer::DeviceControlSvr().GetFabricIndex(); + + Server * server = &(chip::Server::GetInstance()); + chip::FabricInfo * fabric = server->GetFabricTable().FindFabricWithIndex(peerFabricIndex); + if (fabric == nullptr) + { + ChipLogError(AppServer, "Did not find fabric for index %d", peerFabricIndex); + return; + } + + chip::DeviceProxyInitParams initParams = { + .sessionManager = &(server->GetSecureSessionManager()), + .exchangeMgr = &(server->GetExchangeManager()), + .idAllocator = &(server->GetSessionIDAllocator()), + .fabricTable = &(server->GetFabricTable()), + .clientPool = &gCASEClientPool, + .imDelegate = chip::Platform::New(), + }; + + PeerId peerID = fabric->GetPeerIdForNode(tvNodeId); + chip::OperationalDeviceProxy * operationalDeviceProxy = + chip::Platform::New(initParams, peerID); + if (operationalDeviceProxy == nullptr) + { + ChipLogError(AppServer, "Failed in creating an instance of OperationalDeviceProxy"); + return; + } + + SessionHandle handle = server->GetSecureSessionManager().FindSecureSessionForNode(tvNodeId); + operationalDeviceProxy->SetConnectedSession(handle); + + ContentLauncherCluster cluster; + CHIP_ERROR err = cluster.Associate(operationalDeviceProxy, kTvEndpoint); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "Associate() failed: %" CHIP_ERROR_FORMAT, err.Format()); + return; + } + LaunchURLRequest::Type request; + request.contentURL = chip::CharSpan(kContentUrl, strlen(kContentUrl)); + request.displayString = chip::CharSpan(kContentDisplayStr, strlen(kContentDisplayStr)); + request.brandingInformation = chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::Type(); + cluster.InvokeCommand(request, nullptr, OnContentLauncherSuccessResponse, OnContentLauncherFailureResponse); + } +} + int main(int argc, char * argv[]) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -215,7 +290,8 @@ int main(int argc, char * argv[]) chip::System::Clock::Milliseconds32(kCommissionerDiscoveryTimeoutInMs), [](System::Layer *, void *) { chip::DeviceLayer::PlatformMgr().ScheduleWork(InitCommissioningFlow); }, nullptr); - // TBD: Content casting commands + // Add callback to send Content casting commands after commissioning completes + chip::DeviceLayer::PlatformMgrImpl().AddEventHandler(DeviceEventCallback, 0); DeviceLayer::PlatformMgr().RunEventLoop(); exit: diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index 7b88b5a710e901..2c65903dbde9ee 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -22,4 +22,5 @@ chip_data_model("tv-casting-common") { zap_pregenerated_dir = "${chip_root}/zzz_generated/tv-casting-app/zap-generated" is_server = true + use_default_client_callbacks = true } 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 ae8d70b000b154..baffa731a1a644 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 @@ -1280,7 +1280,7 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, + "code": 2, "mfgCode": null, "source": "client", "incoming": 1, @@ -1288,11 +1288,11 @@ }, { "name": "NotifyUpdateApplied", - "code": 2, + "code": 4, "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 1 + "outgoing": 0 } ], "attributes": [ @@ -1323,15 +1323,15 @@ "commands": [ { "name": "QueryImageResponse", - "code": 3, + "code": 1, "mfgCode": null, "source": "server", - "incoming": 1, + "incoming": 0, "outgoing": 1 }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -1703,7 +1703,7 @@ "reportableChange": 0 }, { - "name": "NetworkDisabled", + "name": "InterfaceEnabled", "code": 4, "mfgCode": null, "side": "server", @@ -4068,7 +4068,7 @@ "commands": [], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", @@ -4083,7 +4083,7 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", @@ -7996,14 +7996,6 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "NotifyUpdateApplied", "code": 2, "mfgCode": null, "source": "client", @@ -8037,17 +8029,9 @@ "side": "server", "enabled": 0, "commands": [ - { - "name": "QueryImageResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -8786,7 +8770,7 @@ "commands": [], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", @@ -8801,7 +8785,7 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", @@ -11865,15 +11849,15 @@ ] }, { - "name": "TV Channel", + "name": "Channel", "code": 1284, "mfgCode": null, - "define": "TV_CHANNEL_CLUSTER", + "define": "CHANNEL_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "ChangeChannel", + "name": "ChangeChannelRequest", "code": 0, "mfgCode": null, "source": "client", @@ -11881,16 +11865,16 @@ "outgoing": 1 }, { - "name": "ChangeChannelByNumber", - "code": 1, + "name": "ChangeChannelByNumberRequest", + "code": 2, "mfgCode": null, "source": "client", "incoming": 0, "outgoing": 1 }, { - "name": "SkipChannel", - "code": 2, + "name": "SkipChannelRequest", + "code": 3, "mfgCode": null, "source": "client", "incoming": 0, @@ -11898,6 +11882,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11916,25 +11915,16 @@ ] }, { - "name": "TV Channel", + "name": "Channel", "code": 1284, "mfgCode": null, - "define": "TV_CHANNEL_CLUSTER", + "define": "CHANNEL_CLUSTER", "side": "server", - "enabled": 1, - "commands": [ - { - "name": "ChangeChannelResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "enabled": 0, + "commands": [], "attributes": [ { - "name": "tv channel list", + "name": "channel list", "code": 0, "mfgCode": null, "side": "server", @@ -11949,7 +11939,7 @@ "reportableChange": 0 }, { - "name": "tv channel lineup", + "name": "channel lineup", "code": 1, "mfgCode": null, "side": "server", @@ -11964,7 +11954,7 @@ "reportableChange": 0 }, { - "name": "current tv channel", + "name": "current channel", "code": 2, "mfgCode": null, "side": "server", @@ -12001,10 +11991,10 @@ "mfgCode": null, "define": "TARGET_NAVIGATOR_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "NavigateTarget", + "name": "NavigateTargetRequest", "code": 0, "mfgCode": null, "source": "client", @@ -12013,6 +12003,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12036,17 +12041,8 @@ "mfgCode": null, "define": "TARGET_NAVIGATOR_CLUSTER", "side": "server", - "enabled": 1, - "commands": [ - { - "name": "NavigateTargetResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "enabled": 0, + "commands": [], "attributes": [ { "name": "target navigator list", @@ -12086,10 +12082,10 @@ "mfgCode": null, "define": "MEDIA_PLAYBACK_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "MediaPlay", + "name": "PlayRequest", "code": 0, "mfgCode": null, "source": "client", @@ -12097,7 +12093,7 @@ "outgoing": 1 }, { - "name": "MediaPause", + "name": "PauseReques", "code": 1, "mfgCode": null, "source": "client", @@ -12105,7 +12101,7 @@ "outgoing": 1 }, { - "name": "MediaStop", + "name": "StopRequest", "code": 2, "mfgCode": null, "source": "client", @@ -12113,7 +12109,7 @@ "outgoing": 1 }, { - "name": "MediaStartOver", + "name": "StartOver", "code": 3, "mfgCode": null, "source": "client", @@ -12121,7 +12117,7 @@ "outgoing": 1 }, { - "name": "MediaPrevious", + "name": "PreviousRequest", "code": 4, "mfgCode": null, "source": "client", @@ -12129,7 +12125,7 @@ "outgoing": 1 }, { - "name": "MediaNext", + "name": "NextRequest", "code": 5, "mfgCode": null, "source": "client", @@ -12137,7 +12133,7 @@ "outgoing": 1 }, { - "name": "MediaRewind", + "name": "RewindRequest", "code": 6, "mfgCode": null, "source": "client", @@ -12145,7 +12141,7 @@ "outgoing": 1 }, { - "name": "MediaFastForward", + "name": "FastForwardRequest", "code": 7, "mfgCode": null, "source": "client", @@ -12153,7 +12149,7 @@ "outgoing": 1 }, { - "name": "MediaSkipForward", + "name": "SkipForwardRequest", "code": 8, "mfgCode": null, "source": "client", @@ -12161,7 +12157,7 @@ "outgoing": 1 }, { - "name": "MediaSkipBackward", + "name": "SkipBackwardRequest", "code": 9, "mfgCode": null, "source": "client", @@ -12169,8 +12165,8 @@ "outgoing": 1 }, { - "name": "MediaSeek", - "code": 10, + "name": "SeekRequest", + "code": 11, "mfgCode": null, "source": "client", "incoming": 0, @@ -12178,6 +12174,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12201,89 +12212,8 @@ "mfgCode": null, "define": "MEDIA_PLAYBACK_CLUSTER", "side": "server", - "enabled": 1, - "commands": [ - { - "name": "MediaPlayResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaPauseResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaStopResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaStartOverResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaPreviousResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaNextResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaRewindResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaFastForwardResponse", - "code": 7, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaSkipForwardResponse", - "code": 8, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaSkipBackwardResponse", - "code": 9, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "enabled": 0, + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -12308,10 +12238,10 @@ "mfgCode": null, "define": "MEDIA_INPUT_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "SelectInput", + "name": "SelectInputRequest", "code": 0, "mfgCode": null, "source": "client", @@ -12319,7 +12249,7 @@ "outgoing": 1 }, { - "name": "ShowInputStatus", + "name": "ShowInputStatusRequest", "code": 1, "mfgCode": null, "source": "client", @@ -12327,7 +12257,7 @@ "outgoing": 1 }, { - "name": "HideInputStatus", + "name": "HideInputStatusRequest", "code": 2, "mfgCode": null, "source": "client", @@ -12335,7 +12265,7 @@ "outgoing": 1 }, { - "name": "RenameInput", + "name": "RenameInputRequest", "code": 3, "mfgCode": null, "source": "client", @@ -12344,6 +12274,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12367,7 +12312,7 @@ "mfgCode": null, "define": "MEDIA_INPUT_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [], "attributes": [ { @@ -12408,10 +12353,10 @@ "mfgCode": null, "define": "KEYPAD_INPUT_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "SendKey", + "name": "SendKeyRequest", "code": 0, "mfgCode": null, "source": "client", @@ -12420,6 +12365,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12443,17 +12403,8 @@ "mfgCode": null, "define": "KEYPAD_INPUT_CLUSTER", "side": "server", - "enabled": 1, - "commands": [ - { - "name": "SendKeyResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "enabled": 0, + "commands": [], "attributes": [ { "name": "ClusterRevision", @@ -12478,10 +12429,10 @@ "mfgCode": null, "define": "CONTENT_LAUNCH_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "LaunchContent", + "name": "LaunchContentRequest", "code": 0, "mfgCode": null, "source": "client", @@ -12489,7 +12440,7 @@ "outgoing": 1 }, { - "name": "LaunchURL", + "name": "LaunchURLRequest", "code": 1, "mfgCode": null, "source": "client", @@ -12498,6 +12449,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12521,28 +12487,11 @@ "mfgCode": null, "define": "CONTENT_LAUNCH_CLUSTER", "side": "server", - "enabled": 1, - "commands": [ - { - "name": "LaunchContentResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "LaunchURLResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "enabled": 0, + "commands": [], "attributes": [ { - "name": "accepts header list", + "name": "accept header list", "code": 0, "mfgCode": null, "side": "server", @@ -12557,7 +12506,7 @@ "reportableChange": 0 }, { - "name": "supported streaming types", + "name": "supported streaming protocols", "code": 1, "mfgCode": null, "side": "server", @@ -12594,10 +12543,10 @@ "mfgCode": null, "define": "AUDIO_OUTPUT_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "SelectOutput", + "name": "SelectOutputRequest", "code": 0, "mfgCode": null, "source": "client", @@ -12605,7 +12554,7 @@ "outgoing": 1 }, { - "name": "RenameOutput", + "name": "RenameOutputRequest", "code": 1, "mfgCode": null, "source": "client", @@ -12614,6 +12563,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12637,7 +12601,7 @@ "mfgCode": null, "define": "AUDIO_OUTPUT_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [], "attributes": [ { @@ -12678,18 +12642,49 @@ "mfgCode": null, "define": "APPLICATION_LAUNCHER_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "LaunchApp", + "name": "LaunchAppRequest", "code": 0, "mfgCode": null, "source": "client", "incoming": 0, "outgoing": 1 + }, + { + "name": "StopAppRequest", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "HideAppRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12713,17 +12708,8 @@ "mfgCode": null, "define": "APPLICATION_LAUNCHER_CLUSTER", "side": "server", - "enabled": 1, - "commands": [ - { - "name": "LaunchAppResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "enabled": 0, + "commands": [], "attributes": [ { "name": "application launcher list", @@ -12763,9 +12749,24 @@ "mfgCode": null, "define": "APPLICATION_BASIC_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12789,7 +12790,7 @@ "mfgCode": null, "define": "APPLICATION_BASIC_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [], "attributes": [ { @@ -12853,7 +12854,7 @@ "reportableChange": 0 }, { - "name": "application id", + "name": "application status", "code": 5, "mfgCode": null, "side": "server", @@ -12868,7 +12869,7 @@ "reportableChange": 0 }, { - "name": "catalog vendor id", + "name": "application version", "code": 6, "mfgCode": null, "side": "server", @@ -12882,21 +12883,6 @@ "maxInterval": 65344, "reportableChange": 0 }, - { - "name": "application status", - "code": 7, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, { "name": "ClusterRevision", "code": 65533, @@ -12920,10 +12906,10 @@ "mfgCode": null, "define": "ACCOUNT_LOGIN_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { - "name": "GetSetupPIN", + "name": "GetSetupPINRequest", "code": 0, "mfgCode": null, "source": "client", @@ -12931,8 +12917,16 @@ "outgoing": 1 }, { - "name": "Login", - "code": 1, + "name": "LoginRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "LogoutRequest", + "code": 3, "mfgCode": null, "source": "client", "incoming": 0, @@ -12940,6 +12934,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12963,17 +12972,8 @@ "mfgCode": null, "define": "ACCOUNT_LOGIN_CLUSTER", "side": "server", - "enabled": 1, - "commands": [ - { - "name": "GetSetupPINResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], + "enabled": 0, + "commands": [], "attributes": [ { "name": "ClusterRevision", diff --git a/examples/window-app/common/src/WindowApp.cpp b/examples/window-app/common/src/WindowApp.cpp index 01d9649d9b309d..813ad816a156ad 100644 --- a/examples/window-app/common/src/WindowApp.cpp +++ b/examples/window-app/common/src/WindowApp.cpp @@ -425,9 +425,15 @@ void WindowApp::Cover::Finish() void WindowApp::Cover::LiftUp() { - uint16_t percent100ths = 0; + EmberAfStatus status; + chip::app::DataModel::Nullable current; + chip::Percent100ths percent100ths = 5000; // set at middle + + status = Attributes::CurrentPositionLiftPercent100ths::Get(mEndpoint, current); + + if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull()) + percent100ths = current.Value(); - Attributes::CurrentPositionLiftPercent100ths::Get(mEndpoint, &percent100ths); if (percent100ths < 9000) { percent100ths += 1000; @@ -441,9 +447,15 @@ void WindowApp::Cover::LiftUp() void WindowApp::Cover::LiftDown() { - uint16_t percent100ths = 0; + EmberAfStatus status; + chip::app::DataModel::Nullable current; + chip::Percent100ths percent100ths = 5000; // set at middle + + status = Attributes::CurrentPositionLiftPercent100ths::Get(mEndpoint, current); + + if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull()) + percent100ths = current.Value(); - Attributes::CurrentPositionLiftPercent100ths::Get(mEndpoint, &percent100ths); if (percent100ths > 1000) { percent100ths -= 1000; @@ -457,10 +469,15 @@ void WindowApp::Cover::LiftDown() void WindowApp::Cover::GotoLift(EventId action) { - uint16_t current = 0; - uint16_t target = 0; - Attributes::TargetPositionLiftPercent100ths::Get(mEndpoint, &target); - Attributes::CurrentPositionLiftPercent100ths::Get(mEndpoint, ¤t); + chip::app::DataModel::Nullable current; + chip::app::DataModel::Nullable target; + Attributes::TargetPositionLiftPercent100ths::Get(mEndpoint, target); + Attributes::CurrentPositionLiftPercent100ths::Get(mEndpoint, current); + + if (current.IsNull() || target.IsNull()) + { + return; + } if (EventId::None != action) { @@ -469,7 +486,7 @@ void WindowApp::Cover::GotoLift(EventId action) if (EventId::LiftUp == mLiftAction) { - if (current < target) + if (current.Value() < target.Value()) { LiftUp(); } @@ -480,7 +497,7 @@ void WindowApp::Cover::GotoLift(EventId action) } else { - if (current > target) + if (current.Value() > target.Value()) { LiftDown(); } @@ -498,8 +515,15 @@ void WindowApp::Cover::GotoLift(EventId action) void WindowApp::Cover::TiltUp() { - uint16_t percent100ths = 0; - Attributes::CurrentPositionTiltPercent100ths::Get(mEndpoint, &percent100ths); + EmberAfStatus status; + chip::app::DataModel::Nullable current; + chip::Percent100ths percent100ths = 5000; // set at middle + + status = Attributes::CurrentPositionTiltPercent100ths::Get(mEndpoint, current); + + if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull()) + percent100ths = current.Value(); + if (percent100ths < 9000) { percent100ths += 1000; @@ -513,8 +537,15 @@ void WindowApp::Cover::TiltUp() void WindowApp::Cover::TiltDown() { - uint16_t percent100ths = 0; - Attributes::CurrentPositionTiltPercent100ths::Get(mEndpoint, &percent100ths); + EmberAfStatus status; + chip::app::DataModel::Nullable current; + chip::Percent100ths percent100ths = 5000; // set at middle + + status = Attributes::CurrentPositionTiltPercent100ths::Get(mEndpoint, current); + + if ((status == EMBER_ZCL_STATUS_SUCCESS) && !current.IsNull()) + percent100ths = current.Value(); + if (percent100ths > 1000) { percent100ths -= 1000; @@ -528,11 +559,15 @@ void WindowApp::Cover::TiltDown() void WindowApp::Cover::GotoTilt(EventId action) { - uint16_t current = 0; - uint16_t target = 0; + chip::app::DataModel::Nullable current; + chip::app::DataModel::Nullable target; + Attributes::TargetPositionTiltPercent100ths::Get(mEndpoint, target); + Attributes::CurrentPositionTiltPercent100ths::Get(mEndpoint, current); - Attributes::TargetPositionTiltPercent100ths::Get(mEndpoint, &target); - Attributes::CurrentPositionTiltPercent100ths::Get(mEndpoint, ¤t); + if (current.IsNull() || target.IsNull()) + { + return; + } if (EventId::None != action) { @@ -541,7 +576,7 @@ void WindowApp::Cover::GotoTilt(EventId action) if (EventId::TiltUp == mTiltAction) { - if (current < target) + if (current.Value() < target.Value()) { TiltUp(); } @@ -552,7 +587,7 @@ void WindowApp::Cover::GotoTilt(EventId action) } else { - if (current > target) + if (current.Value() > target.Value()) { TiltDown(); } diff --git a/examples/window-app/common/src/ZclCallbacks.cpp b/examples/window-app/common/src/ZclCallbacks.cpp index b564449abcef39..fdea8bac07fd86 100644 --- a/examples/window-app/common/src/ZclCallbacks.cpp +++ b/examples/window-app/common/src/ZclCallbacks.cpp @@ -55,8 +55,9 @@ void MatterPostAttributeChangeCallback(const app::ConcreteAttributePath & attrib WindowApp & app = WindowApp::Instance(); EndpointId endpoint = attributePath.mEndpointId; - uint16_t current; - uint16_t target; + + chip::app::DataModel::Nullable current; + chip::app::DataModel::Nullable target; switch (attributePath.mAttributeId) { @@ -73,28 +74,34 @@ void MatterPostAttributeChangeCallback(const app::ConcreteAttributePath & attrib break; case Attributes::TargetPositionLiftPercent100ths::Id: - Attributes::TargetPositionLiftPercent100ths::Get(endpoint, &target); - Attributes::CurrentPositionLiftPercent100ths::Get(endpoint, ¤t); - if (current > target) - { - app.PostEvent(WindowApp::Event(WindowApp::EventId::LiftDown, endpoint)); - } - else if (current < target) + Attributes::TargetPositionLiftPercent100ths::Get(endpoint, target); + Attributes::CurrentPositionLiftPercent100ths::Get(endpoint, current); + if (!current.IsNull() && !target.IsNull()) { - app.PostEvent(WindowApp::Event(WindowApp::EventId::LiftUp, endpoint)); + if (current.Value() > target.Value()) + { + app.PostEvent(WindowApp::Event(WindowApp::EventId::LiftDown, endpoint)); + } + else if (current.Value() < target.Value()) + { + app.PostEvent(WindowApp::Event(WindowApp::EventId::LiftUp, endpoint)); + } } break; case Attributes::TargetPositionTiltPercent100ths::Id: - Attributes::TargetPositionTiltPercent100ths::Get(endpoint, &target); - Attributes::CurrentPositionTiltPercent100ths::Get(endpoint, ¤t); - if (current > target) - { - app.PostEvent(WindowApp::Event(WindowApp::EventId::TiltDown, endpoint)); - } - else if (current < target) + Attributes::TargetPositionTiltPercent100ths::Get(endpoint, target); + Attributes::CurrentPositionTiltPercent100ths::Get(endpoint, current); + if (!current.IsNull() && !target.IsNull()) { - app.PostEvent(WindowApp::Event(WindowApp::EventId::TiltUp, endpoint)); + if (current.Value() > target.Value()) + { + app.PostEvent(WindowApp::Event(WindowApp::EventId::TiltDown, endpoint)); + } + else if (current.Value() < target.Value()) + { + app.PostEvent(WindowApp::Event(WindowApp::EventId::TiltUp, endpoint)); + } } break; diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 4cf527075c1a45..4847140a84e503 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -1468,7 +1468,7 @@ "reportableChange": 0 }, { - "name": "NetworkDisabled", + "name": "InterfaceEnabled", "code": 4, "mfgCode": null, "side": "server", @@ -7558,4 +7558,4 @@ "deviceIdentifier": 514 } ] -} +} \ No newline at end of file diff --git a/examples/window-app/efr32/src/WindowAppImpl.cpp b/examples/window-app/efr32/src/WindowAppImpl.cpp index 6d19e2930b410f..6a294c941b5261 100644 --- a/examples/window-app/efr32/src/WindowAppImpl.cpp +++ b/examples/window-app/efr32/src/WindowAppImpl.cpp @@ -327,11 +327,11 @@ void WindowAppImpl::UpdateLEDs() { mActionLED.Blink(100); } - else if (IsOpen(cover.mEndpoint)) + else if (IsLiftOpen(cover.mEndpoint)) { mActionLED.Set(true); } - else if (IsClosed(cover.mEndpoint)) + else if (IsLiftClosed(cover.mEndpoint)) { mActionLED.Set(false); } @@ -350,11 +350,15 @@ void WindowAppImpl::UpdateLCD() { Cover & cover = GetCover(); EmberAfWcType type = TypeGet(cover.mEndpoint); - uint16_t lift = 0; - uint16_t tilt = 0; - Attributes::CurrentPositionLift::Get(cover.mEndpoint, &lift); - Attributes::CurrentPositionTilt::Get(cover.mEndpoint, &tilt); - LcdPainter::Paint(type, static_cast(lift), static_cast(tilt), mIcon); + chip::app::DataModel::Nullable lift; + chip::app::DataModel::Nullable tilt; + Attributes::CurrentPositionLift::Get(cover.mEndpoint, lift); + Attributes::CurrentPositionTilt::Get(cover.mEndpoint, tilt); + + if (!tilt.IsNull() && !lift.IsNull()) + { + LcdPainter::Paint(type, static_cast(lift.Value()), static_cast(tilt.Value()), mIcon); + } } else { diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index 78b8bf269b7891..e940f6b235ceda 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -1,5 +1,5 @@ steps: - - name: "connectedhomeip/chip-build-vscode:0.5.33" + - name: "connectedhomeip/chip-build-vscode:0.5.40" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -12,7 +12,7 @@ steps: path: /pwenv timeout: 900s - - name: "connectedhomeip/chip-build-vscode:0.5.33" + - name: "connectedhomeip/chip-build-vscode:0.5.40" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -31,7 +31,7 @@ steps: logsBucket: matter-build-automation-build-logs # Global timeout for all steps -timeout: 7200s +timeout: 14400s artifacts: objects: diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index 8f77bbc02879b4..3286cf95973659 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -1,5 +1,5 @@ steps: - - name: "connectedhomeip/chip-build-vscode:0.5.33" + - name: "connectedhomeip/chip-build-vscode:0.5.40" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -12,7 +12,7 @@ steps: path: /pwenv timeout: 900s - - name: "connectedhomeip/chip-build-vscode:0.5.33" + - name: "connectedhomeip/chip-build-vscode:0.5.40" id: ESP32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -28,7 +28,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.5.33" + - name: "connectedhomeip/chip-build-vscode:0.5.40" id: NRFConnect env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -45,7 +45,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.5.33" + - name: "connectedhomeip/chip-build-vscode:0.5.40" id: EFR32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -62,7 +62,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.5.33" + - name: "connectedhomeip/chip-build-vscode:0.5.40" id: Linux env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -79,7 +79,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.5.33" + - name: "connectedhomeip/chip-build-vscode:0.5.40" id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv diff --git a/integrations/docker/images/chip-build-esp32/Dockerfile b/integrations/docker/images/chip-build-esp32/Dockerfile index 59b8f7349db09e..665cef871285c0 100644 --- a/integrations/docker/images/chip-build-esp32/Dockerfile +++ b/integrations/docker/images/chip-build-esp32/Dockerfile @@ -10,8 +10,7 @@ RUN set -x \ && : # last line RUN set -x \ - && git clone --recursive -b release/v4.4 https://github.com/espressif/esp-idf.git /tmp/esp-idf \ - && git -C /tmp/esp-idf checkout f23dcd3555cd59dfd44f4d7fbf2242c9827f91f1 \ + && git clone --recursive -b v4.4-beta1 https://github.com/espressif/esp-idf.git /tmp/esp-idf \ && : # last line FROM connectedhomeip/chip-build:${VERSION} diff --git a/integrations/docker/images/chip-build-nrf-platform/Dockerfile b/integrations/docker/images/chip-build-nrf-platform/Dockerfile index 45e68edabb6d57..de3094203f9682 100644 --- a/integrations/docker/images/chip-build-nrf-platform/Dockerfile +++ b/integrations/docker/images/chip-build-nrf-platform/Dockerfile @@ -2,7 +2,7 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} as build # Compatible Nordic Connect SDK revision. -ARG NCS_REVISION=ffcf07fe4586634a6793a48e5444a7196e7ebac6 +ARG NCS_REVISION=v1.8.0 RUN set -x \ && apt-get update \ diff --git a/integrations/docker/images/chip-build-zap/Dockerfile b/integrations/docker/images/chip-build-zap/Dockerfile new file mode 100644 index 00000000000000..700171d4ce8b10 --- /dev/null +++ b/integrations/docker/images/chip-build-zap/Dockerfile @@ -0,0 +1,16 @@ +FROM alpine:3.14 + +RUN apk add --no-cache \ + nodejs=14.18.1-r0 \ + openjdk11=11.0.12_p7-r0 \ + npm=7.17.0-r0 \ + python3=3.9.5-r2 \ + pixman-dev=0.40.0-r2 \ + cairo-dev=1.16.0-r3 \ + pango-dev=1.48.5-r0 \ + make=4.3-r0 \ + g++=10.3.1_git20210424-r2 \ + libjpeg-turbo-dev=2.1.0-r0 \ + giflib-dev=5.2.1-r0 \ + git=2.32.0-r0 \ + clang-dev=11.1.0-r1 diff --git a/integrations/docker/images/chip-build-zap/build.sh b/integrations/docker/images/chip-build-zap/build.sh new file mode 120000 index 00000000000000..fcb4d4ee75d531 --- /dev/null +++ b/integrations/docker/images/chip-build-zap/build.sh @@ -0,0 +1 @@ +../../build.sh \ No newline at end of file diff --git a/integrations/docker/images/chip-build-zap/run.sh b/integrations/docker/images/chip-build-zap/run.sh new file mode 120000 index 00000000000000..ccbd3501b330d9 --- /dev/null +++ b/integrations/docker/images/chip-build-zap/run.sh @@ -0,0 +1 @@ +../../run.sh \ No newline at end of file diff --git a/integrations/docker/images/chip-build-zap/version b/integrations/docker/images/chip-build-zap/version new file mode 120000 index 00000000000000..a4280acd348e7f --- /dev/null +++ b/integrations/docker/images/chip-build-zap/version @@ -0,0 +1 @@ +../chip-build/version \ No newline at end of file diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 9f8d8526aa9708..560f1be18dc7d7 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.5.39 Version bump reason: Push ESP forward, stop using 'depth 1' for checkouts +0.5.41 Version bump reason: ESP-IDF update to v4.4-beta1 pre-release diff --git a/scripts/build/BUILD.gn b/scripts/build/BUILD.gn index a85fb3fba7dbc5..127430285611b1 100644 --- a/scripts/build/BUILD.gn +++ b/scripts/build/BUILD.gn @@ -33,12 +33,15 @@ pw_python_package("build_examples") { "build_examples.py", "builders/__init__.py", "builders/ameba.py", + "builders/android.py", "builders/builder.py", "builders/efr32.py", "builders/esp32.py", "builders/gn.py", "builders/host.py", "builders/infineon.py", + "builders/k32w.py", + "builders/mbed.py", "builders/nrf.py", "builders/qpg.py", "builders/telink.py", diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 47a4b538c8e29c..626e4b92b74514 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -17,17 +17,18 @@ from typing import Any, List from itertools import combinations +from builders.ameba import AmebaApp, AmebaBoard, AmebaBuilder from builders.android import AndroidBoard, AndroidApp, AndroidBuilder from builders.efr32 import Efr32Builder, Efr32App, Efr32Board from builders.esp32 import Esp32Builder, Esp32Board, Esp32App from builders.host import HostBuilder, HostApp, HostBoard +from builders.infineon import InfineonBuilder, InfineonApp, InfineonBoard +from builders.k32w import K32WApp, K32WBuilder +from builders.mbed import MbedApp, MbedBoard, MbedProfile, MbedBuilder from builders.nrf import NrfApp, NrfBoard, NrfConnectBuilder from builders.qpg import QpgBuilder -from builders.infineon import InfineonBuilder, InfineonApp, InfineonBoard from builders.telink import TelinkApp, TelinkBoard, TelinkBuilder from builders.tizen import TizenApp, TizenBoard, TizenBuilder -from builders.ameba import AmebaApp, AmebaBoard, AmebaBuilder -from builders.mbed import MbedApp, MbedBoard, MbedProfile, MbedBuilder class Target: @@ -219,6 +220,8 @@ def Esp32Targets(): yield devkitc.Extend('bridge', app=Esp32App.BRIDGE) yield devkitc.Extend('temperature-measurement', app=Esp32App.TEMPERATURE_MEASUREMENT) + yield esp32_target.Extend('qemu-tests', board=Esp32Board.QEMU, app=Esp32App.TESTS) + def Efr32Targets(): efr_target = Target('efr32', Efr32Builder) @@ -333,6 +336,22 @@ def AmebaTargets(): yield ameba_target.Extend('amebad-all-clusters', board=AmebaBoard.AMEBAD, app=AmebaApp.ALL_CLUSTERS) yield ameba_target.Extend('amebad-light', board=AmebaBoard.AMEBAD, app=AmebaApp.LIGHT) + yield ameba_target.Extend('amebad-pigweed', board=AmebaBoard.AMEBAD, app=AmebaApp.PIGWEED) + + +def K32WTargets(): + target = Target('k32w', K32WBuilder) + + # This is for testing only in case debug builds are to be fixed + # Error is LWIP_DEBUG being redefined between 0 and 1 in debug builds in: + # third_party/connectedhomeip/src/lwip/k32w0/lwipopts.h + # gen/include/lwip/lwip_buildconfig.h + yield target.Extend('light', app=K32WApp.LIGHT).GlobBlacklist("Debug builds broken due to LWIP_DEBUG redefition") + + yield target.Extend('light-release', app=K32WApp.LIGHT, release=True) + yield target.Extend('shell-release', app=K32WApp.SHELL, release=True) + yield target.Extend('lock-release', app=K32WApp.LOCK, release=True) + yield target.Extend('lock-low-power-release', app=K32WApp.LOCK, low_power=True, release=True).GlobBlacklist("Only on demand build") ALL = [] @@ -345,7 +364,8 @@ def AmebaTargets(): AndroidTargets(), MbedTargets(), InfineonTargets(), - AmebaTargets() + AmebaTargets(), + K32WTargets(), ] for generator in target_generators: diff --git a/scripts/build/builders/ameba.py b/scripts/build/builders/ameba.py index 7f3df30edf14a1..18b394d242e2f9 100644 --- a/scripts/build/builders/ameba.py +++ b/scripts/build/builders/ameba.py @@ -26,6 +26,7 @@ class AmebaBoard(Enum): class AmebaApp(Enum): ALL_CLUSTERS = auto() LIGHT = auto() + PIGWEED = auto() @property def ExampleName(self): @@ -33,6 +34,8 @@ def ExampleName(self): return 'all-clusters-app' elif self == AmebaApp.LIGHT: return 'lighting-app' + elif self == AmebaApp.PIGWEED: + return 'pigweed-app' else: raise Exception('Unknown app type: %r' % self) @@ -42,6 +45,8 @@ def AppNamePrefix(self): return 'chip-ameba-all-clusters-app' elif self == AmebaApp.LIGHT: return 'chip-ameba-lighting-app' + elif self == AmebaApp.PIGWEED: + return 'chip-ameba-pigweed-app' else: raise Exception('Unknown app type: %r' % self) diff --git a/scripts/build/builders/esp32.py b/scripts/build/builders/esp32.py index f3f709e4e76e83..e99ab8e291b1b7 100644 --- a/scripts/build/builders/esp32.py +++ b/scripts/build/builders/esp32.py @@ -25,6 +25,7 @@ class Esp32Board(Enum): DevKitC = auto() M5Stack = auto() C3DevKit = auto() + QEMU = auto() class Esp32App(Enum): @@ -33,19 +34,22 @@ class Esp32App(Enum): SHELL = auto() BRIDGE = auto() TEMPERATURE_MEASUREMENT = auto() + TESTS = auto() @property - def ExampleName(self): + def ExamplePath(self): if self == Esp32App.ALL_CLUSTERS: - return 'all-clusters-app' + return 'examples/all-clusters-app' elif self == Esp32App.LOCK: - return 'lock-app' + return 'examples/lock-app' elif self == Esp32App.SHELL: - return 'shell' + return 'examples/shell' elif self == Esp32App.BRIDGE: - return 'bridge-app' + return 'examples/bridge-app' elif self == Esp32App.TEMPERATURE_MEASUREMENT: - return 'temperature-measurement-app' + return 'examples/temperature-measurement-app' + elif self == Esp32App.TESTS: + return 'src/test_driver' else: raise Exception('Unknown app type: %r' % self) @@ -61,15 +65,33 @@ def AppNamePrefix(self): return 'chip-bridge-app' elif self == Esp32App.TEMPERATURE_MEASUREMENT: return 'chip-temperature-measurement-app' + elif self == Esp32App.TESTS: + return None else: raise Exception('Unknown app type: %r' % self) + @property def FlashBundleName(self): + if not self.AppNamePrefix: + return None + return self.AppNamePrefix + '.flashbundle.txt' + def IsCompatible(self, board: Esp32Board): + if board == Esp32Board.QEMU: + return self == Esp32App.TESTS + elif board == Esp32Board.M5Stack: + return self == Esp32App.ALL_CLUSTERS + elif board == Esp32Board.C3DevKit: + return self == Esp32App.ALL_CLUSTERS + else: + return (board == Esp32Board.DevKitC) and (self != Esp32App.TESTS) + def DefaultsFileName(board: Esp32Board, app: Esp32App, enable_rpcs: bool): - if app != Esp32App.ALL_CLUSTERS: + if app == Esp32App.TESTS: + return 'sdkconfig_qemu.defaults' + elif app != Esp32App.ALL_CLUSTERS: return 'sdkconfig.defaults' rpc = "_rpc" if enable_rpcs else "" @@ -99,6 +121,10 @@ def __init__(self, self.enable_rpcs = enable_rpcs self.enable_ipv4 = enable_ipv4 + if not app.IsCompatible(board): + raise Exception( + "Incompatible app/board combination: %r and %r", app, board) + def _IdfEnvExecute(self, cmd, title=None): # Run activate.sh after export.sh to ensure using the chip environment. self._Execute( @@ -107,7 +133,7 @@ def _IdfEnvExecute(self, cmd, title=None): @property def ExamplePath(self): - return os.path.join('examples', self.app.ExampleName, 'esp32') + return os.path.join(self.app.ExamplePath, 'esp32') def generate(self): if os.path.exists(os.path.join(self.output_dir, 'build.ninja')): @@ -162,6 +188,16 @@ def _build(self): self._IdfEnvExecute(cmd, title='Building ' + self.identifier) def build_outputs(self): + if self.app == Esp32App.TESTS: + # Include the runnable image names as artifacts + result = dict() + with open(os.path.join(self.output_dir, 'test_images.txt'), 'rt') as f: + for name in f.readlines(): + name = name.strip() + result[name] = os.path.join(self.output_dir, name) + + return result + return { self.app.AppNamePrefix + '.elf': os.path.join(self.output_dir, self.app.AppNamePrefix + '.elf'), @@ -170,7 +206,10 @@ def build_outputs(self): } def flashbundle(self): - with open(os.path.join(self.output_dir, self.app.FlashBundleName()), 'r') as fp: + if not self.app.FlashBundleName: + return {} + + with open(os.path.join(self.output_dir, self.app.FlashBundleName), 'r') as fp: return { l.strip(): os.path.join(self.output_dir, l.strip()) for l in fp.readlines() if l.strip() } diff --git a/scripts/build/builders/k32w.py b/scripts/build/builders/k32w.py new file mode 100644 index 00000000000000..aef1bff6cc5e28 --- /dev/null +++ b/scripts/build/builders/k32w.py @@ -0,0 +1,93 @@ +# 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 os +from enum import Enum, auto + +from .gn import GnBuilder + + +class K32WApp(Enum): + LIGHT = auto() + LOCK = auto() + SHELL = auto() + + def ExampleName(self): + if self == K32WApp.LIGHT: + return 'lighting-app' + elif self == K32WApp.LOCK: + return 'lock-app' + elif self == K32WApp.SHELL: + return 'shell' + else: + raise Exception('Unknown app type: %r' % self) + + def AppNamePrefix(self): + if self == K32WApp.LIGHT: + return 'chip-k32w061-light-example' + elif self == K32WApp.LOCK: + return 'chip-k32w061-lock-example' + elif self == K32WApp.SHELL: + return 'chip-k32w061-shell-example' + else: + raise Exception('Unknown app type: %r' % self) + + def BuildRoot(self, root): + return os.path.join(root, 'examples', self.ExampleName(), 'nxp', 'k32w', 'k32w0') + + +class K32WBuilder(GnBuilder): + + def __init__(self, + root, + runner, + app: K32WApp = K32WApp.LIGHT, + release: bool = False, + low_power: bool = False): + super(K32WBuilder, self).__init__( + root=app.BuildRoot(root), + runner=runner) + self.code_root = root + self.app = app + self.low_power = low_power + self.release = release + + def GnBuildArgs(self): + args = [ + 'k32w0_sdk_root="%s"' % os.environ['NXP_K32W061_SDK_ROOT'], + ] + + if self.low_power: + args.append('chip_with_low_power=1') + else: + args.append('chip_with_low_power=0') + + if self.release: + args.append('is_debug=false') + + return args + + def generate(self): + self._Execute([os.path.join( + self.code_root, 'third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh')]) + + super(K32WBuilder, self).generate() + + def build_outputs(self): + items = {} + for extension in ["", ".map", ".hex"]: + name = '%s%s' % (self.app.AppNamePrefix(), extension) + items[name] = os.path.join(self.output_dir, name) + + return items diff --git a/scripts/build/test.py b/scripts/build/test.py index 8128ad28525f63..0e5e01706dc1a6 100644 --- a/scripts/build/test.py +++ b/scripts/build/test.py @@ -50,6 +50,7 @@ def build_actual_output(root: str, out: str, args: List[str]) -> List[str]: 'TIZEN_HOME': 'TEST_TIZEN_HOME', 'TELINK_ZEPHYR_SDK_DIR': 'TELINK_ZEPHYR_SDK_DIR', 'SYSROOT_AARCH64': 'SYSROOT_AARCH64', + 'NXP_K32W061_SDK_ROOT': 'TEST_NXP_K32W061_SDK_ROOT', }) retval = subprocess.run([ diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index ea4a929c3be31c..49e67f381a020d 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -1,5 +1,6 @@ ameba-amebad-all-clusters ameba-amebad-light +ameba-amebad-pigweed android-androidstudio-arm-chip-tool android-androidstudio-arm64-chip-tool android-androidstudio-x64-chip-tool @@ -70,9 +71,15 @@ esp32-m5stack-all-clusters esp32-m5stack-all-clusters-ipv6only esp32-m5stack-all-clusters-rpc esp32-m5stack-all-clusters-rpc-ipv6only +esp32-qemu-tests infineon-p6-all-clusters infineon-p6-light infineon-p6-lock +k32w-light (NOGLOB: Debug builds broken due to LWIP_DEBUG redefition) +k32w-light-release +k32w-lock-low-power-release (NOGLOB: Only on demand build) +k32w-lock-release +k32w-shell-release mbed-CY8CPROTO_062_4343W-all-clusters-debug (NOGLOB: Compile only for debugging purpose - https://os.mbed.com/docs/mbed-os/latest/program-setup/build-profiles-and-rules.html) mbed-CY8CPROTO_062_4343W-all-clusters-develop (NOGLOB: Compile only for debugging purpose - https://os.mbed.com/docs/mbed-os/latest/program-setup/build-profiles-and-rules.html) mbed-CY8CPROTO_062_4343W-all-clusters-release diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index 139966e0a740c1..349750e4921865 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -7,6 +7,9 @@ bash -c '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh {ro # Generating ameba-amebad-light bash -c '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh {root} ninja {out}/ameba-amebad-light lighting-app' +# Generating ameba-amebad-pigweed +bash -c '$AMEBA_PATH/project/realtek_amebaD_va0_example/GCC-RELEASE/build.sh {root} ninja {out}/ameba-amebad-pigweed pigweed-app' + # Generating JARs for Java build rules test python3 build/chip/java/tests/generate_jars_for_test.py @@ -410,6 +413,17 @@ bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-m5stack-all-clusters-rpc-ipv6only/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-m5stack-all-clusters-rpc-ipv6only reconfigure' +# Generating esp32-qemu-tests +mkdir -p {out}/esp32-qemu-tests + +cp src/test_driver/esp32/sdkconfig_qemu.defaults {out}/esp32-qemu-tests/sdkconfig.defaults + +rm -f src/test_driver/esp32/sdkconfig + +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; +export SDKCONFIG_DEFAULTS={out}/esp32-qemu-tests/sdkconfig.defaults +idf.py -C src/test_driver/esp32 -B {out}/esp32-qemu-tests reconfigure' + # Generating infineon-p6-all-clusters gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/all-clusters-app/p6 '--args=p6_board="CY8CKIT-062S2-43012"' {out}/infineon-p6-all-clusters @@ -419,6 +433,31 @@ gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/exa # Generating infineon-p6-lock gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/p6 '--args=p6_board="CY8CKIT-062S2-43012"' {out}/infineon-p6-lock +{root}/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh + +# Generating k32w-light +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W061_SDK_ROOT" chip_with_low_power=0' {out}/k32w-light + +{root}/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh + +# Generating k32w-light-release +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lighting-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W061_SDK_ROOT" chip_with_low_power=0 is_debug=false' {out}/k32w-light-release + +{root}/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh + +# Generating k32w-lock-low-power-release +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W061_SDK_ROOT" chip_with_low_power=1 is_debug=false' {out}/k32w-lock-low-power-release + +{root}/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh + +# Generating k32w-lock-release +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W061_SDK_ROOT" chip_with_low_power=0 is_debug=false' {out}/k32w-lock-release + +{root}/third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh + +# Generating k32w-shell-release +gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/shell/nxp/k32w/k32w0 '--args=k32w0_sdk_root="TEST_NXP_K32W061_SDK_ROOT" chip_with_low_power=0 is_debug=false' {out}/k32w-shell-release + # Generating config mbed-CY8CPROTO_062_4343W-all-clusters-debug mbed-tools configure -t GCC_ARM -m CY8CPROTO_062_4343W -p {root}/examples/all-clusters-app/mbed -o {out}/mbed-CY8CPROTO_062_4343W-all-clusters-debug --mbed-os-path {root}/third_party/mbed-os/repo @@ -593,6 +632,9 @@ ninja -C {out}/ameba-amebad-all-clusters # Building ameba-amebad-light ninja -C {out}/ameba-amebad-light +# Building ameba-amebad-pigweed +ninja -C {out}/ameba-amebad-pigweed + # Building APP android-androidstudio-arm-chip-tool {root}/src/android/CHIPTool/gradlew -p {root}/src/android/CHIPTool -PmatterBuildSrcDir={out}/android-androidstudio-arm-chip-tool -PmatterSdkSourceBuild=true -PmatterSourceBuildAbiFilters=armeabi-v7a assembleDebug @@ -977,6 +1019,13 @@ bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-m5stack-all-clusters-rpc-ipv6only/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-m5stack-all-clusters-rpc-ipv6only build' +rm -f src/test_driver/esp32/sdkconfig + +# Building esp32-qemu-tests +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; +export SDKCONFIG_DEFAULTS={out}/esp32-qemu-tests/sdkconfig.defaults +idf.py -C src/test_driver/esp32 -B {out}/esp32-qemu-tests build' + # Building infineon-p6-all-clusters ninja -C {out}/infineon-p6-all-clusters @@ -986,6 +1035,21 @@ ninja -C {out}/infineon-p6-light # Building infineon-p6-lock ninja -C {out}/infineon-p6-lock +# Building k32w-light +ninja -C {out}/k32w-light + +# Building k32w-light-release +ninja -C {out}/k32w-light-release + +# Building k32w-lock-low-power-release +ninja -C {out}/k32w-lock-low-power-release + +# Building k32w-lock-release +ninja -C {out}/k32w-lock-release + +# Building k32w-shell-release +ninja -C {out}/k32w-shell-release + # Remove old artifacts mbed-CY8CPROTO_062_4343W-all-clusters-debug bash -c 'rm -rf {out}/mbed-CY8CPROTO_062_4343W-all-clusters-debug/chip-*' diff --git a/scripts/build/testdata/glob_star_targets_except_host.txt b/scripts/build/testdata/glob_star_targets_except_host.txt index 32f0e5e91dc31c..e95ba534e53536 100644 --- a/scripts/build/testdata/glob_star_targets_except_host.txt +++ b/scripts/build/testdata/glob_star_targets_except_host.txt @@ -1,5 +1,6 @@ ameba-amebad-all-clusters ameba-amebad-light +ameba-amebad-pigweed android-androidstudio-arm-chip-tool android-androidstudio-arm64-chip-tool android-androidstudio-x64-chip-tool @@ -28,9 +29,13 @@ esp32-m5stack-all-clusters esp32-m5stack-all-clusters-ipv6only esp32-m5stack-all-clusters-rpc esp32-m5stack-all-clusters-rpc-ipv6only +esp32-qemu-tests infineon-p6-all-clusters infineon-p6-light infineon-p6-lock +k32w-light-release +k32w-lock-release +k32w-shell-release mbed-CY8CPROTO_062_4343W-all-clusters-release mbed-CY8CPROTO_062_4343W-light-release mbed-CY8CPROTO_062_4343W-lock-release diff --git a/scripts/examples/k32w_example.sh b/scripts/examples/k32w_example.sh deleted file mode 100755 index 0a8fc8d92d1dbb..00000000000000 --- a/scripts/examples/k32w_example.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -# -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -set -e - -# Build script for K32W examples GitHub workflow. - -source "$(dirname "$0")/../../scripts/activate.sh" - -set -x -env - -"$(dirname "$0")"/../../third_party/nxp/k32w0_sdk/sdk_fixes/patch_k32w_sdk.sh - -if [ -z "$3" ]; then - gn gen --check --fail-on-unused-args --root="$1" "$2" --args="k32w0_sdk_root=\"$NXP_K32W061_SDK_ROOT\" is_debug=false chip_with_low_power=1" -else - gn gen --check --fail-on-unused-args --root="$1" "$2" --args="k32w0_sdk_root=\"$NXP_K32W061_SDK_ROOT\" is_debug=false chip_with_low_power=0" -fi - -ninja -C "$2" diff --git a/scripts/helpers/bloat_check.py b/scripts/helpers/bloat_check.py index db1157008d2a9f..def289280ac3ae 100755 --- a/scripts/helpers/bloat_check.py +++ b/scripts/helpers/bloat_check.py @@ -111,7 +111,7 @@ def generateBloatReport(outputFileName, baselineDir, buildOutputDir, title='BLOAT REPORT'): - """Generates a bloat report fo files betwen two diferent directories.""" + """Generates a bloat report fo files between two diferent directories.""" logging.info('Generating bloat diff report between %s and %s', baselineDir, buildOutputDir) with open(outputFileName, 'wt') as f: diff --git a/scripts/tests/cirque_tests.sh b/scripts/tests/cirque_tests.sh index edde10bc999b8e..ff6996c4aa3094 100755 --- a/scripts/tests/cirque_tests.sh +++ b/scripts/tests/cirque_tests.sh @@ -104,18 +104,6 @@ function cirquetest_bootstrap() { __cirquetest_build_ot_lazy pip3 install -r requirements_nogrpc.txt - - if [[ "x$GITHUB_ACTION_RUN" = "x1" ]]; then - # We may run Cirque tests locally, in that case, we will run - # CHIP bootstrap script elsewhere. Don't run bootstrap so we - # won't break local environment. - set +x - - # Call activate here so the later tests can be faster - # set -e will cause error if activate.sh is sourced twice - # this is an expected behavior caused by pigweed/activate.sh - source "$REPO_DIR/scripts/bootstrap.sh" - fi } function cirquetest_run_test() { diff --git a/scripts/tests/esp32_qemu_tests.sh b/scripts/tests/esp32_qemu_tests.sh deleted file mode 100755 index 942c9403962f61..00000000000000 --- a/scripts/tests/esp32_qemu_tests.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env bash -# -# -# 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. -# -# -# Description: -# This is scripts builds ESP32 QEMU, and runs CHIP unit tests using it. -# - -set -e -set -o pipefail -set -x - -here=$(cd "$(dirname "$0")" && pwd) -chip_dir="$here"/../.. - -if [[ -n "$1" ]]; then - log_dir=$1 - shift -fi - -# shellcheck source=/dev/null -source "$chip_dir"/src/test_driver/esp32/idf.sh -"$chip_dir"/src/test_driver/esp32/qemu_setup.sh - -if [ $? -ne 0 ]; then - echo "Setup failure" - exit 1 -fi - -really_run_suite() { - idf scripts/tools/qemu_run_test.sh src/test_driver/esp32/build/chip "$@" -} - -run_suite() { - if [[ -d "${log_dir}" ]]; then - suite=${1%.a} - suite=${suite#lib} - really_run_suite "$@" 2>&1 | tee "$log_dir/$suite.log" - else - really_run_suite "$@" - fi -} - -# Currently only crypto, inet, and system tests are configured to run on QEMU. -# The specific qualifiers will be removed, once all CHIP unit tests are -# updated to run on QEMU. -SUITES=( -) - -# TODO: libAppTests depends on MessagingTestHelpers, which depends on -# NetworkTestHelpers. That sort of depends on InetTestHelpers or -# equivalent (to provide gSystemLayer, gInet, InitNetwork(), -# ShutdownNetwork()) but there's only a POSIX implementation of that -# last, which does not compile on ESP32. Need to figure out how to -# make that work. See comments below for the transport layer tests, -# which have the same issue. -# run_suite libAppTests.a -lMessagingTestHelpers -lNetworkTestHelpers - -run_suite libASN1Tests.a -run_suite libBleLayerTests.a -run_suite libCoreTests.a -run_suite libInetLayerTests.a -run_suite libRetransmitTests.a -run_suite libSystemLayerTests.a -run_suite libChipCryptoTests.a "-lChipCertTestVectors" - -# TODO: Transport layer tests do not link: -# - getpid undefined -# - ArgParser for IPAddresses are not linked in -# - std::__throw_bad_alloc() linker errors -# run_suite libRawTransportTests.a "-lNetworkTestHelpers -lInetTestHelpers" - -# TODO: Transport layer tests do not link: -# - getpid undefined -# - ArgParser for IPAddresses are not linked in -# - std::__throw_bad_alloc() linker errors -# run_suite libTransportLayerTests.a "-lNetworkTestHelpers -lInetTestHelpers" diff --git a/scripts/tools/esp32_qemu_run.sh b/scripts/tools/esp32_qemu_run.sh deleted file mode 100755 index fb4e1e092a99d0..00000000000000 --- a/scripts/tools/esp32_qemu_run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env bash -# -# -# 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. -# - -# -# Description: -# This is a utility script that runs ESP32 QEMU using the given -# application image. -# - -usage() { - exitcode=0 - if [[ -n "$1" ]]; then - exitcode=1 - echo "*** Error: $*" - fi - echo "Usage: $0 " - exit "$exitcode" -} - -me=$(basename "$0") -die() { - echo "$me: *** ERROR: " "${*}" - exit 1 -} - -realpath() { - path=$1 # input - - [[ -z $path ]] && return 0 - - # trim trailing slashes - while [[ ${#path} -gt 1 && $path = */ ]]; do - path=${path%/} - done - - # if we're at root we're done - if [[ $path = / ]]; then - echo "$path" - return 0 - fi - - [[ $path != /* ]] && path=$PWD/$path - - if [[ -d $path ]]; then - (cd "$path" && pwd) - else - echo "$(realpath "${path%/*}")/${path##*/}" - fi -} - -[[ $# -eq 1 ]] || usage "Incorrect number of arguments" - -[[ -n $QEMU_ESP32 ]] || die "Environment variable QEMU_ESP32 is undefined." - -flash_image=$(realpath "$1") - -[[ -r $flash_image ]] || usage "Could not read file $flash_image" - -"$QEMU_ESP32" -nographic -machine esp32 -drive file="$flash_image",if=mtd,format=raw -no-reboot diff --git a/scripts/tools/linux_ip_namespace_setup.sh b/scripts/tools/linux_ip_namespace_setup.sh index 1520efe1bc3368..5d467b4b48c23e 100755 --- a/scripts/tools/linux_ip_namespace_setup.sh +++ b/scripts/tools/linux_ip_namespace_setup.sh @@ -116,7 +116,7 @@ function help() { echo "between a controller and device on the same linux machine." echo "" echo "To use this script, run the device code in a namespace using the -r command" - echo "and a controller in a seperate terminal to simulate two devices communicating" + echo "and a controller in a separate terminal to simulate two devices communicating" echo "across a network." echo "Example:" echo "--------" diff --git a/scripts/tools/memory/platform/mbed.cfg b/scripts/tools/memory/platform/mbed.cfg index f261ef24a6f9d3..ca5d43d692eb7f 100644 --- a/scripts/tools/memory/platform/mbed.cfg +++ b/scripts/tools/memory/platform/mbed.cfg @@ -18,7 +18,7 @@ 'section': { # By default, only these sections will be included # when operating by sections. - 'default': ['.text', '.data', '.bss', '.heap'], + 'default': ['.text', '.data', '.bss'], }, # 'symbol': { # 'free': { diff --git a/scripts/tools/memory/platform/p6.cfg b/scripts/tools/memory/platform/p6.cfg index 96990a3cc7b5b6..d1870ee8e1fb79 100644 --- a/scripts/tools/memory/platform/p6.cfg +++ b/scripts/tools/memory/platform/p6.cfg @@ -18,7 +18,7 @@ 'section': { # By default, only these sections will be included # when operating by sections. - 'default': ['.text', '.data', '.bss', '.heap'], + 'default': ['.text', '.data', '.bss'], }, # 'symbol': { # 'free': { diff --git a/scripts/tools/qemu_run_test.sh b/scripts/tools/qemu_run_test.sh deleted file mode 100755 index c2196bf7c657b7..00000000000000 --- a/scripts/tools/qemu_run_test.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash -# -# -# 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. -# -# -# Description: -# This is a utility script that runs CHIP tests using ESP32 QEMU. -# - -set -e -set -x - -die() { - echo "${me:?}: *** ERROR: " "${*}" - exit 1 -} - -SRC_DIR="$(dirname "$0")/../.." -BUILD_DIR="$1" -shift -QEMU_TEST_TARGET="$1" -shift -EXTRA_COMPILE_ARGUMENTS="$*" # generally -lFooHelperLibrary - -# shellcheck source=/dev/null -source "$BUILD_DIR"/env.sh -bash "$BUILD_DIR"/esp32_elf_builder.sh "$BUILD_DIR/lib/$QEMU_TEST_TARGET" "$EXTRA_COMPILE_ARGUMENTS" - -flash_image_file=$(mktemp) -log_file=$(mktemp) -trap '{ rm -f $flash_image_file $log_file; }' EXIT - -"$SRC_DIR"/scripts/tools/build_esp32_flash_image.sh "$BUILD_DIR"/chip-tests.bin "$flash_image_file" -"$SRC_DIR"/scripts/tools/esp32_qemu_run.sh "$flash_image_file" | tee "$log_file" - -# If the logs contain failure message -if grep -F "] : FAILED" "$log_file"; then - die 'Some tests failed.' -fi - -# If the logs do not contain final success status -if grep -F "CHIP-tests: CHIP test status: 0" "$log_file"; then - echo "$me: All tests passed" -else - die 'Tests did not run to completion.' -fi diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt index 08ecaaea799ea4..7918915787c02f 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt @@ -31,7 +31,6 @@ import kotlinx.android.synthetic.main.on_off_client_fragment.view.readBtn import kotlinx.android.synthetic.main.on_off_client_fragment.view.showSubscribeDialogBtn import kotlinx.android.synthetic.main.on_off_client_fragment.view.toggleBtn import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.isActive import kotlinx.coroutines.launch class OnOffClientFragment : Fragment() { @@ -108,7 +107,9 @@ class OnOffClientFragment : Fragment() { minIntervalEd.text.toString().toInt(), maxIntervalEd.text.toString().toInt() ) - dialog.dismiss() + requireActivity().runOnUiThread { + dialog.dismiss() + } } } dialog.show() @@ -117,26 +118,20 @@ class OnOffClientFragment : Fragment() { private suspend fun sendSubscribeOnOffClick(minInterval: Int, maxInterval: Int) { val onOffCluster = getOnOffClusterForDevice() - val subscribeCallback = object : ChipClusters.DefaultClusterCallback { - override fun onSuccess() { - val message = "Subscribe on/off success" - Log.v(TAG, message) - showMessage(message) - - onOffCluster.reportOnOffAttribute(object : ChipClusters.BooleanAttributeCallback { - override fun onSuccess(on: Boolean) { - Log.v(TAG, "Report on/off attribute value: $on") + val subscribeCallback = object : ChipClusters.BooleanAttributeCallback { + override fun onSuccess(value: Boolean) { + val formatter = SimpleDateFormat("HH:mm:ss", Locale.getDefault()) + val time = formatter.format(Calendar.getInstance(Locale.getDefault()).time) + val message = "Subscribed on/off value at $time: ${if (value) "ON" else "OFF"}" - val formatter = SimpleDateFormat("HH:mm:ss", Locale.getDefault()) - val time = formatter.format(Calendar.getInstance(Locale.getDefault()).time) - showReportMessage("Report on/off at $time: ${if (on) "ON" else "OFF"}") - } + Log.v(TAG, message) + showReportMessage(message) + } - override fun onError(ex: Exception) { - Log.e(TAG, "Error reporting on/off attribute", ex) - showReportMessage("Error reporting on/off attribute: $ex") - } - }) + override fun onSubscriptionEstablished() { + val message = "Subscription for on/off established" + Log.v(TAG, message) + showMessage(message) } override fun onError(ex: Exception) { diff --git a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt index 4e2d77cca7770b..b9c25e3520e105 100644 --- a/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt +++ b/src/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt @@ -26,11 +26,8 @@ import kotlinx.android.synthetic.main.sensor_client_fragment.clusterNameSpinner import kotlinx.android.synthetic.main.sensor_client_fragment.deviceIdEd import kotlinx.android.synthetic.main.sensor_client_fragment.endpointIdEd import kotlinx.android.synthetic.main.sensor_client_fragment.lastValueTv +import kotlinx.android.synthetic.main.sensor_client_fragment.readSensorBtn import kotlinx.android.synthetic.main.sensor_client_fragment.sensorGraph -import kotlinx.android.synthetic.main.sensor_client_fragment.view.clusterNameSpinner -import kotlinx.android.synthetic.main.sensor_client_fragment.view.readSensorBtn -import kotlinx.android.synthetic.main.sensor_client_fragment.view.sensorGraph -import kotlinx.android.synthetic.main.sensor_client_fragment.view.watchSensorBtn import kotlinx.android.synthetic.main.sensor_client_fragment.watchSensorBtn import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch @@ -52,53 +49,56 @@ class SensorClientFragment : Fragment() { savedInstanceState: Bundle? ): View { scope = viewLifecycleOwner.lifecycleScope + return inflater.inflate(R.layout.sensor_client_fragment, container, false) + } - return inflater.inflate(R.layout.sensor_client_fragment, container, false).apply { - ChipClient.getDeviceController(requireContext()).setCompletionListener(null) - deviceIdEd.setOnEditorActionListener { textView, actionId, _ -> - if (actionId == EditorInfo.IME_ACTION_DONE) { - updateAddress(textView.text.toString()) - resetSensorGraph() // reset the graph on device change - } - actionId == EditorInfo.IME_ACTION_DONE - } - endpointIdEd.setOnEditorActionListener { textView, actionId, _ -> - if (actionId == EditorInfo.IME_ACTION_DONE) - resetSensorGraph() // reset the graph on endpoint change - actionId == EditorInfo.IME_ACTION_DONE + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + ChipClient.getDeviceController(requireContext()).setCompletionListener(null) + deviceIdEd.setOnEditorActionListener { textView, actionId, _ -> + if (actionId == EditorInfo.IME_ACTION_DONE) { + updateAddress(textView.text.toString()) + resetSensorGraph() // reset the graph on device change } - clusterNameSpinner.adapter = makeClusterNamesAdapter() - clusterNameSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onNothingSelected(parent: AdapterView<*>?) = Unit - override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { - resetSensorGraph() // reset the graph on cluster change - } + actionId == EditorInfo.IME_ACTION_DONE + } + endpointIdEd.setOnEditorActionListener { textView, actionId, _ -> + if (actionId == EditorInfo.IME_ACTION_DONE) + resetSensorGraph() // reset the graph on endpoint change + actionId == EditorInfo.IME_ACTION_DONE + } + clusterNameSpinner.adapter = makeClusterNamesAdapter() + clusterNameSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { + override fun onNothingSelected(parent: AdapterView<*>?) = Unit + override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { + resetSensorGraph() // reset the graph on cluster change } + } - readSensorBtn.setOnClickListener { scope.launch { readSensorCluster() } } - watchSensorBtn.setOnCheckedChangeListener { _, isChecked -> - if (isChecked) { - scope.launch { subscribeSensorCluster() } - } else { - unsubscribeSensorCluster() - } + readSensorBtn.setOnClickListener { scope.launch { readSensorCluster() } } + watchSensorBtn.setOnCheckedChangeListener { _, isChecked -> + if (isChecked) { + scope.launch { subscribeSensorCluster() } + } else { + unsubscribeSensorCluster() } + } - val currentTime = Calendar.getInstance().time.time - sensorGraph.addSeries(sensorData) - sensorGraph.viewport.isXAxisBoundsManual = true - sensorGraph.viewport.setMinX(currentTime.toDouble()) - sensorGraph.viewport.setMaxX(currentTime.toDouble() + MIN_REFRESH_PERIOD_S * 1000 * MAX_DATA_POINTS) - sensorGraph.gridLabelRenderer.padding = 20 - sensorGraph.gridLabelRenderer.numHorizontalLabels = 4 - sensorGraph.gridLabelRenderer.setHorizontalLabelsAngle(150) - sensorGraph.gridLabelRenderer.labelFormatter = object : LabelFormatter { - override fun setViewport(viewport: Viewport?) = Unit - override fun formatLabel(value: Double, isValueX: Boolean): String { - if (!isValueX) - return "%.2f".format(value) - return SimpleDateFormat("H:mm:ss").format(Date(value.toLong())).toString() - } + val currentTime = Calendar.getInstance().time.time + sensorGraph.addSeries(sensorData) + sensorGraph.viewport.isXAxisBoundsManual = true + sensorGraph.viewport.setMinX(currentTime.toDouble()) + sensorGraph.viewport.setMaxX(currentTime.toDouble() + MIN_REFRESH_PERIOD_S * 1000 * MAX_DATA_POINTS) + sensorGraph.gridLabelRenderer.padding = 20 + sensorGraph.gridLabelRenderer.numHorizontalLabels = 4 + sensorGraph.gridLabelRenderer.setHorizontalLabelsAngle(150) + sensorGraph.gridLabelRenderer.labelFormatter = object : LabelFormatter { + override fun setViewport(viewport: Viewport?) = Unit + override fun formatLabel(value: Double, isValueX: Boolean): String { + if (!isValueX) + return "%.2f".format(value) + return SimpleDateFormat("H:mm:ss").format(Date(value.toLong())).toString() } } } @@ -243,13 +243,9 @@ class SensorClientFragment : Fragment() { }, "subscribe" to { device: Long, endpointId: Int, callback: ReadCallback -> val cluster = ChipClusters.TemperatureMeasurementCluster(device, endpointId) - cluster.reportMeasuredValueAttribute(callback) - cluster.subscribeMeasuredValueAttribute(object : ChipClusters.DefaultClusterCallback { - override fun onSuccess() = Unit - override fun onError(ex: Exception) { - callback.onError(ex) - } - }, MIN_REFRESH_PERIOD_S, MAX_REFRESH_PERIOD_S) + cluster.subscribeMeasuredValueAttribute(callback, + MIN_REFRESH_PERIOD_S, + MAX_REFRESH_PERIOD_S) }, "unitValue" to 0.01, "unitSymbol" to "\u00B0C" @@ -261,13 +257,9 @@ class SensorClientFragment : Fragment() { }, "subscribe" to { device: Long, endpointId: Int, callback: ReadCallback -> val cluster = ChipClusters.PressureMeasurementCluster(device, endpointId) - cluster.reportMeasuredValueAttribute(callback) - cluster.subscribeMeasuredValueAttribute(object : ChipClusters.DefaultClusterCallback { - override fun onSuccess() = Unit - override fun onError(ex: Exception) { - callback.onError(ex) - } - }, MIN_REFRESH_PERIOD_S, MAX_REFRESH_PERIOD_S) + cluster.subscribeMeasuredValueAttribute(callback, + MIN_REFRESH_PERIOD_S, + MAX_REFRESH_PERIOD_S) }, "unitValue" to 1.0, "unitSymbol" to "hPa" @@ -279,13 +271,9 @@ class SensorClientFragment : Fragment() { }, "subscribe" to { device: Long, endpointId: Int, callback: ReadCallback -> val cluster = ChipClusters.RelativeHumidityMeasurementCluster(device, endpointId) - cluster.reportMeasuredValueAttribute(callback) - cluster.subscribeMeasuredValueAttribute(object : ChipClusters.DefaultClusterCallback { - override fun onSuccess() = Unit - override fun onError(ex: Exception) { - callback.onError(ex) - } - }, MIN_REFRESH_PERIOD_S, MAX_REFRESH_PERIOD_S) + cluster.subscribeMeasuredValueAttribute(callback, + MIN_REFRESH_PERIOD_S, + MAX_REFRESH_PERIOD_S) }, "unitValue" to 0.01, "unitSymbol" to "%" diff --git a/src/app/AttributeAccessInterface.cpp b/src/app/AttributeAccessInterface.cpp index 3850128b6bf17f..e9ca4325b1f3d2 100644 --- a/src/app/AttributeAccessInterface.cpp +++ b/src/app/AttributeAccessInterface.cpp @@ -55,7 +55,7 @@ CHIP_ERROR AttributeReportBuilder::FinishAttribute(AttributeReportIBs::Builder & return aAttributeReportIBsBuilder.GetAttributeReport().EndOfAttributeReportIB().GetError(); } -CHIP_ERROR AttributeValueEncoder::EncodeEmptyList() +CHIP_ERROR AttributeValueEncoder::EnsureListStarted() { if (mCurrentEncodingListIndex == kInvalidListIndex) { diff --git a/src/app/AttributeAccessInterface.h b/src/app/AttributeAccessInterface.h index 259d2ad1d3c920..b62af6d90bfb9e 100644 --- a/src/app/AttributeAccessInterface.h +++ b/src/app/AttributeAccessInterface.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -177,6 +178,15 @@ class AttributeValueEncoder return Encode(DataModel::Nullable()); } + /** + * Encode an explicit empty list. + */ + CHIP_ERROR EncodeEmptyList() + { + // Doesn't matter what type List we use here. + return Encode(DataModel::List()); + } + /** * aCallback is expected to take a const auto & argument and Encode() on it as many times as needed to encode all the list * elements one by one. If any of those Encode() calls returns failure, aCallback must stop encoding and return failure. When @@ -200,7 +210,7 @@ class AttributeValueEncoder // EmptyList acts as the beginning of the whole array type attribute report. // An empty list is encoded iff both mCurrentEncodingListIndex and mEncodeState.mCurrentEncodingListIndex are invalid // values. After encoding the empty list, mEncodeState.mCurrentEncodingListIndex and mCurrentEncodingListIndex are set to 0. - ReturnErrorOnFailure(EncodeEmptyList()); + ReturnErrorOnFailure(EnsureListStarted()); ReturnErrorOnFailure(aCallback(ListEncodeHelper(*this))); // The Encode procedure finished without any error, clear the state. mEncodeState = AttributeEncodeState(); @@ -226,7 +236,7 @@ class AttributeValueEncoder template CHIP_ERROR EncodeListItem(Ts &&... aArgs) { - // EncodeListItem must be called after EncodeEmptyList(), thus mCurrentEncodingListIndex and + // EncodeListItem must be called after EnsureListStarted(), thus mCurrentEncodingListIndex and // mEncodeState.mCurrentEncodingListIndex are not invalid values. if (mCurrentEncodingListIndex < mEncodeState.mCurrentEncodingListIndex) { @@ -273,7 +283,8 @@ class AttributeValueEncoder } /** - * EncodeEmptyList encodes the first item of one report with lists (an empty list). + * EnsureListStarted encodes the first item of one report with lists (an + * empty list), as needed. * * If internal state indicates we have already encoded the empty list, this function will encode nothing, set * mCurrentEncodingListIndex to 0 and return CHIP_NO_ERROR. @@ -282,7 +293,7 @@ class AttributeValueEncoder * after it returns, because at that point we will be encoding the list * items. */ - CHIP_ERROR EncodeEmptyList(); + CHIP_ERROR EnsureListStarted(); bool mTriedEncode = false; AttributeReportIBs::Builder & mAttributeReportIBsBuilder; diff --git a/src/app/AttributeCache.cpp b/src/app/AttributeCache.cpp index b027cc0ca8c177..64fc1d57ce9e58 100644 --- a/src/app/AttributeCache.cpp +++ b/src/app/AttributeCache.cpp @@ -36,7 +36,7 @@ CHIP_ERROR AttributeCache::UpdateCache(const ConcreteDataAttributePath & aPath, writer.Init(std::move(handle), false); - ReturnErrorOnFailure(writer.CopyElement(TLV::AnonymousTag, *apData)); + ReturnErrorOnFailure(writer.CopyElement(TLV::AnonymousTag(), *apData)); ReturnErrorOnFailure(writer.Finalize(&handle)); // diff --git a/src/app/BufferedReadCallback.cpp b/src/app/BufferedReadCallback.cpp index 3241a61c7aa988..f69bb972e2b772 100644 --- a/src/app/BufferedReadCallback.cpp +++ b/src/app/BufferedReadCallback.cpp @@ -79,7 +79,7 @@ CHIP_ERROR BufferedReadCallback::GenerateListTLV(TLV::ScopedBufferTLVReader & aR VerifyOrReturnError(backingBuffer.Get() != nullptr, CHIP_ERROR_NO_MEMORY); TLV::ScopedBufferTLVWriter writer(std::move(backingBuffer), totalBufSize); - ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Array, outerType)); + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Array, outerType)); for (auto & bufHandle : mBufferedList) { @@ -88,7 +88,7 @@ CHIP_ERROR BufferedReadCallback::GenerateListTLV(TLV::ScopedBufferTLVReader & aR reader.Init(std::move(bufHandle)); ReturnErrorOnFailure(reader.Next()); - ReturnErrorOnFailure(writer.CopyElement(TLV::AnonymousTag, reader)); + ReturnErrorOnFailure(writer.CopyElement(TLV::AnonymousTag(), reader)); } ReturnErrorOnFailure(writer.EndContainer(outerType)); @@ -120,7 +120,7 @@ CHIP_ERROR BufferedReadCallback::BufferListItem(TLV::TLVReader & reader) writer.Init(std::move(handle), false); - ReturnErrorOnFailure(writer.CopyElement(TLV::AnonymousTag, reader)); + ReturnErrorOnFailure(writer.CopyElement(TLV::AnonymousTag(), reader)); ReturnErrorOnFailure(writer.Finalize(&handle)); // Compact the buffer down to a more reasonably sized packet buffer diff --git a/src/app/CASEClient.cpp b/src/app/CASEClient.cpp index 24c79ae9ed6819..9e05560030e194 100644 --- a/src/app/CASEClient.cpp +++ b/src/app/CASEClient.cpp @@ -38,8 +38,6 @@ CHIP_ERROR CASEClient::EstablishSession(PeerId peer, const Transport::PeerAddres Messaging::ExchangeContext * exchange = mInitParams.exchangeMgr->NewContext(session.Value(), &mCASESession); VerifyOrReturnError(exchange != nullptr, CHIP_ERROR_INTERNAL); - ReturnErrorOnFailure(mCASESession.MessageDispatch().Init(mInitParams.sessionManager)); - uint16_t keyID = 0; ReturnErrorOnFailure(mInitParams.idAllocator->Allocate(keyID)); @@ -66,7 +64,7 @@ void CASEClient::OnSessionEstablishmentError(CHIP_ERROR error) void CASEClient::OnSessionEstablished() { - // On successfull CASE connection, the local session ID will be used for the derived secure session. + // On successful CASE connection, the local session ID will be used for the derived secure session. if (mConnectionSuccessCallback) { mConnectionSuccessCallback(mConectionContext, this); diff --git a/src/app/CASESessionManager.cpp b/src/app/CASESessionManager.cpp index c96a3319c51f63..5d3ed0e5e3f07e 100644 --- a/src/app/CASESessionManager.cpp +++ b/src/app/CASESessionManager.cpp @@ -21,17 +21,14 @@ namespace chip { -CHIP_ERROR CASESessionManager::FindOrEstablishSession(FabricInfo * fabric, NodeId nodeId, - Callback::Callback * onConnection, +CHIP_ERROR CASESessionManager::FindOrEstablishSession(PeerId peerId, Callback::Callback * onConnection, Callback::Callback * onFailure) { Dnssd::ResolvedNodeData resolutionData; - PeerId peerId = fabric->GetPeerIdForNode(nodeId); - bool nodeIDWasResolved = (mConfig.dnsCache != nullptr && mConfig.dnsCache->Lookup(peerId, resolutionData) == CHIP_NO_ERROR); - OperationalDeviceProxy * session = FindExistingSession(nodeId); + OperationalDeviceProxy * session = FindExistingSession(peerId); if (session == nullptr) { // TODO - Implement LRU to evict least recently used session to handle mActiveSessions pool exhaustion @@ -46,7 +43,7 @@ CHIP_ERROR CASESessionManager::FindOrEstablishSession(FabricInfo * fabric, NodeI if (session == nullptr) { - onFailure->mCall(onFailure->mContext, nodeId, CHIP_ERROR_NO_MEMORY); + onFailure->mCall(onFailure->mContext, peerId, CHIP_ERROR_NO_MEMORY); return CHIP_ERROR_NO_MEMORY; } } @@ -64,9 +61,9 @@ CHIP_ERROR CASESessionManager::FindOrEstablishSession(FabricInfo * fabric, NodeI return err; } -void CASESessionManager::ReleaseSession(NodeId nodeId) +void CASESessionManager::ReleaseSession(PeerId peerId) { - ReleaseSession(FindExistingSession(nodeId)); + ReleaseSession(FindExistingSession(peerId)); } CHIP_ERROR CASESessionManager::ResolveDeviceAddress(FabricInfo * fabric, NodeId nodeId) @@ -84,7 +81,7 @@ void CASESessionManager::OnNodeIdResolved(const Dnssd::ResolvedNodeData & nodeDa LogErrorOnFailure(mConfig.dnsCache->Insert(nodeData)); } - OperationalDeviceProxy * session = FindExistingSession(nodeData.mPeerId.GetNodeId()); + OperationalDeviceProxy * session = FindExistingSession(nodeData.mPeerId); VerifyOrReturn(session != nullptr, ChipLogDetail(Controller, "OnNodeIdResolved was called for a device with no active sessions, ignoring it.")); @@ -96,23 +93,23 @@ void CASESessionManager::OnNodeIdResolutionFailed(const PeerId & peer, CHIP_ERRO ChipLogError(Controller, "Error resolving node id: %s", ErrorStr(error)); } -CHIP_ERROR CASESessionManager::GetPeerAddress(FabricInfo * fabric, NodeId nodeId, Transport::PeerAddress & addr) +CHIP_ERROR CASESessionManager::GetPeerAddress(PeerId peerId, Transport::PeerAddress & addr) { if (mConfig.dnsCache != nullptr) { Dnssd::ResolvedNodeData resolutionData; - ReturnErrorOnFailure(mConfig.dnsCache->Lookup(fabric->GetPeerIdForNode(nodeId), resolutionData)); + ReturnErrorOnFailure(mConfig.dnsCache->Lookup(peerId, resolutionData)); addr = OperationalDeviceProxy::ToPeerAddress(resolutionData); return CHIP_NO_ERROR; } - OperationalDeviceProxy * session = FindExistingSession(nodeId); + OperationalDeviceProxy * session = FindExistingSession(peerId); VerifyOrReturnError(session != nullptr, CHIP_ERROR_NOT_CONNECTED); addr = session->GetPeerAddress(); return CHIP_NO_ERROR; } -void CASESessionManager::OnSessionReleased(SessionHandle sessionHandle) +void CASESessionManager::OnSessionReleased(const SessionHandle & sessionHandle) { OperationalDeviceProxy * session = FindSession(sessionHandle); VerifyOrReturn(session != nullptr, ChipLogDetail(Controller, "OnSessionReleased was called for unknown device, ignoring it.")); @@ -120,14 +117,14 @@ void CASESessionManager::OnSessionReleased(SessionHandle sessionHandle) session->OnSessionReleased(sessionHandle); } -OperationalDeviceProxy * CASESessionManager::FindSession(SessionHandle session) +OperationalDeviceProxy * CASESessionManager::FindSession(const SessionHandle & session) { return mConfig.devicePool->FindDevice(session); } -OperationalDeviceProxy * CASESessionManager::FindExistingSession(NodeId id) +OperationalDeviceProxy * CASESessionManager::FindExistingSession(PeerId peerId) { - return mConfig.devicePool->FindDevice(id); + return mConfig.devicePool->FindDevice(peerId); } void CASESessionManager::ReleaseSession(OperationalDeviceProxy * session) diff --git a/src/app/CASESessionManager.h b/src/app/CASESessionManager.h index 5be8b82c2cdd61..382fcd493784e8 100644 --- a/src/app/CASESessionManager.h +++ b/src/app/CASESessionManager.h @@ -79,12 +79,12 @@ class CASESessionManager : public SessionReleaseDelegate, public Dnssd::Resolver * these will be used to inform the caller about successful or failed connection establishment. * If the connection is already established, the `onConnection` callback will be immediately called. */ - CHIP_ERROR FindOrEstablishSession(FabricInfo * fabric, NodeId nodeId, Callback::Callback * onConnection, + CHIP_ERROR FindOrEstablishSession(PeerId peerId, Callback::Callback * onConnection, Callback::Callback * onFailure); - OperationalDeviceProxy * FindExistingSession(NodeId nodeId); + OperationalDeviceProxy * FindExistingSession(PeerId peerId); - void ReleaseSession(NodeId nodeId); + void ReleaseSession(PeerId peerId); /** * This API triggers the DNS-SD resolution for the given node ID. The node ID will be looked up @@ -103,10 +103,10 @@ class CASESessionManager : public SessionReleaseDelegate, public Dnssd::Resolver * an ongoing session with the peer node. If the session doesn't exist, the API will return * `CHIP_ERROR_NOT_CONNECTED` error. */ - CHIP_ERROR GetPeerAddress(FabricInfo * fabric, NodeId nodeId, Transport::PeerAddress & addr); + CHIP_ERROR GetPeerAddress(PeerId peerId, Transport::PeerAddress & addr); //////////// SessionReleaseDelegate Implementation /////////////// - void OnSessionReleased(SessionHandle session) override; + void OnSessionReleased(const SessionHandle & session) override; //////////// ResolverDelegate Implementation /////////////// void OnNodeIdResolved(const Dnssd::ResolvedNodeData & nodeData) override; @@ -114,7 +114,7 @@ class CASESessionManager : public SessionReleaseDelegate, public Dnssd::Resolver void OnNodeDiscoveryComplete(const Dnssd::DiscoveredNodeData & nodeData) override {} private: - OperationalDeviceProxy * FindSession(SessionHandle session); + OperationalDeviceProxy * FindSession(const SessionHandle & session); void ReleaseSession(OperationalDeviceProxy * device); CASESessionManagerConfig mConfig; diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index b4724884acf26b..25a3558353ce2c 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -124,7 +124,7 @@ CHIP_ERROR CommandHandler::ProcessInvokeRequest(System::PacketBufferHandle && pa invokeRequests.GetReader(&invokeRequestsReader); while (CHIP_NO_ERROR == (err = invokeRequestsReader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == invokeRequestsReader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == invokeRequestsReader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); CommandDataIB::Parser commandData; ReturnErrorOnFailure(commandData.Init(invokeRequestsReader)); ReturnErrorOnFailure(ProcessCommandDataIB(commandData)); diff --git a/src/app/CommandSender.cpp b/src/app/CommandSender.cpp index 13a955da805ca8..c9174d78b62eaa 100644 --- a/src/app/CommandSender.cpp +++ b/src/app/CommandSender.cpp @@ -60,7 +60,7 @@ CHIP_ERROR CommandSender::AllocateBuffer() return CHIP_NO_ERROR; } -CHIP_ERROR CommandSender::SendCommandRequest(SessionHandle session, System::Clock::Timeout timeout) +CHIP_ERROR CommandSender::SendCommandRequest(const SessionHandle & session, System::Clock::Timeout timeout) { VerifyOrReturnError(mState == State::AddedCommand, CHIP_ERROR_INCORRECT_STATE); @@ -171,7 +171,7 @@ CHIP_ERROR CommandSender::ProcessInvokeResponse(System::PacketBufferHandle && pa while (CHIP_NO_ERROR == (err = invokeResponsesReader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == invokeResponsesReader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == invokeResponsesReader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); InvokeResponseIB::Parser invokeResponse; ReturnErrorOnFailure(invokeResponse.Init(invokeResponsesReader)); ReturnErrorOnFailure(ProcessInvokeResponseIB(invokeResponse)); diff --git a/src/app/CommandSender.h b/src/app/CommandSender.h index 496e1c28cd98b3..8409694ea290f1 100644 --- a/src/app/CommandSender.h +++ b/src/app/CommandSender.h @@ -97,7 +97,7 @@ class CommandSender final : public Messaging::ExchangeDelegate {} /** - * OnError will be called when an error occurr *after* a successful call to SendCommandRequest(). The following + * OnError will be called when an error occur *after* a successful call to SendCommandRequest(). The following * errors will be delivered through this call in the aError field: * * - CHIP_ERROR_TIMEOUT: A response was not received within the expected response timeout. @@ -117,7 +117,7 @@ class CommandSender final : public Messaging::ExchangeDelegate virtual void OnError(const CommandSender * apCommandSender, const StatusIB & aStatusIB, CHIP_ERROR aError) {} /** - * OnDone will be called when CommandSender has finished all work and is safe to destory and free the + * OnDone will be called when CommandSender has finished all work and is safe to destroy and free the * allocated CommandSender object. * * This function will: @@ -202,7 +202,7 @@ class CommandSender final : public Messaging::ExchangeDelegate // Upon successful return from this call, all subsequent errors that occur during this interaction // will be conveyed through the OnError callback above. In addition, upon completion of work regardless of // whether it was successful or not, the OnDone callback will be invoked to indicate completion of work on this - // object and to indicate to the application that it can destory and free this object. + // object and to indicate to the application that it can destroy and free this object. // // Applications can, however, destroy this object at any time after this call, except while handling // an OnResponse or OnError callback, and it will safely clean-up. @@ -213,7 +213,7 @@ class CommandSender final : public Messaging::ExchangeDelegate // Client can specify the maximum time to wait for response (in milliseconds) via timeout parameter. // Default timeout value will be used otherwise. // - CHIP_ERROR SendCommandRequest(SessionHandle session, System::Clock::Timeout timeout = kImMessageTimeout); + CHIP_ERROR SendCommandRequest(const SessionHandle & session, System::Clock::Timeout timeout = kImMessageTimeout); private: friend class TestCommandInteraction; diff --git a/src/app/DeviceControllerInteractionModelDelegate.h b/src/app/DeviceControllerInteractionModelDelegate.h index 91301bb9fed637..5e5c2f980a1d90 100644 --- a/src/app/DeviceControllerInteractionModelDelegate.h +++ b/src/app/DeviceControllerInteractionModelDelegate.h @@ -17,15 +17,12 @@ namespace Controller { * * TODO:(#8967) Implementation of CommandSender::Callback should be removed after switching to ClusterObjects. */ -class DeviceControllerInteractionModelDelegate : public chip::app::ReadClient::Callback, - public chip::app::CommandSender::Callback, +class DeviceControllerInteractionModelDelegate : public chip::app::CommandSender::Callback, public chip::app::WriteClient::Callback, public chip::app::InteractionModelDelegate { public: - DeviceControllerInteractionModelDelegate() : mBufferedReadAdapter(*this) {} - - app::BufferedReadCallback & GetBufferedCallback() { return mBufferedReadAdapter; } + DeviceControllerInteractionModelDelegate() {} void OnResponse(app::CommandSender * apCommandSender, const app::ConcreteCommandPath & aPath, const chip::app::StatusIB & aStatus, TLV::TLVReader * aData) override @@ -72,83 +69,6 @@ class DeviceControllerInteractionModelDelegate : public chip::app::ReadClient::C } void OnDone(app::WriteClient * apWriteClient) override {} - - void OnEventData(const app::ReadClient * apReadClient, const app::EventHeader & aEventHeader, TLV::TLVReader * apData, - const app::StatusIB * apStatus) override - {} - - void OnAttributeData(const app::ReadClient * apReadClient, const app::ConcreteDataAttributePath & aPath, - TLV::TLVReader * apData, const app::StatusIB & aStatus) override - { - // - // We shouldn't be getting list item operations in the provided path since that should be handled by the buffered read - // callback. If we do, that's a bug. - // - VerifyOrDie(!aPath.IsListItemOperation()); - - IMReadReportAttributesResponseCallback(apReadClient, &aPath, apData, aStatus.mStatus); - } - - void OnSubscriptionEstablished(const app::ReadClient * apReadClient) override - { - IMSubscribeResponseCallback(apReadClient, EMBER_ZCL_STATUS_SUCCESS); - } - - void OnError(const app::ReadClient * apReadClient, CHIP_ERROR aError) override - { - app::ClusterInfo path; - path.mNodeId = apReadClient->GetPeerNodeId(); - IMReadReportAttributesResponseCallback(apReadClient, nullptr, nullptr, Protocols::InteractionModel::Status::Failure); - } - - void OnDone(app::ReadClient * apReadClient) override - { - if (apReadClient->IsSubscriptionType()) - { - this->FreeAttributePathParam(reinterpret_cast(apReadClient)); - } - } - - // TODO: FreeAttributePathParam and AllocateAttributePathParam are used by CHIPDevice.cpp for getting a long-live attribute path - // object. - void FreeAttributePathParam(uint64_t applicationId) - { - for (auto & item : mAttributePathTransactionMapPool) - { - if (item.ApplicationId == applicationId) - { - item.ApplicationId = UINT64_MAX; - } - } - } - - // TODO: We only support allocating one path, should support multiple path later. - app::AttributePathParams * AllocateAttributePathParam(size_t n, uint64_t applicationId) - { - if (n > 1) - { - return nullptr; - } - for (auto & item : mAttributePathTransactionMapPool) - { - if (item.ApplicationId == UINT64_MAX) - { - item.ApplicationId = applicationId; - return &item.Params; - } - } - return nullptr; - } - -private: - struct AttributePathTransactionMap - { - uint64_t ApplicationId = UINT64_MAX; - app::AttributePathParams Params; - }; - - app::BufferedReadCallback mBufferedReadAdapter; - AttributePathTransactionMap mAttributePathTransactionMapPool[CHIP_DEVICE_CONTROLLER_SUBSCRIPTION_ATTRIBUTE_PATH_POOL_SIZE]; }; } // namespace Controller diff --git a/src/app/DeviceProxy.cpp b/src/app/DeviceProxy.cpp index 66167ee18b0bd3..0e374cff5bc385 100644 --- a/src/app/DeviceProxy.cpp +++ b/src/app/DeviceProxy.cpp @@ -68,55 +68,6 @@ void DeviceProxy::CancelIMResponseHandler(void * commandObj) mCallbacksMgr.CancelResponseCallback(transactionId, 0 /* seqNum, always 0 for IM before #6559 */); } -void DeviceProxy::AddReportHandler(EndpointId endpoint, ClusterId cluster, AttributeId attribute, - Callback::Cancelable * onReportCallback, app::TLVDataFilter tlvDataFilter) -{ - mCallbacksMgr.AddReportCallback(GetDeviceId(), endpoint, cluster, attribute, onReportCallback, tlvDataFilter); -} - -CHIP_ERROR DeviceProxy::SendSubscribeAttributeRequest(app::AttributePathParams aPath, uint16_t mMinIntervalFloorSeconds, - uint16_t mMaxIntervalCeilingSeconds, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - VerifyOrReturnLogError(IsSecureConnected(), CHIP_ERROR_INCORRECT_STATE); - - uint8_t seqNum = GetNextSequenceNumber(); - - app::AttributePathParams * path = GetInteractionModelDelegate()->AllocateAttributePathParam(1, seqNum); - - VerifyOrReturnError(path != nullptr, CHIP_ERROR_NO_MEMORY); - - *path = aPath; - - app::ReadClient * readClient = nullptr; - ReturnErrorOnFailure(chip::app::InteractionModelEngine::GetInstance()->NewReadClient( - &readClient, app::ReadClient::InteractionType::Subscribe, &GetInteractionModelDelegate()->GetBufferedCallback())); - - // The application context is used to identify different requests from client application the type of it is intptr_t, here we - // use the seqNum. - VerifyOrReturnError(GetSecureSession().HasValue(), CHIP_ERROR_INCORRECT_STATE); - app::ReadPrepareParams params(GetSecureSession().Value()); - params.mpAttributePathParamsList = path; - params.mAttributePathParamsListSize = 1; - params.mMinIntervalFloorSeconds = mMinIntervalFloorSeconds; - params.mMaxIntervalCeilingSeconds = mMaxIntervalCeilingSeconds; - params.mKeepSubscriptions = false; - - CHIP_ERROR err = readClient->SendRequest(params); - if (err != CHIP_NO_ERROR) - { - GetInteractionModelDelegate()->FreeAttributePathParam(reinterpret_cast(readClient)); - readClient->Shutdown(); - return err; - } - - if (onSuccessCallback != nullptr || onFailureCallback != nullptr) - { - AddIMResponseHandler(readClient, onSuccessCallback, onFailureCallback); - } - return CHIP_NO_ERROR; -} - CHIP_ERROR DeviceProxy::SendWriteAttributeRequest(app::WriteClientHandle aHandle, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { diff --git a/src/app/DeviceProxy.h b/src/app/DeviceProxy.h index 15378279cf3ddb..50684140aabb54 100644 --- a/src/app/DeviceProxy.h +++ b/src/app/DeviceProxy.h @@ -51,9 +51,6 @@ class DLL_EXPORT DeviceProxy virtual bool GetAddress(Inet::IPAddress & addr, uint16_t & port) const { return false; } - virtual CHIP_ERROR SendSubscribeAttributeRequest(app::AttributePathParams aPath, uint16_t mMinIntervalFloorSeconds, - uint16_t mMaxIntervalCeilingSeconds, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback); virtual CHIP_ERROR ShutdownSubscriptions() { return CHIP_ERROR_NOT_IMPLEMENTED; } virtual CHIP_ERROR SendWriteAttributeRequest(app::WriteClientHandle aHandle, Callback::Cancelable * onSuccessCallback, @@ -61,9 +58,6 @@ class DLL_EXPORT DeviceProxy virtual CHIP_ERROR SendCommands(app::CommandSender * commandObj); - virtual void AddReportHandler(EndpointId endpoint, ClusterId cluster, AttributeId attribute, - Callback::Cancelable * onReportCallback, app::TLVDataFilter tlvDataFilter); - // Interaction model uses the object and callback interface instead of sequence number to mark different transactions. virtual void AddIMResponseHandler(void * commandObj, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, app::TLVDataFilter tlvDataFilter = nullptr); diff --git a/src/app/EventLoggingTypes.h b/src/app/EventLoggingTypes.h index 742c2c71892117..8ef91c418bba8c 100644 --- a/src/app/EventLoggingTypes.h +++ b/src/app/EventLoggingTypes.h @@ -149,8 +149,7 @@ class EventOptions struct EventLoadOutContext { EventLoadOutContext(TLV::TLVWriter & aWriter, PriorityLevel aPriority, EventNumber aStartingEventNumber) : - mWriter(aWriter), mPriority(aPriority), mStartingEventNumber(aStartingEventNumber), mCurrentEventNumber(0), mFirst(true), - mSamePriorityEvent(false) + mWriter(aWriter), mPriority(aPriority), mStartingEventNumber(aStartingEventNumber), mCurrentEventNumber(0), mFirst(true) {} TLV::TLVWriter & mWriter; @@ -162,7 +161,6 @@ struct EventLoadOutContext size_t mEventCount = 0; ClusterInfo * mpInterestedEventPaths = nullptr; bool mFirst = true; - bool mSamePriorityEvent = false; }; } // namespace app } // namespace chip diff --git a/src/app/EventManagement.cpp b/src/app/EventManagement.cpp index 0f522832e94dea..1fd8d8d0e639e5 100644 --- a/src/app/EventManagement.cpp +++ b/src/app/EventManagement.cpp @@ -88,18 +88,43 @@ struct EventEnvelopeContext int mFieldsToRead = 0; /* PriorityLevel and DeltaTime are there if that is not first event when putting events in report*/ #if CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS & CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME - Timestamp mDeltaTime = Timestamp::System(System::Clock::kZero); + Timestamp mCurrentTime = Timestamp::System(System::Clock::kZero); #else - Timestamp mDeltaTime = Timestamp::Epoch(System::Clock::kZero); + Timestamp mCurrentTime = Timestamp::Epoch(System::Clock::kZero); #endif - PriorityLevel mPriority = PriorityLevel::First; - ClusterId mClusterId = 0; - EndpointId mEndpointId = 0; - EventId mEventId = 0; + PriorityLevel mPriority = PriorityLevel::First; + ClusterId mClusterId = 0; + EndpointId mEndpointId = 0; + EventId mEventId = 0; + EventNumber mEventNumber = 0; }; +void EventManagement::InitializeCounter(Platform::PersistedStorage::Key * apCounterKey, uint32_t aCounterEpoch, + PersistedCounter * apPersistedCounter) +{ + PersistedCounter * eventNumberCounter = nullptr; + if (apPersistedCounter != nullptr && apCounterKey != nullptr && aCounterEpoch != 0) + { + eventNumberCounter = + (apPersistedCounter->Init(*apCounterKey, aCounterEpoch) == CHIP_NO_ERROR) ? apPersistedCounter : nullptr; + } + + if (eventNumberCounter == nullptr) + { + mNonPersistedCounter.Init(0); + mpEventNumberCounter = &(mNonPersistedCounter); + } + else + { + mpEventNumberCounter = eventNumberCounter; + } + mLastEventNumber = mpEventNumberCounter->GetValue(); +} + void EventManagement::Init(Messaging::ExchangeManager * apExchangeManager, uint32_t aNumBuffers, - CircularEventBuffer * apCircularEventBuffer, const LogStorageResources * const apLogStorageResources) + CircularEventBuffer * apCircularEventBuffer, const LogStorageResources * const apLogStorageResources, + Platform::PersistedStorage::Key * apCounterKey, uint32_t aCounterEpoch, + PersistedCounter * apPersistedCounter) { CircularEventBuffer * current = nullptr; CircularEventBuffer * prev = nullptr; @@ -130,9 +155,10 @@ void EventManagement::Init(Messaging::ExchangeManager * apExchangeManager, uint3 current->mProcessEvictedElement = AlwaysFail; current->mAppData = nullptr; - current->InitCounter(apLogStorageResources[bufferIndex].InitializeCounter()); } + InitializeCounter(apCounterKey, aCounterEpoch, apPersistedCounter); + mpEventBuffer = apCircularEventBuffer; mState = EventManagementStates::Idle; mBytesWritten = 0; @@ -275,10 +301,8 @@ CHIP_ERROR EventManagement::EnsureSpaceInCircularBuffer(size_t aRequiredSpace) CHIP_ERROR EventManagement::CalculateEventSize(EventLoggingDelegate * apDelegate, const EventOptions * apOptions, uint32_t & requiredSize) { - CHIP_ERROR err = CHIP_NO_ERROR; System::PacketBufferTLVWriter writer; - EventLoadOutContext ctxt = - EventLoadOutContext(writer, apOptions->mPriority, GetPriorityBuffer(apOptions->mPriority)->GetLastEventNumber()); + EventLoadOutContext ctxt = EventLoadOutContext(writer, apOptions->mPriority, GetLastEventNumber()); System::PacketBufferHandle buf = System::PacketBufferHandle::New(kMaxEventSizeReserve); if (buf.IsNull()) { @@ -286,22 +310,12 @@ CHIP_ERROR EventManagement::CalculateEventSize(EventLoggingDelegate * apDelegate } writer.Init(std::move(buf)); - ctxt.mCurrentEventNumber = GetPriorityBuffer(apOptions->mPriority)->GetLastEventNumber(); - ctxt.mCurrentTime.mValue = GetPriorityBuffer(apOptions->mPriority)->GetLastEventTimestamp(); - - TLVWriter checkpoint = ctxt.mWriter; - err = ConstructEvent(&ctxt, apDelegate, apOptions); - if (err != CHIP_NO_ERROR) + ctxt.mCurrentEventNumber = mLastEventNumber; + ctxt.mCurrentTime = mLastEventTimestamp; + CHIP_ERROR err = ConstructEvent(&ctxt, apDelegate, apOptions); + if (err == CHIP_NO_ERROR) { - ctxt.mWriter = checkpoint; - } - else - { - // update these variables since ConstructEvent can be used to track the - // state of a set of events over multiple calls. - ctxt.mCurrentEventNumber++; - ctxt.mCurrentTime = apOptions->mTimestamp; - requiredSize = writer.GetLengthWritten(); + requiredSize = writer.GetLengthWritten(); } return err; } @@ -309,7 +323,6 @@ CHIP_ERROR EventManagement::CalculateEventSize(EventLoggingDelegate * apDelegate CHIP_ERROR EventManagement::ConstructEvent(EventLoadOutContext * apContext, EventLoggingDelegate * apDelegate, const EventOptions * apOptions) { - uint64_t deltatime = 0; VerifyOrReturnError(apContext->mCurrentEventNumber >= apContext->mStartingEventNumber, CHIP_NO_ERROR /* no-op: don't write event, but advance current event Number */); @@ -330,17 +343,16 @@ CHIP_ERROR EventManagement::ConstructEvent(EventLoadOutContext * apContext, Even .IsUrgent(false) .EndOfEventPathIB(); ReturnErrorOnFailure(eventPathBuilder.GetError()); - eventDataIBBuilder.Priority(chip::to_underlying(apContext->mPriority)); + eventDataIBBuilder.EventNumber(apContext->mCurrentEventNumber).Priority(chip::to_underlying(apContext->mPriority)); ReturnErrorOnFailure(eventDataIBBuilder.GetError()); - deltatime = apOptions->mTimestamp.mValue - apContext->mCurrentTime.mValue; if (apOptions->mTimestamp.IsSystem()) { - eventDataIBBuilder.DeltaSystemTimestamp(deltatime); + eventDataIBBuilder.SystemTimestamp(apOptions->mTimestamp.mValue); } else { - eventDataIBBuilder.DeltaEpochTimestamp(deltatime); + eventDataIBBuilder.EpochTimestamp(apOptions->mTimestamp.mValue); } ReturnErrorOnFailure(eventDataIBBuilder.GetError()); @@ -358,10 +370,13 @@ CHIP_ERROR EventManagement::ConstructEvent(EventLoadOutContext * apContext, Even void EventManagement::CreateEventManagement(Messaging::ExchangeManager * apExchangeManager, uint32_t aNumBuffers, CircularEventBuffer * apCircularEventBuffer, - const LogStorageResources * const apLogStorageResources) + const LogStorageResources * const apLogStorageResources, + Platform::PersistedStorage::Key * apCounterKey, uint32_t aCounterEpoch, + PersistedCounter * apPersistedCounter) { - sInstance.Init(apExchangeManager, aNumBuffers, apCircularEventBuffer, apLogStorageResources); + sInstance.Init(apExchangeManager, aNumBuffers, apCircularEventBuffer, apLogStorageResources, apCounterKey, aCounterEpoch, + apPersistedCounter); } /** @@ -377,34 +392,6 @@ void EventManagement::DestroyEventManagement() sInstance.mpExchangeMgr = nullptr; } -EventNumber CircularEventBuffer::VendEventNumber() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - // Assign event Number to the buffer's counter's value. - mLastEventNumber = static_cast(mpEventNumberCounter->GetValue()); - - // Now advance the counter. - err = mpEventNumberCounter->Advance(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(EventLogging, "%s Advance() for priority %u failed with %" CHIP_ERROR_FORMAT, __FUNCTION__, - static_cast(mPriority), err.Format()); - } - - return mLastEventNumber; -} - -EventNumber EventManagement::GetLastEventNumber(PriorityLevel aPriority) -{ - return GetPriorityBuffer(aPriority)->GetLastEventNumber(); -} - -EventNumber EventManagement::GetFirstEventNumber(PriorityLevel aPriority) -{ - return GetPriorityBuffer(aPriority)->GetFirstEventNumber(); -} - CircularEventBuffer * EventManagement::GetPriorityBuffer(PriorityLevel aPriority) const { CircularEventBuffer * buf = mpEventBuffer; @@ -419,54 +406,43 @@ CircularEventBuffer * EventManagement::GetPriorityBuffer(PriorityLevel aPriority CHIP_ERROR EventManagement::CopyAndAdjustDeltaTime(const TLVReader & aReader, size_t aDepth, void * apContext) { - CHIP_ERROR err; + CHIP_ERROR err = CHIP_NO_ERROR; CopyAndAdjustDeltaTimeContext * ctx = static_cast(apContext); TLVReader reader(aReader); - if (aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaSystemTimestamp)) || - aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaEpochTimestamp))) + if ((aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kSystemTimestamp))) && !(ctx->mpContext->mFirst)) { - if (ctx->mpContext->mFirst) // First event gets a timestamp, subsequent ones get a delta T - { - if (ctx->mpContext->mCurrentTime.IsSystem()) - { - err = ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kSystemTimestamp)), - ctx->mpContext->mCurrentTime.mValue); - } - else - { - err = ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kEpochTimestamp)), - ctx->mpContext->mCurrentTime.mValue); - } - } - else - { - if (ctx->mpContext->mCurrentTime.IsSystem()) - { - err = ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaSystemTimestamp)), - ctx->mpContext->mCurrentTime.mValue - ctx->mpContext->mPreviousTime.mValue); - } - else - { - err = ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaEpochTimestamp)), - ctx->mpContext->mCurrentTime.mValue - ctx->mpContext->mPreviousTime.mValue); - } - } + err = ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaSystemTimestamp)), + ctx->mpContext->mCurrentTime.mValue - ctx->mpContext->mPreviousTime.mValue); + } + else if ((aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kEpochTimestamp))) && !(ctx->mpContext->mFirst)) + { + err = ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaEpochTimestamp)), + ctx->mpContext->mCurrentTime.mValue - ctx->mpContext->mPreviousTime.mValue); } else { err = ctx->mpWriter->CopyElement(reader); } + return err; +} - if (aReader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kPath))) +void EventManagement::VendEventNumber() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + // Now advance the counter. + err = mpEventNumberCounter->Advance(); + if (err != CHIP_NO_ERROR) { - err = - ctx->mpWriter->Put(TLV::ContextTag(to_underlying(EventDataIB::Tag::kEventNumber)), ctx->mpContext->mCurrentEventNumber); + ChipLogError(EventLogging, "%s Advance() failed with %" CHIP_ERROR_FORMAT, __FUNCTION__, err.Format()); } - return err; + + // Assign event Number to the buffer's counter's value. + mLastEventNumber = static_cast(mpEventNumberCounter->GetValue()); } -CHIP_ERROR EventManagement::LogEvent(EventLoggingDelegate * apDelegate, EventOptions & aEventOptions, EventNumber & aEventNumber) +CHIP_ERROR EventManagement::LogEvent(EventLoggingDelegate * apDelegate, const EventOptions & aEventOptions, + EventNumber & aEventNumber) { CHIP_ERROR err = CHIP_NO_ERROR; { @@ -481,17 +457,16 @@ CHIP_ERROR EventManagement::LogEvent(EventLoggingDelegate * apDelegate, EventOpt return err; } -CHIP_ERROR EventManagement::LogEventPrivate(EventLoggingDelegate * apDelegate, EventOptions & aEventOptions, +CHIP_ERROR EventManagement::LogEventPrivate(EventLoggingDelegate * apDelegate, const EventOptions & aEventOptions, EventNumber & aEventNumber) { CircularTLVWriter writer; - CHIP_ERROR err = CHIP_NO_ERROR; - uint32_t requestSize = 0; - aEventNumber = 0; - CircularEventBuffer checkpoint = *mpEventBuffer; - CircularEventBuffer * buffer = nullptr; - EventLoadOutContext ctxt = - EventLoadOutContext(writer, aEventOptions.mPriority, GetPriorityBuffer(aEventOptions.mPriority)->GetLastEventNumber()); + CHIP_ERROR err = CHIP_NO_ERROR; + uint32_t requestSize = 0; + aEventNumber = 0; + CircularTLVWriter checkpoint = writer; + CircularEventBuffer * buffer = nullptr; + EventLoadOutContext ctxt = EventLoadOutContext(writer, aEventOptions.mPriority, mLastEventNumber); EventOptions opts; #if CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS & CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME Timestamp timestamp; @@ -507,23 +482,16 @@ CHIP_ERROR EventManagement::LogEventPrivate(EventLoggingDelegate * apDelegate, E opts = EventOptions(timestamp); // Start the event container (anonymous structure) in the circular buffer writer.Init(*mpEventBuffer); - // check whether the entry is to be logged or discarded silently - VerifyOrExit(aEventOptions.mPriority >= CHIP_CONFIG_EVENT_GLOBAL_PRIORITY, /* no-op */); opts.mPriority = aEventOptions.mPriority; // Create all event specific data // Timestamp; encoded as a delta time - if (GetPriorityBuffer(aEventOptions.mPriority)->GetFirstEventTimestamp() == 0) - { - GetPriorityBuffer(aEventOptions.mPriority)->UpdateFirstLastEventTime(opts.mTimestamp); - } - opts.mUrgent = aEventOptions.mUrgent; opts.mPath = aEventOptions.mPath; - ctxt.mCurrentEventNumber = GetPriorityBuffer(opts.mPriority)->GetLastEventNumber(); - ctxt.mCurrentTime.mValue = GetPriorityBuffer(opts.mPriority)->GetLastEventTimestamp(); + ctxt.mCurrentEventNumber = mLastEventNumber; + ctxt.mCurrentTime.mValue = mLastEventTimestamp.mValue; err = CalculateEventSize(apDelegate, &opts, requestSize); SuccessOrExit(err); @@ -558,27 +526,25 @@ CHIP_ERROR EventManagement::LogEventPrivate(EventLoggingDelegate * apDelegate, E exit: if (err != CHIP_NO_ERROR) { - *mpEventBuffer = checkpoint; + ChipLogError(EventLogging, "Log event with error %s", ErrorStr(err)); + writer = checkpoint; } else if (opts.mPriority >= CHIP_CONFIG_EVENT_GLOBAL_PRIORITY) { - CircularEventBuffer * currentBuffer = GetPriorityBuffer(opts.mPriority); - aEventNumber = currentBuffer->VendEventNumber(); - currentBuffer->UpdateFirstLastEventTime(opts.mTimestamp); - + aEventNumber = mLastEventNumber; + VendEventNumber(); + mLastEventTimestamp = timestamp; #if CHIP_CONFIG_EVENT_LOGGING_VERBOSE_DEBUG_LOGS ChipLogDetail(EventLogging, - "LogEvent event number: 0x" ChipLogFormatX64 " schema priority: %u, endpoint id: 0x%" PRIx16 + "LogEvent event number: 0x" ChipLogFormatX64 " priority: %u, endpoint id: 0x%" PRIx16 " cluster id: " ChipLogFormatMEI " event id: 0x%" PRIx32 " %s timestamp: 0x" ChipLogFormatX64, ChipLogValueX64(aEventNumber), static_cast(opts.mPriority), opts.mPath.mEndpointId, ChipLogValueMEI(opts.mPath.mClusterId), opts.mPath.mEventId, opts.mTimestamp.mType == Timestamp::Type::kSystem ? "Sys" : "Epoch", ChipLogValueX64(opts.mTimestamp.mValue)); #endif // CHIP_CONFIG_EVENT_LOGGING_VERBOSE_DEBUG_LOGS - if (opts.mUrgent == EventOptions::Type::kUrgent) - { - err = InteractionModelEngine::GetInstance()->GetReportingEngine().ScheduleUrgentEventDelivery(opts.mPath); - } + err = InteractionModelEngine::GetInstance()->GetReportingEngine().ScheduleEventDelivery(opts.mPath, opts.mUrgent, + mBytesWritten); } return err; @@ -594,7 +560,7 @@ CHIP_ERROR EventManagement::CopyEvent(const TLVReader & aReader, TLVWriter & aWr reader.Init(aReader); ReturnErrorOnFailure(reader.EnterContainer(containerType)); - ReturnErrorOnFailure(aWriter.StartContainer(AnonymousTag, kTLVType_Structure, containerType)); + ReturnErrorOnFailure(aWriter.StartContainer(AnonymousTag(), kTLVType_Structure, containerType)); ReturnErrorOnFailure(reader.Next()); ReturnErrorOnFailure(reader.EnterContainer(containerType1)); @@ -656,18 +622,13 @@ CHIP_ERROR EventManagement::EventIterator(const TLVReader & aReader, size_t aDep } ReturnErrorOnFailure(err); - if (event.mPriority == apEventLoadOutContext->mPriority) + apEventLoadOutContext->mCurrentTime = event.mCurrentTime; + apEventLoadOutContext->mCurrentEventNumber = event.mEventNumber; + if (IsInterestedEventPaths(apEventLoadOutContext, event)) { - apEventLoadOutContext->mCurrentTime.mValue += event.mDeltaTime.mValue; - // If the retrieved event has the same priority as the one set by FetchEventSince, we need to use mSamePriorityEvent to - // increase the event number after encoding the current event number. Then this updated event number will be used by - // FetchEventSince for next use - apEventLoadOutContext->mSamePriorityEvent = true; - if (IsInterestedEventPaths(apEventLoadOutContext, event)) - { - return CHIP_EVENT_ID_FOUND; - } + return CHIP_EVENT_ID_FOUND; } + return CHIP_NO_ERROR; } @@ -696,40 +657,25 @@ CHIP_ERROR EventManagement::CopyEventsSince(const TLVReader & aReader, size_t aD loadOutContext->mFirst = false; loadOutContext->mEventCount++; } - if (loadOutContext->mSamePriorityEvent) - { - // Update to next Event Number - loadOutContext->mCurrentEventNumber++; - loadOutContext->mSamePriorityEvent = false; - } - return err; } -CHIP_ERROR EventManagement::FetchEventsSince(TLVWriter & aWriter, ClusterInfo * apClusterInfolist, PriorityLevel aPriority, - EventNumber & aEventNumber, size_t & aEventCount) +CHIP_ERROR EventManagement::FetchEventsSince(TLVWriter & aWriter, ClusterInfo * apClusterInfolist, EventNumber & aEventMin, + size_t & aEventCount) { // TODO: Add particular set of event Paths in FetchEventsSince so that we can filter the interested paths CHIP_ERROR err = CHIP_NO_ERROR; const bool recurse = false; TLVReader reader; CircularEventBufferWrapper bufWrapper; - EventLoadOutContext context(aWriter, aPriority, aEventNumber); + EventLoadOutContext context(aWriter, PriorityLevel::Invalid, aEventMin); - CircularEventBuffer * buf = mpEventBuffer; #if !CHIP_SYSTEM_CONFIG_NO_LOCKING ScopedLock lock(sInstance); #endif // !CHIP_SYSTEM_CONFIG_NO_LOCKING - while (!buf->IsFinalDestinationForPriority(aPriority)) - { - buf = buf->GetNextCircularEventBuffer(); - } - context.mpInterestedEventPaths = apClusterInfolist; - context.mCurrentTime.mValue = buf->GetFirstEventTimestamp(); - context.mCurrentEventNumber = buf->GetFirstEventNumber(); - err = GetEventReader(reader, aPriority, &bufWrapper); + err = GetEventReader(reader, PriorityLevel::Critical, &bufWrapper); SuccessOrExit(err); err = TLV::Utilities::Iterate(reader, CopyEventsSince, &context, recurse); @@ -739,7 +685,7 @@ CHIP_ERROR EventManagement::FetchEventsSince(TLVWriter & aWriter, ClusterInfo * } exit: - aEventNumber = context.mCurrentEventNumber; + aEventMin = context.mCurrentEventNumber + 1; aEventCount += context.mEventCount; return err; } @@ -781,20 +727,25 @@ CHIP_ERROR EventManagement::FetchEventParameters(const TLVReader & aReader, size envelope->mFieldsToRead |= 1 << to_underlying(EventDataIB::Tag::kPriority); } - if (reader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaSystemTimestamp))) + if (reader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kEventNumber))) { - uint64_t deltaSystemTime; - ReturnErrorOnFailure(reader.Get(deltaSystemTime)); - envelope->mDeltaTime.mType = Timestamp::Type::kSystem; - envelope->mDeltaTime.mValue = deltaSystemTime; + ReturnErrorOnFailure(reader.Get(envelope->mEventNumber)); } - if (reader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kDeltaEpochTimestamp))) + if (reader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kSystemTimestamp))) { - uint64_t deltaEpochTime; - ReturnErrorOnFailure(reader.Get(deltaEpochTime)); - envelope->mDeltaTime.mType = Timestamp::Type::kEpoch; - envelope->mDeltaTime.mValue = deltaEpochTime; + uint64_t systemTime; + ReturnErrorOnFailure(reader.Get(systemTime)); + envelope->mCurrentTime.mType = Timestamp::Type::kSystem; + envelope->mCurrentTime.mValue = systemTime; + } + + if (reader.GetTag() == TLV::ContextTag(to_underlying(EventDataIB::Tag::kEpochTimestamp))) + { + uint64_t epochTime; + ReturnErrorOnFailure(reader.Get(epochTime)); + envelope->mCurrentTime.mType = Timestamp::Type::kEpoch; + envelope->mCurrentTime.mValue = epochTime; } return CHIP_NO_ERROR; } @@ -827,15 +778,11 @@ CHIP_ERROR EventManagement::EvictEvent(CHIPCircularTLVBuffer & apBuffer, void * CircularEventBuffer * const eventBuffer = ctx->mpEventBuffer; if (eventBuffer->IsFinalDestinationForPriority(imp)) { - // event is getting dropped. Increase the event number and first timestamp. - EventNumber numEventsToDrop = 1; - eventBuffer->RemoveEvent(numEventsToDrop); - eventBuffer->SetFirstEventTimestamp(eventBuffer->GetFirstEventTimestamp() + context.mDeltaTime.mValue); - ChipLogProgress( - EventLogging, - "Dropped events from buffer with priority %u due to overflow: { event priority_level: %u, count: 0x" ChipLogFormatX64 - " };", - static_cast(eventBuffer->GetPriority()), static_cast(imp), ChipLogValueX64(numEventsToDrop)); + ChipLogProgress(EventLogging, + "Dropped 1 event from buffer with priority %u and event number 0x" ChipLogFormatX64 + " due to overflow: event priority_level: %u", + static_cast(eventBuffer->GetPriority()), ChipLogValueX64(context.mEventNumber), + static_cast(imp)); ctx->mSpaceNeededForMovedEvent = 0; return CHIP_NO_ERROR; } @@ -845,40 +792,23 @@ CHIP_ERROR EventManagement::EvictEvent(CHIPCircularTLVBuffer & apBuffer, void * return CHIP_END_OF_TLV; } -void EventManagement::SetScheduledEventEndpoint(EventNumber * apEventEndpoints) +void EventManagement::SetScheduledEventInfo(EventNumber & aEventNumber, uint32_t & aInitialWrittenEventBytes) { - CircularEventBuffer * eventBuffer = mpEventBuffer; - #if !CHIP_SYSTEM_CONFIG_NO_LOCKING ScopedLock lock(sInstance); #endif // !CHIP_SYSTEM_CONFIG_NO_LOCKING - while (eventBuffer != nullptr) - { - if (eventBuffer->GetPriority() >= PriorityLevel::First && (eventBuffer->GetPriority() <= PriorityLevel::Last)) - { - apEventEndpoints[static_cast(eventBuffer->GetPriority())] = eventBuffer->GetLastEventNumber(); - } - eventBuffer = eventBuffer->GetNextCircularEventBuffer(); - } + aEventNumber = mLastEventNumber; + aInitialWrittenEventBytes = mBytesWritten; } void CircularEventBuffer::Init(uint8_t * apBuffer, uint32_t aBufferLength, CircularEventBuffer * apPrev, CircularEventBuffer * apNext, PriorityLevel aPriorityLevel) { CHIPCircularTLVBuffer::Init(apBuffer, aBufferLength); - mpPrev = apPrev; - mpNext = apNext; - mPriority = aPriorityLevel; - mFirstEventNumber = 1; - mLastEventNumber = 0; -#if CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS & CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME - mFirstEventTimestamp = Timestamp::Epoch(System::Clock::kZero); - mLastEventTimestamp = Timestamp::Epoch(System::Clock::kZero); -#else - mFirstEventTimestamp = Timestamp::System(System::Clock::kZero); - mLastEventTimestamp = Timestamp::System(System::Clock::kZero); -#endif + mpPrev = apPrev; + mpNext = apNext; + mPriority = aPriorityLevel; mpEventNumberCounter = nullptr; } @@ -887,21 +817,6 @@ bool CircularEventBuffer::IsFinalDestinationForPriority(PriorityLevel aPriority) return !((mpNext != nullptr) && (mpNext->mPriority <= aPriority)); } -void CircularEventBuffer::UpdateFirstLastEventTime(Timestamp aEventTimestamp) -{ - if (mFirstEventTimestamp.mValue == 0) - { - mFirstEventTimestamp = aEventTimestamp; - mLastEventTimestamp = aEventTimestamp; - } - mLastEventTimestamp = aEventTimestamp; -} - -void CircularEventBuffer::RemoveEvent(EventNumber aNumEvents) -{ - mFirstEventNumber = mFirstEventNumber + aNumEvents; -} - void CircularEventReader::Init(CircularEventBufferWrapper * apBufWrapper) { CircularEventBuffer * prev; diff --git a/src/app/EventManagement.h b/src/app/EventManagement.h index 217b05f0bf77d5..2f7d8ba033f466 100644 --- a/src/app/EventManagement.h +++ b/src/app/EventManagement.h @@ -88,44 +88,6 @@ class CircularEventBuffer : public TLV::CHIPCircularTLVBuffer */ bool IsFinalDestinationForPriority(PriorityLevel aPriority) const; - /** - * @brief - * Allocate a new event Number based on the event priority, and advance the counter - * if we have one. - * - * @return EventNumber Event Number for this priority. - */ - EventNumber VendEventNumber(); - - /** - * @brief - * Remove the number of event - * - * @param[in] aNumEvents the number of the event. - */ - void RemoveEvent(EventNumber aNumEvents); - - /** - * @brief - * Given a timestamp of an event, compute the delta time to store in the log - * - * @param aEventTimestamp The event timestamp. - * - */ - void UpdateFirstLastEventTime(Timestamp aEventTimestamp); - - void InitCounter(MonotonicallyIncreasingCounter * apEventNumberCounter) - { - if (apEventNumberCounter == nullptr) - { - mNonPersistedCounter.Init(1); - mpEventNumberCounter = &(mNonPersistedCounter); - return; - } - mpEventNumberCounter = apEventNumberCounter; - mFirstEventNumber = mpEventNumberCounter->GetValue(); - } - PriorityLevel GetPriority() { return mPriority; } CircularEventBuffer * GetPreviousCircularEventBuffer() { return mpPrev; } @@ -134,14 +96,6 @@ class CircularEventBuffer : public TLV::CHIPCircularTLVBuffer void SetRequiredSpaceforEvicted(size_t aRequiredSpace) { mRequiredSpaceForEvicted = aRequiredSpace; } size_t GetRequiredSpaceforEvicted() { return mRequiredSpaceForEvicted; } - EventNumber GetFirstEventNumber() { return mFirstEventNumber; } - EventNumber GetLastEventNumber() { return mLastEventNumber; } - - uint64_t GetFirstEventTimestamp() { return mFirstEventTimestamp.mValue; } - void SetFirstEventTimestamp(uint64_t aValue) { mLastEventTimestamp.mValue = aValue; } - - uint64_t GetLastEventTimestamp() { return mLastEventTimestamp.mValue; } - virtual ~CircularEventBuffer() = default; private: @@ -158,10 +112,6 @@ class CircularEventBuffer : public TLV::CHIPCircularTLVBuffer MonotonicallyIncreasingCounter mNonPersistedCounter; size_t mRequiredSpaceForEvicted = 0; ///< Required space for previous buffer to evict event to new buffer - EventNumber mFirstEventNumber = 0; ///< First event Number stored in the logging subsystem for this priority - EventNumber mLastEventNumber = 0; ///< Last event Number vended for this priority - Timestamp mFirstEventTimestamp; ///< The timestamp of the first event in this buffer - Timestamp mLastEventTimestamp; ///< The timestamp of the last event in this buffer }; class CircularEventReader; @@ -207,22 +157,8 @@ struct LogStorageResources nullptr; // Buffer to be used as a storage at the particular priority level and shared with more important events. // Must not be nullptr. Must be large enough to accommodate the largest event emitted by the system. uint32_t mBufferSize = 0; ///< The size, in bytes, of the `mBuffer`. - Platform::PersistedStorage::Key * mCounterKey = - nullptr; // Name of the key naming persistent counter for events of this priority. When NULL, the persistent - // counters will not be used for this priority level. - uint32_t mCounterEpoch = 0; // The interval used in incrementing persistent counters. When 0, the persistent counters will not - // be used for this priority level. - PersistedCounter * mpCounterStorage = nullptr; // application provided storage for persistent counter for this priority level. PriorityLevel mPriority = PriorityLevel::Invalid; // Log priority level associated with the resources provided in this structure. - PersistedCounter * InitializeCounter() const - { - if (mpCounterStorage != nullptr && mCounterKey != nullptr && mCounterEpoch != 0) - { - return (mpCounterStorage->Init(*mCounterKey, mCounterEpoch) == CHIP_NO_ERROR) ? mpCounterStorage : nullptr; - } - return nullptr; - } }; /** @@ -259,7 +195,11 @@ class EventManagement * */ void Init(Messaging::ExchangeManager * apExchangeManager, uint32_t aNumBuffers, CircularEventBuffer * apCircularEventBuffer, - const LogStorageResources * const apLogStorageResources); + const LogStorageResources * const apLogStorageResources, Platform::PersistedStorage::Key * apCounterKey, + uint32_t aCounterEpoch, PersistedCounter * apPersistedCounter); + + void InitializeCounter(Platform::PersistedStorage::Key * apCounterKey, uint32_t aCounterEpoch, + PersistedCounter * apPersistedCounter); static EventManagement & GetInstance(); @@ -285,7 +225,9 @@ class EventManagement */ static void CreateEventManagement(Messaging::ExchangeManager * apExchangeManager, uint32_t aNumBuffers, CircularEventBuffer * apCircularEventBuffer, - const LogStorageResources * const apLogStorageResources); + const LogStorageResources * const apLogStorageResources, + Platform::PersistedStorage::Key * apCounterKey, uint32_t aCounterEpoch, + PersistedCounter * apPersistedCounter); static void DestroyEventManagement(); @@ -337,7 +279,7 @@ class EventManagement * * @return CHIP_ERROR CHIP Error Code */ - CHIP_ERROR LogEvent(EventLoggingDelegate * apDelegate, EventOptions & aEventOptions, EventNumber & aEventNumber); + CHIP_ERROR LogEvent(EventLoggingDelegate * apDelegate, const EventOptions & aEventOptions, EventNumber & aEventNumber); /** * @brief @@ -367,19 +309,17 @@ class EventManagement * A function to retrieve events of specified priority since a specified event ID. * * Given a TLV::TLVWriter, an priority type, and an event ID, the - * function will fetch events of specified priority since the - * specified event. The function will continue fetching events until + * function will fetch events since the + * specified event number. The function will continue fetching events until * it runs out of space in the TLV::TLVWriter or in the log. The function - * will terminate the event writing on event boundary. + * will terminate the event writing on event boundary. The function would filter out event based upon interested path + * specified by read/subscribe request. * * @param[in] aWriter The writer to use for event storage * @param[in] apClusterInfolist the interested cluster info list with event path inside - * @param[in] aPriority The priority of events to be fetched * - * @param[in,out] aEventNumber On input, the Event number immediately - * prior to the one we're fetching. On - * completion, the event number of the last event - * fetched. + * @param[in,out] aEventMin On input, the Event number is the one we're fetching. On + * completion, the event number of the next one we plan to fetch. * * @param[out] aEventCount The number of fetched event * @retval #CHIP_END_OF_TLV The function has reached the end of the @@ -395,8 +335,8 @@ class EventManagement * available. * */ - CHIP_ERROR FetchEventsSince(chip::TLV::TLVWriter & aWriter, ClusterInfo * apClusterInfolist, PriorityLevel aPriority, - EventNumber & aEventNumber, size_t & aEventCount); + CHIP_ERROR FetchEventsSince(chip::TLV::TLVWriter & aWriter, ClusterInfo * apClusterInfolist, EventNumber & aEventMin, + size_t & aEventCount); /** * @brief @@ -406,17 +346,7 @@ class EventManagement * * @return EventNumber most recently vended event Number for that event priority */ - EventNumber GetLastEventNumber(PriorityLevel aPriority); - - /** - * @brief - * Fetch the first event Number currently stored for a particular priority level - * - * @param aPriority Priority level - * - * @return EventNumber First currently stored event Number for that event priority - */ - EventNumber GetFirstEventNumber(PriorityLevel aPriority); + EventNumber GetLastEventNumber() { return mLastEventNumber; } /** * @brief @@ -425,11 +355,12 @@ class EventManagement bool IsValid(void) { return EventManagementStates::Shutdown != mState; }; /** - * Logger would save last logged event number for each logger buffer into schedule event number array + * Logger would save last logged event number and initial written event bytes number into schedule event number array */ - void SetScheduledEventEndpoint(EventNumber * aEventEndpoints); + void SetScheduledEventInfo(EventNumber & aEventNumber, uint32_t & aInitialWrittenEventBytes); private: + void VendEventNumber(); CHIP_ERROR CalculateEventSize(EventLoggingDelegate * apDelegate, const EventOptions * apOptions, uint32_t & requiredSize); /** * @brief Helper function for writing event header and data according to event @@ -448,7 +379,7 @@ class EventManagement CHIP_ERROR ConstructEvent(EventLoadOutContext * apContext, EventLoggingDelegate * apDelegate, const EventOptions * apOptions); // Internal function to log event - CHIP_ERROR LogEventPrivate(EventLoggingDelegate * apDelegate, EventOptions & aEventOptions, EventNumber & aEventNumber); + CHIP_ERROR LogEventPrivate(EventLoggingDelegate * apDelegate, const EventOptions & aEventOptions, EventNumber & aEventNumber); /** * @brief copy the event outright to next buffer with higher priority @@ -540,6 +471,15 @@ class EventManagement #if !CHIP_SYSTEM_CONFIG_NO_LOCKING System::Mutex mAccessLock; #endif // !CHIP_SYSTEM_CONFIG_NO_LOCKING + + // The counter we're going to actually use. + MonotonicallyIncreasingCounter * mpEventNumberCounter = nullptr; + + // The backup counter to use if no counter is provided for us. + MonotonicallyIncreasingCounter mNonPersistedCounter; + + EventNumber mLastEventNumber = 0; ///< Last event Number vended for this priority + Timestamp mLastEventTimestamp; ///< The timestamp of the last event in this buffer }; } // namespace app } // namespace chip diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 1ebfbdbaf4bade..eae1ec87fa7ce1 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -18,7 +18,7 @@ /** * @file - * This file defines objects for a CHIP Interaction Data model Engine which handle unsolicitied IM message, and + * This file defines objects for a CHIP Interaction Data model Engine which handle unsolicited IM message, and * manage different kinds of IM client and handlers. * */ @@ -84,15 +84,8 @@ void InteractionModelEngine::Shutdown() mpExchangeMgr->CloseAllContextsForDelegate(obj); return Loop::Continue; }); - mTimedHandlers.ReleaseAll(); - for (auto & readClient : mReadClients) - { - if (!readClient.IsFree()) - { - readClient.Shutdown(); - } - } + mTimedHandlers.ReleaseAll(); for (auto & readHandler : mReadHandlers) { @@ -102,6 +95,28 @@ void InteractionModelEngine::Shutdown() } } + // + // We hold weak references to ReadClient objects. The application ultimately + // actually owns them, so it's on them to eventually shut them down and free them + // up. + // + // However, we should null out their pointers back to us at the very least so that + // at destruction time, they won't attempt to reach back here to remove themselves + // from this list. + // + for (auto * readClient = mpActiveReadClientList; readClient != nullptr;) + { + readClient->mpImEngine = nullptr; + auto * tmpClient = readClient->GetNextClient(); + readClient->SetNextClient(nullptr); + readClient = tmpClient; + } + + // + // After that, we just null out our tracker. + // + mpActiveReadClientList = nullptr; + for (auto & writeClient : mWriteClients) { if (!writeClient.IsFree()) @@ -127,43 +142,6 @@ void InteractionModelEngine::Shutdown() mpExchangeMgr->UnregisterUnsolicitedMessageHandlerForProtocol(Protocols::InteractionModel::Id); } -CHIP_ERROR InteractionModelEngine::NewReadClient(ReadClient ** const apReadClient, ReadClient::InteractionType aInteractionType, - ReadClient::Callback * aCallback) -{ - *apReadClient = nullptr; - for (auto & readClient : mReadClients) - { - if (readClient.IsFree()) - { - CHIP_ERROR err; - - *apReadClient = &readClient; - err = readClient.Init(mpExchangeMgr, aCallback, aInteractionType); - if (CHIP_NO_ERROR != err) - { - *apReadClient = nullptr; - } - return err; - } - } - return CHIP_ERROR_NO_MEMORY; -} - -uint32_t InteractionModelEngine::GetNumActiveReadClients() const -{ - uint32_t numActive = 0; - - for (auto & readClient : mReadClients) - { - if (!readClient.IsFree()) - { - numActive++; - } - } - - return numActive; -} - uint32_t InteractionModelEngine::GetNumActiveReadHandlers() const { uint32_t numActive = 0; @@ -211,35 +189,30 @@ uint32_t InteractionModelEngine::GetNumActiveWriteHandlers() const CHIP_ERROR InteractionModelEngine::ShutdownSubscription(uint64_t aSubscriptionId) { - CHIP_ERROR err = CHIP_ERROR_KEY_NOT_FOUND; - - for (auto & readClient : mReadClients) + for (auto * readClient = mpActiveReadClientList; readClient != nullptr; readClient = readClient->GetNextClient()) { - if (!readClient.IsFree() && readClient.IsSubscriptionType() && readClient.IsMatchingClient(aSubscriptionId)) + if (readClient->IsSubscriptionType() && readClient->IsMatchingClient(aSubscriptionId)) { - readClient.Shutdown(); - err = CHIP_NO_ERROR; + readClient->Close(CHIP_NO_ERROR); + return CHIP_NO_ERROR; } } - return err; + return CHIP_ERROR_KEY_NOT_FOUND; } CHIP_ERROR InteractionModelEngine::ShutdownSubscriptions(FabricIndex aFabricIndex, NodeId aPeerNodeId) { - CHIP_ERROR err = CHIP_ERROR_KEY_NOT_FOUND; - - for (ReadClient & readClient : mReadClients) + for (auto * readClient = mpActiveReadClientList; readClient != nullptr; readClient = readClient->GetNextClient()) { - if (!readClient.IsFree() && readClient.IsSubscriptionType() && readClient.GetFabricIndex() == aFabricIndex && - readClient.GetPeerNodeId() == aPeerNodeId) + if (readClient->IsSubscriptionType() && readClient->GetFabricIndex() == aFabricIndex && + readClient->GetPeerNodeId() == aPeerNodeId) { - readClient.Shutdown(); - err = CHIP_NO_ERROR; + readClient->Close(CHIP_NO_ERROR); } } - return err; + return CHIP_NO_ERROR; } CHIP_ERROR InteractionModelEngine::NewWriteClient(WriteClientHandle & apWriteClient, WriteClient::Callback * apCallback, @@ -392,18 +365,21 @@ CHIP_ERROR InteractionModelEngine::OnUnsolicitedReportData(Messaging::ExchangeCo uint64_t subscriptionId = 0; ReturnLogErrorOnFailure(report.GetSubscriptionId(&subscriptionId)); - for (auto & readClient : mReadClients) + for (auto * readClient = mpActiveReadClientList; readClient != nullptr; readClient = readClient->GetNextClient()) { - if (!readClient.IsSubscriptionIdle()) + if (!readClient->IsSubscriptionIdle()) { continue; } - if (!readClient.IsMatchingClient(subscriptionId)) + + if (!readClient->IsMatchingClient(subscriptionId)) { continue; } - return readClient.OnUnsolicitedReportData(apExchangeContext, std::move(aPayload)); + + return readClient->OnUnsolicitedReportData(apExchangeContext, std::move(aPayload)); } + return CHIP_NO_ERROR; } @@ -462,40 +438,79 @@ void InteractionModelEngine::OnResponseTimeout(Messaging::ExchangeContext * ec) ChipLogValueExchange(ec)); } -CHIP_ERROR InteractionModelEngine::SendReadRequest(ReadPrepareParams & aReadPrepareParams, ReadClient::Callback * aCallback) +uint16_t InteractionModelEngine::GetWriteClientArrayIndex(const WriteClient * const apWriteClient) const { - ReadClient * client = nullptr; - CHIP_ERROR err = CHIP_NO_ERROR; - ReturnErrorOnFailure(NewReadClient(&client, ReadClient::InteractionType::Read, aCallback)); - err = client->SendRequest(aReadPrepareParams); - if (err != CHIP_NO_ERROR) - { - client->Shutdown(); - } - return err; + return static_cast(apWriteClient - mWriteClients); } -CHIP_ERROR InteractionModelEngine::SendSubscribeRequest(ReadPrepareParams & aReadPrepareParams, ReadClient::Callback * aCallback) +uint16_t InteractionModelEngine::GetReadHandlerArrayIndex(const ReadHandler * const apReadHandler) const { - ReadClient * client = nullptr; - ReturnErrorOnFailure(NewReadClient(&client, ReadClient::InteractionType::Subscribe, aCallback)); - ReturnErrorOnFailure(client->SendRequest(aReadPrepareParams)); - return CHIP_NO_ERROR; + return static_cast(apReadHandler - mReadHandlers); } -uint16_t InteractionModelEngine::GetReadClientArrayIndex(const ReadClient * const apReadClient) const +void InteractionModelEngine::AddReadClient(ReadClient * apReadClient) { - return static_cast(apReadClient - mReadClients); + apReadClient->SetNextClient(mpActiveReadClientList); + mpActiveReadClientList = apReadClient; } -uint16_t InteractionModelEngine::GetWriteClientArrayIndex(const WriteClient * const apWriteClient) const +void InteractionModelEngine::RemoveReadClient(ReadClient * apReadClient) { - return static_cast(apWriteClient - mWriteClients); + ReadClient * pPrevListItem = nullptr; + ReadClient * pCurListItem = mpActiveReadClientList; + + while (pCurListItem != apReadClient) + { + pPrevListItem = pCurListItem; + pCurListItem = pCurListItem->GetNextClient(); + } + + // + // Item must exist in this tracker list. If not, there's a bug somewhere. + // + VerifyOrDie(pCurListItem != nullptr); + + if (pPrevListItem) + { + pPrevListItem->SetNextClient(apReadClient->GetNextClient()); + } + else + { + mpActiveReadClientList = apReadClient->GetNextClient(); + } + + apReadClient->SetNextClient(nullptr); } -uint16_t InteractionModelEngine::GetReadHandlerArrayIndex(const ReadHandler * const apReadHandler) const +size_t InteractionModelEngine::GetNumActiveReadClients() { - return static_cast(apReadHandler - mReadHandlers); + ReadClient * pListItem = mpActiveReadClientList; + size_t count = 0; + + while (pListItem) + { + pListItem = pListItem->GetNextClient(); + count++; + } + + return count; +} + +bool InteractionModelEngine::InActiveReadClientList(ReadClient * apReadClient) +{ + ReadClient * pListItem = mpActiveReadClientList; + + while (pListItem) + { + if (pListItem == apReadClient) + { + return true; + } + + pListItem = pListItem->GetNextClient(); + } + + return false; } void InteractionModelEngine::ReleaseClusterInfoList(ClusterInfo *& aClusterInfo) diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index 9597458dbd5cb8..a306706e70ba33 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -18,7 +18,7 @@ /** * @file - * This file defines objects for a CHIP Interaction Data model Engine which handle unsolicitied IM message, and + * This file defines objects for a CHIP Interaction Data model Engine which handle unsolicited IM message, and * manage different kinds of IM client and handlers. * */ @@ -95,24 +95,6 @@ class InteractionModelEngine : public Messaging::ExchangeDelegate, public Comman Messaging::ExchangeManager * GetExchangeManager(void) const { return mpExchangeMgr; }; - /** - * Creates a new read client and send ReadRequest message to the node using the read client, - * shutdown if fail to send it out - * - * @retval #CHIP_ERROR_NO_MEMORY If there is no ReadClient available - * @retval #CHIP_NO_ERROR On success. - */ - CHIP_ERROR SendReadRequest(ReadPrepareParams & aReadPrepareParams, ReadClient::Callback * aCallback); - - /** - * Creates a new read client and sends SubscribeRequest message to the node using the read client. - * Shuts down on transmission failure. - * - * @retval #CHIP_ERROR_NO_MEMORY If there is no ReadClient available - * @retval #CHIP_NO_ERROR On success. - */ - CHIP_ERROR SendSubscribeRequest(ReadPrepareParams & aReadPrepareParams, ReadClient::Callback * aCallback); - /** * Tears down an active subscription. * @@ -145,38 +127,11 @@ class InteractionModelEngine : public Messaging::ExchangeDelegate, public Comman CHIP_ERROR NewWriteClient(WriteClientHandle & apWriteClient, WriteClient::Callback * callback, const Optional & aTimedWriteTimeoutMs = NullOptional); - /** - * Allocate a ReadClient that can be used to do a read interaction. If the call succeeds, the consumer - * is responsible for calling Shutdown() on the ReadClient once it's done using it. - * - * @param[in,out] apReadClient A double pointer to a ReadClient that is updated to point to a valid ReadClient - * on successful completion of this function. On failure, it will be updated to point to - * nullptr. - * @param[in] aInteractionType Type of interaction (read or subscription) that the requested ReadClient should execute. - * @param[in] aCallback If not-null, permits overriding the default delegate registered with the - * InteractionModelEngine that will be used by the ReadClient. - * - * @retval #CHIP_ERROR_INCORRECT_STATE If there is no ReadClient available - * @retval #CHIP_NO_ERROR On success. - */ - CHIP_ERROR NewReadClient(ReadClient ** const apReadClient, ReadClient::InteractionType aInteractionType, - ReadClient::Callback * aCallback); - uint32_t GetNumActiveReadHandlers() const; - uint32_t GetNumActiveReadClients() const; uint32_t GetNumActiveWriteHandlers() const; uint32_t GetNumActiveWriteClients() const; - /** - * Get read client index in mReadClients - * - * @param[in] apReadClient A pointer to a read client object. - * - * @retval the index in mReadClients array - */ - uint16_t GetReadClientArrayIndex(const ReadClient * const apReadClient) const; - uint16_t GetWriteClientArrayIndex(const WriteClient * const apWriteClient) const; uint16_t GetReadHandlerArrayIndex(const ReadHandler * const apReadHandler) const; @@ -220,6 +175,27 @@ class InteractionModelEngine : public Messaging::ExchangeDelegate, public Comman void OnTimedWrite(TimedHandler * apTimedHandler, Messaging::ExchangeContext * apExchangeContext, const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload); + /** + * Add a read client to the internally tracked list of weak references. This list is used to + * correctly dispatch unsolicited reports to the right matching handler by subscription ID. + */ + void AddReadClient(ReadClient * apReadClient); + + /** + * Remove a read client from the internally tracked list of weak references. + */ + void RemoveReadClient(ReadClient * apReadClient); + + /** + * Test to see if a read client is in the actively tracked list. + */ + bool InActiveReadClientList(ReadClient * apReadClient); + + /** + * Return the number of active read clients being tracked by the engine. + */ + size_t GetNumActiveReadClients(); + private: friend class reporting::Engine; friend class TestCommandInteraction; @@ -287,7 +263,6 @@ class InteractionModelEngine : public Messaging::ExchangeDelegate, public Comman // TODO(#8006): investgate if we can provide more flexible object management on devices with more resources. BitMapObjectPool mCommandHandlerObjs; BitMapObjectPool mTimedHandlers; - ReadClient mReadClients[CHIP_IM_MAX_NUM_READ_CLIENT]; ReadHandler mReadHandlers[CHIP_IM_MAX_NUM_READ_HANDLER]; WriteClient mWriteClients[CHIP_IM_MAX_NUM_WRITE_CLIENT]; WriteHandler mWriteHandlers[CHIP_IM_MAX_NUM_WRITE_HANDLER]; @@ -295,6 +270,8 @@ class InteractionModelEngine : public Messaging::ExchangeDelegate, public Comman ClusterInfo mClusterInfoPool[CHIP_IM_SERVER_MAX_NUM_PATH_GROUPS]; ClusterInfo * mpNextAvailableClusterInfo = nullptr; + ReadClient * mpActiveReadClientList = nullptr; + // A magic number for tracking values between stack Shutdown()-s and Init()-s. // An ObjectHandle is valid iff. its magic equals to this one. uint32_t mMagic = 0; diff --git a/src/app/MessageDef/ArrayBuilder.cpp b/src/app/MessageDef/ArrayBuilder.cpp index c1727e861fb954..8f185175b6c31f 100644 --- a/src/app/MessageDef/ArrayBuilder.cpp +++ b/src/app/MessageDef/ArrayBuilder.cpp @@ -33,7 +33,7 @@ CHIP_ERROR ArrayBuilder::Init(TLV::TLVWriter * const apWriter, const uint8_t aCo CHIP_ERROR ArrayBuilder::Init(TLV::TLVWriter * const apWriter) { mpWriter = apWriter; - mError = mpWriter->StartContainer(TLV::AnonymousTag, chip::TLV::kTLVType_Array, mOuterContainerType); + mError = mpWriter->StartContainer(TLV::AnonymousTag(), chip::TLV::kTLVType_Array, mOuterContainerType); return mError; } diff --git a/src/app/MessageDef/AttributeDataIBs.cpp b/src/app/MessageDef/AttributeDataIBs.cpp index 913888e7e36c35..53dba2d517a38b 100644 --- a/src/app/MessageDef/AttributeDataIBs.cpp +++ b/src/app/MessageDef/AttributeDataIBs.cpp @@ -51,7 +51,7 @@ CHIP_ERROR AttributeDataIBs::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrExit(chip::TLV::AnonymousTag == reader.GetTag(), err = CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrExit(chip::TLV::AnonymousTag() == reader.GetTag(), err = CHIP_ERROR_INVALID_TLV_TAG); VerifyOrExit(chip::TLV::kTLVType_Structure == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); { diff --git a/src/app/MessageDef/AttributePathIBs.cpp b/src/app/MessageDef/AttributePathIBs.cpp index 30fc8480aae864..b3f824d6ca25c7 100644 --- a/src/app/MessageDef/AttributePathIBs.cpp +++ b/src/app/MessageDef/AttributePathIBs.cpp @@ -42,7 +42,7 @@ CHIP_ERROR AttributePathIBs::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); VerifyOrReturnError(TLV::kTLVType_List == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); { AttributePathIB::Parser path; diff --git a/src/app/MessageDef/AttributeReportIBs.cpp b/src/app/MessageDef/AttributeReportIBs.cpp index cfa97ad5b0dca8..5d626f7e5361ae 100644 --- a/src/app/MessageDef/AttributeReportIBs.cpp +++ b/src/app/MessageDef/AttributeReportIBs.cpp @@ -47,7 +47,7 @@ CHIP_ERROR AttributeReportIBs::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); { AttributeReportIB::Parser AttributeReport; ReturnErrorOnFailure(AttributeReport.Init(reader)); diff --git a/src/app/MessageDef/AttributeStatusIBs.cpp b/src/app/MessageDef/AttributeStatusIBs.cpp index c604a4bb2c2a00..f9d4de4ed1b223 100644 --- a/src/app/MessageDef/AttributeStatusIBs.cpp +++ b/src/app/MessageDef/AttributeStatusIBs.cpp @@ -59,7 +59,7 @@ CHIP_ERROR AttributeStatusIBs::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); { AttributeStatusIB::Parser status; ReturnErrorOnFailure(status.Init(reader)); diff --git a/src/app/MessageDef/DataVersionFilterIBs.cpp b/src/app/MessageDef/DataVersionFilterIBs.cpp index dcce8afe403cf4..efbc00e29e6cc8 100644 --- a/src/app/MessageDef/DataVersionFilterIBs.cpp +++ b/src/app/MessageDef/DataVersionFilterIBs.cpp @@ -41,7 +41,7 @@ CHIP_ERROR DataVersionFilterIBs::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); { DataVersionFilterIB::Parser DataVersionFilter; ReturnErrorOnFailure(DataVersionFilter.Init(reader)); diff --git a/src/app/MessageDef/EventFilterIBs.cpp b/src/app/MessageDef/EventFilterIBs.cpp index 97cc23ed78f282..c3a9f7e188bcb4 100644 --- a/src/app/MessageDef/EventFilterIBs.cpp +++ b/src/app/MessageDef/EventFilterIBs.cpp @@ -41,7 +41,7 @@ CHIP_ERROR EventFilterIBs::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); { EventFilterIB::Parser eventFilter; ReturnErrorOnFailure(eventFilter.Init(reader)); diff --git a/src/app/MessageDef/EventPathIBs.cpp b/src/app/MessageDef/EventPathIBs.cpp index 2002f7d55c2776..fc541ad4610ac6 100644 --- a/src/app/MessageDef/EventPathIBs.cpp +++ b/src/app/MessageDef/EventPathIBs.cpp @@ -43,7 +43,7 @@ CHIP_ERROR EventPathIBs::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); VerifyOrReturnError(TLV::kTLVType_List == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); { diff --git a/src/app/MessageDef/EventReportIBs.cpp b/src/app/MessageDef/EventReportIBs.cpp index 47d3fc16e65c36..9559be854079f9 100644 --- a/src/app/MessageDef/EventReportIBs.cpp +++ b/src/app/MessageDef/EventReportIBs.cpp @@ -47,7 +47,7 @@ CHIP_ERROR EventReportIBs::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); { EventReportIB::Parser eventReport; ReturnErrorOnFailure(eventReport.Init(reader)); diff --git a/src/app/MessageDef/InvokeRequests.cpp b/src/app/MessageDef/InvokeRequests.cpp index 81608bb34fee09..2e74397fecaa19 100644 --- a/src/app/MessageDef/InvokeRequests.cpp +++ b/src/app/MessageDef/InvokeRequests.cpp @@ -41,7 +41,7 @@ CHIP_ERROR InvokeRequests::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); { CommandDataIB::Parser commandData; ReturnErrorOnFailure(commandData.Init(reader)); diff --git a/src/app/MessageDef/InvokeResponseIBs.cpp b/src/app/MessageDef/InvokeResponseIBs.cpp index a4c87174e73d2d..4a148b889ae500 100644 --- a/src/app/MessageDef/InvokeResponseIBs.cpp +++ b/src/app/MessageDef/InvokeResponseIBs.cpp @@ -41,7 +41,7 @@ CHIP_ERROR InvokeResponseIBs::Parser::CheckSchemaValidity() const while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); { InvokeResponseIB::Parser invokeResponse; ReturnErrorOnFailure(invokeResponse.Init(reader)); diff --git a/src/app/MessageDef/ListBuilder.cpp b/src/app/MessageDef/ListBuilder.cpp index 54114c00b9795b..0153bec77e1424 100644 --- a/src/app/MessageDef/ListBuilder.cpp +++ b/src/app/MessageDef/ListBuilder.cpp @@ -35,7 +35,7 @@ CHIP_ERROR ListBuilder::Init(TLV::TLVWriter * const apWriter, const uint8_t aCon CHIP_ERROR ListBuilder::Init(TLV::TLVWriter * const apWriter) { mpWriter = apWriter; - mError = mpWriter->StartContainer(TLV::AnonymousTag, TLV::kTLVType_List, mOuterContainerType); + mError = mpWriter->StartContainer(TLV::AnonymousTag(), TLV::kTLVType_List, mOuterContainerType); return mError; } diff --git a/src/app/MessageDef/StructBuilder.cpp b/src/app/MessageDef/StructBuilder.cpp index 261187e81889c6..903f982b924981 100644 --- a/src/app/MessageDef/StructBuilder.cpp +++ b/src/app/MessageDef/StructBuilder.cpp @@ -32,7 +32,7 @@ CHIP_ERROR StructBuilder::Init(TLV::TLVWriter * const apWriter, const uint8_t aC CHIP_ERROR StructBuilder::Init(TLV::TLVWriter * const apWriter) { mpWriter = apWriter; - mError = mpWriter->StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, mOuterContainerType); + mError = mpWriter->StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, mOuterContainerType); return mError; } } // namespace app diff --git a/src/app/OperationalDeviceProxy.cpp b/src/app/OperationalDeviceProxy.cpp index 09f87b03833a2d..9cf2234098ca51 100644 --- a/src/app/OperationalDeviceProxy.cpp +++ b/src/app/OperationalDeviceProxy.cpp @@ -84,7 +84,7 @@ CHIP_ERROR OperationalDeviceProxy::Connect(Callback::Callback if (err != CHIP_NO_ERROR && onFailure != nullptr) { - onFailure->mCall(onFailure->mContext, mPeerId.GetNodeId(), err); + onFailure->mCall(onFailure->mContext, mPeerId, err); } return err; @@ -205,7 +205,7 @@ void OperationalDeviceProxy::DequeueConnectionFailureCallbacks(CHIP_ERROR error, cb->Cancel(); if (executeCallback) { - cb->mCall(cb->mContext, mPeerId.GetNodeId(), error); + cb->mCall(cb->mContext, mPeerId, error); } } } @@ -262,6 +262,12 @@ CHIP_ERROR OperationalDeviceProxy::Disconnect() return CHIP_NO_ERROR; } +void OperationalDeviceProxy::SetConnectedSession(SessionHandle handle) +{ + mSecureSession.Grab(handle); + mState = State::SecureConnected; +} + void OperationalDeviceProxy::Clear() { if (mCASEClient) @@ -290,7 +296,7 @@ void OperationalDeviceProxy::DeferCloseCASESession() mSystemLayer->ScheduleWork(CloseCASESessionTask, this); } -void OperationalDeviceProxy::OnSessionReleased(SessionHandle session) +void OperationalDeviceProxy::OnSessionReleased(const SessionHandle & session) { VerifyOrReturn(mSecureSession.Contains(session), ChipLogDetail(Controller, "Connection expired, but it doesn't match the current session")); diff --git a/src/app/OperationalDeviceProxy.h b/src/app/OperationalDeviceProxy.h index 2391c56d7f1c67..c56a92453c94f0 100644 --- a/src/app/OperationalDeviceProxy.h +++ b/src/app/OperationalDeviceProxy.h @@ -74,7 +74,7 @@ struct DeviceProxyInitParams class OperationalDeviceProxy; typedef void (*OnDeviceConnected)(void * context, OperationalDeviceProxy * device); -typedef void (*OnDeviceConnectionFailure)(void * context, NodeId deviceId, CHIP_ERROR error); +typedef void (*OnDeviceConnectionFailure)(void * context, PeerId peerId, CHIP_ERROR error); class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, SessionReleaseDelegate, public SessionEstablishmentDelegate { @@ -124,7 +124,7 @@ class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, SessionReleaseDele * Called when a connection is closing. * The object releases all resources associated with the connection. */ - void OnSessionReleased(SessionHandle session) override; + void OnSessionReleased(const SessionHandle & session) override; void OnNodeIdResolved(const Dnssd::ResolvedNodeData & nodeResolutionData) { @@ -143,6 +143,15 @@ class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, SessionReleaseDele */ CHIP_ERROR Disconnect() override; + /** + * Use SetConnectedSession if 'this' object is a newly allocated device proxy. + * It will take an existing session, such as the one established + * during commissioning, and use it for this device proxy. + * + * Note: Avoid using this function generally as it is Deprecated + */ + void SetConnectedSession(SessionHandle handle); + NodeId GetDeviceId() const override { return mPeerId.GetNodeId(); } /** @@ -155,7 +164,7 @@ class DLL_EXPORT OperationalDeviceProxy : public DeviceProxy, SessionReleaseDele PeerId GetPeerId() const { return mPeerId; } - bool MatchesSession(SessionHandle session) const { return mSecureSession.Contains(session); } + bool MatchesSession(const SessionHandle & session) const { return mSecureSession.Contains(session); } uint8_t GetNextSequenceNumber() override { return mSequenceNumber++; }; diff --git a/src/app/OperationalDeviceProxyPool.h b/src/app/OperationalDeviceProxyPool.h index 79b63391d9cf4b..8fed456db7998d 100644 --- a/src/app/OperationalDeviceProxyPool.h +++ b/src/app/OperationalDeviceProxyPool.h @@ -33,9 +33,9 @@ class OperationalDeviceProxyPoolDelegate virtual void Release(OperationalDeviceProxy * device) = 0; - virtual OperationalDeviceProxy * FindDevice(SessionHandle session) = 0; + virtual OperationalDeviceProxy * FindDevice(const SessionHandle & session) = 0; - virtual OperationalDeviceProxy * FindDevice(NodeId id) = 0; + virtual OperationalDeviceProxy * FindDevice(PeerId peerId) = 0; virtual ~OperationalDeviceProxyPoolDelegate() {} }; @@ -59,7 +59,7 @@ class OperationalDeviceProxyPool : public OperationalDeviceProxyPoolDelegate void Release(OperationalDeviceProxy * device) override { mDevicePool.ReleaseObject(device); } - OperationalDeviceProxy * FindDevice(SessionHandle session) override + OperationalDeviceProxy * FindDevice(const SessionHandle & session) override { OperationalDeviceProxy * foundDevice = nullptr; mDevicePool.ForEachActiveObject([&](auto * activeDevice) { @@ -74,11 +74,11 @@ class OperationalDeviceProxyPool : public OperationalDeviceProxyPoolDelegate return foundDevice; } - OperationalDeviceProxy * FindDevice(NodeId id) override + OperationalDeviceProxy * FindDevice(PeerId peerId) override { OperationalDeviceProxy * foundDevice = nullptr; mDevicePool.ForEachActiveObject([&](auto * activeDevice) { - if (activeDevice->GetDeviceId() == id) + if (activeDevice->GetPeerId() == peerId) { foundDevice = activeDevice; return Loop::Break; diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index 1c075f5c801567..c1b993ef34b83d 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -31,60 +31,63 @@ namespace chip { namespace app { -CHIP_ERROR ReadClient::Init(Messaging::ExchangeManager * apExchangeMgr, Callback * apCallback, InteractionType aInteractionType) +ReadClient::ReadClient(InteractionModelEngine * apImEngine, Messaging::ExchangeManager * apExchangeMgr, Callback & apCallback, + InteractionType aInteractionType) : + mpCallback(apCallback) { - CHIP_ERROR err = CHIP_NO_ERROR; // Error if already initialized. - VerifyOrExit(IsFree(), err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(apExchangeMgr != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mpExchangeMgr == nullptr, err = CHIP_ERROR_INVALID_ARGUMENT); - mpExchangeMgr = apExchangeMgr; - mpCallback = apCallback; - mState = ClientState::Initialized; - mMinIntervalFloorSeconds = 0; - mMaxIntervalCeilingSeconds = 0; - mSubscriptionId = 0; - mIsInitialReport = true; - mIsPrimingReports = true; - mInteractionType = aInteractionType; - AbortExistingExchangeContext(); + mpExchangeMgr = apExchangeMgr; + mpCallback = apCallback; + mInteractionType = aInteractionType; -exit: - return err; -} + mpImEngine = apImEngine; -void ReadClient::Shutdown() -{ - AbortExistingExchangeContext(); - ShutdownInternal(CHIP_NO_ERROR); + if (aInteractionType == InteractionType::Subscribe) + { + mpImEngine->AddReadClient(this); + } } -void ReadClient::ShutdownInternal(CHIP_ERROR aError) +ReadClient::~ReadClient() { - if (mpCallback != nullptr) + Abort(); + + if (IsSubscriptionType()) { - if (aError != CHIP_NO_ERROR) + CancelLivenessCheckTimer(); + + // + // Only remove ourselves from the engine's tracker list if we still continue to have a valid pointer to it. + // This won't be the case if the engine shut down before this destructor was called (in which case, mpImEngine + // will point to null) + // + if (mpImEngine) { - mpCallback->OnError(this, aError); + mpImEngine->RemoveReadClient(this); } - mpCallback->OnDone(this); - mpCallback = nullptr; } - if (IsSubscriptionType()) +} + +void ReadClient::Close(CHIP_ERROR aError) +{ + // OnDone below can destroy us before we unwind all the way back into the + // exchange code and it tries to close itself. Make sure that it doesn't + // try to notify us that it's closing, since we will be dead. + // + // For more details, see #10344. + if (mpExchangeCtx != nullptr) { - CancelLivenessCheckTimer(); + mpExchangeCtx->SetDelegate(nullptr); + } + + mpExchangeCtx = nullptr; + + if (aError != CHIP_NO_ERROR) + { + mpCallback.OnError(this, aError); } - mMinIntervalFloorSeconds = 0; - mMaxIntervalCeilingSeconds = 0; - mSubscriptionId = 0; - mInteractionType = InteractionType::Read; - mpExchangeMgr = nullptr; - mpExchangeCtx = nullptr; - mIsInitialReport = true; - mIsPrimingReports = true; - mPeerNodeId = kUndefinedNodeId; - mFabricIndex = kUndefinedFabricIndex; - MoveToState(ClientState::Uninitialized); + + mpCallback.OnDone(this); } const char * ReadClient::GetStateStr() const @@ -92,10 +95,8 @@ const char * ReadClient::GetStateStr() const #if CHIP_DETAIL_LOGGING switch (mState) { - case ClientState::Uninitialized: - return "UNINIT"; - case ClientState::Initialized: - return "INIT"; + case ClientState::Idle: + return "Idle"; case ClientState::AwaitingInitialReport: return "AwaitingInitialReport"; case ClientState::AwaitingSubscribeResponse: @@ -110,8 +111,7 @@ const char * ReadClient::GetStateStr() const void ReadClient::MoveToState(const ClientState aTargetState) { mState = aTargetState; - ChipLogDetail(DataManagement, "Client[%u] moving to [%s]", InteractionModelEngine::GetInstance()->GetReadClientArrayIndex(this), - GetStateStr()); + ChipLogDetail(DataManagement, "%s ReadClient[%p]: Moving to [%10.10s]", __func__, this, GetStateStr()); } CHIP_ERROR ReadClient::SendRequest(ReadPrepareParams & aReadPrepareParams) @@ -134,85 +134,68 @@ CHIP_ERROR ReadClient::SendReadRequest(ReadPrepareParams & aReadPrepareParams) // TODO: SendRequest parameter is too long, need to have the structure to represent it CHIP_ERROR err = CHIP_NO_ERROR; System::PacketBufferHandle msgBuf; - ChipLogDetail(DataManagement, "%s: Client[%u] [%5.5s]", __func__, - InteractionModelEngine::GetInstance()->GetReadClientArrayIndex(this), GetStateStr()); - VerifyOrExit(ClientState::Initialized == mState, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mpCallback != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + ChipLogDetail(DataManagement, "%s ReadClient[%p]: Sending Read Request", __func__, this); - // Discard any existing exchange context. Effectively we can only have one exchange per ReadClient - // at any one time. - AbortExistingExchangeContext(); + VerifyOrReturnError(ClientState::Idle == mState, err = CHIP_ERROR_INCORRECT_STATE); { System::PacketBufferTLVWriter writer; ReadRequestMessage::Builder request; msgBuf = System::PacketBufferHandle::New(kMaxSecureSduLengthBytes); - VerifyOrExit(!msgBuf.IsNull(), err = CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(!msgBuf.IsNull(), err = CHIP_ERROR_NO_MEMORY); writer.Init(std::move(msgBuf)); - err = request.Init(&writer); - SuccessOrExit(err); + ReturnErrorOnFailure(request.Init(&writer)); if (aReadPrepareParams.mAttributePathParamsListSize != 0 && aReadPrepareParams.mpAttributePathParamsList != nullptr) { AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributeRequests(); - SuccessOrExit(err = request.GetError()); - err = GenerateAttributePathList(attributePathListBuilder, aReadPrepareParams.mpAttributePathParamsList, - aReadPrepareParams.mAttributePathParamsListSize); - SuccessOrExit(err); + ReturnErrorOnFailure(err = request.GetError()); + ReturnErrorOnFailure(GenerateAttributePathList(attributePathListBuilder, aReadPrepareParams.mpAttributePathParamsList, + aReadPrepareParams.mAttributePathParamsListSize)); } if (aReadPrepareParams.mEventPathParamsListSize != 0 && aReadPrepareParams.mpEventPathParamsList != nullptr) { EventPathIBs::Builder & eventPathListBuilder = request.CreateEventRequests(); - SuccessOrExit(err = request.GetError()); - err = GenerateEventPaths(eventPathListBuilder, aReadPrepareParams.mpEventPathParamsList, - aReadPrepareParams.mEventPathParamsListSize); - SuccessOrExit(err); + ReturnErrorOnFailure(err = request.GetError()); + + ReturnErrorOnFailure(GenerateEventPaths(eventPathListBuilder, aReadPrepareParams.mpEventPathParamsList, + aReadPrepareParams.mEventPathParamsListSize)); + if (aReadPrepareParams.mEventNumber != 0) { // EventFilter is optional EventFilterIBs::Builder & eventFilters = request.CreateEventFilters(); - SuccessOrExit(err = request.GetError()); + ReturnErrorOnFailure(request.GetError()); + EventFilterIB::Builder & eventFilter = eventFilters.CreateEventFilter(); - SuccessOrExit(err = eventFilters.GetError()); - eventFilter.EventMin(aReadPrepareParams.mEventNumber).EndOfEventFilterIB(); - SuccessOrExit(err = eventFilter.GetError()); - eventFilters.EndOfEventFilters(); - SuccessOrExit(err = eventFilters.GetError()); + ReturnErrorOnFailure(eventFilters.GetError()); + ReturnErrorOnFailure(eventFilter.EventMin(aReadPrepareParams.mEventNumber).EndOfEventFilterIB().GetError()); + ReturnErrorOnFailure(eventFilters.EndOfEventFilters().GetError()); } } - request.IsFabricFiltered(false).EndOfReadRequestMessage(); - SuccessOrExit(err = request.GetError()); - - err = writer.Finalize(&msgBuf); - SuccessOrExit(err); + ReturnErrorOnFailure(request.IsFabricFiltered(false).EndOfReadRequestMessage().GetError()); + ReturnErrorOnFailure(writer.Finalize(&msgBuf)); } mpExchangeCtx = mpExchangeMgr->NewContext(aReadPrepareParams.mSessionHandle, this); - VerifyOrExit(mpExchangeCtx != nullptr, err = CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(mpExchangeCtx != nullptr, err = CHIP_ERROR_NO_MEMORY); + mpExchangeCtx->SetResponseTimeout(aReadPrepareParams.mTimeout); - err = mpExchangeCtx->SendMessage(Protocols::InteractionModel::MsgType::ReadRequest, std::move(msgBuf), - Messaging::SendFlags(Messaging::SendMessageFlags::kExpectResponse)); - SuccessOrExit(err); + ReturnErrorOnFailure(mpExchangeCtx->SendMessage(Protocols::InteractionModel::MsgType::ReadRequest, std::move(msgBuf), + Messaging::SendFlags(Messaging::SendMessageFlags::kExpectResponse))); mPeerNodeId = aReadPrepareParams.mSessionHandle.GetPeerNodeId(); mFabricIndex = aReadPrepareParams.mSessionHandle.GetFabricIndex(); MoveToState(ClientState::AwaitingInitialReport); -exit: - - if (err != CHIP_NO_ERROR) - { - AbortExistingExchangeContext(); - } - - return err; + return CHIP_NO_ERROR; } CHIP_ERROR ReadClient::GenerateEventPaths(EventPathIBs::Builder & aEventPathsBuilder, EventPathParams * apEventPathParamsList, @@ -241,6 +224,7 @@ CHIP_ERROR ReadClient::GenerateAttributePathList(AttributePathIBs::Builder & aAt ReturnErrorOnFailure(aAttributePathIBsBuilder.GetError()); ReturnErrorOnFailure(path.Encode(apAttributePathParamsList[index])); } + aAttributePathIBsBuilder.EndOfAttributePathIBs(); return aAttributePathIBsBuilder.GetError(); } @@ -249,8 +233,9 @@ CHIP_ERROR ReadClient::OnMessageReceived(Messaging::ExchangeContext * apExchange System::PacketBufferHandle && aPayload) { CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit(!IsFree(), err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mpCallback != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + + VerifyOrExit(!IsIdle(), err = CHIP_ERROR_INCORRECT_STATE); + if (aPayloadHeader.HasMessageType(Protocols::InteractionModel::MsgType::ReportData)) { err = ProcessReportData(std::move(aPayload)); @@ -260,6 +245,7 @@ CHIP_ERROR ReadClient::OnMessageReceived(Messaging::ExchangeContext * apExchange { VerifyOrExit(apExchangeContext == mpExchangeCtx, err = CHIP_ERROR_INCORRECT_STATE); err = ProcessSubscribeResponse(std::move(aPayload)); + // Forget the context as SUBSCRIBE RESPONSE is the last message in SUBSCRIBE transaction and // ExchangeContext::HandleMessage automatically closes a context if no other messages need to // be sent or received. @@ -281,31 +267,45 @@ CHIP_ERROR ReadClient::OnMessageReceived(Messaging::ExchangeContext * apExchange exit: if ((!IsSubscriptionType() && !mPendingMoreChunks) || err != CHIP_NO_ERROR) { - ShutdownInternal(err); + Close(err); } + return err; } -CHIP_ERROR ReadClient::AbortExistingExchangeContext() +void ReadClient::Abort() { + // + // If the exchange context hasn't already been gracefully closed + // (signaled by setting it to null), then we need to forcibly + // tear it down. + // if (mpExchangeCtx != nullptr) { + // We might be a delegate for this exchange, and we don't want the + // OnExchangeClosing notification in that case. Null out the delegate + // to avoid that. + // + // TODO: This makes all sorts of assumptions about what the delegate is + // (notice the "might" above!) that might not hold in practice. We + // really need a better solution here.... + mpExchangeCtx->SetDelegate(nullptr); mpExchangeCtx->Abort(); mpExchangeCtx = nullptr; } - - return CHIP_NO_ERROR; } CHIP_ERROR ReadClient::OnUnsolicitedReportData(Messaging::ExchangeContext * apExchangeContext, System::PacketBufferHandle && aPayload) { - mpExchangeCtx = apExchangeContext; + mpExchangeCtx = apExchangeContext; + CHIP_ERROR err = ProcessReportData(std::move(aPayload)); if (err != CHIP_NO_ERROR) { - ShutdownInternal(err); + Close(err); } + return err; } @@ -382,7 +382,7 @@ CHIP_ERROR ReadClient::ProcessReportData(System::PacketBufferHandle && aPayload) } SuccessOrExit(err); - if (isEventReportsPresent && nullptr != mpCallback) + if (isEventReportsPresent) { chip::TLV::TLVReader EventReportsReader; eventReportIBs.GetReader(&EventReportsReader); @@ -397,14 +397,15 @@ CHIP_ERROR ReadClient::ProcessReportData(System::PacketBufferHandle && aPayload) err = CHIP_NO_ERROR; } SuccessOrExit(err); - if (isAttributeReportIBsPresent && nullptr != mpCallback) + + if (isAttributeReportIBsPresent) { TLV::TLVReader attributeReportIBsReader; attributeReportIBs.GetReader(&attributeReportIBsReader); if (mIsInitialReport) { - mpCallback->OnReportBegin(this); + mpCallback.OnReportBegin(this); mIsInitialReport = false; } @@ -413,7 +414,7 @@ CHIP_ERROR ReadClient::ProcessReportData(System::PacketBufferHandle && aPayload) if (!mPendingMoreChunks) { - mpCallback->OnReportEnd(this); + mpCallback.OnReportEnd(this); mIsInitialReport = true; } } @@ -452,7 +453,7 @@ void ReadClient::OnResponseTimeout(Messaging::ExchangeContext * apExchangeContex { ChipLogProgress(DataManagement, "Time out! failed to receive report data from Exchange: " ChipLogFormatExchange, ChipLogValueExchange(apExchangeContext)); - ShutdownInternal(CHIP_ERROR_TIMEOUT); + Close(CHIP_ERROR_TIMEOUT); } CHIP_ERROR ReadClient::ProcessAttributePath(AttributePathIB::Parser & aAttributePathParser, @@ -510,7 +511,7 @@ CHIP_ERROR ReadClient::ProcessAttributeReportIBs(TLV::TLVReader & aAttributeRepo ReturnErrorOnFailure(ProcessAttributePath(path, attributePath)); ReturnErrorOnFailure(status.GetErrorStatus(&errorStatus)); ReturnErrorOnFailure(errorStatus.DecodeStatusIB(statusIB)); - mpCallback->OnAttributeData(this, attributePath, nullptr, statusIB); + mpCallback.OnAttributeData(this, attributePath, nullptr, statusIB); } else if (CHIP_END_OF_TLV == err) { @@ -526,7 +527,7 @@ CHIP_ERROR ReadClient::ProcessAttributeReportIBs(TLV::TLVReader & aAttributeRepo attributePath.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; } - mpCallback->OnAttributeData(this, attributePath, &dataReader, statusIB); + mpCallback.OnAttributeData(this, attributePath, &dataReader, statusIB); } } @@ -534,6 +535,7 @@ CHIP_ERROR ReadClient::ProcessAttributeReportIBs(TLV::TLVReader & aAttributeRepo { err = CHIP_NO_ERROR; } + return err; } @@ -555,16 +557,17 @@ CHIP_ERROR ReadClient::ProcessEventReportIBs(TLV::TLVReader & aEventReportIBsRea header.mTimestamp = mEventTimestamp; ReturnErrorOnFailure(data.DecodeEventHeader(header)); mEventTimestamp = header.mTimestamp; - + mEventMin = header.mEventNumber + 1; ReturnErrorOnFailure(data.GetData(&dataReader)); - mpCallback->OnEventData(this, header, &dataReader, nullptr); + mpCallback.OnEventData(this, header, &dataReader, nullptr); } if (CHIP_END_OF_TLV == err) { err = CHIP_NO_ERROR; } + return err; } @@ -582,8 +585,9 @@ CHIP_ERROR ReadClient::RefreshLivenessCheckTimer() if (err != CHIP_NO_ERROR) { - ShutdownInternal(err); + Close(err); } + return err; } @@ -596,18 +600,19 @@ void ReadClient::CancelLivenessCheckTimer() void ReadClient::OnLivenessTimeoutCallback(System::Layer * apSystemLayer, void * apAppState) { ReadClient * const client = reinterpret_cast(apAppState); - if (client->IsFree()) - { - ChipLogError(DataManagement, - "ReadClient::OnLivenessTimeoutCallback invoked on a free client! This is a bug in CHIP stack!"); - return; - } + + // + // Might as well try to see if this instance exists in the tracked list in the IM. + // This might blow-up if either the client has since been free'ed (use-after-free), or if the engine has since + // been shutdown at which point the client wouldn't exist in the active read client list. + // + VerifyOrDie(client->mpImEngine->InActiveReadClientList(client)); ChipLogError(DataManagement, "Subscription Liveness timeout with peer node 0x%" PRIx64 ", shutting down ", client->mPeerNodeId); - client->mpExchangeCtx = nullptr; + // TODO: add a more specific error here for liveness timeout failure to distinguish between other classes of timeouts (i.e // response timeouts). - client->ShutdownInternal(CHIP_ERROR_TIMEOUT); + client->Close(CHIP_ERROR_TIMEOUT); } CHIP_ERROR ReadClient::ProcessSubscribeResponse(System::PacketBufferHandle && aPayload) @@ -629,10 +634,7 @@ CHIP_ERROR ReadClient::ProcessSubscribeResponse(System::PacketBufferHandle && aP ReturnLogErrorOnFailure(subscribeResponse.GetMinIntervalFloorSeconds(&mMinIntervalFloorSeconds)); ReturnLogErrorOnFailure(subscribeResponse.GetMaxIntervalCeilingSeconds(&mMaxIntervalCeilingSeconds)); - if (mpCallback != nullptr) - { - mpCallback->OnSubscriptionEstablished(this); - } + mpCallback.OnSubscriptionEstablished(this); MoveToState(ClientState::SubscriptionActive); @@ -645,18 +647,18 @@ CHIP_ERROR ReadClient::SendSubscribeRequest(ReadPrepareParams & aReadPreparePara System::PacketBufferHandle msgBuf; System::PacketBufferTLVWriter writer; SubscribeRequestMessage::Builder request; - VerifyOrExit(ClientState::Initialized == mState, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mpExchangeCtx == nullptr, err = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mpCallback != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + + VerifyOrReturnError(ClientState::Idle == mState, err = CHIP_ERROR_INCORRECT_STATE); + msgBuf = System::PacketBufferHandle::New(kMaxSecureSduLengthBytes); - VerifyOrExit(!msgBuf.IsNull(), err = CHIP_ERROR_NO_MEMORY); - VerifyOrExit(aReadPrepareParams.mMinIntervalFloorSeconds <= aReadPrepareParams.mMaxIntervalCeilingSeconds, - err = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(!msgBuf.IsNull(), err = CHIP_ERROR_NO_MEMORY); + + VerifyOrReturnError(aReadPrepareParams.mMinIntervalFloorSeconds <= aReadPrepareParams.mMaxIntervalCeilingSeconds, + err = CHIP_ERROR_INVALID_ARGUMENT); writer.Init(std::move(msgBuf)); - err = request.Init(&writer); - SuccessOrExit(err); + ReturnErrorOnFailure(request.Init(&writer)); request.KeepSubscriptions(aReadPrepareParams.mKeepSubscriptions) .MinIntervalFloorSeconds(aReadPrepareParams.mMinIntervalFloorSeconds) @@ -665,64 +667,57 @@ CHIP_ERROR ReadClient::SendSubscribeRequest(ReadPrepareParams & aReadPreparePara if (aReadPrepareParams.mAttributePathParamsListSize != 0 && aReadPrepareParams.mpAttributePathParamsList != nullptr) { AttributePathIBs::Builder & attributePathListBuilder = request.CreateAttributeRequests(); - SuccessOrExit(err = attributePathListBuilder.GetError()); - err = GenerateAttributePathList(attributePathListBuilder, aReadPrepareParams.mpAttributePathParamsList, - aReadPrepareParams.mAttributePathParamsListSize); - SuccessOrExit(err); + ReturnErrorOnFailure(err = attributePathListBuilder.GetError()); + ReturnErrorOnFailure(GenerateAttributePathList(attributePathListBuilder, aReadPrepareParams.mpAttributePathParamsList, + aReadPrepareParams.mAttributePathParamsListSize)); } if (aReadPrepareParams.mEventPathParamsListSize != 0 && aReadPrepareParams.mpEventPathParamsList != nullptr) { EventPathIBs::Builder & eventPathListBuilder = request.CreateEventRequests(); - SuccessOrExit(err = eventPathListBuilder.GetError()); - err = GenerateEventPaths(eventPathListBuilder, aReadPrepareParams.mpEventPathParamsList, - aReadPrepareParams.mEventPathParamsListSize); - SuccessOrExit(err); + ReturnErrorOnFailure(err = eventPathListBuilder.GetError()); + ReturnErrorOnFailure(GenerateEventPaths(eventPathListBuilder, aReadPrepareParams.mpEventPathParamsList, + aReadPrepareParams.mEventPathParamsListSize)); if (aReadPrepareParams.mEventNumber != 0) { - // EventNumber is optional - EventFilterIBs::Builder & eventFilters = request.CreateEventFilters(); - SuccessOrExit(err = request.GetError()); - EventFilterIB::Builder & eventFilter = eventFilters.CreateEventFilter(); - SuccessOrExit(err = eventFilters.GetError()); - eventFilter.EventMin(aReadPrepareParams.mEventNumber).EndOfEventFilterIB(); - SuccessOrExit(err = eventFilter.GetError()); - eventFilters.EndOfEventFilters(); - SuccessOrExit(err = eventFilters.GetError()); + mEventMin = aReadPrepareParams.mEventNumber; } + + EventFilterIBs::Builder & eventFilters = request.CreateEventFilters(); + ReturnErrorOnFailure(err = request.GetError()); + EventFilterIB::Builder & eventFilter = eventFilters.CreateEventFilter(); + ReturnErrorOnFailure(err = eventFilters.GetError()); + eventFilter.EventMin(mEventMin).EndOfEventFilterIB(); + ReturnErrorOnFailure(err = eventFilter.GetError()); + eventFilters.EndOfEventFilters(); + ReturnErrorOnFailure(err = eventFilters.GetError()); } request.IsFabricFiltered(false).EndOfSubscribeRequestMessage(); - SuccessOrExit(err = request.GetError()); + ReturnErrorOnFailure(err = request.GetError()); - err = writer.Finalize(&msgBuf); - SuccessOrExit(err); + ReturnErrorOnFailure(writer.Finalize(&msgBuf)); mpExchangeCtx = mpExchangeMgr->NewContext(aReadPrepareParams.mSessionHandle, this); - VerifyOrExit(mpExchangeCtx != nullptr, err = CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(mpExchangeCtx != nullptr, err = CHIP_ERROR_NO_MEMORY); + mpExchangeCtx->SetResponseTimeout(kImMessageTimeout); if (mpExchangeCtx->IsBLETransport()) { ChipLogError(DataManagement, "IM Subscribe cannot work with BLE"); - SuccessOrExit(err = CHIP_ERROR_INCORRECT_STATE); + return CHIP_ERROR_INCORRECT_STATE; } - err = mpExchangeCtx->SendMessage(Protocols::InteractionModel::MsgType::SubscribeRequest, std::move(msgBuf), - Messaging::SendFlags(Messaging::SendMessageFlags::kExpectResponse)); - SuccessOrExit(err); + ReturnErrorOnFailure(mpExchangeCtx->SendMessage(Protocols::InteractionModel::MsgType::SubscribeRequest, std::move(msgBuf), + Messaging::SendFlags(Messaging::SendMessageFlags::kExpectResponse))); mPeerNodeId = aReadPrepareParams.mSessionHandle.GetPeerNodeId(); mFabricIndex = aReadPrepareParams.mSessionHandle.GetFabricIndex(); + MoveToState(ClientState::AwaitingInitialReport); -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(DataManagement, "Failed to send subscribe request: %" CHIP_ERROR_FORMAT, err.Format()); - Shutdown(); - } - return err; + return CHIP_NO_ERROR; } }; // namespace app diff --git a/src/app/ReadClient.h b/src/app/ReadClient.h index f64b537fb85263..511e46b83163f2 100644 --- a/src/app/ReadClient.h +++ b/src/app/ReadClient.h @@ -47,6 +47,9 @@ namespace chip { namespace app { + +class InteractionModelEngine; + /** * @class ReadClient * @@ -64,20 +67,29 @@ class ReadClient : public Messaging::ExchangeDelegate /** * Used to signal the commencement of processing of the first attribute report received in a given exchange. + * + * This object MUST continue to exist after this call is completed. The application shall wait until it + * receives an OnDone call to destroy the object. + * */ virtual void OnReportBegin(const ReadClient * apReadClient) {} /** * Used to signal the completion of processing of the last attribute report in a given exchange. + * + * This object MUST continue to exist after this call is completed. The application shall wait until it + * receives an OnDone call to destroy the object. + * */ virtual void OnReportEnd(const ReadClient * apReadClient) {} /** - * The ReadClient object MUST continue to exist after this call is completed. + * Used to deliver event data received through the Read and Subscribe interactions * - * This callback will be called when receiving event data received in the Read and Subscribe interactions + * Only one of the apData and apStatus can be non-null. * - * Only one of the apData and apStatus will be non-null. + * This object MUST continue to exist after this call is completed. The application shall wait until it + * receives an OnDone call to destroy the object. * * @param[in] apReadClient: The read client object that initiated the read or subscribe transaction. * @param[in] aEventHeader: The event header in report response. @@ -90,15 +102,16 @@ class ReadClient : public Messaging::ExchangeDelegate {} /** - * OnResponse will be called when a report data response has been received and processed for the given path. - * - * The ReadClient object MUST continue to exist after this call is completed. + * Used to deliver attribute data received through the Read and Subscribe interactions. * * This callback will be called when: * - Receiving attribute data as response of Read interactions * - Receiving attribute data as reports of subscriptions * - Receiving attribute data as initial reports of subscriptions * + * This object MUST continue to exist after this call is completed. The application shall wait until it + * receives an OnDone call to destroy the object. + * * @param[in] apReadClient The read client object that initiated the read or subscribe transaction. * @param[in] aPath The attribute path field in report response. * @param[in] apData The attribute data of the given path, will be a nullptr if status is not Success. @@ -112,8 +125,8 @@ class ReadClient : public Messaging::ExchangeDelegate /** * OnSubscriptionEstablished will be called when a subscription is established for the given subscription transaction. * - * The ReadClient object MUST continue to exist after this call is completed. The application shall not shut down the - * object until after this call has returned, and shall not delete the object until OnDone is called. + * This object MUST continue to exist after this call is completed. The application shall wait until it + * receives an OnDone call to destroy the object. * * @param[in] apReadClient The read client object that initiated the read transaction. */ @@ -127,8 +140,8 @@ class ReadClient : public Messaging::ExchangeDelegate * - CHIP_ERROR_*TLV*: A malformed, non-compliant response was received from the server. * - CHIP_ERROR*: All other cases. * - * The ReadClient object MUST continue to exist after this call is completed. The application shall wait until it - * receives an OnDone call before it shuts down the object. + * This object MUST continue to exist after this call is completed. The application shall wait until it + * receives an OnDone call to destroy the object. * * @param[in] apReadClient The read client object that initiated the attribute read transaction. * @param[in] aError A system error code that conveys the overall error code. @@ -136,8 +149,8 @@ class ReadClient : public Messaging::ExchangeDelegate virtual void OnError(const ReadClient * apReadClient, CHIP_ERROR aError) {} /** - * OnDone will be called when ReadClient has finished all work and is reserved for future ReadClient ownership change. - * (#10366) Users may use this function to release their own objects related to this read or subscribe interaction. + * OnDone will be called when ReadClient has finished all work and is safe to destroy and free the + * allocated CommandSender object. * * This function will: * - Always be called exactly *once* for a given ReadClient instance. @@ -155,18 +168,45 @@ class ReadClient : public Messaging::ExchangeDelegate Read, Subscribe, }; + + /** + * + * Constructor. + * + * The callback passed in has to outlive this ReadClient object. + * + * This object can outlive the InteractionModelEngine passed in. However, upon shutdown of the engine, + * this object will cease to function correctly since it depends on the engine for a number of critical functions. + * + * @param[in] apImEngine A valid pointer to the IM engine. + * @param[in] apExchangeMgr A pointer to the ExchangeManager object. + * @param[in] apCallback InteractionModelDelegate set by application. + * @param[in] aInteractionType Type of interaction (read or subscribe) + * + * @retval #CHIP_ERROR_INCORRECT_STATE incorrect state if it is already initialized + * @retval #CHIP_NO_ERROR On success. + * + */ + ReadClient(InteractionModelEngine * apImEngine, Messaging::ExchangeManager * apExchangeMgr, Callback & apCallback, + InteractionType aInteractionType); + /** - * Shut down the Client. This terminates this instance of the object and releases - * all held resources. The object must not be used after Shutdown() is called. + * Destructor. * - * SDK consumer can choose when to shut down the ReadClient. The - * ReadClient will automatically shut itself down when it receives a read - * response or the response times out. So manual shutdown is only needed - * to shut down a ReadClient before one of those two things has happened, - * (e.g. if SendRequest returned failure) or if this ReadClient represents - * a subscription. + * Will abort the exchange context if a valid one still exists. It will also cancel any + * liveness timers that may be active. + * + * OnDone() will not be called. + */ + virtual ~ReadClient(); + + /* + * This forcibly closes the exchange context if a valid one is pointed to. Such a situation does + * not arise during normal message processing flows that all normally call Close() above. This can only + * arise due to application-initiated destruction of the object when this object is handling receiving/sending + * message payloads. Abort() should be called first before the object is destroyed. */ - void Shutdown(); + void Abort(); /** * Send a request. There can be one request outstanding on a given ReadClient. @@ -194,14 +234,16 @@ class ReadClient : public Messaging::ExchangeDelegate bool IsReadType() { return mInteractionType == InteractionType::Read; } bool IsSubscriptionType() const { return mInteractionType == InteractionType::Subscribe; }; + ReadClient * GetNextClient() { return mpNext; } + void SetNextClient(ReadClient * apClient) { mpNext = apClient; } + private: friend class TestReadInteraction; friend class InteractionModelEngine; enum class ClientState : uint8_t { - Uninitialized = 0, ///< The client has not been initialized - Initialized, ///< The client has been initialized and is ready for a SendRequest + Idle, ///< The client has been initialized and is ready for a SendRequest AwaitingInitialReport, ///< The client is waiting for initial report AwaitingSubscribeResponse, ///< The client is waiting for subscribe response SubscriptionActive, ///< The client is maintaining subscription @@ -211,32 +253,6 @@ class ReadClient : public Messaging::ExchangeDelegate { return aSubscriptionId == mSubscriptionId && mInteractionType == InteractionType::Subscribe; } - /** - * Initialize the client object. Within the lifetime - * of this instance, this method is invoked once after object - * construction until a call to Shutdown is made to terminate the - * instance. - * - * The following callbacks are expected to be invoked on the InteractionModelDelegate: - * - EventStreamReceived - * - OnReportData - * - ReportProcessed - * - ReadError - * - ReadDone - * - * When processing subscriptions, these callbacks are invoked as well: - * - SubscribeResponseProcessed - * - * @param[in] apExchangeMgr A pointer to the ExchangeManager object. - * @param[in] apCallback InteractionModelDelegate set by application. - * - * @retval #CHIP_ERROR_INCORRECT_STATE incorrect state if it is already initialized - * @retval #CHIP_NO_ERROR On success. - * - */ - CHIP_ERROR Init(Messaging::ExchangeManager * apExchangeMgr, Callback * apCallback, InteractionType aInteractionType); - - virtual ~ReadClient() = default; CHIP_ERROR OnMessageReceived(Messaging::ExchangeContext * apExchangeContext, const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload) override; @@ -246,7 +262,7 @@ class ReadClient : public Messaging::ExchangeDelegate * Check if current read client is being used * */ - bool IsFree() const { return mState == ClientState::Uninitialized; } + bool IsIdle() const { return mState == ClientState::Idle; } bool IsSubscriptionIdle() const { return mState == ClientState::SubscriptionActive; } bool IsAwaitingInitialReport() const { return mState == ClientState::AwaitingInitialReport; } bool IsAwaitingSubscribeResponse() const { return mState == ClientState::AwaitingSubscribeResponse; } @@ -266,31 +282,40 @@ class ReadClient : public Messaging::ExchangeDelegate void MoveToState(const ClientState aTargetState); CHIP_ERROR ProcessAttributePath(AttributePathIB::Parser & aAttributePath, ConcreteDataAttributePath & aClusterInfo); CHIP_ERROR ProcessReportData(System::PacketBufferHandle && aPayload); - CHIP_ERROR AbortExistingExchangeContext(); const char * GetStateStr() const; // Specialized request-sending functions. CHIP_ERROR SendReadRequest(ReadPrepareParams & aReadPrepareParams); CHIP_ERROR SendSubscribeRequest(ReadPrepareParams & aSubscribePrepareParams); - /** - * Internal shutdown method that we use when we know what's going on with - * our exchange and don't need to manually close it. + + /* + * Called internally to signal the completion of all work on this object, gracefully close the + * exchange and finally, signal to the application that it's + * safe to release this object. + * + * If aError != CHIP_NO_ERROR, it is delivered to the application through the OnError callback first. + * */ - void ShutdownInternal(CHIP_ERROR aError); + void Close(CHIP_ERROR aError); + Messaging::ExchangeManager * mpExchangeMgr = nullptr; Messaging::ExchangeContext * mpExchangeCtx = nullptr; - Callback * mpCallback = nullptr; - ClientState mState = ClientState::Uninitialized; - bool mIsInitialReport = true; - bool mIsPrimingReports = true; - bool mPendingMoreChunks = false; - uint16_t mMinIntervalFloorSeconds = 0; - uint16_t mMaxIntervalCeilingSeconds = 0; - uint64_t mSubscriptionId = 0; - NodeId mPeerNodeId = kUndefinedNodeId; - FabricIndex mFabricIndex = kUndefinedFabricIndex; - InteractionType mInteractionType = InteractionType::Read; + Callback & mpCallback; + ClientState mState = ClientState::Idle; + bool mIsInitialReport = true; + bool mIsPrimingReports = true; + bool mPendingMoreChunks = false; + uint16_t mMinIntervalFloorSeconds = 0; + uint16_t mMaxIntervalCeilingSeconds = 0; + uint64_t mSubscriptionId = 0; + NodeId mPeerNodeId = kUndefinedNodeId; + FabricIndex mFabricIndex = kUndefinedFabricIndex; + InteractionType mInteractionType = InteractionType::Read; Timestamp mEventTimestamp; + EventNumber mEventMin = 0; + + ReadClient * mpNext = nullptr; + InteractionModelEngine * mpImEngine = nullptr; }; }; // namespace app diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index eb8ada48e8e624..8e9c93640b12a1 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -47,23 +47,21 @@ CHIP_ERROR ReadHandler::Init(Messaging::ExchangeManager * apExchangeMgr, Interac mpAttributeClusterInfoList = nullptr; mpEventClusterInfoList = nullptr; mCurrentPriority = PriorityLevel::Invalid; - for (size_t index = 0; index < kNumPriorityLevel; index++) - { - mSelfProcessedEvents[index] = 0; - mLastScheduledEventNumber[index] = 0; - } - mIsPrimingReports = true; + mEventMin = 0; + mLastScheduledEventNumber = 0; + mIsPrimingReports = true; MoveToState(HandlerState::Initialized); - mpDelegate = apDelegate; - mSubscriptionId = 0; - mHoldReport = false; - mDirty = false; - mActiveSubscription = false; - mIsChunkedReport = false; - mInteractionType = aInteractionType; - mInitiatorNodeId = apExchangeContext->GetSessionHandle().GetPeerNodeId(); - mSubjectDescriptor = apExchangeContext->GetSessionHandle().GetSubjectDescriptor(); - mHoldSync = false; + mpDelegate = apDelegate; + mSubscriptionId = 0; + mHoldReport = false; + mDirty = false; + mActiveSubscription = false; + mIsChunkedReport = false; + mInteractionType = aInteractionType; + mInitiatorNodeId = apExchangeContext->GetSessionHandle().GetPeerNodeId(); + mSubjectDescriptor = apExchangeContext->GetSessionHandle().GetSubjectDescriptor(); + mHoldSync = false; + mLastWrittenEventsBytes = 0; if (apExchangeContext != nullptr) { apExchangeContext->SetDelegate(this); @@ -108,19 +106,17 @@ void ReadHandler::Shutdown(ShutdownOptions aOptions) mpAttributeClusterInfoList = nullptr; mpEventClusterInfoList = nullptr; mCurrentPriority = PriorityLevel::Invalid; - for (size_t index = 0; index < kNumPriorityLevel; index++) - { - mSelfProcessedEvents[index] = 0; - mLastScheduledEventNumber[index] = 0; - } - mIsPrimingReports = false; - mpDelegate = nullptr; - mHoldReport = false; - mDirty = false; - mActiveSubscription = false; - mIsChunkedReport = false; - mInitiatorNodeId = kUndefinedNodeId; - mHoldSync = false; + mEventMin = 0; + mLastScheduledEventNumber = 0; + mIsPrimingReports = false; + mpDelegate = nullptr; + mHoldReport = false; + mDirty = false; + mActiveSubscription = false; + mIsChunkedReport = false; + mInitiatorNodeId = kUndefinedNodeId; + mHoldSync = false; + mLastWrittenEventsBytes = 0; } CHIP_ERROR ReadHandler::OnReadInitialRequest(System::PacketBufferHandle && aPayload) @@ -282,19 +278,15 @@ CHIP_ERROR ReadHandler::ProcessReadRequest(System::PacketBufferHandle && aPayloa ReadRequestMessage::Parser readRequestParser; EventPathIBs::Parser eventPathListParser; - + EventFilterIBs::Parser eventFilterIBsParser; AttributePathIBs::Parser attributePathListParser; reader.Init(std::move(aPayload)); - err = reader.Next(); - SuccessOrExit(err); - - err = readRequestParser.Init(reader); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.Next()); + ReturnErrorOnFailure(readRequestParser.Init(reader)); #if CHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK - err = readRequestParser.CheckSchemaValidity(); - SuccessOrExit(err); + ReturnErrorOnFailure(readRequestParser.CheckSchemaValidity()); #endif err = readRequestParser.GetAttributeRequests(&attributePathListParser); @@ -302,34 +294,35 @@ CHIP_ERROR ReadHandler::ProcessReadRequest(System::PacketBufferHandle && aPayloa { err = CHIP_NO_ERROR; } - else + else if (err == CHIP_NO_ERROR) { - SuccessOrExit(err); - err = ProcessAttributePathList(attributePathListParser); + ReturnErrorOnFailure(ProcessAttributePathList(attributePathListParser)); } - SuccessOrExit(err); + ReturnErrorOnFailure(err); err = readRequestParser.GetEventRequests(&eventPathListParser); if (err == CHIP_END_OF_TLV) { err = CHIP_NO_ERROR; } - else - { - SuccessOrExit(err); - err = ProcessEventPaths(eventPathListParser); - } - SuccessOrExit(err); - - // if we have exhausted this container - if (CHIP_END_OF_TLV == err) + else if (err == CHIP_NO_ERROR) { - err = CHIP_NO_ERROR; + ReturnErrorOnFailure(err); + ReturnErrorOnFailure(ProcessEventPaths(eventPathListParser)); + err = readRequestParser.GetEventFilters(&eventFilterIBsParser); + if (err == CHIP_END_OF_TLV) + { + err = CHIP_NO_ERROR; + } + else if (err == CHIP_NO_ERROR) + { + ReturnErrorOnFailure(ProcessEventFilters(eventFilterIBsParser)); + } } + ReturnErrorOnFailure(err); MoveToState(HandlerState::GeneratingReports); - err = InteractionModelEngine::GetInstance()->GetReportingEngine().ScheduleRun(); - SuccessOrExit(err); + ReturnErrorOnFailure(InteractionModelEngine::GetInstance()->GetReportingEngine().ScheduleRun()); // mpExchangeCtx can be null here due to // https://github.com/project-chip/connectedhomeip/issues/8031 @@ -341,8 +334,7 @@ CHIP_ERROR ReadHandler::ProcessReadRequest(System::PacketBufferHandle && aPayloa // There must be no code after the WillSendMessage() call that can cause // this method to return a failure. -exit: - return err; + return CHIP_NO_ERROR; } CHIP_ERROR ReadHandler::ProcessAttributePathList(AttributePathIBs::Parser & aAttributePathListParser) @@ -353,7 +345,7 @@ CHIP_ERROR ReadHandler::ProcessAttributePathList(AttributePathIBs::Parser & aAtt while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrExit(TLV::AnonymousTag == reader.GetTag(), err = CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrExit(TLV::AnonymousTag() == reader.GetTag(), err = CHIP_ERROR_INVALID_TLV_TAG); VerifyOrExit(TLV::kTLVType_List == reader.GetType(), err = CHIP_ERROR_WRONG_TLV_TYPE); ClusterInfo clusterInfo; AttributePathIB::Parser path; @@ -428,7 +420,7 @@ CHIP_ERROR ReadHandler::ProcessEventPaths(EventPathIBs::Parser & aEventPathsPars while (CHIP_NO_ERROR == (err = reader.Next())) { - VerifyOrReturnError(TLV::AnonymousTag == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); ClusterInfo clusterInfo; EventPathIB::Parser path; ReturnErrorOnFailure(path.Init(reader)); @@ -477,6 +469,27 @@ CHIP_ERROR ReadHandler::ProcessEventPaths(EventPathIBs::Parser & aEventPathsPars return err; } +CHIP_ERROR ReadHandler::ProcessEventFilters(EventFilterIBs::Parser & aEventFiltersParser) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVReader reader; + aEventFiltersParser.GetReader(&reader); + + while (CHIP_NO_ERROR == (err = reader.Next())) + { + VerifyOrReturnError(TLV::AnonymousTag() == reader.GetTag(), CHIP_ERROR_INVALID_TLV_TAG); + EventFilterIB::Parser filter; + ReturnErrorOnFailure(filter.Init(reader)); + // this is for current node, and would have only one event filter. + ReturnErrorOnFailure(filter.GetEventMin(&(mEventMin))); + } + if (CHIP_END_OF_TLV == err) + { + err = CHIP_NO_ERROR; + } + return err; +} + const char * ReadHandler::GetStateStr() const { #if CHIP_DETAIL_LOGGING @@ -506,45 +519,24 @@ void ReadHandler::MoveToState(const HandlerState aTargetState) bool ReadHandler::CheckEventClean(EventManagement & aEventManager) { - if (mCurrentPriority == PriorityLevel::Invalid) + if (mIsChunkedReport) { - // Upload is not in middle, previous mLastScheduledEventNumber is not valid, Check for new events from Critical high - // priority to Debug low priority, and set a checkpoint when there is dirty events - for (int index = ArraySize(mSelfProcessedEvents) - 1; index >= 0; index--) + if ((mLastScheduledEventNumber != 0) && (mEventMin <= mLastScheduledEventNumber)) { - EventNumber lastEventNumber = aEventManager.GetLastEventNumber(static_cast(index)); - if ((lastEventNumber != 0) && (lastEventNumber >= mSelfProcessedEvents[index])) - { - // We have more events. snapshot last event IDs - aEventManager.SetScheduledEventEndpoint(&(mLastScheduledEventNumber[0])); - // initialize the next dirty priority level to transfer - MoveToNextScheduledDirtyPriority(); - return false; - } + return false; } - return true; } else { - // Upload is in middle, previous mLastScheduledEventNumber is still valid, recheck via MoveToNextScheduledDirtyPriority, - // if finally mCurrentPriority is invalid, it means no more event - MoveToNextScheduledDirtyPriority(); - return mCurrentPriority == PriorityLevel::Invalid; - } -} - -void ReadHandler::MoveToNextScheduledDirtyPriority() -{ - for (int i = ArraySize(mSelfProcessedEvents) - 1; i >= 0; i--) - { - if ((mLastScheduledEventNumber[i] != 0) && mSelfProcessedEvents[i] <= mLastScheduledEventNumber[i]) + EventNumber lastEventNumber = aEventManager.GetLastEventNumber(); + if ((lastEventNumber != 0) && (mEventMin <= lastEventNumber)) { - mCurrentPriority = static_cast(i); - return; + // We have more events. snapshot last event number + aEventManager.SetScheduledEventInfo(mLastScheduledEventNumber, mLastWrittenEventsBytes); + return false; } } - - mCurrentPriority = PriorityLevel::Invalid; + return true; } CHIP_ERROR ReadHandler::SendSubscribeResponse() @@ -609,6 +601,16 @@ CHIP_ERROR ReadHandler::ProcessSubscribeRequest(System::PacketBufferHandle && aP else if (err == CHIP_NO_ERROR) { ReturnErrorOnFailure(ProcessEventPaths(eventPathListParser)); + EventFilterIBs::Parser eventFilterIBsParser; + err = subscribeRequestParser.GetEventFilters(&eventFilterIBsParser); + if (err == CHIP_END_OF_TLV) + { + err = CHIP_NO_ERROR; + } + else if (err == CHIP_NO_ERROR) + { + ReturnErrorOnFailure(ProcessEventFilters(eventFilterIBsParser)); + } } ReturnErrorOnFailure(err); diff --git a/src/app/ReadHandler.h b/src/app/ReadHandler.h index d973fe1c8e9799..75ce763ff1362a 100644 --- a/src/app/ReadHandler.h +++ b/src/app/ReadHandler.h @@ -118,7 +118,7 @@ class ReadHandler : public Messaging::ExchangeDelegate ClusterInfo * GetAttributeClusterInfolist() { return mpAttributeClusterInfoList; } ClusterInfo * GetEventClusterInfolist() { return mpEventClusterInfoList; } - EventNumber * GetVendedEventNumberList() { return mSelfProcessedEvents; } + EventNumber & GetEventMin() { return mEventMin; } PriorityLevel GetCurrentPriority() { return mCurrentPriority; } // if current priority is in the middle, it has valid snapshoted last event number, it check cleaness via comparing @@ -126,10 +126,6 @@ class ReadHandler : public Messaging::ExchangeDelegate // sanpshotted last event, check with latest last event number, re-setup snapshoted checkpoint, and compare again. bool CheckEventClean(EventManagement & aEventManager); - // Move to the next dirty priority from critical high priority to debug low priority, where last schedule event number - // is larger than current self vended event number - void MoveToNextScheduledDirtyPriority(); - bool IsReadType() { return mInteractionType == InteractionType::Read; } bool IsSubscriptionType() { return mInteractionType == InteractionType::Subscribe; } bool IsChunkedReport() { return mIsChunkedReport; } @@ -161,6 +157,7 @@ class ReadHandler : public Messaging::ExchangeDelegate const AttributeValueEncoder::AttributeEncodeState & GetAttributeEncodeState() const { return mAttributeEncoderState; } void SetAttributeEncodeState(const AttributeValueEncoder::AttributeEncodeState & aState) { mAttributeEncoderState = aState; } + uint32_t GetLastWrittenEventsBytes() { return mLastWrittenEventsBytes; } private: friend class TestReadInteraction; @@ -181,6 +178,7 @@ class ReadHandler : public Messaging::ExchangeDelegate CHIP_ERROR ProcessReadRequest(System::PacketBufferHandle && aPayload); CHIP_ERROR ProcessAttributePathList(AttributePathIBs::Parser & aAttributePathListParser); CHIP_ERROR ProcessEventPaths(EventPathIBs::Parser & aEventPathsParser); + CHIP_ERROR ProcessEventFilters(EventFilterIBs::Parser & aEventFiltersParser); CHIP_ERROR OnStatusResponse(Messaging::ExchangeContext * apExchangeContext, System::PacketBufferHandle && aPayload); CHIP_ERROR OnMessageReceived(Messaging::ExchangeContext * apExchangeContext, const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload) override; @@ -203,13 +201,12 @@ class ReadHandler : public Messaging::ExchangeDelegate PriorityLevel mCurrentPriority = PriorityLevel::Invalid; - // The event number of the last processed event for each priority level - EventNumber mSelfProcessedEvents[kNumPriorityLevel] = { 0 }; + EventNumber mEventMin = 0; // The last schedule event number snapshoted in the beginning when preparing to fill new events to reports - EventNumber mLastScheduledEventNumber[kNumPriorityLevel] = { 0 }; - Messaging::ExchangeManager * mpExchangeMgr = nullptr; - InteractionModelDelegate * mpDelegate = nullptr; + EventNumber mLastScheduledEventNumber = 0; + Messaging::ExchangeManager * mpExchangeMgr = nullptr; + InteractionModelDelegate * mpDelegate = nullptr; // Tracks whether we're in the initial phase of receiving priming // reports, which is always true for reads and true for subscriptions @@ -230,6 +227,7 @@ class ReadHandler : public Messaging::ExchangeDelegate AttributePathExpandIterator mAttributePathExpandIterator = AttributePathExpandIterator(nullptr); bool mIsFabricFiltered = false; bool mHoldSync = false; + uint32_t mLastWrittenEventsBytes = 0; SubjectDescriptor mSubjectDescriptor; // The detailed encoding state for a single attribute, used by list chunking feature. AttributeValueEncoder::AttributeEncodeState mAttributeEncoderState; diff --git a/src/app/ReadPrepareParams.h b/src/app/ReadPrepareParams.h index 17844adb8ff987..547da0607c62e3 100644 --- a/src/app/ReadPrepareParams.h +++ b/src/app/ReadPrepareParams.h @@ -40,7 +40,7 @@ struct ReadPrepareParams uint16_t mMaxIntervalCeilingSeconds = 0; bool mKeepSubscriptions = true; - ReadPrepareParams(SessionHandle sessionHandle) : mSessionHandle(sessionHandle) {} + ReadPrepareParams(const SessionHandle & sessionHandle) : mSessionHandle(sessionHandle) {} ReadPrepareParams(ReadPrepareParams && other) : mSessionHandle(other.mSessionHandle) { mKeepSubscriptions = other.mKeepSubscriptions; diff --git a/src/app/WriteClient.cpp b/src/app/WriteClient.cpp index 36501ee780d35f..13bcbff5f80495 100644 --- a/src/app/WriteClient.cpp +++ b/src/app/WriteClient.cpp @@ -112,7 +112,7 @@ CHIP_ERROR WriteClient::ProcessWriteResponseMessage(System::PacketBufferHandle & while (CHIP_NO_ERROR == (err = attributeStatusesReader.Next())) { - VerifyOrExit(TLV::AnonymousTag == attributeStatusesReader.GetTag(), err = CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrExit(TLV::AnonymousTag() == attributeStatusesReader.GetTag(), err = CHIP_ERROR_INVALID_TLV_TAG); AttributeStatusIB::Parser element; @@ -211,7 +211,7 @@ void WriteClient::ClearState() MoveToState(State::Uninitialized); } -CHIP_ERROR WriteClient::SendWriteRequest(SessionHandle session, System::Clock::Timeout timeout) +CHIP_ERROR WriteClient::SendWriteRequest(const SessionHandle & session, System::Clock::Timeout timeout) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -248,14 +248,20 @@ CHIP_ERROR WriteClient::SendWriteRequest(SessionHandle session, System::Clock::T ChipLogError(DataManagement, "Write client failed to SendWriteRequest"); ClearExistingExchangeContext(); } - - if (session.IsGroupSession()) + else { - // Always shutdown on Group communication - ChipLogDetail(DataManagement, "Closing on group Communication "); + // TODO: Ideally this would happen async, but to make sure that we + // handle this object dying (e.g. due to IM enging shutdown) while the + // async bits are pending we'd need to malloc some state bit that we can + // twiddle if we die. For now just do the OnDone callback sync. + if (session.IsGroupSession()) + { + // Always shutdown on Group communication + ChipLogDetail(DataManagement, "Closing on group Communication "); - // onDone is called - ShutdownInternal(); + // onDone is called + ShutdownInternal(); + } } return err; @@ -385,7 +391,7 @@ CHIP_ERROR WriteClient::ProcessAttributeStatusIB(AttributeStatusIB::Parser & aAt return err; } -CHIP_ERROR WriteClientHandle::SendWriteRequest(SessionHandle session, System::Clock::Timeout timeout) +CHIP_ERROR WriteClientHandle::SendWriteRequest(const SessionHandle & session, System::Clock::Timeout timeout) { CHIP_ERROR err = mpWriteClient->SendWriteRequest(session, timeout); diff --git a/src/app/WriteClient.h b/src/app/WriteClient.h index 1a9a93dae7ffd3..35a5996e70959e 100644 --- a/src/app/WriteClient.h +++ b/src/app/WriteClient.h @@ -149,7 +149,7 @@ class WriteClient : public Messaging::ExchangeDelegate * If SendWriteRequest is never called, or the call fails, the API * consumer is responsible for calling Shutdown on the WriteClient. */ - CHIP_ERROR SendWriteRequest(SessionHandle session, System::Clock::Timeout timeout); + CHIP_ERROR SendWriteRequest(const SessionHandle & session, System::Clock::Timeout timeout); /** * Initialize the client object. Within the lifetime @@ -248,8 +248,11 @@ class WriteClientHandle /** * Finalize the message and send it to the desired node. The underlying write object will always be released, and the user * should not use this object after calling this function. + * + * Note: In failure cases this will _synchronously_ invoke OnDone on the + * WriteClient::Callback before returning. */ - CHIP_ERROR SendWriteRequest(SessionHandle session, System::Clock::Timeout timeout = kImMessageTimeout); + CHIP_ERROR SendWriteRequest(const SessionHandle & session, System::Clock::Timeout timeout = kImMessageTimeout); /** * Encode an attribute value that can be directly encoded using TLVWriter::Put diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index b8552565a575a3..a19f120daa9660 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -88,7 +88,7 @@ template("chip_data_model") { "${_app_root}/clusters/level-control/level-control.h", "${_app_root}/clusters/messaging-client/messaging-client.h", "${_app_root}/clusters/messaging-server/messaging-server.h", - "${_app_root}/clusters/network-commissioning/network-commissioning.h", + "${_app_root}/clusters/network-commissioning-old/network-commissioning.h", "${_app_root}/clusters/on-off-server/on-off-server.h", "${_app_root}/clusters/scenes/scenes-tokens.h", "${_app_root}/clusters/scenes/scenes.h", @@ -132,10 +132,10 @@ template("chip_data_model") { foreach(cluster, _cluster_sources) { if (cluster == "door-lock-server") { sources += [ "${_app_root}/clusters/${cluster}/door-lock-server.cpp" ] - } else if (cluster == "network-commissioning") { + } else if (cluster == "network-commissioning-old") { sources += [ - "${_app_root}/clusters/${cluster}/${cluster}-ember.cpp", - "${_app_root}/clusters/${cluster}/${cluster}.cpp", + "${_app_root}/clusters/${cluster}/network-commissioning-ember.cpp", + "${_app_root}/clusters/${cluster}/network-commissioning-old.cpp", ] } else if (cluster == "mode-select-server") { sources += [ diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp index ed86013e3226a3..b8927fbf9ff4b3 100644 --- a/src/app/clusters/access-control-server/access-control-server.cpp +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -163,7 +163,7 @@ struct AccessControlEntryCodec { NodeId subject; ReturnErrorOnFailure(entry.GetSubject(i, subject)); - ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::AnonymousTag, subject)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::AnonymousTag(), subject)); } ReturnErrorOnFailure(aWriter.EndContainer(subjectsContainer)); } @@ -180,7 +180,7 @@ struct AccessControlEntryCodec for (size_t i = 0; i < count; ++i) { TLV::TLVType targetContainer; - ReturnErrorOnFailure(aWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, targetContainer)); + ReturnErrorOnFailure(aWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, targetContainer)); AccessControl::Entry::Target target; ReturnErrorOnFailure(entry.GetTarget(i, target)); if (target.flags & AccessControl::Entry::Target::kCluster) @@ -371,7 +371,7 @@ CHIP_ERROR AccessControlAttribute::ReadAcl(AttributeValueEncoder & aEncoder) CHIP_ERROR AccessControlAttribute::ReadExtension(AttributeValueEncoder & aEncoder) { - return aEncoder.EncodeList([&](const auto & encoder) -> CHIP_ERROR { return CHIP_NO_ERROR; }); + return aEncoder.EncodeEmptyList(); } CHIP_ERROR AccessControlAttribute::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) diff --git a/src/app/clusters/account-login-server/account-login-delegate.h b/src/app/clusters/account-login-server/account-login-delegate.h new file mode 100644 index 00000000000000..3880b7aa7f6456 --- /dev/null +++ b/src/app/clusters/account-login-server/account-login-delegate.h @@ -0,0 +1,46 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace AccountLogin { + +/** @brief + * Defines methods for implementing application-specific logic for the Account Login Cluster. + */ +class Delegate +{ +public: + virtual bool HandleLogin(const chip::CharSpan & tempAccountIdentifierString, const chip::CharSpan & setupPinString) = 0; + virtual bool HandleLogout() = 0; + virtual Commands::GetSetupPINResponse::Type HandleGetSetupPin(const chip::CharSpan & tempAccountIdentifierString) = 0; + + virtual ~Delegate() = default; +}; + +} // namespace AccountLogin +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp index ac1d845f451126..a095944282f97c 100644 --- a/src/app/clusters/account-login-server/account-login-server.cpp +++ b/src/app/clusters/account-login-server/account-login-server.cpp @@ -21,76 +21,142 @@ ******************************************************************************* ******************************************************************************/ +#include +#include + #include #include #include #include -#include using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::AccountLogin; -bool accountLoginClusterIsUserLoggedIn(std::string requestTempAccountIdentifier, std::string requestSetupPin); -bool accountLoginClusterLogout(); -std::string accountLoginClusterGetSetupPin(std::string requestTempAccountIdentifier, EndpointId endpoint); +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::AccountLogin::Delegate; + +namespace { -void sendResponse(app::CommandHandler * command, const char * responseSetupPin) +Delegate * gDelegateTable[EMBER_AF_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) { - CHIP_ERROR err = CHIP_NO_ERROR; - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), AccountLogin::Id, Commands::GetSetupPINResponse::Id }; - TLV::TLVWriter * writer = nullptr; - SuccessOrExit(err = command->PrepareCommand(path)); - VerifyOrExit((writer = command->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - SuccessOrExit(err = writer->PutString(TLV::ContextTag(0), responseSetupPin)); - SuccessOrExit(err = command->FinishCommand()); -exit: - if (err != CHIP_NO_ERROR) + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::AccountLogin::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) { - ChipLogError(Zcl, "Failed to encode GetSetupPIN command. Error:%s", ErrorStr(err)); + ChipLogError(Zcl, "Account Login has no delegate set for endpoint:%" PRIu16, endpoint); + return true; } + return false; } +} // namespace -bool emberAfAccountLoginClusterGetSetupPINCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::GetSetupPIN::DecodableType & commandData) +namespace chip { +namespace app { +namespace Clusters { +namespace AccountLogin { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) { + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::AccountLogin::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace AccountLogin +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +bool emberAfAccountLoginClusterGetSetupPINRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::GetSetupPINRequest::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; auto & tempAccountIdentifier = commandData.tempAccountIdentifier; - std::string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size()); - std::string responseSetupPin = accountLoginClusterGetSetupPin(tempAccountIdentifierString, emberAfCurrentEndpoint()); - sendResponse(command, responseSetupPin.c_str()); + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::GetSetupPINResponse::Type response = delegate->HandleGetSetupPin(tempAccountIdentifier); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfAccountLoginClusterGetSetupPINCallback error: %s", err.AsString()); + + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -bool emberAfAccountLoginClusterLoginCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::Login::DecodableType & commandData) +bool emberAfAccountLoginClusterLoginRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::LoginRequest::DecodableType & commandData) { + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; auto & tempAccountIdentifier = commandData.tempAccountIdentifier; - auto & tempSetupPin = commandData.setupPIN; + auto & setupPin = commandData.setupPIN; - std::string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size()); - std::string tempSetupPinString(tempSetupPin.data(), tempSetupPin.size()); - bool isLoggedIn = accountLoginClusterIsUserLoggedIn(tempAccountIdentifierString, tempSetupPinString); - EmberAfStatus status = isLoggedIn ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_NOT_AUTHORIZED; - if (!isLoggedIn) + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + +exit: + if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "User is not authorized."); + ChipLogError(Zcl, "emberAfAccountLoginClusterLoginRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } + + bool isLoggedIn = delegate->HandleLogin(tempAccountIdentifier, setupPin); + EmberAfStatus status = isLoggedIn ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_NOT_AUTHORIZED; emberAfSendImmediateDefaultResponse(status); return true; } -bool emberAfAccountLoginClusterLogoutCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - const Commands::Logout::DecodableType & commandData) +bool emberAfAccountLoginClusterLogoutRequestCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + const Commands::LogoutRequest::DecodableType & commandData) { - bool isLoggedOut = accountLoginClusterLogout(); - EmberAfStatus status = isLoggedOut ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_NOT_AUTHORIZED; - if (!isLoggedOut) + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); +exit: + if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "User is not logged out."); + ChipLogError(Zcl, "emberAfAccountLoginClusterLogoutRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } + + bool isLoggedOut = delegate->HandleLogout(); + EmberAfStatus status = isLoggedOut ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_NOT_AUTHORIZED; emberAfSendImmediateDefaultResponse(status); return true; } +// ----------------------------------------------------------------------------- +// Plugin initialization + void MatterAccountLoginPluginServerInitCallback() {} diff --git a/src/app/clusters/account-login-server/account-login-server.h b/src/app/clusters/account-login-server/account-login-server.h new file mode 100644 index 00000000000000..297bc3acc7e724 --- /dev/null +++ b/src/app/clusters/account-login-server/account-login-server.h @@ -0,0 +1,32 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "account-login-delegate.h" + +namespace chip { +namespace app { +namespace Clusters { +namespace AccountLogin { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace AccountLogin +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/application-basic-server/application-basic-delegate.h b/src/app/clusters/application-basic-server/application-basic-delegate.h new file mode 100644 index 00000000000000..cc53f85c999dd0 --- /dev/null +++ b/src/app/clusters/application-basic-server/application-basic-delegate.h @@ -0,0 +1,52 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ApplicationBasic { + +/** @brief + * Defines methods for implementing application-specific logic for the Application Basic Cluster. + */ +class Delegate +{ +public: + virtual chip::CharSpan HandleGetVendorName() = 0; + virtual uint16_t HandleGetVendorId() = 0; + virtual chip::CharSpan HandleGetApplicationName() = 0; + virtual uint16_t HandleGetProductId() = 0; + virtual chip::app::Clusters::ApplicationBasic::Structs::Application::Type HandleGetApplication() = 0; + virtual ApplicationStatusEnum HandleGetStatus() = 0; + virtual chip::CharSpan HandleGetApplicationVersion() = 0; + virtual std::list HandleGetAllowedVendorList() = 0; + + virtual ~Delegate() = default; +}; + +} // namespace ApplicationBasic +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index be5a31a1c11d65..6615c28b61d4f9 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -17,33 +17,202 @@ /**************************************************************************** * @file - * @brief Routines for the Application Launcher plugin, the - *server implementation of the Application Launcher cluster. + * @brief Routines for the Application Basic plugin, the + *server implementation of the Application Basic cluster. ******************************************************************************* ******************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include + +#include +#include +#include +#include using namespace chip; +using namespace chip::app::Clusters; using namespace chip::app::Clusters::ApplicationBasic; -bool applicationBasicClusterChangeApplicationStatus(EndpointId endpoint, ApplicationBasicStatus status); +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::ApplicationBasic::Delegate; + +namespace { + +Delegate * gDelegateTable[EMBER_AF_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::ApplicationBasic::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) + { + ChipLogError(Zcl, "Application Basic has no delegate set for endpoint:%" PRIu16, endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace ApplicationBasic { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::ApplicationBasic::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace ApplicationBasic +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Attribute Accessor Implementation + +namespace { + +class ApplicationBasicAttrAccess : public app::AttributeAccessInterface +{ +public: + ApplicationBasicAttrAccess() : + app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::ApplicationBasic::Id) + {} + + CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadVendorNameAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadVendorIdAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadApplicationNameAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadProductIdAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadApplicationAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadStatusAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadApplicationVersionAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadAllowedVendorListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); +}; + +ApplicationBasicAttrAccess gApplicationBasicAttrAccess; + +CHIP_ERROR ApplicationBasicAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +{ + EndpointId endpoint = aPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); + + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + switch (aPath.mAttributeId) + { + case app::Clusters::ApplicationBasic::Attributes::VendorName::Id: { + return ReadVendorNameAttribute(aEncoder, delegate); + } + case app::Clusters::ApplicationBasic::Attributes::VendorId::Id: { + return ReadVendorIdAttribute(aEncoder, delegate); + } + case app::Clusters::ApplicationBasic::Attributes::ApplicationName::Id: { + return ReadApplicationNameAttribute(aEncoder, delegate); + } + case app::Clusters::ApplicationBasic::Attributes::ProductId::Id: { + return ReadProductIdAttribute(aEncoder, delegate); + } + case app::Clusters::ApplicationBasic::Attributes::ApplicationApp::Id: { + return ReadApplicationAttribute(aEncoder, delegate); + } + case app::Clusters::ApplicationBasic::Attributes::ApplicationStatus::Id: { + return ReadStatusAttribute(aEncoder, delegate); + } + case app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::Id: { + return ReadApplicationVersionAttribute(aEncoder, delegate); + } + case app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::Id: { + return ReadAllowedVendorListAttribute(aEncoder, delegate); + } + default: { + break; + } + } -bool emberAfApplicationBasicClusterChangeStatusCallback(app::CommandHandler * commandObj, - const app::ConcreteCommandPath & commandPath, - const Commands::ChangeStatus::DecodableType & commandData) + return CHIP_NO_ERROR; +} + +CHIP_ERROR ApplicationBasicAttrAccess::ReadVendorNameAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + chip::CharSpan vendorName = delegate->HandleGetVendorName(); + return aEncoder.Encode(vendorName); +} + +CHIP_ERROR ApplicationBasicAttrAccess::ReadVendorIdAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + uint16_t vendorId = delegate->HandleGetVendorId(); + return aEncoder.Encode(vendorId); +} + +CHIP_ERROR ApplicationBasicAttrAccess::ReadApplicationNameAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + chip::CharSpan applicationName = delegate->HandleGetApplicationName(); + return aEncoder.Encode(applicationName); +} + +CHIP_ERROR ApplicationBasicAttrAccess::ReadProductIdAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + uint16_t vendorId = delegate->HandleGetProductId(); + return aEncoder.Encode(vendorId); +} + +CHIP_ERROR ApplicationBasicAttrAccess::ReadApplicationAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) { - auto & newApplicationStatus = commandData.status; + Structs::Application::Type application = delegate->HandleGetApplication(); + return aEncoder.Encode(application); +} - bool success = applicationBasicClusterChangeApplicationStatus(emberAfCurrentEndpoint(), newApplicationStatus); - EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; - emberAfSendImmediateDefaultResponse(status); - return true; +CHIP_ERROR ApplicationBasicAttrAccess::ReadStatusAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + ApplicationStatusEnum status = delegate->HandleGetStatus(); + return aEncoder.Encode(status); } -void MatterApplicationBasicPluginServerInitCallback() {} +CHIP_ERROR ApplicationBasicAttrAccess::ReadApplicationVersionAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + chip::CharSpan applicationVersion = delegate->HandleGetApplicationVersion(); + return aEncoder.Encode(applicationVersion); +} + +CHIP_ERROR ApplicationBasicAttrAccess::ReadAllowedVendorListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + std::list allowedVendorList = delegate->HandleGetAllowedVendorList(); + return aEncoder.EncodeList([allowedVendorList](const auto & encoder) -> CHIP_ERROR { + for (const auto & allowedVendor : allowedVendorList) + { + ReturnErrorOnFailure(encoder.Encode(allowedVendor)); + } + return CHIP_NO_ERROR; + }); +} + +} // anonymous namespace + +// ----------------------------------------------------------------------------- +// Plugin initialization + +void MatterApplicationBasicPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gApplicationBasicAttrAccess); +} diff --git a/src/app/clusters/application-basic-server/application-basic-server.h b/src/app/clusters/application-basic-server/application-basic-server.h new file mode 100644 index 00000000000000..05fa4b69ce106b --- /dev/null +++ b/src/app/clusters/application-basic-server/application-basic-server.h @@ -0,0 +1,33 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "application-basic-delegate.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ApplicationBasic { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace ApplicationBasic +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/application-launcher-server/application-launcher-delegate.h b/src/app/clusters/application-launcher-server/application-launcher-delegate.h new file mode 100644 index 00000000000000..7d6ff13c06a2f9 --- /dev/null +++ b/src/app/clusters/application-launcher-server/application-launcher-delegate.h @@ -0,0 +1,54 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ApplicationLauncher { + +/** @brief + * Defines methods for implementing application-specific logic for the Application Launcher Cluster. + */ +class Delegate +{ +public: + virtual chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type HandleGetCurrentApp() = 0; + virtual std::list HandleGetCatalogList() = 0; + + virtual Commands::LauncherResponse::Type + HandleLaunchApp(const chip::CharSpan & data, + const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0; + virtual Commands::LauncherResponse::Type + HandleStopApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0; + virtual Commands::LauncherResponse::Type + HandleHideApp(const chip::app::Clusters::ApplicationLauncher::Structs::Application::Type & application) = 0; + + virtual ~Delegate() = default; +}; + +} // namespace ApplicationLauncher +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 92863361707959..50b2b2506baf52 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -22,109 +22,229 @@ ******************************************************************************* ******************************************************************************/ -#include -#include -#include +#include +#include + +#include #include #include -#include -#include +#include +#include using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::ApplicationLauncher; -ApplicationLauncherResponse applicationLauncherClusterLaunchApp(EndpointId endpoint, ::ApplicationLauncherApp application, - std::string data); +// ----------------------------------------------------------------------------- +// Delegate Implementation -ApplicationLauncherResponse applicationLauncherClusterStopApp(EndpointId endpoint, ::ApplicationLauncherApp application, - std::string data); +using chip::app::Clusters::ApplicationLauncher::Delegate; -ApplicationLauncherResponse applicationLauncherClusterHideApp(EndpointId endpoint, ::ApplicationLauncherApp application, - std::string data); +namespace { -bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * commandObj, - const app::ConcreteCommandPath & commandPath, EndpointId endpoint, - uint8_t *, uint8_t *, Commands::LaunchApp::DecodableType & commandData) +Delegate * gDelegateTable[EMBER_AF_APPLICATION_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) { - EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - emberAfSendImmediateDefaultResponse(status); - return true; + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::ApplicationLauncher::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); } -void sendResponse(app::CommandHandler * command, app::ConcreteCommandPath path, ApplicationLauncherResponse response) +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) { - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - SuccessOrExit(err = command->PrepareCommand(path)); - VerifyOrExit((writer = command->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - SuccessOrExit(err = writer->Put(TLV::ContextTag(0), response.status)); - SuccessOrExit(err = writer->PutString(TLV::ContextTag(1), reinterpret_cast(response.data))); - SuccessOrExit(err = command->FinishCommand()); -exit: - if (err != CHIP_NO_ERROR) + if (delegate == nullptr) + { + ChipLogError(Zcl, "Application Launcher has no delegate set for endpoint:%" PRIu16, endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace ApplicationLauncher { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::ApplicationLauncher::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace ApplicationLauncher +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Attribute Accessor Implementation + +namespace { + +class ApplicationLauncherAttrAccess : public app::AttributeAccessInterface +{ +public: + ApplicationLauncherAttrAccess() : + app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::ApplicationLauncher::Id) + {} + + CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadCatalogListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadCurrentAppAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); +}; + +ApplicationLauncherAttrAccess gApplicationLauncherAttrAccess; + +CHIP_ERROR ApplicationLauncherAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +{ + EndpointId endpoint = aPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); + + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + switch (aPath.mAttributeId) { - ChipLogError(Zcl, "Failed to send LaunchAppResponse. Error:%s", ErrorStr(err)); + case app::Clusters::ApplicationLauncher::Attributes::ApplicationLauncherList::Id: { + return ReadCatalogListAttribute(aEncoder, delegate); + } + case app::Clusters::ApplicationLauncher::Attributes::ApplicationLauncherApp::Id: { + return ReadCurrentAppAttribute(aEncoder, delegate); + } + default: { + break; } + } + + return CHIP_NO_ERROR; } -::ApplicationLauncherApp getApplicationFromCommand(uint16_t catalogVendorId, CharSpan applicationId) +CHIP_ERROR ApplicationLauncherAttrAccess::ReadCatalogListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) { - ::ApplicationLauncherApp application = {}; - application.applicationId = applicationId; - application.catalogVendorId = catalogVendorId; - return application; + std::list catalogList = delegate->HandleGetCatalogList(); + return aEncoder.EncodeList([catalogList](const auto & encoder) -> CHIP_ERROR { + for (const auto & catalog : catalogList) + { + ReturnErrorOnFailure(encoder.Encode(catalog)); + } + return CHIP_NO_ERROR; + }); } -bool emberAfApplicationLauncherClusterLaunchAppCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::LaunchApp::DecodableType & commandData) +CHIP_ERROR ApplicationLauncherAttrAccess::ReadCurrentAppAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) { - auto & requestData = commandData.data; - auto & requestApplicationCatalogVendorId = commandData.application.catalogVendorId; - auto & requestApplicationId = commandData.application.applicationId; + Structs::ApplicationEP::Type currentApp = delegate->HandleGetCurrentApp(); + return aEncoder.Encode(currentApp); +} - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), ApplicationLauncher::Id, Commands::LaunchAppResponse::Id }; +} // anonymous namespace + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +bool emberAfApplicationLauncherClusterLaunchAppRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::LaunchAppRequest::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & data = commandData.data; + auto & application = commandData.application; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::LauncherResponse::Type response = delegate->HandleLaunchApp(data, application); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfApplicationLauncherClusterLaunchAppRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } - ::ApplicationLauncherApp application = getApplicationFromCommand(requestApplicationCatalogVendorId, requestApplicationId); - std::string reqestDataString(requestData.data(), requestData.size()); - ApplicationLauncherResponse response = - applicationLauncherClusterLaunchApp(emberAfCurrentEndpoint(), application, reqestDataString); - sendResponse(command, path, response); return true; } /** * @brief Application Launcher Cluster StopApp Command callback (from client) */ -bool emberAfApplicationLauncherClusterStopAppCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::StopApp::DecodableType & commandData) +bool emberAfApplicationLauncherClusterStopAppRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::StopAppRequest::DecodableType & commandData) { - auto & requestApplicationCatalogVendorId = commandData.application.catalogVendorId; - auto & requestApplicationId = commandData.application.applicationId; + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & application = commandData.application; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::LauncherResponse::Type response = delegate->HandleStopApp(application); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), ApplicationLauncher::Id, Commands::StopAppResponse::Id }; +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfApplicationLauncherClusterStopAppRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } - ::ApplicationLauncherApp application = getApplicationFromCommand(requestApplicationCatalogVendorId, requestApplicationId); - ApplicationLauncherResponse response = applicationLauncherClusterStopApp(emberAfCurrentEndpoint(), application, "data"); - sendResponse(command, path, response); return true; } + /** * @brief Application Launcher Cluster HideApp Command callback (from client) */ -bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::HideApp::DecodableType & commandData) +bool emberAfApplicationLauncherClusterHideAppRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::HideAppRequest::DecodableType & commandData) { + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & application = commandData.application; - auto & requestApplicationCatalogVendorId = commandData.application.catalogVendorId; - auto & requestApplicationId = commandData.application.applicationId; + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), ApplicationLauncher::Id, Commands::HideAppResponse::Id }; + { + Commands::LauncherResponse::Type response = delegate->HandleHideApp(application); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfApplicationLauncherClusterStopAppRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } - ::ApplicationLauncherApp application = getApplicationFromCommand(requestApplicationCatalogVendorId, requestApplicationId); - ApplicationLauncherResponse response = applicationLauncherClusterHideApp(emberAfCurrentEndpoint(), application, "data"); - sendResponse(command, path, response); return true; } -void MatterApplicationLauncherPluginServerInitCallback() {} +// ----------------------------------------------------------------------------- +// Plugin initialization + +void MatterApplicationLauncherPluginServerInitCallback(void) +{ + registerAttributeAccessOverride(&gApplicationLauncherAttrAccess); +} diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.h b/src/app/clusters/application-launcher-server/application-launcher-server.h index f7e538e9f52030..f2fdb156e2eacc 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.h +++ b/src/app/clusters/application-launcher-server/application-launcher-server.h @@ -23,8 +23,17 @@ #pragma once -struct ApplicationLauncherResponse -{ - uint8_t status; - uint8_t * data; -}; +#include "application-launcher-delegate.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ApplicationLauncher { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace ApplicationLauncher +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/audio-output-server/audio-output-delegate.h b/src/app/clusters/audio-output-server/audio-output-delegate.h new file mode 100644 index 00000000000000..daa1f0f084a6d2 --- /dev/null +++ b/src/app/clusters/audio-output-server/audio-output-delegate.h @@ -0,0 +1,49 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace AudioOutput { + +/** @brief + * Defines methods for implementing application-specific logic for the Audio Output Cluster. + */ +class Delegate +{ +public: + virtual uint8_t HandleGetCurrentOutput() = 0; + virtual std::list HandleGetOutputList() = 0; + + virtual bool HandleRenameOutput(const uint8_t & index, const chip::CharSpan & name) = 0; + virtual bool HandleSelectOutput(const uint8_t & index) = 0; + + virtual ~Delegate() = default; +}; + +} // namespace AudioOutput +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/audio-output-server/audio-output-server.cpp b/src/app/clusters/audio-output-server/audio-output-server.cpp index 8af6fa308eec0d..fb8ff0b401919d 100644 --- a/src/app/clusters/audio-output-server/audio-output-server.cpp +++ b/src/app/clusters/audio-output-server/audio-output-server.cpp @@ -22,38 +22,185 @@ ******************************************************************************* ******************************************************************************/ -#include +#include +#include + +#include #include #include -#include +#include +#include using namespace chip; using namespace chip::app::Clusters::AudioOutput; -bool audioOutputClusterSelectOutput(uint8_t index); -bool audioOutputClusterRenameOutput(uint8_t index, const CharSpan & name); +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::AudioOutput::Delegate; + +namespace { + +Delegate * gDelegateTable[EMBER_AF_AUDIO_OUTPUT_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::AudioOutput::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) + { + ChipLogError(Zcl, "Audio Output has no delegate set for endpoint:%" PRIu16, endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace AudioOutput { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::AudioOutput::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace AudioOutput +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Attribute Accessor Implementation + +namespace { + +class AudioOutputAttrAccess : public app::AttributeAccessInterface +{ +public: + AudioOutputAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::AudioOutput::Id) + {} + + CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadOutputListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadCurrentOutputAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); +}; -bool emberAfAudioOutputClusterRenameOutputCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::RenameOutput::DecodableType & commandData) +AudioOutputAttrAccess gAudioOutputAttrAccess; + +CHIP_ERROR AudioOutputAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) { - auto & index = commandData.index; - auto & name = commandData.name; + EndpointId endpoint = aPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); + + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + switch (aPath.mAttributeId) + { + case app::Clusters::AudioOutput::Attributes::AudioOutputList::Id: { + return ReadOutputListAttribute(aEncoder, delegate); + } + case app::Clusters::AudioOutput::Attributes::CurrentAudioOutput::Id: { + return ReadCurrentOutputAttribute(aEncoder, delegate); + } + default: { + break; + } + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR AudioOutputAttrAccess::ReadOutputListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + std::list outputList = delegate->HandleGetOutputList(); + return aEncoder.EncodeList([outputList](const auto & encoder) -> CHIP_ERROR { + for (const auto & output : outputList) + { + ReturnErrorOnFailure(encoder.Encode(output)); + } + return CHIP_NO_ERROR; + }); +} + +CHIP_ERROR AudioOutputAttrAccess::ReadCurrentOutputAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + uint8_t currentOutput = delegate->HandleGetCurrentOutput(); + return aEncoder.Encode(currentOutput); +} - bool success = audioOutputClusterRenameOutput(index, name); +} // anonymous namespace + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +bool emberAfAudioOutputClusterRenameOutputRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::RenameOutputRequest::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & index = commandData.index; + auto & name = commandData.name; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfAudioOutputClusterRenameOutputRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + + bool success = delegate->HandleRenameOutput(index, name); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; } -bool emberAfAudioOutputClusterSelectOutputCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::SelectOutput::DecodableType & commandData) +bool emberAfAudioOutputClusterSelectOutputRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::SelectOutputRequest::DecodableType & commandData) { - auto & index = commandData.index; + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & index = commandData.index; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfAudioOutputClusterSelectOutputRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } - bool success = audioOutputClusterSelectOutput(index); + bool success = delegate->HandleSelectOutput(index); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; } -void MatterAudioOutputPluginServerInitCallback() {} +void MatterAudioOutputPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gAudioOutputAttrAccess); +} diff --git a/src/app/clusters/audio-output-server/audio-output-server.h b/src/app/clusters/audio-output-server/audio-output-server.h new file mode 100644 index 00000000000000..f7fab288c8648b --- /dev/null +++ b/src/app/clusters/audio-output-server/audio-output-server.h @@ -0,0 +1,39 @@ +/** + * + * 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. + */ +/**************************************************************************** + * @file + * @brief Routines for the Audio Output plugin, the + *server implementation of the Audio Output cluster. + ******************************************************************************* + ******************************************************************************/ + +#pragma once + +#include "audio-output-delegate.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace AudioOutput { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace AudioOutput +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/basic/basic.cpp b/src/app/clusters/basic/basic.cpp index 38ccf5ecc31f96..d01abf835f9df2 100644 --- a/src/app/clusters/basic/basic.cpp +++ b/src/app/clusters/basic/basic.cpp @@ -33,10 +33,98 @@ using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::Basic; +using namespace chip::app::Clusters::Basic::Attributes; using namespace chip::DeviceLayer; namespace { +class BasicAttrAccess : public AttributeAccessInterface +{ +public: + // Register for the Basic cluster on all endpoints. + BasicAttrAccess() : AttributeAccessInterface(Optional::Missing(), Basic::Id) {} + + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + +private: + CHIP_ERROR ReadLocation(AttributeValueEncoder & aEncoder); + CHIP_ERROR WriteLocation(AttributeValueDecoder & aDecoder); +}; + +BasicAttrAccess gAttrAccess; + +CHIP_ERROR BasicAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + if (aPath.mClusterId != Basic::Id) + { + // We shouldn't have been called at all. + return CHIP_ERROR_INVALID_ARGUMENT; + } + + switch (aPath.mAttributeId) + { + case Location::Id: + return ReadLocation(aEncoder); + default: + break; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR BasicAttrAccess::ReadLocation(AttributeValueEncoder & aEncoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + char location[DeviceLayer::ConfigurationManager::kMaxLocationLength + 1]; + size_t codeLen = 0; + + if (ConfigurationMgr().GetCountryCode(location, sizeof(location), codeLen) == CHIP_NO_ERROR) + { + if (codeLen == 0) + { + err = aEncoder.Encode(chip::CharSpan("XX", strlen("XX"))); + } + else + { + err = aEncoder.Encode(chip::CharSpan(location, strlen(location))); + } + } + else + { + err = aEncoder.Encode(chip::CharSpan("XX", strlen("XX"))); + } + + return err; +} + +CHIP_ERROR BasicAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + VerifyOrDie(aPath.mClusterId == Basic::Id); + + switch (aPath.mAttributeId) + { + case Location::Id: + return WriteLocation(aDecoder); + default: + break; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR BasicAttrAccess::WriteLocation(AttributeValueDecoder & aDecoder) +{ + chip::CharSpan location; + + ReturnErrorOnFailure(aDecoder.Decode(location)); + VerifyOrReturnError(location.size() <= DeviceLayer::ConfigurationManager::kMaxLocationLength, + CHIP_ERROR_INVALID_MESSAGE_LENGTH); + + return DeviceLayer::ConfigurationMgr().StoreCountryCode(location.data(), location.size()); +} + class PlatformMgrDelegate : public DeviceLayer::PlatformManagerDelegate { // Gets called by the current Node after completing a boot or reboot process. @@ -68,7 +156,7 @@ class PlatformMgrDelegate : public DeviceLayer::PlatformManagerDelegate Events::ShutDown::Type event; EventNumber eventNumber; - if (CHIP_NO_ERROR != LogEvent(event, endpoint, eventNumber)) + if (CHIP_NO_ERROR != LogEvent(event, endpoint, eventNumber, EventOptions::Type::kUrgent)) { ChipLogError(Zcl, "PlatformMgrDelegate: Failed to record ShutDown event"); } diff --git a/src/app/clusters/channel-server/channel-delegate.h b/src/app/clusters/channel-server/channel-delegate.h new file mode 100644 index 00000000000000..0195c1004389b7 --- /dev/null +++ b/src/app/clusters/channel-server/channel-delegate.h @@ -0,0 +1,51 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace Channel { + +/** @brief + * Defines methods for implementing application-specific logic for the Channel Cluster. + */ +class Delegate +{ +public: + virtual std::list HandleGetChannelList() = 0; + virtual chip::app::Clusters::Channel::Structs::LineupInfo::Type HandleGetLineup() = 0; + virtual chip::app::Clusters::Channel::Structs::ChannelInfo::Type HandleGetCurrentChannel() = 0; + + virtual Commands::ChangeChannelResponse::Type HandleChangeChannel(const chip::CharSpan & match) = 0; + virtual bool HandleChangeChannelByNumber(const uint16_t & majorNumber, const uint16_t & minorNumber) = 0; + virtual bool HandleSkipChannel(const uint16_t & count) = 0; + + virtual ~Delegate() = default; +}; + +} // namespace Channel +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp new file mode 100644 index 00000000000000..c5f08c427a750d --- /dev/null +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -0,0 +1,256 @@ +/** + * + * 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. + */ + +/** + * + * Copyright (c) 2021 Silicon Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/**************************************************************************** + * @file + * @brief Routines for the Channel plugin, the + *server implementation of the Channel cluster. + ******************************************************************************* + ******************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app::Clusters::Channel; + +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::Channel::Delegate; + +namespace { + +Delegate * gDelegateTable[EMBER_AF_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::Channel::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) + { + ChipLogError(Zcl, "Channel has no delegate set for endpoint:%" PRIu16, endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace Channel { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::Channel::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace Channel +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Attribute Accessor Implementation + +namespace { + +class ChannelAttrAccess : public app::AttributeAccessInterface +{ +public: + ChannelAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::Channel::Id) {} + + CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadChannelListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadLineupAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadCurrentChannelAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); +}; + +ChannelAttrAccess gChannelAttrAccess; + +CHIP_ERROR ChannelAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +{ + EndpointId endpoint = aPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); + + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + switch (aPath.mAttributeId) + { + case app::Clusters::Channel::Attributes::ChannelList::Id: { + return ReadChannelListAttribute(aEncoder, delegate); + } + case app::Clusters::Channel::Attributes::ChannelLineup::Id: { + return ReadLineupAttribute(aEncoder, delegate); + } + case app::Clusters::Channel::Attributes::CurrentChannel::Id: { + return ReadCurrentChannelAttribute(aEncoder, delegate); + } + default: { + break; + } + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR ChannelAttrAccess::ReadChannelListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + std::list channelList = delegate->HandleGetChannelList(); + return aEncoder.EncodeList([channelList](const auto & encoder) -> CHIP_ERROR { + for (const auto & channel : channelList) + { + ReturnErrorOnFailure(encoder.Encode(channel)); + } + return CHIP_NO_ERROR; + }); +} + +CHIP_ERROR ChannelAttrAccess::ReadLineupAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + Structs::LineupInfo::Type lineup = delegate->HandleGetLineup(); + return aEncoder.Encode(lineup); +} + +CHIP_ERROR ChannelAttrAccess::ReadCurrentChannelAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + Structs::ChannelInfo::Type currentChannel = delegate->HandleGetCurrentChannel(); + return aEncoder.Encode(currentChannel); +} + +} // anonymous namespace + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +bool emberAfChannelClusterChangeChannelRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::ChangeChannelRequest::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + auto & match = commandData.match; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + Commands::ChangeChannelResponse::Type response = delegate->HandleChangeChannel(match); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfChannelClusterChangeChannelRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; +} + +bool emberAfChannelClusterChangeChannelByNumberRequestCallback( + app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::ChangeChannelByNumberRequest::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + auto & majorNumber = commandData.majorNumber; + auto & minorNumber = commandData.minorNumber; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfChannelClusterChangeChannelByNumberRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + + bool success = delegate->HandleChangeChannelByNumber(majorNumber, minorNumber); + EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; + emberAfSendImmediateDefaultResponse(status); + return true; +} + +bool emberAfChannelClusterSkipChannelRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::SkipChannelRequest::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & count = commandData.count; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfChannelClusterSkipChannelRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + + bool success = delegate->HandleSkipChannel(count); + EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; + emberAfSendImmediateDefaultResponse(status); + return true; +} + +void MatterChannelPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gChannelAttrAccess); +} diff --git a/src/app/clusters/channel-server/channel-server.h b/src/app/clusters/channel-server/channel-server.h new file mode 100644 index 00000000000000..4901cb94e29296 --- /dev/null +++ b/src/app/clusters/channel-server/channel-server.h @@ -0,0 +1,39 @@ +/** + * + * 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. + */ +/**************************************************************************** + * @file + * @brief Routines for the Channel plugin, the + *server implementation of the Channel cluster. + ******************************************************************************* + ******************************************************************************/ + +#pragma once + +#include "channel-delegate.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace Channel { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace Channel +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index 2e5752f9801794..811992b81835dc 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -427,7 +427,7 @@ uint8_t ColorControlServer::addHue(uint8_t hue1, uint8_t hue2) } /** - * @brief Return difference betwen two hues. + * @brief Return difference between two hues. * * @param hue1 * @param hue2 @@ -2065,7 +2065,7 @@ void ColorControlServer::startUpColorTempCommand(EndpointId endpoint) // the StartUpColorTemperatureMireds attribute are listed in the table below. // Value Action on power up // 0x0000-0xffef Set the ColorTemperatureMireds attribute to this value. - // 0xffff Set the ColorTemperatureMireds attribue to its previous value. + // 0xffff Set the ColorTemperatureMireds attribute to its previous value. // Initialize startUpColorTempMireds to "maintain previous value" value 0xFFFF uint16_t startUpColorTemp = 0xFFFF; diff --git a/src/app/clusters/color-control-server/color-control-server.h b/src/app/clusters/color-control-server/color-control-server.h index 6c3a90df15599d..7ce355db3ee870 100644 --- a/src/app/clusters/color-control-server/color-control-server.h +++ b/src/app/clusters/color-control-server/color-control-server.h @@ -234,7 +234,7 @@ class ColorControlServer #endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP /********************************************************** - * Attributes Decleration + * Attributes Declaration *********************************************************/ static ColorControlServer instance; diff --git a/src/app/clusters/content-launch-server/content-launch-delegate.h b/src/app/clusters/content-launch-server/content-launch-delegate.h new file mode 100644 index 00000000000000..0ac1da2bf96a0a --- /dev/null +++ b/src/app/clusters/content-launch-server/content-launch-delegate.h @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ContentLauncher { + +/** @brief + * Defines methods for implementing application-specific logic for the Content Launcher Cluster. + */ +class Delegate +{ +public: + virtual Commands::LaunchResponse::Type HandleLaunchContent(chip::EndpointId endpointId, + const std::list & parameterList, bool autoplay, + const chip::CharSpan & data) = 0; + + virtual Commands::LaunchResponse::Type HandleLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, + const std::list & brandingInformation) = 0; + + virtual std::list HandleGetAcceptHeaderList() = 0; + + virtual uint32_t HandleGetSupportedStreamingProtocols() = 0; + + virtual ~Delegate() = default; +}; + +} // namespace ContentLauncher +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index c9b5bb5e9f94e3..286e141bd324b1 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -38,45 +38,166 @@ ******************************************************************************* ******************************************************************************/ -#include "content-launch-server.h" -#include +#include +#include + +#include #include -#include +#include +#include +#include #include using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters::ContentLauncher; + +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::ContentLauncher::Delegate; + +namespace { -ContentLaunchResponse contentLauncherClusterLaunchContent(chip::EndpointId endpointId, - std::list parameterList, bool autoplay, - const chip::CharSpan & data); +Delegate * gDelegateTable[EMBER_AF_CONTENT_LAUNCH_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; -ContentLaunchResponse contentLauncherClusterLaunchUrl(const chip::CharSpan & contentUrl, const chip::CharSpan & displayString, - ContentLaunchBrandingInformation & brandingInformation); +Delegate * GetDelegate(EndpointId endpoint) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::ContentLauncher::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) + { + ChipLogError(Zcl, "Content Launcher has no delegate set for endpoint:%" PRIu16, endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace ContentLauncher { + +void SetDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::ContentLauncher::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace ContentLauncher +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Attribute Accessor Implementation + +namespace { + +class ContentLauncherAttrAccess : public app::AttributeAccessInterface +{ +public: + ContentLauncherAttrAccess() : + app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::ContentLauncher::Id) + {} + + CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadAcceptHeaderAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadSupportedStreamingProtocolsAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); +}; + +ContentLauncherAttrAccess gContentLauncherAttrAccess; + +CHIP_ERROR ContentLauncherAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +{ + EndpointId endpoint = aPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); -bool emberAfContentLauncherClusterLaunchContentCallback( + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + switch (aPath.mAttributeId) + { + case app::Clusters::ContentLauncher::Attributes::AcceptHeaderList::Id: { + return ReadAcceptHeaderAttribute(aEncoder, delegate); + } + case app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::Id: { + return ReadSupportedStreamingProtocolsAttribute(aEncoder, delegate); + } + default: { + break; + } + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR ContentLauncherAttrAccess::ReadAcceptHeaderAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + std::list acceptHeaderList = delegate->HandleGetAcceptHeaderList(); + return aEncoder.EncodeList([acceptHeaderList](const auto & encoder) -> CHIP_ERROR { + for (const auto & acceptedHeader : acceptHeaderList) + { + CharSpan span(acceptedHeader.c_str(), acceptedHeader.length()); + ReturnErrorOnFailure(encoder.Encode(span)); + } + return CHIP_NO_ERROR; + }); +} + +CHIP_ERROR ContentLauncherAttrAccess::ReadSupportedStreamingProtocolsAttribute(app::AttributeValueEncoder & aEncoder, + Delegate * delegate) +{ + uint32_t streamingProtocols = delegate->HandleGetSupportedStreamingProtocols(); + return aEncoder.Encode(streamingProtocols); +} + +} // anonymous namespace + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +bool emberAfContentLauncherClusterLaunchContentRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ContentLauncher::Commands::LaunchContent::DecodableType & commandData) + const chip::app::Clusters::ContentLauncher::Commands::LaunchContentRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; - chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::Type response; + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; auto & autoplay = commandData.autoPlay; auto & data = commandData.data; - std::list parameterList; - - ContentLaunchResponse resp = contentLauncherClusterLaunchContent(emberAfCurrentEndpoint(), parameterList, autoplay, data); - VerifyOrExit(resp.err == CHIP_NO_ERROR, err = resp.err); + // TODO: Decode the parameter and pass it to delegate + // auto searchIterator = commandData.search.begin(); + std::list parameterList; - response.contentLaunchStatus = resp.status; - response.data = resp.data; + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - err = commandObj->AddResponseData(commandPath, response); - SuccessOrExit(err); + { + Commands::LaunchResponse::Type response = delegate->HandleLaunchContent(endpoint, parameterList, autoplay, data); + err = commandObj->AddResponseData(commandPath, response); + SuccessOrExit(err); + } exit: if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "emberAfContentLauncherClusterLaunchContentCallback error: %s", err.AsString()); + ChipLogError(Zcl, "emberAfContentLauncherClusterLaunchContentRequestCallback error: %s", err.AsString()); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } @@ -84,25 +205,27 @@ bool emberAfContentLauncherClusterLaunchContentCallback( return true; } -bool emberAfContentLauncherClusterLaunchURLCallback( +bool emberAfContentLauncherClusterLaunchURLRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ContentLauncher::Commands::LaunchURL::DecodableType & commandData) + const chip::app::Clusters::ContentLauncher::Commands::LaunchURLRequest::DecodableType & commandData) { - CHIP_ERROR err = CHIP_NO_ERROR; - chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::Type response; + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; auto & contentUrl = commandData.contentURL; auto & displayString = commandData.displayString; - ContentLaunchBrandingInformation brandingInformation; - - ContentLaunchResponse resp = contentLauncherClusterLaunchUrl(contentUrl, displayString, brandingInformation); - VerifyOrExit(resp.err == CHIP_NO_ERROR, err = resp.err); + // TODO: Decode the parameter and pass it to delegate + // auto brandingInformationIterator = commandData.brandingInformation.begin(); + std::list brandingInformationList; - response.contentLaunchStatus = resp.status; - response.data = resp.data; + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); - err = commandObj->AddResponseData(commandPath, response); - SuccessOrExit(err); + { + Commands::LaunchResponse::Type response = delegate->HandleLaunchUrl(contentUrl, displayString, brandingInformationList); + err = commandObj->AddResponseData(commandPath, response); + SuccessOrExit(err); + } exit: if (err != CHIP_NO_ERROR) @@ -115,4 +238,10 @@ bool emberAfContentLauncherClusterLaunchURLCallback( return true; } -void MatterContentLauncherPluginServerInitCallback() {} +// ----------------------------------------------------------------------------- +// Plugin initialization + +void MatterContentLauncherPluginServerInitCallback(void) +{ + registerAttributeAccessOverride(&gContentLauncherAttrAccess); +} diff --git a/src/app/clusters/content-launch-server/content-launch-server.h b/src/app/clusters/content-launch-server/content-launch-server.h index 2d4934e5fc0eb9..b41472a3af1a35 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.h +++ b/src/app/clusters/content-launch-server/content-launch-server.h @@ -17,12 +17,17 @@ #pragma once +#include "content-launch-delegate.h" #include -#include -struct ContentLaunchResponse -{ - CHIP_ERROR err; - chip::CharSpan data; - chip::app::Clusters::ContentLauncher::ContentLaunchStatus status; -}; +namespace chip { +namespace app { +namespace Clusters { +namespace ContentLauncher { + +void SetDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace ContentLauncher +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp index 62dffe0331ec78..bbd8b83a01b6ad 100644 --- a/src/app/clusters/descriptor/descriptor.cpp +++ b/src/app/clusters/descriptor/descriptor.cpp @@ -79,7 +79,7 @@ CHIP_ERROR DescriptorAttrAccess::ReadPartsAttribute(EndpointId endpoint, Attribu } else { - err = aEncoder.Encode(DataModel::List()); + err = aEncoder.EncodeEmptyList(); } return err; diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index b450b58e0920bb..4cf693727aa8a1 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -61,77 +62,123 @@ DoorLockServer & DoorLockServer::Instance() */ void DoorLockServer::InitServer(chip::EndpointId endpointId) { - emberAfDoorLockClusterPrintln("Door Lock cluster initialized at %d", endpointId); + emberAfDoorLockClusterPrintln("Door Lock cluster initialized at endpoint #%" PRIu16, endpointId); } bool DoorLockServer::SetLockState(chip::EndpointId endpointId, DlLockState newLockState) { - auto lockState = static_cast(newLockState); + auto lockState = chip::to_underlying(newLockState); - emberAfDoorLockClusterPrintln("Setting Lock State to '%hhu'", lockState); + emberAfDoorLockClusterPrintln("Setting LockState to '%" PRIu8 "'", lockState); + EmberAfStatus status = Attributes::LockState::Set(endpointId, newLockState); - bool status = Attributes::LockState::Set(endpointId, lockState); - if (!status) + if (EMBER_ZCL_STATUS_SUCCESS != status) { - ChipLogError(Zcl, "Unable to set the Lock State to %hhu: internal error", lockState); + ChipLogError(Zcl, "Unable to set LockState attribute: status=0x%" PRIx8, status); } - return status; + return (EMBER_ZCL_STATUS_SUCCESS == status); } -bool DoorLockServer::SetActuatorState(chip::EndpointId endpointId, bool newActuatorState) +bool DoorLockServer::SetActuatorEnabled(chip::EndpointId endpointId, bool newActuatorState) { auto actuatorState = static_cast(newActuatorState); - emberAfDoorLockClusterPrintln("Setting Actuator State to '%hhu'", actuatorState); + emberAfDoorLockClusterPrintln("Setting ActuatorEnabled to '%" PRIu8 "'", actuatorState); + EmberAfStatus status = Attributes::ActuatorEnabled::Set(endpointId, newActuatorState); - bool status = Attributes::LockState::Set(endpointId, actuatorState); - if (!status) + if (EMBER_ZCL_STATUS_SUCCESS != status) { - ChipLogError(Zcl, "Unable to set the Actuator State to %hhu: internal error", actuatorState); + ChipLogError(Zcl, "Unable to set ActuatorEnabled attribute: status=0x%" PRIx8, status); } - return false; + return (EMBER_ZCL_STATUS_SUCCESS == status); } -bool DoorLockServer::SetDoorState(chip::EndpointId endpointId, DlLockState newDoorState) +bool DoorLockServer::SetDoorState(chip::EndpointId endpointId, DlDoorState newDoorState) { - auto doorState = static_cast(newDoorState); + auto doorState = chip::to_underlying(newDoorState); - emberAfDoorLockClusterPrintln("Setting Door State to '%hhu'", doorState); - bool status = Attributes::DoorState::Set(endpointId, doorState); + emberAfDoorLockClusterPrintln("Setting DoorState to '%" PRIu8 "'", doorState); + EmberAfStatus status = Attributes::DoorState::Set(endpointId, newDoorState); - if (!status) + if (EMBER_ZCL_STATUS_SUCCESS != status) { - ChipLogError(Zcl, "Unable to set the Door State to %hhu: internal error", doorState); + ChipLogError(Zcl, "Unable to set DoorState attribute: status=0x%" PRIx8, status); } - return false; + return (EMBER_ZCL_STATUS_SUCCESS == status); } bool DoorLockServer::SetLanguage(chip::EndpointId endpointId, const char * newLanguage) { - return true; + auto lang = chip::CharSpan(newLanguage, strlen(newLanguage)); + + emberAfDoorLockClusterPrintln("Setting Language to '%s'", newLanguage); + EmberAfStatus status = Attributes::Language::Set(endpointId, lang); + + if (EMBER_ZCL_STATUS_SUCCESS != status) + { + ChipLogError(Zcl, "Unable to set Language attribute: status=0x%" PRIx8, status); + } + + return (EMBER_ZCL_STATUS_SUCCESS == status); } -bool DoorLockServer::SetAutoRelockTime(chip::EndpointId, uint32_t newAutoRelockTimeSec) +bool DoorLockServer::SetAutoRelockTime(chip::EndpointId endpointId, uint32_t newAutoRelockTimeSec) { - return true; + emberAfDoorLockClusterPrintln("Setting AutoRelockTime to '%" PRIu32 "'", newAutoRelockTimeSec); + EmberAfStatus status = Attributes::AutoRelockTime::Set(endpointId, newAutoRelockTimeSec); + + if (EMBER_ZCL_STATUS_SUCCESS != status) + { + ChipLogError(Zcl, "Unable to set AutoRelockTime attribute: status=0x%" PRIx8, status); + } + + return (EMBER_ZCL_STATUS_SUCCESS == status); } bool DoorLockServer::SetSoundVolume(chip::EndpointId endpointId, uint8_t newSoundVolume) { - return true; + emberAfDoorLockClusterPrintln("Setting SoundVolume to '%" PRIu8 "'", newSoundVolume); + EmberAfStatus status = Attributes::SoundVolume::Set(endpointId, newSoundVolume); + + if (EMBER_ZCL_STATUS_SUCCESS != status) + { + ChipLogError(Zcl, "Unable to set SoundVolume attribute: status=0x%" PRIx8, status); + } + + return (EMBER_ZCL_STATUS_SUCCESS == status); } bool DoorLockServer::SetOneTouchLocking(chip::EndpointId endpointId, bool isEnabled) { - return true; + auto enable = static_cast(isEnabled); + + emberAfDoorLockClusterPrintln("Setting EnableOneTouchLocking to '%" PRIu8 "'", enable); + EmberAfStatus status = Attributes::EnableOneTouchLocking::Set(endpointId, isEnabled); + + if (EMBER_ZCL_STATUS_SUCCESS != status) + { + ChipLogError(Zcl, "Unable to set EnableOneTouchLocking attribute: status=0x%" PRIx8, status); + } + + return (EMBER_ZCL_STATUS_SUCCESS == status); } bool DoorLockServer::SetPrivacyModeButton(chip::EndpointId endpointId, bool isEnabled) { - return true; + auto enable = static_cast(isEnabled); + + emberAfDoorLockClusterPrintln("Setting EnablePrivacyModeButton to '%" PRIu8 "'", enable); + EmberAfStatus status = Attributes::EnablePrivacyModeButton::Set(endpointId, isEnabled); + + if (EMBER_ZCL_STATUS_SUCCESS != status) + { + ChipLogError(Zcl, "Unable to set EnablePrivacyModeButton attribute: status=0x%" PRIx8, status); + } + + return (EMBER_ZCL_STATUS_SUCCESS == status); } // ======================================================= @@ -143,7 +190,6 @@ bool emberAfDoorLockClusterLockDoorCallback(chip::app::CommandHandler * commandO emberAfDoorLockClusterPrintln("Received Lock Door command (not implemented)"); // TODO: Implement door locking by calling emberAfPluginDoorLockOnDoorLockCommand - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; } @@ -229,8 +275,109 @@ chip::Protocols::InteractionModel::Status MatterDoorLockClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value) { - // TODO: Implement attribute changes - return chip::Protocols::InteractionModel::Status::Success; + chip::Protocols::InteractionModel::Status res; + + switch (attributePath.mAttributeId) + { + case chip::app::Clusters::DoorLock::Attributes::Language::Id: + if (value[0] <= 3) + { + char lang[3 + 1] = { 0 }; + memcpy(lang, &value[1], value[0]); + res = emberAfPluginDoorLockOnLanguageChange(attributePath.mEndpointId, lang); + } + else + { + res = chip::Protocols::InteractionModel::Status::InvalidValue; + } + break; + + case chip::app::Clusters::DoorLock::Attributes::AutoRelockTime::Id: + if (sizeof(uint32_t) == size) + { + uint32_t newRelockTime = *(reinterpret_cast(value)); + res = emberAfPluginDoorLockOnAutoRelockTimeChange(attributePath.mEndpointId, newRelockTime); + } + else + { + res = chip::Protocols::InteractionModel::Status::InvalidValue; + } + break; + + case chip::app::Clusters::DoorLock::Attributes::SoundVolume::Id: + if (sizeof(uint8_t) == size) + { + res = emberAfPluginDoorLockOnSoundVolumeChange(attributePath.mEndpointId, *value); + } + else + { + res = chip::Protocols::InteractionModel::Status::InvalidValue; + } + break; + + case chip::app::Clusters::DoorLock::Attributes::OperatingMode::Id: + if (sizeof(uint8_t) == size) + { + res = emberAfPluginDoorLockOnOperatingModeChange(attributePath.mEndpointId, *value); + } + else + { + res = chip::Protocols::InteractionModel::Status::InvalidValue; + } + break; + + case chip::app::Clusters::DoorLock::Attributes::EnableOneTouchLocking::Id: + if (sizeof(bool) == size) + { + bool enable = *reinterpret_cast(value); + res = emberAfPluginDoorLockOnEnableOneTouchLockingChange(attributePath.mEndpointId, enable); + } + else + { + res = chip::Protocols::InteractionModel::Status::InvalidValue; + } + break; + + case chip::app::Clusters::DoorLock::Attributes::EnablePrivacyModeButton::Id: + if (sizeof(bool) == size) + { + bool enable = *reinterpret_cast(value); + res = emberAfPluginDoorLockOnEnablePrivacyModeButtonChange(attributePath.mEndpointId, enable); + } + else + { + res = chip::Protocols::InteractionModel::Status::InvalidValue; + } + break; + + case chip::app::Clusters::DoorLock::Attributes::WrongCodeEntryLimit::Id: + if (sizeof(uint8_t) == size) + { + res = emberAfPluginDoorLockOnWrongCodeEntryLimitChange(attributePath.mEndpointId, *value); + } + else + { + res = chip::Protocols::InteractionModel::Status::InvalidValue; + } + break; + + case chip::app::Clusters::DoorLock::Attributes::UserCodeTemporaryDisableTime::Id: + if (sizeof(uint8_t) == size) + { + res = emberAfPluginDoorLockOnUserCodeTemporaryDisableTimeChange(attributePath.mEndpointId, *value); + } + else + { + res = chip::Protocols::InteractionModel::Status::InvalidValue; + } + break; + + default: + res = emberAfPluginDoorLockOnUnhandledAttributeChange(attributePath.mEndpointId, attributeType, size, value); + break; + } + + return res; } void emberAfPluginDoorLockServerLockoutEventHandler(void) {} @@ -243,3 +390,62 @@ void MatterDoorLockPluginServerInitCallback() } void MatterDoorLockClusterServerAttributeChangedCallback(const app::ConcreteAttributePath & attributePath) {} + +// ============================================================================= +// Pre-change callbacks for cluster attributes +// ============================================================================= + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnLanguageChange(chip::EndpointId EndpointId, const char * newLanguage) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnAutoRelockTimeChange(chip::EndpointId EndpointId, uint32_t newTime) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnSoundVolumeChange(chip::EndpointId EndpointId, uint8_t newVolume) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnOperatingModeChange(chip::EndpointId EndpointId, uint8_t newMode) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnEnableOneTouchLockingChange(chip::EndpointId EndpointId, bool enable) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnEnablePrivacyModeButtonChange(chip::EndpointId EndpointId, bool enable) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnWrongCodeEntryLimitChange(chip::EndpointId EndpointId, uint8_t newLimit) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnUserCodeTemporaryDisableTimeChange(chip::EndpointId EndpointId, uint8_t newTime) +{ + return chip::Protocols::InteractionModel::Status::Success; +} + +chip::Protocols::InteractionModel::Status __attribute__((weak)) +emberAfPluginDoorLockOnUnhandledAttributeChange(chip::EndpointId EndpointId, EmberAfAttributeType attrType, uint16_t attrSize, + uint8_t * attrValue) +{ + return chip::Protocols::InteractionModel::Status::Success; +} diff --git a/src/app/clusters/door-lock-server/door-lock-server.h b/src/app/clusters/door-lock-server/door-lock-server.h index 2810a4aafd2826..9e853a6c2bd214 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.h +++ b/src/app/clusters/door-lock-server/door-lock-server.h @@ -39,11 +39,11 @@ class DoorLockServer void InitServer(chip::EndpointId endpointId); bool SetLockState(chip::EndpointId endpointId, chip::app::Clusters::DoorLock::DlLockState newLockState); - bool SetActuatorState(chip::EndpointId endpointId, bool newActuatorState); - bool SetDoorState(chip::EndpointId endpointId, chip::app::Clusters::DoorLock::DlLockState newDoorState); + bool SetActuatorEnabled(chip::EndpointId endpointId, bool newActuatorState); + bool SetDoorState(chip::EndpointId endpointId, chip::app::Clusters::DoorLock::DlDoorState newDoorState); bool SetLanguage(chip::EndpointId endpointId, const char * newLanguage); - bool SetAutoRelockTime(chip::EndpointId, uint32_t newAutoRelockTimeSec); + bool SetAutoRelockTime(chip::EndpointId endpointId, uint32_t newAutoRelockTimeSec); bool SetSoundVolume(chip::EndpointId endpointId, uint8_t newSoundVolume); bool SetOneTouchLocking(chip::EndpointId endpointId, bool isEnabled); @@ -55,3 +55,109 @@ class DoorLockServer bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const char * PINCOde); bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const char * PINCode); + +// ============================================================================= +// Pre-change callbacks for cluster attributes +// ============================================================================= + +/** @brief 'Language' attribute pre-change callback + * + * @param EndpointId endpoint for which attribute is changing + * @param newLanguage language to set + * + * @retval InteractionModel::Status::Success if attribute change is possible + * @retval any other InteractionModel::Status value to forbid attribute change + */ +chip::Protocols::InteractionModel::Status emberAfPluginDoorLockOnLanguageChange(chip::EndpointId EndpointId, + const char * newLanguage); + +/** @brief 'AutoRelockTime' attribute pre-change callback + * + * @param EndpointId endpoint for which attribute is changing + * @param newTime relock time value to set + * + * @retval InteractionModel::Status::Success if attribute change is possible + * @retval any other InteractionModel::Status value to forbid attribute change + */ +chip::Protocols::InteractionModel::Status emberAfPluginDoorLockOnAutoRelockTimeChange(chip::EndpointId EndpointId, + uint32_t newTime); + +/** @brief 'SoundVolume' attribute pre-change callback + * + * @param EndpointId endpoint for which attribute is changing + * @param newVolume volume level to set + * + * @retval InteractionModel::Status::Success if attribute change is possible + * @retval any other InteractionModel::Status value to forbid attribute change + */ +chip::Protocols::InteractionModel::Status emberAfPluginDoorLockOnSoundVolumeChange(chip::EndpointId EndpointId, uint8_t newVolume); + +/** @brief 'OperatingMode' attribute pre-change callback + * + * @param EndpointId endpoint for which attribute is changing + * @param newMode operating mode to set + * + * @retval InteractionModel::Status::Success if attribute change is possible + * @retval any other InteractionModel::Status value to forbid attribute change + */ +chip::Protocols::InteractionModel::Status emberAfPluginDoorLockOnOperatingModeChange(chip::EndpointId EndpointId, uint8_t newMode); + +/** @brief 'EnableOneTouchLocking' attribute pre-change callback + * + * @param EndpointId endpoint for which attribute is changing + * @param enable true to enable one touch locking, false otherwise + * + * @retval InteractionModel::Status::Success if attribute change is possible + * @retval any other InteractionModel::Status value to forbid attribute change + */ +chip::Protocols::InteractionModel::Status emberAfPluginDoorLockOnEnableOneTouchLockingChange(chip::EndpointId EndpointId, + bool enable); + +/** @brief 'EnablePrivacyModeButton' attribute pre-change callback + * + * @param EndpointId endpoint for which attribute is changing + * @param enable true to enable privacy mode button, false otherwise + * + * @retval InteractionModel::Status::Success if attribute change is possible + * @retval any other InteractionModel::Status value to forbid attribute change + */ +chip::Protocols::InteractionModel::Status emberAfPluginDoorLockOnEnablePrivacyModeButtonChange(chip::EndpointId EndpointId, + bool enable); + +/** @brief 'WrongCodeEntryLimit' attribute pre-change callback + * + * @param EndpointId endpoint for which attribute is changing + * @param newLimit new limit for the number of incorrect PIN attempts to set + * + * @retval InteractionModel::Status::Success if attribute change is possible + * @retval any other InteractionModel::Status value to forbid attribute change + */ +chip::Protocols::InteractionModel::Status emberAfPluginDoorLockOnWrongCodeEntryLimitChange(chip::EndpointId EndpointId, + uint8_t newLimit); + +/** @brief 'UserCodeTemporaryDisableTime' attribute pre-change callback + * + * @param EndpointId endpoint for which attribute is changing + * @param newTime new number of seconds for which lock will be shut down due to wrong code entry + * + * @retval InteractionModel::Status::Success if attribute change is possible + * @retval any other InteractionModel::Status value to forbid attribute change + */ +chip::Protocols::InteractionModel::Status emberAfPluginDoorLockOnUserCodeTemporaryDisableTimeChange(chip::EndpointId EndpointId, + uint8_t newTime); + +/** @note This callback is called for any cluster attribute that has no predefined callback above + * + * @brief Cluster attribute pre-change callback + * + * @param EndpointId endpoint for which attribute is changing + * @param attrType attribute that is going to be changed + * @param attrSize attribute value storage size + * @param attrValue attribute value to set + * + * @retval InteractionModel::Status::Success if attribute change is possible + * @retval any other InteractionModel::Status value to forbid attribute change + */ +chip::Protocols::InteractionModel::Status emberAfPluginDoorLockOnUnhandledAttributeChange(chip::EndpointId EndpointId, + EmberAfAttributeType attrType, + uint16_t attrSize, uint8_t * attrValue); diff --git a/src/app/clusters/fixed-label-server/fixed-label-server.cpp b/src/app/clusters/fixed-label-server/fixed-label-server.cpp index fb57d67f24b4f5..76cf27dfa919ef 100644 --- a/src/app/clusters/fixed-label-server/fixed-label-server.cpp +++ b/src/app/clusters/fixed-label-server/fixed-label-server.cpp @@ -68,7 +68,7 @@ CHIP_ERROR FixedLabelAttrAccess::ReadLabelList(EndpointId endpoint, AttributeVal } else { - err = aEncoder.Encode(DataModel::List()); + err = aEncoder.EncodeEmptyList(); } return err; diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index 7a0d08fe73779f..4f7649194ab79e 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include using namespace chip; using namespace chip::app; @@ -104,17 +104,26 @@ bool emberAfGeneralCommissioningClusterArmFailSafeCallback(app::CommandHandler * { auto expiryLengthSeconds = System::Clock::Seconds16(commandData.expiryLengthSeconds); - CHIP_ERROR err = DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().ArmFailSafe(expiryLengthSeconds); + CHIP_ERROR err = DeviceLayer::DeviceControlServer::DeviceControlSvr().ArmFailSafe(expiryLengthSeconds); emberAfSendImmediateDefaultResponse(err == CHIP_NO_ERROR ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); return true; } +/** + * Pass fabric and nodeId of commissioner to DeviceControlSvr. + * This allows device to send messages back to commissioner. + * Once bindings are implemented, this may no longer be needed. + */ bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback( app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::CommissioningComplete::DecodableType & commandData) { - CHIP_ERROR err = DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().CommissioningComplete(); + SessionHandle handle = commandObj->GetExchangeContext()->GetSessionHandle(); + DeviceLayer::DeviceControlServer::DeviceControlSvr().SetFabricIndex(handle.GetFabricIndex()); + DeviceLayer::DeviceControlServer::DeviceControlSvr().SetPeerNodeId(handle.GetPeerNodeId()); + + CHIP_ERROR err = DeviceLayer::DeviceControlServer::DeviceControlSvr().CommissioningComplete(); emberAfSendImmediateDefaultResponse(err == CHIP_NO_ERROR ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); return true; @@ -128,8 +137,7 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(app::CommandH auto & countryCode = commandData.countryCode; auto & breadcrumb = commandData.breadcrumb; - CHIP_ERROR err = - DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().SetRegulatoryConfig(location, countryCode, breadcrumb); + CHIP_ERROR err = DeviceLayer::DeviceControlServer::DeviceControlSvr().SetRegulatoryConfig(location, countryCode, breadcrumb); emberAfSendImmediateDefaultResponse(err == CHIP_NO_ERROR ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp index a67a5b4f159b30..9283182c9d9dcf 100644 --- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp +++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.cpp @@ -101,7 +101,7 @@ CHIP_ERROR GeneralDiagosticsAttrAccess::ReadListIfSupported(CHIP_ERROR (Diagnost } else { - err = aEncoder.Encode(DataModel::List()); + err = aEncoder.EncodeEmptyList(); } return err; @@ -127,7 +127,7 @@ CHIP_ERROR GeneralDiagosticsAttrAccess::ReadNetworkInterfaces(AttributeValueEnco } else { - err = aEncoder.Encode(DataModel::List()); + err = aEncoder.EncodeEmptyList(); } return err; diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp new file mode 100644 index 00000000000000..386dc0872f3bd5 --- /dev/null +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -0,0 +1,547 @@ +/** + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::Credentials; +using namespace chip::app::Clusters; + +// +// Attributes +// + +namespace { + +struct GroupKeyCodec +{ + static constexpr TLV::Tag TagFabric() + { + return TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupKey::Fields::kFabricIndex)); + } + static constexpr TLV::Tag TagGroup() + { + return TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupKey::Fields::kGroupId)); + } + static constexpr TLV::Tag TagKeyset() + { + return TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupKey::Fields::kGroupKeySetID)); + } + + chip::FabricIndex mFabric = 0; + GroupDataProvider::GroupKey mMapping; + + GroupKeyCodec() = default; + GroupKeyCodec(chip::FabricIndex fabric_index, const GroupDataProvider::GroupKey & mapping) : + mFabric(fabric_index), mMapping(mapping) + {} + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const + { + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + + // FabricIndex + ReturnErrorOnFailure(DataModel::Encode(writer, TagFabric(), mFabric)); + // GroupId + ReturnErrorOnFailure(DataModel::Encode(writer, TagGroup(), mMapping.group_id)); + // GroupKeySetID + ReturnErrorOnFailure(DataModel::Encode(writer, TagKeyset(), mMapping.keyset_id)); + + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; + } + + CHIP_ERROR Decode(TLV::TLVReader & reader) + { + TLV::TLVType outer; + + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + + // FabricIndex + ReturnErrorOnFailure(reader.Next(TagFabric())); + ReturnErrorOnFailure(reader.Get(mFabric)); + // GroupId + ReturnErrorOnFailure(reader.Next(TagGroup())); + ReturnErrorOnFailure(reader.Get(mMapping.group_id)); + // GroupKeySetID + ReturnErrorOnFailure(reader.Next(TagKeyset())); + ReturnErrorOnFailure(reader.Get(mMapping.keyset_id)); + + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; + } +}; + +struct GroupTableCodec +{ + static constexpr TLV::Tag TagFabric() + { + return TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupInfo::Fields::kFabricIndex)); + } + static constexpr TLV::Tag TagGroup() + { + return TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupInfo::Fields::kGroupId)); + } + static constexpr TLV::Tag TagEndpoints() + { + return TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupInfo::Fields::kEndpoints)); + } + static constexpr TLV::Tag TagGroupName() + { + return TLV::ContextTag(to_underlying(GroupKeyManagement::Structs::GroupInfo::Fields::kGroupName)); + } + + GroupDataProvider * mProvider = nullptr; + chip::FabricIndex mFabric; + GroupDataProvider::GroupInfo mInfo; + + GroupTableCodec(GroupDataProvider * provider, chip::FabricIndex fabric_index, GroupDataProvider::GroupInfo & info) : + mProvider(provider), mFabric(fabric_index), mInfo(info) + {} + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const + { + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + + // FabricIndex + ReturnErrorOnFailure(DataModel::Encode(writer, TagFabric(), mFabric)); + // GroupId + ReturnErrorOnFailure(DataModel::Encode(writer, TagGroup(), mInfo.group_id)); + // Endpoints + TLV::TLVType inner; + ReturnErrorOnFailure(writer.StartContainer(TagEndpoints(), TLV::kTLVType_Array, inner)); + GroupDataProvider::GroupEndpoint mapping; + auto iter = mProvider->IterateEndpoints(mFabric); + if (nullptr != iter) + { + while (iter->Next(mapping)) + { + if (mapping.group_id == mInfo.group_id) + { + ReturnErrorOnFailure(writer.Put(TLV::AnonymousTag(), static_cast(mapping.endpoint_id))); + } + } + iter->Release(); + } + ReturnErrorOnFailure(writer.EndContainer(inner)); + // GroupName + uint32_t name_size = static_cast(strnlen(mInfo.name, GroupDataProvider::GroupInfo::kGroupNameMax)); + ReturnErrorOnFailure(writer.PutString(TagGroupName(), mInfo.name, name_size)); + + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; + } +}; + +class GroupKeyManagementAttributeAccess : public AttributeAccessInterface +{ +public: + // Register for the GroupKeyManagement cluster on all endpoints. + GroupKeyManagementAttributeAccess() : AttributeAccessInterface(Optional(0), GroupKeyManagement::Id) {} + + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override + { + VerifyOrDie(aPath.mClusterId == GroupKeyManagement::Id); + + switch (aPath.mAttributeId) + { + case GroupKeyManagement::Attributes::ClusterRevision::Id: + return ReadClusterRevision(aPath.mEndpointId, aEncoder); + case GroupKeyManagement::Attributes::GroupKeyMap::Id: + return ReadGroupKeyMap(aPath.mEndpointId, aEncoder); + case GroupKeyManagement::Attributes::GroupTable::Id: + return ReadGroupTable(aPath.mEndpointId, aEncoder); + case GroupKeyManagement::Attributes::MaxGroupsPerFabric::Id: + return ReadMaxGroupsPerFabric(aPath.mEndpointId, aEncoder); + case GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::Id: + return ReadMaxGroupKeysPerFabric(aPath.mEndpointId, aEncoder); + default: + break; + } + return CHIP_ERROR_READ_FAILED; + } + + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override + { + + if (GroupKeyManagement::Attributes::GroupKeyMap::Id == aPath.mAttributeId) + { + return WriteGroupKeyMap(aPath.mEndpointId, aDecoder); + } + return CHIP_ERROR_WRITE_FAILED; + } + +private: + static constexpr uint16_t kClusterRevision = 1; + + CHIP_ERROR ReadClusterRevision(EndpointId endpoint, AttributeValueEncoder & aEncoder) + { + return aEncoder.Encode(kClusterRevision); + } + CHIP_ERROR ReadGroupKeyMap(EndpointId endpoint, AttributeValueEncoder & aEncoder) + { + auto fabric_index = aEncoder.AccessingFabricIndex(); + auto provider = GetGroupDataProvider(); + VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); + + CHIP_ERROR err = aEncoder.EncodeList([provider, fabric_index](const auto & encoder) -> CHIP_ERROR { + auto iter = provider->IterateGroupKeys(fabric_index); + VerifyOrReturnError(nullptr != iter, CHIP_ERROR_NO_MEMORY); + + GroupDataProvider::GroupKey mapping; + while (iter->Next(mapping)) + { + encoder.Encode(GroupKeyCodec(fabric_index, mapping)); + } + iter->Release(); + return CHIP_NO_ERROR; + }); + return err; + } + + CHIP_ERROR WriteGroupKeyMap(EndpointId endpoint, AttributeValueDecoder & aDecoder) + { + auto fabric_index = aDecoder.AccessingFabricIndex(); + auto provider = GetGroupDataProvider(); + DataModel::DecodableList list; + size_t new_count; + + VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); + ReturnErrorOnFailure(aDecoder.Decode(list)); + ReturnErrorOnFailure(list.ComputeSize(&new_count)); + + // Remove existing keys + ReturnErrorOnFailure(provider->RemoveGroupKeys(fabric_index)); + + // Add the new keys + auto iter = list.begin(); + size_t i = 0; + while (iter.Next()) + { + const GroupKeyCodec & value = iter.GetValue(); + VerifyOrReturnError(fabric_index == value.mFabric, CHIP_ERROR_INVALID_FABRIC_ID); + ReturnErrorOnFailure(provider->SetGroupKeyAt(value.mFabric, i++, value.mMapping)); + } + ReturnErrorOnFailure(iter.GetStatus()); + return CHIP_NO_ERROR; + } + + CHIP_ERROR ReadGroupTable(EndpointId endpoint, AttributeValueEncoder & aEncoder) + { + auto fabric_index = aEncoder.AccessingFabricIndex(); + auto provider = GetGroupDataProvider(); + VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); + + CHIP_ERROR err = aEncoder.EncodeList([provider, fabric_index](const auto & encoder) -> CHIP_ERROR { + auto iter = provider->IterateGroupInfo(fabric_index); + VerifyOrReturnError(nullptr != iter, CHIP_ERROR_NO_MEMORY); + + GroupDataProvider::GroupInfo info; + while (iter->Next(info)) + { + encoder.Encode(GroupTableCodec(provider, fabric_index, info)); + } + iter->Release(); + return CHIP_NO_ERROR; + }); + return err; + } + CHIP_ERROR ReadMaxGroupsPerFabric(EndpointId endpoint, AttributeValueEncoder & aEncoder) + { + auto * provider = GetGroupDataProvider(); + VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); + return aEncoder.Encode(provider->GetMaxGroupsPerFabric()); + } + CHIP_ERROR ReadMaxGroupKeysPerFabric(EndpointId endpoint, AttributeValueEncoder & aEncoder) + { + auto * provider = GetGroupDataProvider(); + VerifyOrReturnError(nullptr != provider, CHIP_ERROR_INTERNAL); + return aEncoder.Encode(provider->GetMaxGroupKeysPerFabric()); + } +}; + +constexpr uint16_t GroupKeyManagementAttributeAccess::kClusterRevision; + +GroupKeyManagementAttributeAccess gAttribute; + +} // anonymous namespace + +void MatterGroupKeyManagementPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gAttribute); +} + +// +// Commands +// + +void emberAfGroupKeyManagementClusterServerInitCallback(chip::EndpointId endpoint) {} + +bool emberAfGroupKeyManagementClusterKeySetWriteCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::DecodableType & commandData) +{ + auto fabric = commandObj->GetAccessingFabricIndex(); + auto * provider = GetGroupDataProvider(); + + if (nullptr == provider) + { + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + return true; + } + + if (commandData.groupKeySet.epochKey0.empty() || (0 == commandData.groupKeySet.epochStartTime0)) + { + // If the EpochKey0 field is null or its associated EpochStartTime0 field is null, + // then this command SHALL fail with an INVALID_COMMAND + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_COMMAND); + return true; + } + + GroupDataProvider::KeySet keyset(commandData.groupKeySet.groupKeySetID, commandData.groupKeySet.securityPolicy, 0); + + // Epoch Key 0 + keyset.epoch_keys[0].start_time = commandData.groupKeySet.epochStartTime0; + memcpy(keyset.epoch_keys[0].key, commandData.groupKeySet.epochKey0.data(), GroupDataProvider::EpochKey::kLengthBytes); + keyset.num_keys_used++; + + // Epoch Key 1 + if (!commandData.groupKeySet.epochKey1.empty()) + { + if (commandData.groupKeySet.epochStartTime1 <= commandData.groupKeySet.epochStartTime0) + { + // If the EpochKey1 field is not null, its associated EpochStartTime1 field SHALL contain + // a later epoch start time than the epoch start time found in the EpochStartTime0 field. + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_COMMAND); + return true; + } + keyset.epoch_keys[1].start_time = commandData.groupKeySet.epochStartTime1; + memcpy(keyset.epoch_keys[1].key, commandData.groupKeySet.epochKey1.data(), GroupDataProvider::EpochKey::kLengthBytes); + keyset.num_keys_used++; + } + + // Epoch Key 2 + if (!commandData.groupKeySet.epochKey2.empty()) + { + keyset.num_keys_used++; + if (commandData.groupKeySet.epochStartTime2 <= commandData.groupKeySet.epochStartTime1) + { + // If the EpochKey1 field is not null, its associated EpochStartTime1 field SHALL contain + // a later epoch start time than the epoch start time found in the EpochStartTime0 field. + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_COMMAND); + return true; + } + keyset.epoch_keys[2].start_time = commandData.groupKeySet.epochStartTime2; + memcpy(keyset.epoch_keys[2].key, commandData.groupKeySet.epochKey2.data(), GroupDataProvider::EpochKey::kLengthBytes); + keyset.num_keys_used++; + } + + // Set KeySet + CHIP_ERROR err = provider->SetKeySet(fabric, keyset); + if (CHIP_NO_ERROR == err) + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetWrite OK"); + } + else + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetWrite: %s", err.AsString()); + } + + // Send response + EmberStatus status = + emberAfSendImmediateDefaultResponse(CHIP_NO_ERROR == err ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); + if (EMBER_SUCCESS != status) + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetWrite failed: 0x%x", status); + } + return true; +} + +bool emberAfGroupKeyManagementClusterKeySetReadCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::DecodableType & commandData) +{ + auto fabric = commandObj->GetAccessingFabricIndex(); + auto * provider = GetGroupDataProvider(); + + if (nullptr == provider) + { + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + return true; + } + + GroupDataProvider::KeySet keyset; + if (CHIP_NO_ERROR != provider->GetKeySet(fabric, commandData.groupKeySetID, keyset)) + { + // KeySet ID not found + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_NOT_FOUND); + return true; + } + + GroupKeyManagement::Commands::KeySetReadResponse::Type response; + response.groupKeySet.groupKeySetID = keyset.keyset_id; + response.groupKeySet.securityPolicy = keyset.policy; + // Keyset 0 + if (keyset.num_keys_used > 0) + { + response.groupKeySet.epochStartTime0 = keyset.epoch_keys[0].start_time; + response.groupKeySet.epochKey0 = chip::ByteSpan(keyset.epoch_keys[0].key, GroupDataProvider::EpochKey::kLengthBytes); + } + else + { + response.groupKeySet.epochStartTime0 = 0; + response.groupKeySet.epochKey0 = chip::ByteSpan(nullptr, 0); + } + // Keyset 1 + if (keyset.num_keys_used > 1) + { + response.groupKeySet.epochStartTime1 = keyset.epoch_keys[1].start_time; + response.groupKeySet.epochKey1 = chip::ByteSpan(keyset.epoch_keys[1].key, GroupDataProvider::EpochKey::kLengthBytes); + } + else + { + response.groupKeySet.epochStartTime1 = 0; + response.groupKeySet.epochKey1 = chip::ByteSpan(nullptr, 0); + } + // Keyset 2 + if (keyset.num_keys_used > 2) + { + response.groupKeySet.epochStartTime2 = keyset.epoch_keys[2].start_time; + response.groupKeySet.epochKey2 = chip::ByteSpan(keyset.epoch_keys[2].key, GroupDataProvider::EpochKey::kLengthBytes); + } + else + { + response.groupKeySet.epochStartTime2 = 0; + response.groupKeySet.epochKey2 = chip::ByteSpan(nullptr, 0); + } + + CHIP_ERROR err = commandObj->AddResponseData(commandPath, response); + if (CHIP_NO_ERROR != err) + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetRead failed: %s", ErrorStr(err)); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; +} + +bool emberAfGroupKeyManagementClusterKeySetRemoveCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::DecodableType & commandData) + +{ + auto fabric = commandObj->GetAccessingFabricIndex(); + auto * provider = GetGroupDataProvider(); + EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; + + if (nullptr != provider) + { + // Remove keyset + CHIP_ERROR err = provider->RemoveKeySet(fabric, commandData.groupKeySetID); + if (CHIP_ERROR_KEY_NOT_FOUND == err) + { + status = EMBER_ZCL_STATUS_NOT_FOUND; + } + else if (CHIP_NO_ERROR == err) + { + status = EMBER_ZCL_STATUS_SUCCESS; + } + } + + // Send response + EmberStatus send_status = emberAfSendImmediateDefaultResponse(status); + if (EMBER_SUCCESS != send_status) + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetRemove failed: 0x%x", send_status); + } + return true; +} + +struct KeySetReadAllIndicesResponse +{ + static constexpr CommandId GetCommandId() { return GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::Id; } + static constexpr ClusterId GetClusterId() { return GroupKeyManagement::Id; } + + GroupDataProvider::KeySetIterator * mIterator = nullptr; + + KeySetReadAllIndicesResponse(GroupDataProvider::KeySetIterator * iter) : mIterator(iter) {} + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const + { + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + + TLV::TLVType array; + ReturnErrorOnFailure(writer.StartContainer( + TLV::ContextTag(to_underlying(GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::Fields::kGroupKeySetIDs)), + TLV::kTLVType_Array, array)); + + GroupDataProvider::KeySet keyset; + while (mIterator && mIterator->Next(keyset)) + { + ReturnErrorOnFailure(app::DataModel::Encode(writer, TLV::AnonymousTag(), keyset.keyset_id)); + } + + ReturnErrorOnFailure(writer.EndContainer(array)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; + } +}; + +bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::DecodableType & commandData) +{ + auto fabric = commandObj->GetAccessingFabricIndex(); + auto * provider = GetGroupDataProvider(); + + if (nullptr == provider) + { + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + return true; + } + + auto keysIt = provider->IterateKeySets(fabric); + if (nullptr == keysIt) + { + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + return true; + } + + CHIP_ERROR err = commandObj->AddResponseData(commandPath, KeySetReadAllIndicesResponse(keysIt)); + if (CHIP_NO_ERROR != err) + { + ChipLogDetail(Zcl, "GroupKeyManagementCluster: KeySetReadAllIndices failed: %s", ErrorStr(err)); + } + keysIt->Release(); + return true; +} diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index e1c954fa841b19..755032c7ce7223 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -237,7 +237,7 @@ struct GroupMembershipResponse { if (mapping.endpoint_id == mEndpoint) { - ReturnErrorOnFailure(app::DataModel::Encode(writer, TLV::AnonymousTag, mapping.group_id)); + ReturnErrorOnFailure(app::DataModel::Encode(writer, TLV::AnonymousTag(), mapping.group_id)); matchCount++; ChipLogDetail(Zcl, " 0x%02" PRIx16, mapping.group_id); } @@ -252,7 +252,7 @@ struct GroupMembershipResponse { if (mapping.endpoint_id == mEndpoint && mapping.group_id == iter.GetValue()) { - ReturnErrorOnFailure(app::DataModel::Encode(writer, TLV::AnonymousTag, mapping.group_id)); + ReturnErrorOnFailure(app::DataModel::Encode(writer, TLV::AnonymousTag(), mapping.group_id)); matchCount++; ChipLogDetail(Zcl, " 0x%02" PRIx16, mapping.group_id); break; @@ -342,7 +342,6 @@ bool emberAfGroupsClusterRemoveAllGroupsCallback(app::CommandHandler * commandOb #ifdef EMBER_AF_PLUGIN_SCENES { GroupDataProvider::EndpointIterator * iter = provider->IterateEndpoints(fabricIndex); - ; GroupDataProvider::GroupEndpoint mapping; VerifyOrExit(nullptr != iter, status = EMBER_ZCL_STATUS_FAILURE); diff --git a/src/app/clusters/ias-zone-server/ias-zone-server.cpp b/src/app/clusters/ias-zone-server/ias-zone-server.cpp index ab7f33f6bdf0bf..2c33be3a3987ae 100644 --- a/src/app/clusters/ias-zone-server/ias-zone-server.cpp +++ b/src/app/clusters/ias-zone-server/ias-zone-server.cpp @@ -149,7 +149,7 @@ static void resetCurrentQueueRetryParams(void) // Forward declarations static void setZoneId(EndpointId endpoint, uint8_t zoneId); -static bool areZoneServerAttributesTokenized(EndpointId endpoint); +static bool areZoneServerAttributesNonVolatile(EndpointId endpoint); static bool isValidEnrollmentMode(EmberAfIasZoneEnrollmentMode method); #if defined(EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ENABLE_QUEUE) static uint16_t computeElapsedTimeQs(IasZoneStatusQueueEntry * entry); @@ -540,7 +540,7 @@ void emberAfPluginIasZoneServerManageQueueEventHandler(void) void emberAfIasZoneClusterServerInitCallback(EndpointId endpoint) { EmberAfIasZoneType zoneType; - if (!areZoneServerAttributesTokenized(endpoint)) + if (!areZoneServerAttributesNonVolatile(endpoint)) { emberAfAppPrint("WARNING: ATTRIBUTES ARE NOT BEING STORED IN FLASH! "); emberAfAppPrintln("DEVICE WILL NOT FUNCTION PROPERLY AFTER REBOOTING!!"); @@ -587,37 +587,37 @@ uint8_t emberAfPluginIasZoneServerGetZoneId(EndpointId endpoint) // // This function will verify that all attributes necessary for the IAS zone // server to properly retain functionality through a power failure are -// tokenized. +// non-volatile. // //------------------------------------------------------------------------------ -static bool areZoneServerAttributesTokenized(EndpointId endpoint) +static bool areZoneServerAttributesNonVolatile(EndpointId endpoint) { EmberAfAttributeMetadata * metadata; metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE); - if (!emberAfAttributeIsTokenized(metadata)) + if (!metadata->IsNonVolatile()) { return false; } metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_STATE_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE); - if (!emberAfAttributeIsTokenized(metadata)) + if (!metadata->IsNonVolatile()) { return false; } metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_TYPE_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE); - if (!emberAfAttributeIsTokenized(metadata)) + if (!metadata->IsNonVolatile()) { return false; } metadata = emberAfLocateAttributeMetadata(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_ID_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE); - if (!emberAfAttributeIsTokenized(metadata)) + if (!metadata->IsNonVolatile()) { return false; } @@ -801,7 +801,7 @@ void emberAfIasZoneClusterServerMessageSentCallback(const MessageSendDestination // If a change status change notification command is not received by the // client, delay the option specified amount of time and try to resend it. // The event handler will perform the retransmit per the preset queue retry - // parameteres, and the original send request will handle populating the buffer. + // parameters, and the original send request will handle populating the buffer. // Do not try to retransmit again if the maximum number of retries attempts // is reached, this is however discarded if configured for unlimited retries. if ((status == EMBER_DELIVERY_FAILED) && diff --git a/examples/tv-app/android/include/application-basic/Application.h b/src/app/clusters/keypad-input-server/keypad-input-delegate.h similarity index 58% rename from examples/tv-app/android/include/application-basic/Application.h rename to src/app/clusters/keypad-input-server/keypad-input-delegate.h index 5de748b900ff38..633b9a4cfa2f87 100644 --- a/examples/tv-app/android/include/application-basic/Application.h +++ b/src/app/clusters/keypad-input-server/keypad-input-delegate.h @@ -20,16 +20,25 @@ #include -struct Application +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace KeypadInput { + +/** @brief + * Defines methods for implementing application-specific logic for the Keypad Input Cluster. + */ +class Delegate { - using ApplicationBasicStatus = chip::app::Clusters::ApplicationBasic::ApplicationBasicStatus; - char vendorName[32] = ""; - char name[32] = ""; - char id[32] = ""; - char version[32] = ""; - uint16_t vendorId = 0; - uint16_t productId = 0; - uint16_t catalogVendorId = 0; - uint16_t allowedVendorList[32] = { 123, 456 }; - ApplicationBasicStatus status = ApplicationBasicStatus::kStopped; +public: + virtual Commands::SendKeyResponse::Type HandleSendKey(const CecKeyCode & keyCode) = 0; + + virtual ~Delegate() = default; }; + +} // namespace KeypadInput +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp index 026eca546dc61e..bd97df20f97fc1 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp +++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp @@ -21,47 +21,89 @@ ******************************************************************************* ******************************************************************************/ -#include -#include -#include -#include -#include +#include +#include + #include #include -#include +#include using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::KeypadInput; -EmberAfKeypadInputStatus keypadInputClusterSendKey(EmberAfKeypadInputCecKeyCode keyCode); +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::KeypadInput::Delegate; + +namespace { + +Delegate * gDelegateTable[EMBER_AF_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::KeypadInput::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} -static void sendResponse(app::CommandHandler * command, EmberAfKeypadInputStatus keypadInputStatus) +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) { - CHIP_ERROR err = CHIP_NO_ERROR; - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), KeypadInput::Id, KeypadInput::Commands::SendKeyResponse::Id }; - TLV::TLVWriter * writer = nullptr; + if (delegate == nullptr) + { + ChipLogError(Zcl, "Keypad Input has no delegate set for endpoint:%" PRIu16, endpoint); + return true; + } + return false; +} +} // namespace - VerifyOrExit(command != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - SuccessOrExit(err = command->PrepareCommand(path)); - VerifyOrExit((writer = command->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - SuccessOrExit(err = writer->Put(TLV::ContextTag(0), keypadInputStatus)); - SuccessOrExit(err = command->FinishCommand()); +namespace chip { +namespace app { +namespace Clusters { +namespace KeypadInput { -exit: - if (err != CHIP_NO_ERROR) +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::KeypadInput::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else { - ChipLogError(Zcl, "Failed to encode KeypadInputResponse command. Error:%s", ErrorStr(err)); } } -bool emberAfKeypadInputClusterSendKeyCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::SendKey::DecodableType & commandData) +} // namespace KeypadInput +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +bool emberAfKeypadInputClusterSendKeyRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::SendKeyRequest::DecodableType & commandData) { - auto & keyCode = commandData.keyCode; + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & keyCode = commandData.keyCode; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + { + Commands::SendKeyResponse::Type response = delegate->HandleSendKey(keyCode); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } - EmberAfKeypadInputStatus status = keypadInputClusterSendKey(static_cast(keyCode)); - sendResponse(command, status); +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfKeypadInputClusterSendKeyRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } return true; } diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.h b/src/app/clusters/keypad-input-server/keypad-input-server.h new file mode 100644 index 00000000000000..e73552e6700ff9 --- /dev/null +++ b/src/app/clusters/keypad-input-server/keypad-input-server.h @@ -0,0 +1,39 @@ +/** + * + * 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. + */ +/**************************************************************************** + * @file + * @brief Routines for the Keypad Input plugin, the + *server implementation of the Keypad Input cluster. + ******************************************************************************* + ******************************************************************************/ + +#pragma once + +#include "keypad-input-delegate.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace KeypadInput { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace KeypadInput +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 7e0b574bc994f7..c27def0d8c5c03 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -70,7 +70,7 @@ using namespace chip::app::Clusters; using namespace chip::app::Clusters::LevelControl; #ifdef ZCL_USING_LEVEL_CONTROL_CLUSTER_START_UP_CURRENT_LEVEL_ATTRIBUTE -static bool areStartUpLevelControlServerAttributesTokenized(EndpointId endpoint); +static bool areStartUpLevelControlServerAttributesNonVolatile(EndpointId endpoint); #endif #if (EMBER_AF_PLUGIN_LEVEL_CONTROL_RATE == 0) @@ -970,8 +970,8 @@ void emberAfOnOffClusterLevelControlEffectCallback(EndpointId endpoint, bool new void emberAfLevelControlClusterServerInitCallback(EndpointId endpoint) { #ifdef ZCL_USING_LEVEL_CONTROL_CLUSTER_START_UP_CURRENT_LEVEL_ATTRIBUTE - // StartUp behavior relies StartUpCurrentLevel attributes being tokenized. - if (areStartUpLevelControlServerAttributesTokenized(endpoint)) + // StartUp behavior relies StartUpCurrentLevel attributes being non-volatile. + if (areStartUpLevelControlServerAttributesNonVolatile(endpoint)) { // Read the StartUpOnOff attribute and set the OnOff attribute as per // following from zcl 7 14-0127-20i-zcl-ch-3-general.doc. @@ -1030,20 +1030,20 @@ void emberAfLevelControlClusterServerInitCallback(EndpointId endpoint) } #ifdef ZCL_USING_LEVEL_CONTROL_CLUSTER_START_UP_CURRENT_LEVEL_ATTRIBUTE -static bool areStartUpLevelControlServerAttributesTokenized(EndpointId endpoint) +static bool areStartUpLevelControlServerAttributesNonVolatile(EndpointId endpoint) { EmberAfAttributeMetadata * metadata; metadata = emberAfLocateAttributeMetadata(endpoint, LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE); - if (!emberAfAttributeIsTokenized(metadata)) + if (!metadata->IsNonVolatile()) { return false; } metadata = emberAfLocateAttributeMetadata(endpoint, LevelControl::Id, ZCL_START_UP_CURRENT_LEVEL_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE); - if (!emberAfAttributeIsTokenized(metadata)) + if (!metadata->IsNonVolatile()) { return false; } diff --git a/examples/ota-requestor-app/esp32/main/include/OTARequesterImpl.h b/src/app/clusters/low-power-server/low-power-delegate.h similarity index 60% rename from examples/ota-requestor-app/esp32/main/include/OTARequesterImpl.h rename to src/app/clusters/low-power-server/low-power-delegate.h index 01fb7c701dba0e..75b0ba2771cb67 100644 --- a/examples/ota-requestor-app/esp32/main/include/OTARequesterImpl.h +++ b/src/app/clusters/low-power-server/low-power-delegate.h @@ -1,6 +1,7 @@ /* * * 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. @@ -14,23 +15,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#pragma once -class OTARequesterImpl -{ -public: - static OTARequesterImpl & GetInstance(void) - { - static OTARequesterImpl instance; - return instance; - } +#pragma once - void SendQueryImageCommand(const char * ipAddress, uint32_t nodeId); +#include - void SendApplyUpdateRequestCommand(const char * ipAddress, uint32_t nodeId); +namespace chip { +namespace app { +namespace Clusters { +namespace LowPower { - void SendNotifyUpdateAppliedCommand(const char * ipAddress, uint32_t nodeId); +/** @brief + * Defines methods for implementing application-specific logic for the Low Power Cluster. + */ +class Delegate +{ +public: + virtual bool HandleSleep() = 0; -private: - OTARequesterImpl() {} + virtual ~Delegate() = default; }; + +} // namespace LowPower +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/low-power-server/low-power-server.cpp b/src/app/clusters/low-power-server/low-power-server.cpp index 59fb42b2c42bc5..9f43fb3a3604b3 100644 --- a/src/app/clusters/low-power-server/low-power-server.cpp +++ b/src/app/clusters/low-power-server/low-power-server.cpp @@ -18,11 +18,13 @@ /**************************************************************************** * @file * @brief Routines for the Low Power plugin, the - *server implementation of the Low power cluster. + *server implementation of the Low Power cluster. ******************************************************************************* ******************************************************************************/ -#include +#include +#include + #include #include #include @@ -30,12 +32,71 @@ using namespace chip; using namespace chip::app::Clusters::LowPower; -bool lowPowerClusterSleep(); +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::LowPower::Delegate; + +namespace { + +Delegate * gDelegateTable[EMBER_AF_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::LowPower::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) + { + ChipLogError(Zcl, "LowPower has no delegate set for endpoint:%" PRIu16, endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace LowPower { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::LowPower::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace LowPower +} // namespace Clusters +} // namespace app +} // namespace chip bool emberAfLowPowerClusterSleepCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, const Commands::Sleep::DecodableType & commandData) { - bool success = lowPowerClusterSleep(); + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfLowPowerClusterSleepCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + + bool success = delegate->HandleSleep(); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; diff --git a/src/app/clusters/low-power-server/low-power-server.h b/src/app/clusters/low-power-server/low-power-server.h new file mode 100644 index 00000000000000..27ca2bc8ae8ab7 --- /dev/null +++ b/src/app/clusters/low-power-server/low-power-server.h @@ -0,0 +1,38 @@ +/** + * + * 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. + */ +/**************************************************************************** + * @file + * @brief Routines for the Low Power plugin, the + *server implementation of the Low Power cluster. + ******************************************************************************* + ******************************************************************************/ + +#pragma once + +#include "low-power-delegate.h" + +namespace chip { +namespace app { +namespace Clusters { +namespace LowPower { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace LowPower +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/media-input-server/media-input-delegate.h b/src/app/clusters/media-input-server/media-input-delegate.h new file mode 100644 index 00000000000000..b596a9c5e58b2f --- /dev/null +++ b/src/app/clusters/media-input-server/media-input-delegate.h @@ -0,0 +1,50 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace MediaInput { + +/** @brief + * Defines methods for implementing application-specific logic for the Media Input Cluster. + */ +class Delegate +{ +public: + virtual std::list HandleGetInputList() = 0; + virtual uint8_t HandleGetCurrentInput() = 0; + virtual bool HandleSelectInput(const uint8_t index) = 0; + virtual bool HandleShowInputStatus() = 0; + virtual bool HandleHideInputStatus() = 0; + virtual bool HandleRenameInput(const uint8_t index, const chip::CharSpan & name) = 0; + + virtual ~Delegate() = default; +}; + +} // namespace MediaInput +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/media-input-server/media-input-server.cpp b/src/app/clusters/media-input-server/media-input-server.cpp index 8f3149ef899265..896a759ba0a758 100644 --- a/src/app/clusters/media-input-server/media-input-server.cpp +++ b/src/app/clusters/media-input-server/media-input-server.cpp @@ -21,76 +21,230 @@ ******************************************************************************* ******************************************************************************/ -#include -#include +#include "media-input-server.h" +#include "media-input-delegate.h" + +#include #include #include -#include -#include +#include +#include using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::MediaInput; -bool mediaInputClusterSelectInput(uint8_t input); -bool mediaInputClusterShowInputStatus(); -bool mediaInputClusterHideInputStatus(); -bool mediaInputClusterRenameInput(uint8_t input, std::string name); +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::MediaInput::Delegate; + +namespace { -static void storeCurrentInput(EndpointId endpoint, uint8_t currentInput) +Delegate * gDelegateTable[EMBER_AF_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) { - EmberAfStatus status = Attributes::CurrentMediaInput::Set(endpoint, currentInput); - if (status != EMBER_ZCL_STATUS_SUCCESS) + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::MediaInput::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) { - ChipLogError(Zcl, "Failed to store media playback attribute."); + ChipLogError(Zcl, "Media Input has no delegate set for endpoint:%" PRIu16, endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace MediaInput { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::MediaInput::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace MediaInput +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Attribute Accessor Implementation + +namespace { + +class MediaInputAttrAccess : public app::AttributeAccessInterface +{ +public: + MediaInputAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::MediaInput::Id) {} + + CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadInputListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadCurrentInputAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); +}; + +MediaInputAttrAccess gMediaInputAttrAccess; + +CHIP_ERROR MediaInputAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +{ + EndpointId endpoint = aPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); + + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + switch (aPath.mAttributeId) + { + case app::Clusters::MediaInput::Attributes::MediaInputList::Id: { + return ReadInputListAttribute(aEncoder, delegate); + } + case app::Clusters::MediaInput::Attributes::CurrentMediaInput::Id: { + return ReadCurrentInputAttribute(aEncoder, delegate); } + default: { + break; + } + } + + return CHIP_NO_ERROR; } -bool emberAfMediaInputClusterSelectInputCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::SelectInput::DecodableType & commandData) +CHIP_ERROR MediaInputAttrAccess::ReadInputListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) { + std::list inputList = delegate->HandleGetInputList(); + return aEncoder.EncodeList([inputList](const auto & encoder) -> CHIP_ERROR { + for (const auto & input : inputList) + { + ReturnErrorOnFailure(encoder.Encode(input)); + } + return CHIP_NO_ERROR; + }); +} + +CHIP_ERROR MediaInputAttrAccess::ReadCurrentInputAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + uint8_t currentInput = delegate->HandleGetCurrentInput(); + return aEncoder.Encode(currentInput); +} + +} // anonymous namespace + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +bool emberAfMediaInputClusterSelectInputRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::SelectInputRequest::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & input = commandData.index; - bool success = mediaInputClusterSelectInput(input); - EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; - if (success) + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + +exit: + if (err != CHIP_NO_ERROR) { - storeCurrentInput(emberAfCurrentEndpoint(), input); + ChipLogError(Zcl, "emberAfMediaInputClusterSelectInputRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } + + bool success = delegate->HandleSelectInput(input); + EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; } -bool emberAfMediaInputClusterShowInputStatusCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::ShowInputStatus::DecodableType & commandData) +bool emberAfMediaInputClusterShowInputStatusRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::ShowInputStatusRequest::DecodableType & commandData) { - bool success = mediaInputClusterShowInputStatus(); + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaInputClusterShowInputStatusRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + + bool success = delegate->HandleShowInputStatus(); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; } -bool emberAfMediaInputClusterHideInputStatusCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::HideInputStatus::DecodableType & commandData) +bool emberAfMediaInputClusterHideInputStatusRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::HideInputStatusRequest::DecodableType & commandData) { - bool success = mediaInputClusterHideInputStatus(); + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaInputClusterHideInputStatusRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + + bool success = delegate->HandleHideInputStatus(); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; } -bool emberAfMediaInputClusterRenameInputCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::RenameInput::DecodableType & commandData) +bool emberAfMediaInputClusterRenameInputRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::RenameInputRequest::DecodableType & commandData) { - auto & input = commandData.index; - auto & name = commandData.name; + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & index = commandData.index; + auto & name = commandData.name; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaInputClusterRenameInputRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } - // TODO: char is not null terminated, verify this code once #7963 gets merged. - std::string nameString(name.data(), name.size()); - bool success = mediaInputClusterRenameInput(input, nameString); + bool success = delegate->HandleRenameInput(index, name); EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; emberAfSendImmediateDefaultResponse(status); return true; } -void MatterMediaInputPluginServerInitCallback() {} +void MatterMediaInputPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gMediaInputAttrAccess); +} diff --git a/src/app/clusters/media-input-server/media-input-server.h b/src/app/clusters/media-input-server/media-input-server.h new file mode 100644 index 00000000000000..12f45a0e8a1bbd --- /dev/null +++ b/src/app/clusters/media-input-server/media-input-server.h @@ -0,0 +1,39 @@ +/** + * + * 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. + */ +/**************************************************************************** + * @file + * @brief Routines for the Media Input plugin, the + *server implementation of the Media Input cluster. + ******************************************************************************* + ******************************************************************************/ + +#pragma once + +#include "media-input-delegate.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace MediaInput { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace MediaInput +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/media-playback-server/media-playback-delegate.h b/src/app/clusters/media-playback-server/media-playback-delegate.h new file mode 100644 index 00000000000000..ed7b43d1b3b98f --- /dev/null +++ b/src/app/clusters/media-playback-server/media-playback-delegate.h @@ -0,0 +1,63 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace MediaPlayback { + +/** @brief + * Defines methods for implementing application-specific logic for the Media Playback Cluster. + */ +class Delegate +{ +public: + virtual PlaybackStateEnum HandleGetCurrentState() = 0; + virtual uint64_t HandleGetStartTime() = 0; + virtual uint64_t HandleGetDuration() = 0; + virtual Structs::PlaybackPosition::Type HandleGetSampledPosition() = 0; + virtual float HandleGetPlaybackSpeed() = 0; + virtual uint64_t HandleGetSeekRangeStart() = 0; + virtual uint64_t HandleGetSeekRangeEnd() = 0; + + virtual Commands::PlaybackResponse::Type HandlePlay() = 0; + virtual Commands::PlaybackResponse::Type HandlePause() = 0; + virtual Commands::PlaybackResponse::Type HandleStop() = 0; + virtual Commands::PlaybackResponse::Type HandleFastForward() = 0; + virtual Commands::PlaybackResponse::Type HandlePrevious() = 0; + virtual Commands::PlaybackResponse::Type HandleRewind() = 0; + virtual Commands::PlaybackResponse::Type HandleSkipBackward(const uint64_t & deltaPositionMilliseconds) = 0; + virtual Commands::PlaybackResponse::Type HandleSkipForward(const uint64_t & deltaPositionMilliseconds) = 0; + virtual Commands::PlaybackResponse::Type HandleSeekRequest(const uint64_t & positionMilliseconds) = 0; + virtual Commands::PlaybackResponse::Type HandleNext() = 0; + virtual Commands::PlaybackResponse::Type HandleStartOverRequest() = 0; + + virtual ~Delegate() = default; +}; + +} // namespace MediaPlayback +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 3574f7822aa505..38746abdf612b5 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -22,175 +22,465 @@ ******************************************************************************* ******************************************************************************/ -#include -#include +#include +#include + +#include #include #include -#include -#include +#include +#include using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::MediaPlayback; -EmberAfMediaPlaybackStatus mediaPlaybackClusterSendMediaPlaybackRequest(MediaPlaybackRequest mediaPlaybackRequest, - uint64_t deltaPositionMilliseconds); +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::MediaPlayback::Delegate; + +namespace { + +Delegate * gDelegateTable[EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; -static void writePlaybackState(EndpointId endpoint, uint8_t playbackState) +Delegate * GetDelegate(EndpointId endpoint) { - EmberAfStatus status = Attributes::PlaybackState::Set(endpoint, playbackState); - if (status != EMBER_ZCL_STATUS_SUCCESS) + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::MediaPlayback::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) { - ChipLogError(Zcl, "Failed to store media playback attribute."); + ChipLogError(Zcl, "Media Playback has no delegate set for endpoint:%" PRIu16, endpoint); + return true; } + return false; } +} // namespace -static uint8_t readPlaybackStatus(EndpointId endpoint) +namespace chip { +namespace app { +namespace Clusters { +namespace MediaPlayback { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) { - uint8_t playbackState; - EmberAfStatus status = Attributes::PlaybackState::Get(endpoint, &playbackState); - if (status != EMBER_ZCL_STATUS_SUCCESS) + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::MediaPlayback::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else { - ChipLogError(Zcl, "Failed to read media playback attribute."); } - - return playbackState; } -void storeNewPlaybackState(EndpointId endpoint, uint8_t newPlaybackState) +} // namespace MediaPlayback +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Attribute Accessor Implementation + +namespace { + +class MediaPlaybackAttrAccess : public app::AttributeAccessInterface +{ +public: + MediaPlaybackAttrAccess() : + app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::MediaPlayback::Id) + {} + + CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadCurrentStateAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadStartTimeAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadDurationAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadSampledPositionAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadPlaybackSpeedAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadSeekRangeStartAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadSeekRangeEndAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); +}; + +MediaPlaybackAttrAccess gMediaPlaybackAttrAccess; + +CHIP_ERROR MediaPlaybackAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) { - uint8_t mediaPlaybackClusterPlaybackState = readPlaybackStatus(endpoint); + EndpointId endpoint = aPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); - if (mediaPlaybackClusterPlaybackState == newPlaybackState) + if (isDelegateNull(delegate, endpoint)) { - return; + return CHIP_NO_ERROR; } - else + + switch (aPath.mAttributeId) { - writePlaybackState(endpoint, newPlaybackState); + case app::Clusters::MediaPlayback::Attributes::PlaybackState::Id: { + return ReadCurrentStateAttribute(aEncoder, delegate); + } + case app::Clusters::MediaPlayback::Attributes::StartTime::Id: { + return ReadStartTimeAttribute(aEncoder, delegate); + } + case app::Clusters::MediaPlayback::Attributes::Duration::Id: { + return ReadDurationAttribute(aEncoder, delegate); + } + case app::Clusters::MediaPlayback::Attributes::Position::Id: { + return ReadSampledPositionAttribute(aEncoder, delegate); + } + case app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::Id: { + return ReadPlaybackSpeedAttribute(aEncoder, delegate); + } + case app::Clusters::MediaPlayback::Attributes::SeekRangeStart::Id: { + return ReadSeekRangeStartAttribute(aEncoder, delegate); + } + case app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::Id: { + return ReadSeekRangeEndAttribute(aEncoder, delegate); + } + default: { + break; + } } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR MediaPlaybackAttrAccess::ReadCurrentStateAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + chip::app::Clusters::MediaPlayback::PlaybackStateEnum currentState = delegate->HandleGetCurrentState(); + return aEncoder.Encode(currentState); +} + +CHIP_ERROR MediaPlaybackAttrAccess::ReadStartTimeAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + uint64_t startTime = delegate->HandleGetStartTime(); + return aEncoder.Encode(startTime); } -static void sendResponse(app::CommandHandler * command, const char * responseName, CommandId commandId, - EmberAfMediaPlaybackStatus mediaPlaybackStatus) +CHIP_ERROR MediaPlaybackAttrAccess::ReadDurationAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) { - CHIP_ERROR err = CHIP_NO_ERROR; - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), MediaPlayback::Id, commandId }; - TLV::TLVWriter * writer = nullptr; + uint64_t duration = delegate->HandleGetDuration(); + return aEncoder.Encode(duration); +} - VerifyOrExit(command != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - SuccessOrExit(err = command->PrepareCommand(path)); - VerifyOrExit((writer = command->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - SuccessOrExit(err = writer->Put(TLV::ContextTag(0), mediaPlaybackStatus)); - SuccessOrExit(err = command->FinishCommand()); +CHIP_ERROR MediaPlaybackAttrAccess::ReadSampledPositionAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + Structs::PlaybackPosition::Type sampledPosition = delegate->HandleGetSampledPosition(); + return aEncoder.Encode(sampledPosition); +} + +CHIP_ERROR MediaPlaybackAttrAccess::ReadPlaybackSpeedAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + float playbackSpeed = delegate->HandleGetPlaybackSpeed(); + return aEncoder.Encode(playbackSpeed); +} + +CHIP_ERROR MediaPlaybackAttrAccess::ReadSeekRangeStartAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + uint64_t seekRangeStart = delegate->HandleGetSeekRangeStart(); + return aEncoder.Encode(seekRangeStart); +} + +CHIP_ERROR MediaPlaybackAttrAccess::ReadSeekRangeEndAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + uint64_t seekRangeEnd = delegate->HandleGetSeekRangeEnd(); + return aEncoder.Encode(seekRangeEnd); +} + +} // anonymous namespace + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +bool emberAfMediaPlaybackClusterPlayRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::PlayRequest::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandlePlay(); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } exit: if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Failed to send %s. Error:%s", responseName, ErrorStr(err)); + ChipLogError(Zcl, "emberAfMediaPlaybackClusterPlayRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); } -} -bool emberAfMediaPlaybackClusterMediaPlayCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::MediaPlay::DecodableType & commandData) -{ - EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_PLAY, 0); - storeNewPlaybackState(emberAfCurrentEndpoint(), EMBER_ZCL_MEDIA_PLAYBACK_STATE_PLAYING); - sendResponse(command, "MediaPlayResponse", Commands::MediaPlayResponse::Id, status); return true; } -bool emberAfMediaPlaybackClusterMediaPauseCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::MediaPause::DecodableType & commandData) +bool emberAfMediaPlaybackClusterPauseRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::PauseRequest::DecodableType & commandData) { - EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_PAUSE, 0); - storeNewPlaybackState(emberAfCurrentEndpoint(), EMBER_ZCL_MEDIA_PLAYBACK_STATE_PAUSED); - sendResponse(command, "MediaPauseResponse", Commands::MediaPauseResponse::Id, status); + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandlePause(); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterPauseRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -bool emberAfMediaPlaybackClusterMediaStopCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::MediaStop::DecodableType & commandData) +bool emberAfMediaPlaybackClusterStopRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::StopRequest::DecodableType & commandData) { - EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_STOP, 0); - storeNewPlaybackState(emberAfCurrentEndpoint(), EMBER_ZCL_MEDIA_PLAYBACK_STATE_NOT_PLAYING); - sendResponse(command, "MediaStopResponse", Commands::MediaStopResponse::Id, status); + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandleStop(); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterStopRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -bool emberAfMediaPlaybackClusterMediaFastForwardCallback(app::CommandHandler * command, - const app::ConcreteCommandPath & commandPath, - const Commands::MediaFastForward::DecodableType & commandData) +bool emberAfMediaPlaybackClusterFastForwardRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::FastForwardRequest::DecodableType & commandData) { - EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_FAST_FORWARD, 0); - sendResponse(command, "MediaFastForward", Commands::MediaFastForwardResponse::Id, status); + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandleFastForward(); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterFastForwardRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -bool emberAfMediaPlaybackClusterMediaPreviousCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::MediaPrevious::DecodableType & commandData) +bool emberAfMediaPlaybackClusterPreviousRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::PreviousRequest::DecodableType & commandData) { - EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_PREVIOUS, 0); - sendResponse(command, "MediaPrevious", Commands::MediaPreviousResponse::Id, status); + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandlePrevious(); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterPreviousRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -bool emberAfMediaPlaybackClusterMediaRewindCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::MediaRewind::DecodableType & commandData) +bool emberAfMediaPlaybackClusterRewindRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::RewindRequest::DecodableType & commandData) { - EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_REWIND, 0); - sendResponse(command, "MediaRewind", Commands::MediaRewindResponse::Id, status); + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandleRewind(); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterRewindRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback(app::CommandHandler * command, - const app::ConcreteCommandPath & commandPath, - const Commands::MediaSkipBackward::DecodableType & commandData) +bool emberAfMediaPlaybackClusterSkipBackwardRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::SkipBackwardRequest::DecodableType & commandData) { + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & deltaPositionMilliseconds = commandData.deltaPositionMilliseconds; - EmberAfMediaPlaybackStatus status = - mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD, deltaPositionMilliseconds); - sendResponse(command, "MediaSkipBackward", Commands::MediaSkipBackwardResponse::Id, status); + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandleSkipBackward(deltaPositionMilliseconds); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterSkipBackwardRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -bool emberAfMediaPlaybackClusterMediaSkipForwardCallback(app::CommandHandler * command, - const app::ConcreteCommandPath & commandPath, - const Commands::MediaSkipForward::DecodableType & commandData) +bool emberAfMediaPlaybackClusterSkipForwardRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::SkipForwardRequest::DecodableType & commandData) { + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; auto & deltaPositionMilliseconds = commandData.deltaPositionMilliseconds; - EmberAfMediaPlaybackStatus status = - mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD, deltaPositionMilliseconds); - sendResponse(command, "MediaSkipForward", Commands::MediaSkipForwardResponse::Id, status); + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandleSkipForward(deltaPositionMilliseconds); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterSkipForwardRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -bool emberAfMediaPlaybackClusterMediaSeekCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::MediaSeek::DecodableType & commandData) +bool emberAfMediaPlaybackClusterSeekRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::SeekRequest::DecodableType & commandData) { + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; auto & positionMilliseconds = commandData.position; - EmberAfMediaPlaybackStatus status = - mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_SEEK, positionMilliseconds); - sendResponse(command, "MediaSeek", Commands::MediaSeekResponse::Id, status); + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandleSeekRequest(positionMilliseconds); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterSeekRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -bool emberAfMediaPlaybackClusterMediaNextCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::MediaNext::DecodableType & commandData) +bool emberAfMediaPlaybackClusterNextRequestCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, + const Commands::NextRequest::DecodableType & commandData) { - EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_NEXT, 0); - sendResponse(command, "MediaNext", Commands::MediaNextResponse::Id, status); + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandleNext(); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterNextRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -bool emberAfMediaPlaybackClusterMediaStartOverCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::MediaStartOver::DecodableType & commandData) + +bool emberAfMediaPlaybackClusterStartOverRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::StartOverRequest::DecodableType & commandData) { - EmberAfMediaPlaybackStatus status = mediaPlaybackClusterSendMediaPlaybackRequest(MEDIA_PLAYBACK_REQUEST_START_OVER, 0); - sendResponse(command, "MediaStartOver", Commands::MediaStartOverResponse::Id, status); + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::PlaybackResponse::Type response = delegate->HandleStartOverRequest(); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfMediaPlaybackClusterStartOverRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; } -void MatterMediaPlaybackPluginServerInitCallback() {} +void MatterMediaPlaybackPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gMediaPlaybackAttrAccess); +} diff --git a/src/app/clusters/media-playback-server/media-playback-server.h b/src/app/clusters/media-playback-server/media-playback-server.h index 94edf7ed6fd6cc..2befa118207396 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.h +++ b/src/app/clusters/media-playback-server/media-playback-server.h @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - /**************************************************************************** * @file * @brief Routines for the Media Playback plugin, the @@ -24,19 +23,17 @@ #pragma once -#include +#include "media-playback-delegate.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace MediaPlayback { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); -enum MediaPlaybackRequest : uint8_t -{ - MEDIA_PLAYBACK_REQUEST_PLAY = 0, - MEDIA_PLAYBACK_REQUEST_PAUSE = 1, - MEDIA_PLAYBACK_REQUEST_STOP = 2, - MEDIA_PLAYBACK_REQUEST_START_OVER = 3, - MEDIA_PLAYBACK_REQUEST_PREVIOUS = 4, - MEDIA_PLAYBACK_REQUEST_NEXT = 5, - MEDIA_PLAYBACK_REQUEST_REWIND = 6, - MEDIA_PLAYBACK_REQUEST_FAST_FORWARD = 7, - MEDIA_PLAYBACK_REQUEST_SKIP_FORWARD = 8, - MEDIA_PLAYBACK_REQUEST_SKIP_BACKWARD = 9, - MEDIA_PLAYBACK_REQUEST_SEEK = 10, -}; +} // namespace MediaPlayback +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/mode-select-server/mode-select-server.cpp b/src/app/clusters/mode-select-server/mode-select-server.cpp index affc49e641840e..67fd8e4718ede5 100644 --- a/src/app/clusters/mode-select-server/mode-select-server.cpp +++ b/src/app/clusters/mode-select-server/mode-select-server.cpp @@ -59,7 +59,7 @@ CHIP_ERROR ModeSelectAttrAccess::Read(const ConcreteReadAttributePath & aPath, A gSupportedModeManager->getModeOptionsProvider(aPath.mEndpointId); if (modeOptionsProvider.begin() == nullptr) { - aEncoder.Encode(DataModel::List()); + aEncoder.EncodeEmptyList(); return CHIP_NO_ERROR; } CHIP_ERROR err; diff --git a/src/app/clusters/mode-select-server/supported-modes-manager.h b/src/app/clusters/mode-select-server/supported-modes-manager.h index 4fb5bfb0c350c3..c7746888e24936 100644 --- a/src/app/clusters/mode-select-server/supported-modes-manager.h +++ b/src/app/clusters/mode-select-server/supported-modes-manager.h @@ -73,7 +73,7 @@ class SupportedModesManager * @param endpointId The endpoint for which to search the ModeOptionStruct. * @param mode The mode for which to search the ModeOptionStruct. * @param dataPtr The pointer to receive the ModeOptionStruct, if one is found. - * @return EMBER_ZCL_STATUS_SUCCESS if sucessfully found the option. Otherwise, returns appropriate status code (found in + * @return EMBER_ZCL_STATUS_SUCCESS if successfully found the option. Otherwise, returns appropriate status code (found in * ) */ virtual EmberAfStatus getModeOptionByMode(EndpointId endpointId, uint8_t mode, const ModeOptionStructType ** dataPtr) const = 0; diff --git a/src/app/clusters/network-commissioning/network-commissioning-ember.cpp b/src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp similarity index 100% rename from src/app/clusters/network-commissioning/network-commissioning-ember.cpp rename to src/app/clusters/network-commissioning-old/network-commissioning-ember.cpp diff --git a/src/app/clusters/network-commissioning-old/network-commissioning-old.cpp b/src/app/clusters/network-commissioning-old/network-commissioning-old.cpp new file mode 100644 index 00000000000000..556ad93e61a648 --- /dev/null +++ b/src/app/clusters/network-commissioning-old/network-commissioning-old.cpp @@ -0,0 +1,295 @@ + + +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "network-commissioning.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD + +// Include DeviceNetworkProvisioningDelegateImpl for WiFi provisioning. +// TODO: Enable wifi network should be done by ConnectivityManager. (Or other platform neutral interfaces) +#if defined(CHIP_DEVICE_LAYER_TARGET) +#define DEVICENETWORKPROVISIONING_HEADER +#include DEVICENETWORKPROVISIONING_HEADER +#endif + +// TODO: Configuration should move to build-time configuration +#ifndef CHIP_CLUSTER_NETWORK_COMMISSIONING_MAX_NETWORKS +#define CHIP_CLUSTER_NETWORK_COMMISSIONING_MAX_NETWORKS 4 +#endif // CHIP_CLUSTER_NETWORK_COMMISSIONING_MAX_NETWORKS + +using namespace chip; +using namespace chip::app; + +namespace chip { +namespace app { +namespace Clusters { +namespace NetworkCommissioning { + +constexpr uint8_t kMaxNetworkIDLen = 32; +constexpr uint8_t kMaxThreadDatasetLen = 254; // As defined in Thread spec. +constexpr uint8_t kMaxWiFiSSIDLen = 32; +constexpr uint8_t kMaxWiFiCredentialsLen = 64; +constexpr uint8_t kMaxNetworks = CHIP_CLUSTER_NETWORK_COMMISSIONING_MAX_NETWORKS; + +enum class NetworkType : uint8_t +{ + kUndefined = 0, + kWiFi = 1, + kThread = 2, + kEthernet = 3, +}; + +struct ThreadNetworkInfo +{ + uint8_t mDataset[kMaxThreadDatasetLen]; + uint8_t mDatasetLen; +}; + +struct WiFiNetworkInfo +{ + uint8_t mSSID[kMaxWiFiSSIDLen + 1]; + uint8_t mSSIDLen; + uint8_t mCredentials[kMaxWiFiCredentialsLen]; + uint8_t mCredentialsLen; +}; + +struct NetworkInfo +{ + uint8_t mNetworkID[kMaxNetworkIDLen]; + uint8_t mNetworkIDLen; + uint8_t mEnabled; + NetworkType mNetworkType; + union NetworkData + { +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + Thread::OperationalDataset mThread; +#endif +#if defined(CHIP_DEVICE_LAYER_TARGET) + WiFiNetworkInfo mWiFi; +#endif + } mData; +}; + +namespace { +// The internal network info containing credentials. Need to find some better place to save these info. +NetworkInfo sNetworks[kMaxNetworks]; +} // namespace + +void OnAddOrUpdateThreadNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler, + const app::ConcreteCommandPath & commandPath, ByteSpan operationalDataset, + uint64_t breadcrumb, uint32_t timeoutMs) +{ + Commands::NetworkConfigResponse::Type response; +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + NetworkCommissioningStatus err = NetworkCommissioningStatus::kBoundsExceeded; + + for (size_t i = 0; i < kMaxNetworks; i++) + { + if (sNetworks[i].mNetworkType == NetworkType::kUndefined) + { + Thread::OperationalDataset & dataset = sNetworks[i].mData.mThread; + CHIP_ERROR error = dataset.Init(operationalDataset); + + if (error != CHIP_NO_ERROR) + { + ChipLogDetail(Zcl, "Failed to parse Thread operational dataset: %s", ErrorStr(error)); + err = NetworkCommissioningStatus::kUnknownError; + break; + } + + uint8_t extendedPanId[Thread::kSizeExtendedPanId]; + + static_assert(sizeof(sNetworks[i].mNetworkID) >= sizeof(extendedPanId), + "Network ID must be larger than Thread extended PAN ID!"); + SuccessOrExit(dataset.GetExtendedPanId(extendedPanId)); + memcpy(sNetworks[i].mNetworkID, extendedPanId, sizeof(extendedPanId)); + sNetworks[i].mNetworkIDLen = sizeof(extendedPanId); + + sNetworks[i].mNetworkType = NetworkType::kThread; + sNetworks[i].mEnabled = false; + + err = NetworkCommissioningStatus::kSuccess; + break; + } + } + +exit: + // TODO: We should encode response command here. + + ChipLogDetail(Zcl, "AddOrUpdateThreadNetwork: %" PRIu8, to_underlying(err)); + response.networkingStatus = err; +#else + // The target does not supports ThreadNetwork. We should not add AddOrUpdateThreadNetwork command in that case then the upper + // layer will return "Command not found" error. + response.networkingStatus = NetworkCommissioningStatus::kUnknownError; +#endif + apCommandHandler->AddResponseData(commandPath, response); +} + +void OnAddOrUpdateWiFiNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler, + const app::ConcreteCommandPath & commandPath, ByteSpan ssid, + ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs) +{ + Commands::NetworkConfigResponse::Type response; +#if defined(CHIP_DEVICE_LAYER_TARGET) + NetworkCommissioningStatus err = NetworkCommissioningStatus::kBoundsExceeded; + + for (size_t i = 0; i < kMaxNetworks; i++) + { + if (sNetworks[i].mNetworkType == NetworkType::kUndefined) + { + VerifyOrExit(ssid.size() <= sizeof(sNetworks[i].mData.mWiFi.mSSID), err = NetworkCommissioningStatus::kOutOfRange); + memcpy(sNetworks[i].mData.mWiFi.mSSID, ssid.data(), ssid.size()); + + using WiFiSSIDLenType = decltype(sNetworks[i].mData.mWiFi.mSSIDLen); + VerifyOrExit(CanCastTo(ssid.size()), err = NetworkCommissioningStatus::kOutOfRange); + sNetworks[i].mData.mWiFi.mSSIDLen = static_cast(ssid.size()); + + VerifyOrExit(credentials.size() <= sizeof(sNetworks[i].mData.mWiFi.mCredentials), + err = NetworkCommissioningStatus::kOutOfRange); + memcpy(sNetworks[i].mData.mWiFi.mCredentials, credentials.data(), credentials.size()); + + using WiFiCredentialsLenType = decltype(sNetworks[i].mData.mWiFi.mCredentialsLen); + VerifyOrExit(CanCastTo(ssid.size()), err = NetworkCommissioningStatus::kOutOfRange); + sNetworks[i].mData.mWiFi.mCredentialsLen = static_cast(credentials.size()); + + VerifyOrExit(ssid.size() <= sizeof(sNetworks[i].mNetworkID), err = NetworkCommissioningStatus::kOutOfRange); + memcpy(sNetworks[i].mNetworkID, sNetworks[i].mData.mWiFi.mSSID, ssid.size()); + + using NetworkIDLenType = decltype(sNetworks[i].mNetworkIDLen); + VerifyOrExit(CanCastTo(ssid.size()), err = NetworkCommissioningStatus::kOutOfRange); + sNetworks[i].mNetworkIDLen = static_cast(ssid.size()); + + sNetworks[i].mNetworkType = NetworkType::kWiFi; + sNetworks[i].mEnabled = false; + + err = NetworkCommissioningStatus::kSuccess; + break; + } + } + + VerifyOrExit(err == NetworkCommissioningStatus::kSuccess, ); + + ChipLogDetail(Zcl, "WiFi provisioning data: SSID: %.*s", static_cast(ssid.size()), ssid.data()); +exit: + // TODO: We should encode response command here. + + ChipLogDetail(Zcl, "AddOrUpdateWiFiNetwork: %" PRIu8, to_underlying(err)); + response.networkingStatus = err; +#else + // The target does not supports WiFiNetwork. + // return "Command not found" error. + response.networkingStatus = NetworkCommissioningStatus::kUnknownError; +#endif + apCommandHandler->AddResponseData(commandPath, response); +} + +namespace { +CHIP_ERROR DoConnectNetwork(NetworkInfo * network) +{ + switch (network->mNetworkType) + { + case NetworkType::kThread: +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +// TODO: On linux, we are using Reset() instead of Detach() to disable thread network, which is not expected. +// Upstream issue: https://github.com/openthread/ot-br-posix/issues/755 +#if !CHIP_DEVICE_LAYER_TARGET_LINUX + ReturnErrorOnFailure(DeviceLayer::ThreadStackMgr().SetThreadEnabled(false)); +#endif + ReturnErrorOnFailure(DeviceLayer::ThreadStackMgr().SetThreadProvision(network->mData.mThread.AsByteSpan())); + ReturnErrorOnFailure(DeviceLayer::ThreadStackMgr().SetThreadEnabled(true)); +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif + break; + case NetworkType::kWiFi: +#if defined(CHIP_DEVICE_LAYER_TARGET) + { + // TODO: Currently, DeviceNetworkProvisioningDelegateImpl assumes that ssid and credentials are null terminated strings, + // which is not correct, this should be changed once we have better method for commissioning wifi networks. + DeviceLayer::DeviceNetworkProvisioningDelegateImpl deviceDelegate; + ReturnErrorOnFailure(deviceDelegate.ProvisionWiFi(reinterpret_cast(network->mData.mWiFi.mSSID), + reinterpret_cast(network->mData.mWiFi.mCredentials))); + break; + } +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif + break; + case NetworkType::kEthernet: + case NetworkType::kUndefined: + default: + return CHIP_ERROR_NOT_IMPLEMENTED; + } + network->mEnabled = true; + return CHIP_NO_ERROR; +} +} // namespace + +void OnConnectNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler, const app::ConcreteCommandPath & commandPath, + ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs) +{ + Commands::ConnectNetworkResponse::Type response; + size_t networkSeq; + NetworkCommissioningStatus err = NetworkCommissioningStatus::kNetworkIDNotFound; + + for (networkSeq = 0; networkSeq < kMaxNetworks; networkSeq++) + { + if (sNetworks[networkSeq].mNetworkIDLen == networkID.size() && + sNetworks[networkSeq].mNetworkType != NetworkType::kUndefined && + memcmp(sNetworks[networkSeq].mNetworkID, networkID.data(), networkID.size()) == 0) + { + // TODO: Currently, we cannot figure out the detailed error from network provisioning on DeviceLayer, we should + // implement this in device layer. + VerifyOrExit(DoConnectNetwork(&sNetworks[networkSeq]) == CHIP_NO_ERROR, + err = NetworkCommissioningStatus::kUnknownError); + ExitNow(err = NetworkCommissioningStatus::kSuccess); + } + } + // TODO: We should encode response command here. +exit: + if (err == NetworkCommissioningStatus::kSuccess) + { + DeviceLayer::DeviceControlServer::DeviceControlSvr().ConnectNetworkForOperational(networkID); + } + response.networkingStatus = err; + apCommandHandler->AddResponseData(commandPath, response); +} + +} // namespace NetworkCommissioning +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/network-commissioning-old/network-commissioning.h b/src/app/clusters/network-commissioning-old/network-commissioning.h new file mode 100644 index 00000000000000..6b389d8324c724 --- /dev/null +++ b/src/app/clusters/network-commissioning-old/network-commissioning.h @@ -0,0 +1,40 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace NetworkCommissioning { +void OnAddOrUpdateThreadNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath, + ByteSpan operationalDataset, uint64_t breadcrumb, uint32_t timeoutMs); +void OnAddOrUpdateWiFiNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath, + ByteSpan ssid, ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs); +void OnConnectNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath, + ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs); +} // namespace NetworkCommissioning + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index 14e3cd54575c47..50b276aa388d67 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -18,273 +18,415 @@ #include "network-commissioning.h" -#include -#include - -#include +#include +#include +#include +#include #include -#include #include -#include -#include -#include -#include - -#include - -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD -#include -#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD - -// Include DeviceNetworkProvisioningDelegateImpl for WiFi provisioning. -// TODO: Enable wifi network should be done by ConnectivityManager. (Or other platform neutral interfaces) -#if defined(CHIP_DEVICE_LAYER_TARGET) -#define DEVICENETWORKPROVISIONING_HEADER -#include DEVICENETWORKPROVISIONING_HEADER -#endif - -// TODO: Configuration should move to build-time configuration -#ifndef CHIP_CLUSTER_NETWORK_COMMISSIONING_MAX_NETWORKS -#define CHIP_CLUSTER_NETWORK_COMMISSIONING_MAX_NETWORKS 4 -#endif // CHIP_CLUSTER_NETWORK_COMMISSIONING_MAX_NETWORKS - -using namespace chip; -using namespace chip::app; +#include +#include +#include namespace chip { namespace app { namespace Clusters { namespace NetworkCommissioning { -constexpr uint8_t kMaxNetworkIDLen = 32; -constexpr uint8_t kMaxThreadDatasetLen = 254; // As defined in Thread spec. -constexpr uint8_t kMaxWiFiSSIDLen = 32; -constexpr uint8_t kMaxWiFiCredentialsLen = 64; -constexpr uint8_t kMaxNetworks = CHIP_CLUSTER_NETWORK_COMMISSIONING_MAX_NETWORKS; +using namespace DeviceLayer::NetworkCommissioning; -enum class NetworkType : uint8_t -{ - kUndefined = 0, - kWiFi = 1, - kThread = 2, - kEthernet = 3, -}; +namespace { +// For WiFi and Thread scan results, each item will cose ~60 bytes in TLV, thus 15 is a safe upper bound of scan results. +constexpr size_t kMaxNetworksInScanResponse = 15; -struct ThreadNetworkInfo +NetworkCommissioningStatus ToClusterObjectEnum(Status status) { - uint8_t mDataset[kMaxThreadDatasetLen]; - uint8_t mDatasetLen; -}; + // clang-format off + static_assert(to_underlying(NetworkCommissioningStatus::kSuccess ) == to_underlying(Status::kSuccess ), "kSuccess value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kOutOfRange ) == to_underlying(Status::kOutOfRange ), "kOutOfRange value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kBoundsExceeded ) == to_underlying(Status::kBoundsExceeded ), "kBoundsExceeded value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kNetworkIDNotFound ) == to_underlying(Status::kNetworkIDNotFound ), "kNetworkIDNotFound value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kDuplicateNetworkID ) == to_underlying(Status::kDuplicateNetworkID ), "kDuplicateNetworkID value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kNetworkNotFound ) == to_underlying(Status::kNetworkNotFound ), "kNetworkNotFound value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kRegulatoryError ) == to_underlying(Status::kRegulatoryError ), "kRegulatoryError value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kAuthFailure ) == to_underlying(Status::kAuthFailure ), "kAuthFailure value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kUnsupportedSecurity ) == to_underlying(Status::kUnsupportedSecurity ), "kUnsupportedSecurity value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kOtherConnectionFailure) == to_underlying(Status::kOtherConnectionFailure), "kOtherConnectionFailure value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kIPV6Failed ) == to_underlying(Status::kIPV6Failed ), "kIPV6Failed value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kIPBindFailed ) == to_underlying(Status::kIPBindFailed ), "kIPBindFailed value mismatch."); + static_assert(to_underlying(NetworkCommissioningStatus::kUnknownError ) == to_underlying(Status::kUnknownError ), "kUnknownError value mismatch."); + // clang-format on + return static_cast(to_underlying(status)); +} -struct WiFiNetworkInfo +NetworkCommissioning::WiFiBand ToClusterObjectEnum(DeviceLayer::NetworkCommissioning::WiFiBand band) { - uint8_t mSSID[kMaxWiFiSSIDLen + 1]; - uint8_t mSSIDLen; - uint8_t mCredentials[kMaxWiFiCredentialsLen]; - uint8_t mCredentialsLen; -}; + using ClusterObject = NetworkCommissioning::WiFiBand; + using PlatfromInterface = DeviceLayer::NetworkCommissioning::WiFiBand; -struct NetworkInfo -{ - uint8_t mNetworkID[kMaxNetworkIDLen]; - uint8_t mNetworkIDLen; - uint8_t mEnabled; - NetworkType mNetworkType; - union NetworkData - { -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - Thread::OperationalDataset mThread; -#endif -#if defined(CHIP_DEVICE_LAYER_TARGET) - WiFiNetworkInfo mWiFi; -#endif - } mData; -}; + static_assert(to_underlying(ClusterObject::k2g4) == to_underlying(PlatfromInterface::k2g4), "k2g4 valus mismatch."); + static_assert(to_underlying(ClusterObject::k3g65) == to_underlying(PlatfromInterface::k3g65), "k3g65 valus mismatch."); + static_assert(to_underlying(ClusterObject::k5g) == to_underlying(PlatfromInterface::k5g), "k5g valus mismatch."); + static_assert(to_underlying(ClusterObject::k6g) == to_underlying(PlatfromInterface::k6g), "k6g valus mismatch."); + static_assert(to_underlying(ClusterObject::k60g) == to_underlying(PlatfromInterface::k60g), "k60g valus mismatch."); + + return static_cast(to_underlying(band)); +} -namespace { -// The internal network info containing credentials. Need to find some better place to save these info. -NetworkInfo sNetworks[kMaxNetworks]; } // namespace -void OnAddOrUpdateThreadNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler, - const app::ConcreteCommandPath & commandPath, ByteSpan operationalDataset, - uint64_t breadcrumb, uint32_t timeoutMs) +CHIP_ERROR Instance::Init() { - Commands::NetworkConfigResponse::Type response; -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - NetworkCommissioningStatus err = NetworkCommissioningStatus::kBoundsExceeded; + ReturnErrorOnFailure(chip::app::InteractionModelEngine::GetInstance()->RegisterCommandHandler(this)); + VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + ReturnErrorOnFailure( + DeviceLayer::PlatformMgrImpl().AddEventHandler(_OnCommissioningComplete, reinterpret_cast(this))); + ReturnErrorOnFailure(mpBaseDriver->Init()); + return CHIP_NO_ERROR; +} + +CHIP_ERROR Instance::Shutdown() +{ + ReturnErrorOnFailure(mpBaseDriver->Shutdown()); + return CHIP_NO_ERROR; +} - for (size_t i = 0; i < kMaxNetworks; i++) +void Instance::InvokeCommand(HandlerContext & ctxt) +{ + if (mAsyncCommandHandle.Get() != nullptr) { - if (sNetworks[i].mNetworkType == NetworkType::kUndefined) - { - Thread::OperationalDataset & dataset = sNetworks[i].mData.mThread; - CHIP_ERROR error = dataset.Init(operationalDataset); + // We have a command processing in the backend, reject all incoming commands. + ctxt.mCommandHandler.AddStatus(ctxt.mRequestPath, Protocols::InteractionModel::Status::Busy); + ctxt.SetCommandHandled(); + return; + } + + // Since mPath is used for building the response command, and we have checked that we are not pending the response of another + // command above. So it is safe to set the mPath here and not clear it when return. + mPath = ctxt.mRequestPath; + + switch (ctxt.mRequestPath.mCommandId) + { + case Commands::ScanNetworks::Id: + VerifyOrReturn((mType & kFeatureMapWireless) != 0); + HandleCommand( + ctxt, [this](HandlerContext & ctx, const auto & req) { HandleScanNetworks(ctx, req); }); + return; + + case Commands::AddOrUpdateWiFiNetwork::Id: + VerifyOrReturn(mType == kFeatureMapWiFi); + HandleCommand( + ctxt, [this](HandlerContext & ctx, const auto & req) { HandleAddOrUpdateWiFiNetwork(ctx, req); }); + return; + + case Commands::AddOrUpdateThreadNetwork::Id: + VerifyOrReturn(mType == kFeatureMapThread); + HandleCommand( + ctxt, [this](HandlerContext & ctx, const auto & req) { HandleAddOrUpdateThreadNetwork(ctx, req); }); + return; + + case Commands::RemoveNetwork::Id: + VerifyOrReturn((mType & kFeatureMapWireless) != 0); + HandleCommand( + ctxt, [this](HandlerContext & ctx, const auto & req) { HandleRemoveNetwork(ctx, req); }); + return; + + case Commands::ConnectNetwork::Id: + VerifyOrReturn((mType & kFeatureMapWireless) != 0); + HandleCommand( + ctxt, [this](HandlerContext & ctx, const auto & req) { HandleConnectNetwork(ctx, req); }); + return; + + case Commands::ReorderNetwork::Id: + VerifyOrReturn((mType & kFeatureMapWireless) != 0); + HandleCommand( + ctxt, [this](HandlerContext & ctx, const auto & req) { HandleReorderNetwork(ctx, req); }); + return; + } +} - if (error != CHIP_NO_ERROR) +CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + switch (aPath.mAttributeId) + { + case Attributes::MaxNetworks::Id: + return aEncoder.Encode(mpBaseDriver->GetMaxNetworks()); + + case Attributes::Networks::Id: + return aEncoder.EncodeList([this](const auto & encoder) { + auto networks = mpBaseDriver->GetNetworks(); + CHIP_ERROR err = CHIP_NO_ERROR; + Structs::NetworkInfo::Type networkForEncode; + NetworkCommissioning::Network network; + for (; networks != nullptr && networks->Next(network);) { - ChipLogDetail(Zcl, "Failed to parse Thread operational dataset: %s", ErrorStr(error)); - err = NetworkCommissioningStatus::kUnknownError; - break; + networkForEncode.networkID = ByteSpan(network.networkID, network.networkIDLen); + networkForEncode.connected = network.connected; + SuccessOrExit(err = encoder.Encode(networkForEncode)); + } + exit: + if (networks != nullptr) + { + networks->Release(); } - uint8_t extendedPanId[Thread::kSizeExtendedPanId]; - - static_assert(sizeof(sNetworks[i].mNetworkID) >= sizeof(extendedPanId), - "Network ID must be larger than Thread extended PAN ID!"); - SuccessOrExit(dataset.GetExtendedPanId(extendedPanId)); - memcpy(sNetworks[i].mNetworkID, extendedPanId, sizeof(extendedPanId)); - sNetworks[i].mNetworkIDLen = sizeof(extendedPanId); + return err; + }); - sNetworks[i].mNetworkType = NetworkType::kThread; - sNetworks[i].mEnabled = false; + case Attributes::ScanMaxTimeSeconds::Id: + if (mType & kFeatureMapWireless) + { + return aEncoder.Encode(mpWirelessDriver->GetScanNetworkTimeoutSeconds()); + } + return CHIP_NO_ERROR; - err = NetworkCommissioningStatus::kSuccess; - break; + case Attributes::ConnectMaxTimeSeconds::Id: + if (mType & kFeatureMapWireless) + { + return aEncoder.Encode(mpWirelessDriver->GetConnectNetworkTimeoutSeconds()); } + return CHIP_NO_ERROR; + + case Attributes::InterfaceEnabled::Id: + return aEncoder.Encode(mpBaseDriver->GetEnabled()); + + // TODO: Add support to the following attributes + case Attributes::LastNetworkingStatus::Id: + return aEncoder.Encode(NetworkCommissioningStatus::kSuccess); + + case Attributes::LastNetworkID::Id: + return aEncoder.Encode(ByteSpan()); + + case Attributes::LastConnectErrorValue::Id: + return aEncoder.Encode(Attributes::LastConnectErrorValue::TypeInfo::Type(0)); + + case Attributes::FeatureMap::Id: + return aEncoder.Encode(mType); + + default: + return CHIP_NO_ERROR; } +} -exit: - // TODO: We should encode response command here. - - ChipLogDetail(Zcl, "AddOrUpdateThreadNetwork: %" PRIu8, to_underlying(err)); - response.networkingStatus = err; -#else - // The target does not supports ThreadNetwork. We should not add AddOrUpdateThreadNetwork command in that case then the upper - // layer will return "Command not found" error. - response.networkingStatus = NetworkCommissioningStatus::kUnknownError; -#endif - apCommandHandler->AddResponseData(commandPath, response); +CHIP_ERROR Instance::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + switch (aPath.mAttributeId) + { + case Attributes::InterfaceEnabled::Id: + bool value; + ReturnErrorOnFailure(aDecoder.Decode(value)); + return mpBaseDriver->SetEnabled(value); + default: + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; + } } -void OnAddOrUpdateWiFiNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler, - const app::ConcreteCommandPath & commandPath, ByteSpan ssid, - ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs) +void Instance::HandleScanNetworks(HandlerContext & ctx, const Commands::ScanNetworks::DecodableType & req) +{ + switch (mType) + { + case kFeatureMapWiFi: + mAsyncCommandHandle = app::CommandHandler::Handle(&ctx.mCommandHandler); + mpDriver.Get()->ScanNetworks(req.ssid, this); + return; + case kFeatureMapThread: + mAsyncCommandHandle = app::CommandHandler::Handle(&ctx.mCommandHandler); + mpDriver.Get()->ScanNetworks(this); + return; + default: + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::UnsupportedCommand); + return; + } +} + +void Instance::HandleAddOrUpdateWiFiNetwork(HandlerContext & ctx, const Commands::AddOrUpdateWiFiNetwork::DecodableType & req) { Commands::NetworkConfigResponse::Type response; -#if defined(CHIP_DEVICE_LAYER_TARGET) - NetworkCommissioningStatus err = NetworkCommissioningStatus::kBoundsExceeded; + response.networkingStatus = ToClusterObjectEnum(mpDriver.Get()->AddOrUpdateNetwork(req.ssid, req.credentials)); + ctx.mCommandHandler.AddResponseData(ctx.mRequestPath, response); +} - for (size_t i = 0; i < kMaxNetworks; i++) - { - if (sNetworks[i].mNetworkType == NetworkType::kUndefined) - { - VerifyOrExit(ssid.size() <= sizeof(sNetworks[i].mData.mWiFi.mSSID), err = NetworkCommissioningStatus::kOutOfRange); - memcpy(sNetworks[i].mData.mWiFi.mSSID, ssid.data(), ssid.size()); +void Instance::HandleAddOrUpdateThreadNetwork(HandlerContext & ctx, const Commands::AddOrUpdateThreadNetwork::DecodableType & req) +{ + Commands::NetworkConfigResponse::Type response; + response.networkingStatus = ToClusterObjectEnum(mpDriver.Get()->AddOrUpdateNetwork(req.operationalDataset)); + ctx.mCommandHandler.AddResponseData(ctx.mRequestPath, response); +} - using WiFiSSIDLenType = decltype(sNetworks[i].mData.mWiFi.mSSIDLen); - VerifyOrExit(CanCastTo(ssid.size()), err = NetworkCommissioningStatus::kOutOfRange); - sNetworks[i].mData.mWiFi.mSSIDLen = static_cast(ssid.size()); +void Instance::HandleRemoveNetwork(HandlerContext & ctx, const Commands::RemoveNetwork::DecodableType & req) +{ + Commands::NetworkConfigResponse::Type response; + response.networkingStatus = ToClusterObjectEnum(mpWirelessDriver->RemoveNetwork(req.networkID)); + ctx.mCommandHandler.AddResponseData(ctx.mRequestPath, response); +} - VerifyOrExit(credentials.size() <= sizeof(sNetworks[i].mData.mWiFi.mCredentials), - err = NetworkCommissioningStatus::kOutOfRange); - memcpy(sNetworks[i].mData.mWiFi.mCredentials, credentials.data(), credentials.size()); +void Instance::HandleConnectNetwork(HandlerContext & ctx, const Commands::ConnectNetwork::DecodableType & req) +{ + Commands::ConnectNetworkResponse::Type response; - using WiFiCredentialsLenType = decltype(sNetworks[i].mData.mWiFi.mCredentialsLen); - VerifyOrExit(CanCastTo(ssid.size()), err = NetworkCommissioningStatus::kOutOfRange); - sNetworks[i].mData.mWiFi.mCredentialsLen = static_cast(credentials.size()); + mAsyncCommandHandle = app::CommandHandler::Handle(&ctx.mCommandHandler); + mpWirelessDriver->ConnectNetwork(req.networkID, this); +} - VerifyOrExit(ssid.size() <= sizeof(sNetworks[i].mNetworkID), err = NetworkCommissioningStatus::kOutOfRange); - memcpy(sNetworks[i].mNetworkID, sNetworks[i].mData.mWiFi.mSSID, ssid.size()); +void Instance::HandleReorderNetwork(HandlerContext & ctx, const Commands::ReorderNetwork::DecodableType & req) +{ + Commands::NetworkConfigResponse::Type response; + response.networkingStatus = ToClusterObjectEnum(mpWirelessDriver->ReorderNetwork(req.networkID, req.networkIndex)); + ctx.mCommandHandler.AddResponseData(ctx.mRequestPath, response); +} - using NetworkIDLenType = decltype(sNetworks[i].mNetworkIDLen); - VerifyOrExit(CanCastTo(ssid.size()), err = NetworkCommissioningStatus::kOutOfRange); - sNetworks[i].mNetworkIDLen = static_cast(ssid.size()); +void Instance::OnResult(Status commissioningError, CharSpan errorText, int32_t interfaceStatus) +{ + auto commandHandleRef = std::move(mAsyncCommandHandle); + auto commandHandle = commandHandleRef.Get(); + if (commandHandle == nullptr) + { + // When the platform shutted down, interaction model engine will invalidate all commandHandle to avoid dangling references. + // We may receive the callback after it and should make it noop. + return; + } - sNetworks[i].mNetworkType = NetworkType::kWiFi; - sNetworks[i].mEnabled = false; + Commands::ConnectNetworkResponse::Type response; + response.networkingStatus = ToClusterObjectEnum(commissioningError); + response.debugText = errorText; + response.errorValue = interfaceStatus; + commandHandle->AddResponseData(mPath, response); + if (commissioningError == Status::kSuccess) + { + // TODO: Pass the actual network id to device control server. + DeviceLayer::DeviceControlServer::DeviceControlSvr().ConnectNetworkForOperational(ByteSpan()); + } +} - err = NetworkCommissioningStatus::kSuccess; - break; - } +void Instance::OnFinished(Status status, CharSpan debugText, ThreadScanResponseIterator * networks) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + auto commandHandleRef = std::move(mAsyncCommandHandle); + auto commandHandle = commandHandleRef.Get(); + if (commandHandle == nullptr) + { + // When the platform shutted down, interaction model engine will invalidate all commandHandle to avoid dangling references. + // We may receive the callback after it and should make it noop. + return; } - VerifyOrExit(err == NetworkCommissioningStatus::kSuccess, ); + TLV::TLVWriter * writer; + TLV::TLVType listContainerType; + ThreadScanResponse scanResponse; + size_t networksEncoded = 0; + + SuccessOrExit(err = commandHandle->PrepareCommand( + ConcreteCommandPath(mPath.mEndpointId, NetworkCommissioning::Id, Commands::ScanNetworksResponse::Id))); + VerifyOrExit((writer = commandHandle->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + + SuccessOrExit(err = writer->Put(TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kNetworkingStatus)), + ToClusterObjectEnum(status))); + SuccessOrExit(err = DataModel::Encode( + *writer, TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kDebugText)), debugText)); + SuccessOrExit( + err = writer->StartContainer(TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kThreadScanResults)), + TLV::TLVType::kTLVType_Array, listContainerType)); + + for (; networks != nullptr && networks->Next(scanResponse) && networksEncoded < kMaxNetworksInScanResponse; networksEncoded++) + { + Structs::ThreadInterfaceScanResult::Type result; + result.panId = scanResponse.panId; + result.extendedPanId = scanResponse.extendedPanId; + result.networkName = CharSpan(scanResponse.networkName, scanResponse.networkNameLen); + result.channel = scanResponse.channel; + result.version = scanResponse.version; + result.extendedAddress = scanResponse.extendedAddress; + result.rssi = scanResponse.rssi; + result.lqi = scanResponse.lqi; + SuccessOrExit(err = DataModel::Encode(*writer, TLV::AnonymousTag(), result)); + } + + SuccessOrExit(err = writer->EndContainer(listContainerType)); + SuccessOrExit(err = commandHandle->FinishCommand()); - ChipLogDetail(Zcl, "WiFi provisioning data: SSID: %.*s", static_cast(ssid.size()), ssid.data()); exit: - // TODO: We should encode response command here. - - ChipLogDetail(Zcl, "AddOrUpdateWiFiNetwork: %" PRIu8, to_underlying(err)); - response.networkingStatus = err; -#else - // The target does not supports WiFiNetwork. - // return "Command not found" error. - response.networkingStatus = NetworkCommissioningStatus::kUnknownError; -#endif - apCommandHandler->AddResponseData(commandPath, response); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Failed to encode response: %s", err.AsString()); + } + networks->Release(); } -namespace { -CHIP_ERROR DoConnectNetwork(NetworkInfo * network) +void Instance::OnFinished(Status status, CharSpan debugText, WiFiScanResponseIterator * networks) { - switch (network->mNetworkType) + CHIP_ERROR err = CHIP_NO_ERROR; + auto commandHandleRef = std::move(mAsyncCommandHandle); + auto commandHandle = commandHandleRef.Get(); + if (commandHandle == nullptr) { - case NetworkType::kThread: -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD -// TODO: On linux, we are using Reset() instead of Detach() to disable thread network, which is not expected. -// Upstream issue: https://github.com/openthread/ot-br-posix/issues/755 -#if !CHIP_DEVICE_LAYER_TARGET_LINUX - ReturnErrorOnFailure(DeviceLayer::ThreadStackMgr().SetThreadEnabled(false)); -#endif - ReturnErrorOnFailure(DeviceLayer::ThreadStackMgr().SetThreadProvision(network->mData.mThread.AsByteSpan())); - ReturnErrorOnFailure(DeviceLayer::ThreadStackMgr().SetThreadEnabled(true)); -#else - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -#endif - break; - case NetworkType::kWiFi: -#if defined(CHIP_DEVICE_LAYER_TARGET) + // When the platform shutted down, interaction model engine will invalidate all commandHandle to avoid dangling references. + // We may receive the callback after it and should make it noop. + return; + } + + TLV::TLVWriter * writer; + TLV::TLVType listContainerType; + WiFiScanResponse scanResponse; + size_t networksEncoded = 0; + + SuccessOrExit(err = commandHandle->PrepareCommand( + ConcreteCommandPath(mPath.mEndpointId, NetworkCommissioning::Id, Commands::ScanNetworksResponse::Id))); + VerifyOrExit((writer = commandHandle->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + + SuccessOrExit(err = writer->Put(TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kNetworkingStatus)), + ToClusterObjectEnum(status))); + SuccessOrExit(err = DataModel::Encode( + *writer, TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kDebugText)), debugText)); + SuccessOrExit( + err = writer->StartContainer(TLV::ContextTag(to_underlying(Commands::ScanNetworksResponse::Fields::kWiFiScanResults)), + TLV::TLVType::kTLVType_Array, listContainerType)); + + for (; networks != nullptr && networks->Next(scanResponse) && networksEncoded < kMaxNetworksInScanResponse; networksEncoded++) { - // TODO: Currently, DeviceNetworkProvisioningDelegateImpl assumes that ssid and credentials are null terminated strings, - // which is not correct, this should be changed once we have better method for commissioning wifi networks. - DeviceLayer::DeviceNetworkProvisioningDelegateImpl deviceDelegate; - ReturnErrorOnFailure(deviceDelegate.ProvisionWiFi(reinterpret_cast(network->mData.mWiFi.mSSID), - reinterpret_cast(network->mData.mWiFi.mCredentials))); - break; + Structs::WiFiInterfaceScanResult::Type result; + result.security = scanResponse.security; + result.ssid = ByteSpan(scanResponse.ssid, scanResponse.ssidLen); + result.bssid = ByteSpan(scanResponse.bssid, sizeof(scanResponse.bssid)); + result.channel = scanResponse.channel; + result.wiFiBand = ToClusterObjectEnum(scanResponse.wiFiBand); + result.rssi = scanResponse.rssi; + SuccessOrExit(err = DataModel::Encode(*writer, TLV::AnonymousTag(), result)); } -#else - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -#endif - break; - case NetworkType::kEthernet: - case NetworkType::kUndefined: - default: - return CHIP_ERROR_NOT_IMPLEMENTED; + + SuccessOrExit(err = writer->EndContainer(listContainerType)); + SuccessOrExit(err = commandHandle->FinishCommand()); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Failed to encode response: %s", err.AsString()); + } + if (networks != nullptr) + { + networks->Release(); } - network->mEnabled = true; - return CHIP_NO_ERROR; } -} // namespace -void OnConnectNetworkCommandCallbackInternal(app::CommandHandler * apCommandHandler, const app::ConcreteCommandPath & commandPath, - ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs) +void Instance::_OnCommissioningComplete(const DeviceLayer::ChipDeviceEvent * event, intptr_t arg) { - Commands::ConnectNetworkResponse::Type response; - size_t networkSeq; - NetworkCommissioningStatus err = NetworkCommissioningStatus::kNetworkIDNotFound; + Instance * this_ = reinterpret_cast(arg); + VerifyOrReturn(event->Type == DeviceLayer::DeviceEventType::kCommissioningComplete); + this_->OnCommissioningComplete(event->CommissioningComplete.status); +} - for (networkSeq = 0; networkSeq < kMaxNetworks; networkSeq++) +void Instance::OnCommissioningComplete(CHIP_ERROR err) +{ + VerifyOrReturn((mType & kFeatureMapWireless) != 0); + if (err == CHIP_NO_ERROR) { - if (sNetworks[networkSeq].mNetworkIDLen == networkID.size() && - sNetworks[networkSeq].mNetworkType != NetworkType::kUndefined && - memcmp(sNetworks[networkSeq].mNetworkID, networkID.data(), networkID.size()) == 0) - { - // TODO: Currently, we cannot figure out the detailed error from network provisioning on DeviceLayer, we should - // implement this in device layer. - VerifyOrExit(DoConnectNetwork(&sNetworks[networkSeq]) == CHIP_NO_ERROR, - err = NetworkCommissioningStatus::kUnknownError); - ExitNow(err = NetworkCommissioningStatus::kSuccess); - } + ChipLogDetail(Zcl, "Commissioning complete, notify platform driver to persist network credentails."); + mpWirelessDriver->CommitConfiguration(); } - // TODO: We should encode response command here. -exit: - if (err == NetworkCommissioningStatus::kSuccess) + else { - DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().ConnectNetworkForOperational(networkID); + ChipLogDetail(Zcl, "Failsafe timeout, tell platform driver to revert network credentails."); + mpWirelessDriver->RevertConfiguration(); } - response.networkingStatus = err; - apCommandHandler->AddResponseData(commandPath, response); } } // namespace NetworkCommissioning diff --git a/src/app/clusters/network-commissioning/network-commissioning.h b/src/app/clusters/network-commissioning/network-commissioning.h index 6b389d8324c724..705b3879648f93 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.h +++ b/src/app/clusters/network-commissioning/network-commissioning.h @@ -18,23 +18,109 @@ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include namespace chip { namespace app { namespace Clusters { namespace NetworkCommissioning { -void OnAddOrUpdateThreadNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath, - ByteSpan operationalDataset, uint64_t breadcrumb, uint32_t timeoutMs); -void OnAddOrUpdateWiFiNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath, - ByteSpan ssid, ByteSpan credentials, uint64_t breadcrumb, uint32_t timeoutMs); -void OnConnectNetworkCommandCallbackInternal(app::CommandHandler *, const app::ConcreteCommandPath & commandPath, - ByteSpan networkID, uint64_t breadcrumb, uint32_t timeoutMs); -} // namespace NetworkCommissioning +// TODO: Use macro to disable some wifi or thread +class Instance : public CommandHandlerInterface, + public AttributeAccessInterface, + public DeviceLayer::NetworkCommissioning::Internal::WirelessDriver::ConnectCallback, + public DeviceLayer::NetworkCommissioning::WiFiDriver::ScanCallback, + public DeviceLayer::NetworkCommissioning::ThreadDriver::ScanCallback +{ +public: + /** + * Register will register the network commissioning instance to the attribute and command dispatching route. + */ + CHIP_ERROR Init(); + CHIP_ERROR Shutdown(); + + // CommandHandlerInterface + void InvokeCommand(HandlerContext & ctx) override; + + // AttributeAccessInterface + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + + // WirelessDriver::ConnectCallback + void OnResult(DeviceLayer::NetworkCommissioning::Status commissioningError, CharSpan errorText, + int32_t interfaceStatus) override; + + // WiFiDriver::ScanCallback + void OnFinished(DeviceLayer::NetworkCommissioning::Status err, CharSpan debugText, + DeviceLayer::NetworkCommissioning::WiFiScanResponseIterator * networks) override; + + // ThreadDriver::ScanCallback + void OnFinished(DeviceLayer::NetworkCommissioning::Status err, CharSpan debugText, + DeviceLayer::NetworkCommissioning::ThreadScanResponseIterator * networks) override; + +private: + static constexpr uint32_t kFeatureMapWiFi = 0b0000'0001; + static constexpr uint32_t kFeatureMapThread = 0b0000'0010; + static constexpr uint32_t kFeatureMapEthernet = 0b0000'0100; + + static constexpr uint32_t kFeatureMapWireless = 0b0000'0011; + + static void _OnCommissioningComplete(const DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + void OnCommissioningComplete(CHIP_ERROR err); + + const uint32_t mType; + + DeviceLayer::NetworkCommissioning::Internal::WirelessDriver * const mpWirelessDriver; + DeviceLayer::NetworkCommissioning::Internal::BaseDriver * const mpBaseDriver; + + Variant mpDriver; + + app::CommandHandler::Handle mAsyncCommandHandle; + + ConcreteCommandPath mPath = ConcreteCommandPath(0, 0, 0); + + // Actual handlers of the commands + void HandleScanNetworks(HandlerContext & ctx, const Commands::ScanNetworks::DecodableType & req); + void HandleAddOrUpdateWiFiNetwork(HandlerContext & ctx, const Commands::AddOrUpdateWiFiNetwork::DecodableType & req); + void HandleAddOrUpdateThreadNetwork(HandlerContext & ctx, const Commands::AddOrUpdateThreadNetwork::DecodableType & req); + void HandleRemoveNetwork(HandlerContext & ctx, const Commands::RemoveNetwork::DecodableType & req); + void HandleConnectNetwork(HandlerContext & ctx, const Commands::ConnectNetwork::DecodableType & req); + void HandleReorderNetwork(HandlerContext & ctx, const Commands::ReorderNetwork::DecodableType & req); + +public: + Instance(EndpointId aEndpointId, DeviceLayer::NetworkCommissioning::WiFiDriver * apDelegate) : + CommandHandlerInterface(Optional(aEndpointId), Id), + AttributeAccessInterface(Optional(aEndpointId), Id), mType(kFeatureMapWiFi), mpWirelessDriver(apDelegate), + mpBaseDriver(apDelegate) + { + mpDriver.Set(apDelegate); + } + + Instance(EndpointId aEndpointId, DeviceLayer::NetworkCommissioning::ThreadDriver * apDelegate) : + CommandHandlerInterface(Optional(aEndpointId), Id), + AttributeAccessInterface(Optional(aEndpointId), Id), mType(kFeatureMapThread), mpWirelessDriver(apDelegate), + mpBaseDriver(apDelegate) + { + mpDriver.Set(apDelegate); + } + + Instance(EndpointId aEndpointId, DeviceLayer::NetworkCommissioning::EthernetDriver * apDelegate) : + CommandHandlerInterface(Optional(aEndpointId), Id), + AttributeAccessInterface(Optional(aEndpointId), Id), mType(kFeatureMapEthernet), mpWirelessDriver(nullptr), + mpBaseDriver(apDelegate) + {} + + virtual ~Instance() = default; +}; + +} // namespace NetworkCommissioning } // namespace Clusters } // namespace app } // namespace chip diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index 684a30d289d8d9..a2055a18a819fc 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -179,7 +179,7 @@ EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, uint8_t comm #ifdef EMBER_AF_PLUGIN_SCENES // the scene has been changed (the value of on/off has changed) so - // the current scene as descibed in the attribute table is invalid, + // the current scene as described in the attribute table is invalid, // so mark it as invalid (just writes the valid/invalid attribute) if (emberAfContainsServer(endpoint, Scenes::Id)) { @@ -195,8 +195,8 @@ EmberAfStatus OnOffServer::setOnOffValue(chip::EndpointId endpoint, uint8_t comm void OnOffServer::initOnOffServer(chip::EndpointId endpoint) { #ifdef ZCL_USING_ON_OFF_CLUSTER_START_UP_ON_OFF_ATTRIBUTE - // StartUp behavior relies on OnOff and StartUpOnOff attributes being tokenized. - if (areStartUpOnOffServerAttributesTokenized(endpoint)) + // StartUp behavior relies on OnOff and StartUpOnOff attributes being non-volatile. + if (areStartUpOnOffServerAttributesNonVolatile(endpoint)) { // Read the StartUpOnOff attribute and set the OnOff attribute as per // following from zcl 7 14-0127-20i-zcl-ch-3-general.doc. @@ -482,20 +482,20 @@ void OnOffServer::updateOnOffTimeCommand(chip::EndpointId endpoint) } #ifdef ZCL_USING_ON_OFF_CLUSTER_START_UP_ON_OFF_ATTRIBUTE -bool OnOffServer::areStartUpOnOffServerAttributesTokenized(EndpointId endpoint) +bool OnOffServer::areStartUpOnOffServerAttributesNonVolatile(EndpointId endpoint) { EmberAfAttributeMetadata * metadata; metadata = emberAfLocateAttributeMetadata(endpoint, OnOff::Id, Attributes::OnOff::Id, CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE); - if (!emberAfAttributeIsTokenized(metadata)) + if (!metadata->IsNonVolatile()) { return false; } metadata = emberAfLocateAttributeMetadata(endpoint, OnOff::Id, Attributes::StartUpOnOff::Id, CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE); - if (!emberAfAttributeIsTokenized(metadata)) + if (!metadata->IsNonVolatile()) { return false; } diff --git a/src/app/clusters/on-off-server/on-off-server.h b/src/app/clusters/on-off-server/on-off-server.h index fa402be4687864..e72eb61e858715 100644 --- a/src/app/clusters/on-off-server/on-off-server.h +++ b/src/app/clusters/on-off-server/on-off-server.h @@ -63,13 +63,13 @@ class OnOffServer *********************************************************/ #ifdef ZCL_USING_ON_OFF_CLUSTER_START_UP_ON_OFF_ATTRIBUTE - bool areStartUpOnOffServerAttributesTokenized(chip::EndpointId endpoint); + bool areStartUpOnOffServerAttributesNonVolatile(chip::EndpointId endpoint); #endif // ZCL_USING_ON_OFF_CLUSTER_START_UP_ON_OFF_ATTRIBUTE EmberEventControl * getEventControl(chip::EndpointId endpoint); EmberEventControl * configureEventControl(chip::EndpointId endpoint); /********************************************************** - * Attributes Decleration + * Attributes Declaration *********************************************************/ static OnOffServer instance; @@ -92,7 +92,7 @@ struct OnOffEffect /* * effectVariant's type depends on the effect effectIdentifier so we don't know the type at compile time. - * Casting to uint8_t for more flexibilty since the type can be OnOffDelayedAllOffEffectVariant or + * Casting to uint8_t for more flexibility since the type can be OnOffDelayedAllOffEffectVariant or * OnOffDelayedAllOffEffectVariant */ uint8_t effectVariant = static_cast(EMBER_ZCL_ON_OFF_DELAYED_ALL_OFF_EFFECT_VARIANT_FADE_TO_OFF_IN_0P8_SECONDS)); diff --git a/src/app/clusters/ota-requestor/BDXDownloader.cpp b/src/app/clusters/ota-requestor/BDXDownloader.cpp index ec347ecf2c478e..8c2ef8c3626562 100644 --- a/src/app/clusters/ota-requestor/BDXDownloader.cpp +++ b/src/app/clusters/ota-requestor/BDXDownloader.cpp @@ -65,7 +65,7 @@ CHIP_ERROR BDXDownloader::BeginPrepareDownload() VerifyOrReturnError(mImageProcessor != nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorOnFailure(mImageProcessor->PrepareDownload()); - mState = State::kPreparing; + SetState(State::kPreparing); return CHIP_NO_ERROR; } @@ -76,7 +76,7 @@ CHIP_ERROR BDXDownloader::OnPreparedForDownload(CHIP_ERROR status) if (status == CHIP_NO_ERROR) { - mState = State::kInProgress; + SetState(State::kInProgress); // Must call here because StartTransfer() should have prepared a ReceiveInit message, and now we should send it. PollTransferSession(); @@ -85,7 +85,7 @@ CHIP_ERROR BDXDownloader::OnPreparedForDownload(CHIP_ERROR status) { ChipLogError(BDX, "failed to prepare download: %" CHIP_ERROR_FORMAT, status.Format()); mBdxTransfer.Reset(); - mState = State::kIdle; + SetState(State::kIdle); } return CHIP_NO_ERROR; @@ -110,7 +110,7 @@ void BDXDownloader::OnDownloadTimeout() { mImageProcessor->Abort(); } - mState = State::kIdle; + SetState(State::kIdle); } else { @@ -128,7 +128,7 @@ void BDXDownloader::EndDownload(CHIP_ERROR reason) { mImageProcessor->Abort(); } - mState = State::kIdle; + SetState(State::kIdle); // Because AbortTransfer() will generate a StatusReport to send. PollTransferSession(); @@ -171,7 +171,7 @@ CHIP_ERROR BDXDownloader::HandleBdxEvent(const chip::bdx::TransferSession::Outpu if (outEvent.msgTypeData.HasMessageType(chip::bdx::MessageType::BlockAckEOF)) { // BDX transfer is not complete until BlockAckEOF has been sent - mState = State::kComplete; + SetState(State::kComplete); // TODO: how/when to reset the BDXDownloader to be ready to handle another download } @@ -217,4 +217,14 @@ CHIP_ERROR BDXDownloader::HandleBdxEvent(const chip::bdx::TransferSession::Outpu return CHIP_NO_ERROR; } +void BDXDownloader::SetState(State state) +{ + mState = state; + + if (mStateDelegate) + { + mStateDelegate->OnDownloadStateChanged(state); + } +} + } // namespace chip diff --git a/src/app/clusters/ota-requestor/BDXDownloader.h b/src/app/clusters/ota-requestor/BDXDownloader.h index d4c86d29736bd1..e00a39ba886781 100644 --- a/src/app/clusters/ota-requestor/BDXDownloader.h +++ b/src/app/clusters/ota-requestor/BDXDownloader.h @@ -45,12 +45,18 @@ class BDXDownloader : public chip::OTADownloader virtual ~MessagingDelegate() {} }; - BDXDownloader() : chip::OTADownloader() {} + class StateDelegate + { + public: + virtual void OnDownloadStateChanged(State state) = 0; + virtual ~StateDelegate() = default; + }; // To be called when there is an incoming message to handle (of any protocol type) void OnMessageReceived(const chip::PayloadHeader & payloadHeader, chip::System::PacketBufferHandle msg); void SetMessageDelegate(MessagingDelegate * delegate) { mMsgDelegate = delegate; } + void SetStateDelegate(StateDelegate * delegate) { mStateDelegate = delegate; } // Initialize a BDX transfer session but will not proceed until OnPreparedForDownload() is called. CHIP_ERROR SetBDXParams(const chip::bdx::TransferSession::TransferInitData & bdxInitData); @@ -68,9 +74,11 @@ class BDXDownloader : public chip::OTADownloader private: void PollTransferSession(); CHIP_ERROR HandleBdxEvent(const chip::bdx::TransferSession::OutputEvent & outEvent); + void SetState(State state); chip::bdx::TransferSession mBdxTransfer; - MessagingDelegate * mMsgDelegate; + MessagingDelegate * mMsgDelegate = nullptr; + StateDelegate * mStateDelegate = nullptr; }; } // namespace chip diff --git a/src/app/clusters/ota-requestor/ClusterInterface.cpp b/src/app/clusters/ota-requestor/ClusterInterface.cpp deleted file mode 100644 index 03bee4216f9fe3..00000000000000 --- a/src/app/clusters/ota-requestor/ClusterInterface.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* This file contains the glue code for passing the incoming OTA Requestor cluster commands - * to the OTA Requestor object that handles them - */ - -#include - -// OTA Software Update Requestor Cluster AnnounceOtaProvider Command callback -bool emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::DecodableType & commandData) -{ - EmberAfStatus status; - chip::OTARequestorInterface * requestor = chip::GetRequestorInstance(); - - if (requestor != nullptr) - { - status = requestor->HandleAnnounceOTAProvider(commandObj, commandPath, commandData); - } - else - { - status = EMBER_ZCL_STATUS_FAILURE; - } - - emberAfSendImmediateDefaultResponse(status); - return true; -} - -// TBD for now. Not clear what is the API for registering a command response handler -/* Callbacks for QueryImage response */ -// Callback mQueryImageResponseCallback(QueryImageResponseHandler, -// nullptr); - -// void QueryImageResponseHandler(void * context, const QueryImageResponse::DecodableType & response) -//{ } diff --git a/src/app/clusters/ota-requestor/OTARequestor.cpp b/src/app/clusters/ota-requestor/OTARequestor.cpp index 99844744893263..b4e3604035ed02 100644 --- a/src/app/clusters/ota-requestor/OTARequestor.cpp +++ b/src/app/clusters/ota-requestor/OTARequestor.cpp @@ -80,6 +80,13 @@ static void LogQueryImageResponse(const QueryImageResponse::DecodableType & resp } } +static void LogApplyUpdateResponse(const ApplyUpdateResponse::DecodableType & response) +{ + ChipLogDetail(SoftwareUpdate, "ApplyUpdateResponse:"); + ChipLogDetail(SoftwareUpdate, " action: %" PRIu8 "", to_underlying(response.action)); + ChipLogDetail(SoftwareUpdate, " delayedActionTime: %" PRIu32 " seconds", response.delayedActionTime); +} + void StartDelayTimerHandler(System::Layer * systemLayer, void * appState) { VerifyOrReturn(appState != nullptr); @@ -96,94 +103,92 @@ OTARequestorInterface * GetRequestorInstance() return globalOTARequestorInstance; } -struct OTARequestor::QueryImageRequest -{ - char location[2]; - QueryImage::Type args; -}; - void OTARequestor::OnQueryImageResponse(void * context, const QueryImageResponse::DecodableType & response) { LogQueryImageResponse(response); OTARequestor * requestorCore = static_cast(context); - - VerifyOrReturn(requestorCore != nullptr, ChipLogError(SoftwareUpdate, "Received QueryImageResponse with invalid context")); - // TODO: Add a method to OTARequestorDriver used to report error condictions - VerifyOrReturn(requestorCore->ValidateQueryImageResponse(response), - ChipLogError(SoftwareUpdate, "Received invalid QueryImageResponse")); + VerifyOrDie(requestorCore != nullptr); switch (response.status) { case OTAQueryStatus::kUpdateAvailable: { - // Parse out the provider node ID and file designator from the image URI - NodeId nodeId = kUndefinedNodeId; - CharSpan fileDesignator; - CHIP_ERROR err = bdx::ParseURI(response.imageURI.Value(), nodeId, fileDesignator); - VerifyOrReturn(err == CHIP_NO_ERROR, - ChipLogError(SoftwareUpdate, "Parse BDX image URI (%.*s) returned err=%" CHIP_ERROR_FORMAT, - static_cast(response.imageURI.Value().size()), response.imageURI.Value().data(), - err.Format())); - requestorCore->mProviderNodeId = nodeId; + UpdateDescription update; + CHIP_ERROR err = requestorCore->ExtractUpdateDescription(response, update); + + if (err != CHIP_NO_ERROR) + { + requestorCore->mOtaRequestorDriver->HandleError(UpdateStateEnum::Querying, err); + return; + } MutableByteSpan updateToken(requestorCore->mUpdateTokenBuffer); - CopySpanToMutableSpan(response.updateToken.Value(), updateToken); - requestorCore->mUpdateVersion = response.softwareVersion.Value(); + CopySpanToMutableSpan(update.updateToken, updateToken); + requestorCore->mUpdateVersion = update.softwareVersion; requestorCore->mUpdateToken = updateToken; - // CSM should already be created for sending QueryImage command so use the same CSM since the - // provider node ID that will supply the OTA image must be on the same fabric as the sender of the QueryImageResponse - requestorCore->ConnectToProvider(kStartBDX); + requestorCore->mOtaRequestorDriver->UpdateAvailable(update, + System::Clock::Seconds32(response.delayedActionTime.ValueOr(0))); break; } case OTAQueryStatus::kBusy: + requestorCore->mOtaRequestorDriver->UpdateNotFound(UpdateNotFoundReason::Busy, + System::Clock::Seconds32(response.delayedActionTime.ValueOr(0))); break; case OTAQueryStatus::kNotAvailable: + requestorCore->mOtaRequestorDriver->UpdateNotFound(UpdateNotFoundReason::NotAvailable, + System::Clock::Seconds32(response.delayedActionTime.ValueOr(0))); break; - case OTAQueryStatus::kDownloadProtocolNotSupported: - break; - // Issue #9524 should handle all response status appropriately default: + requestorCore->mOtaRequestorDriver->HandleError(UpdateStateEnum::Querying, CHIP_ERROR_BAD_REQUEST); break; } } void OTARequestor::OnQueryImageFailure(void * context, EmberAfStatus status) { + OTARequestor * requestorCore = static_cast(context); + VerifyOrDie(requestorCore != nullptr); + ChipLogDetail(SoftwareUpdate, "QueryImage failure response %" PRIu8, status); + requestorCore->mOtaRequestorDriver->HandleError(UpdateStateEnum::Querying, CHIP_ERROR_BAD_REQUEST); } void OTARequestor::OnApplyUpdateResponse(void * context, const ApplyUpdateResponse::DecodableType & response) { - VerifyOrReturn(context != nullptr, ChipLogError(SoftwareUpdate, "Received ApplyUpdateResponse with invalid context")); + LogApplyUpdateResponse(response); OTARequestor * requestorCore = static_cast(context); + VerifyOrDie(requestorCore != nullptr); switch (response.action) { - case EMBER_ZCL_OTA_APPLY_UPDATE_ACTION_PROCEED: { - // TODO: Call OTARequestorDriver to schedule the image application. - VerifyOrReturn(requestorCore->mBdxDownloader != nullptr, ChipLogError(SoftwareUpdate, "Downloader is not set")); - OTAImageProcessorInterface * imageProcessor = requestorCore->mBdxDownloader->GetImageProcessorDelegate(); - VerifyOrReturn(imageProcessor != nullptr, ChipLogError(SoftwareUpdate, "Image processor is not set")); - imageProcessor->Apply(); + case EMBER_ZCL_OTA_APPLY_UPDATE_ACTION_PROCEED: + requestorCore->mOtaRequestorDriver->UpdateConfirmed(System::Clock::Seconds32(response.delayedActionTime)); break; - } - default: + case EMBER_ZCL_OTA_APPLY_UPDATE_ACTION_AWAIT_NEXT_ACTION: + requestorCore->mOtaRequestorDriver->UpdateSuspended(System::Clock::Seconds32(response.delayedActionTime)); + break; + case EMBER_ZCL_OTA_APPLY_UPDATE_ACTION_DISCONTINUE: + requestorCore->mOtaRequestorDriver->UpdateDiscontinued(); break; } } void OTARequestor::OnApplyUpdateFailure(void * context, EmberAfStatus status) { + OTARequestor * requestorCore = static_cast(context); + VerifyOrDie(requestorCore != nullptr); + ChipLogDetail(SoftwareUpdate, "ApplyUpdate failure response %" PRIu8, status); + requestorCore->mOtaRequestorDriver->HandleError(UpdateStateEnum::Applying, CHIP_ERROR_BAD_REQUEST); } EmberAfStatus OTARequestor::HandleAnnounceOTAProvider(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const AnnounceOtaProvider::DecodableType & commandData) { - auto & providerLocation = commandData.providerLocation; + auto & providerNodeId = commandData.providerNodeId; auto & announcementReason = commandData.announcementReason; if (commandObj == nullptr || commandObj->GetExchangeContext() == nullptr) @@ -192,7 +197,7 @@ EmberAfStatus OTARequestor::HandleAnnounceOTAProvider(app::CommandHandler * comm return EMBER_ZCL_STATUS_FAILURE; } - mProviderNodeId = providerLocation; + mProviderNodeId = providerNodeId; mProviderFabricIndex = commandObj->GetExchangeContext()->GetSessionHandle().GetFabricIndex(); ChipLogProgress(SoftwareUpdate, "OTA Requestor received AnnounceOTAProvider"); @@ -229,6 +234,9 @@ EmberAfStatus OTARequestor::HandleAnnounceOTAProvider(app::CommandHandler * comm void OTARequestor::ConnectToProvider(OnConnectedAction onConnectedAction) { + VerifyOrReturn(mOtaRequestorDriver != nullptr, ChipLogError(SoftwareUpdate, "OTA requestor driver not set")); + VerifyOrReturn(mServer != nullptr, ChipLogError(SoftwareUpdate, "Server not set")); + FabricInfo * fabricInfo = mServer->GetFabricTable().FindFabricWithIndex(mProviderFabricIndex); VerifyOrReturn(fabricInfo != nullptr, ChipLogError(SoftwareUpdate, "Cannot find fabric")); @@ -237,8 +245,8 @@ void OTARequestor::ConnectToProvider(OnConnectedAction onConnectedAction) ChipLogDetail(SoftwareUpdate, "Establishing session to provider node ID 0x" ChipLogFormatX64 " on fabric index %d", ChipLogValueX64(mProviderNodeId), mProviderFabricIndex); - CHIP_ERROR err = mCASESessionManager->FindOrEstablishSession(fabricInfo, mProviderNodeId, &mOnConnectedCallback, - &mOnConnectionFailureCallback); + CHIP_ERROR err = mCASESessionManager->FindOrEstablishSession(fabricInfo->GetPeerIdForNode(mProviderNodeId), + &mOnConnectedCallback, &mOnConnectionFailureCallback); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(SoftwareUpdate, "Cannot establish connection to provider: %" CHIP_ERROR_FORMAT, err.Format())); } @@ -246,86 +254,42 @@ void OTARequestor::ConnectToProvider(OnConnectedAction onConnectedAction) // Called whenever FindOrEstablishSession is successful void OTARequestor::OnConnected(void * context, OperationalDeviceProxy * deviceProxy) { - VerifyOrReturn(context != nullptr, ChipLogError(SoftwareUpdate, "Successfully established session but context is invalid")); OTARequestor * requestorCore = static_cast(context); + VerifyOrDie(requestorCore != nullptr); + VerifyOrDie(deviceProxy != nullptr); switch (requestorCore->mOnConnectedAction) { case kQueryImage: { - QueryImageRequest request; - CHIP_ERROR err = requestorCore->BuildQueryImageRequest(request); - VerifyOrReturn(err == CHIP_NO_ERROR, - ChipLogError(SoftwareUpdate, "Failed to build QueryImage command: %" CHIP_ERROR_FORMAT, err.Format())); - - Controller::OtaSoftwareUpdateProviderCluster cluster; - cluster.Associate(deviceProxy, requestorCore->mProviderEndpointId); + CHIP_ERROR err = requestorCore->SendQueryImageRequest(*deviceProxy); - err = cluster.InvokeCommand(request.args, requestorCore, OnQueryImageResponse, OnQueryImageFailure); - VerifyOrReturn(err == CHIP_NO_ERROR, - ChipLogError(SoftwareUpdate, "Failed to send QueryImage command: %" CHIP_ERROR_FORMAT, err.Format())); + if (err != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "Failed to send QueryImage command: %" CHIP_ERROR_FORMAT, err.Format()); + requestorCore->mOtaRequestorDriver->HandleError(UpdateStateEnum::Querying, err); + } break; } case kStartBDX: { - VerifyOrReturn(requestorCore->mBdxDownloader != nullptr, ChipLogError(SoftwareUpdate, "Downloader is null")); - - // TODO: allow caller to provide their own OTADownloader instance and set BDX parameters + CHIP_ERROR err = requestorCore->StartDownload(*deviceProxy); - TransferSession::TransferInitData initOptions; - initOptions.TransferCtlFlags = bdx::TransferControlFlags::kReceiverDrive; - initOptions.MaxBlockSize = 1024; - char testFileDes[9] = { "test.txt" }; - initOptions.FileDesLength = static_cast(strlen(testFileDes)); - initOptions.FileDesignator = reinterpret_cast(testFileDes); - - if (deviceProxy != nullptr) + if (err != CHIP_NO_ERROR) { - chip::Messaging::ExchangeManager * exchangeMgr = deviceProxy->GetExchangeManager(); - if (exchangeMgr == nullptr) - { - ChipLogError(SoftwareUpdate, "Cannot retrieve exchange manager from device"); - return; - } - - Optional session = deviceProxy->GetSecureSession(); - if (!session.HasValue()) - { - ChipLogError(SoftwareUpdate, "Cannot retrieve session from device"); - return; - } - - requestorCore->mExchangeCtx = exchangeMgr->NewContext(session.Value(), &requestorCore->mBdxMessenger); - - if (requestorCore->mExchangeCtx == nullptr) - { - ChipLogError(BDX, "Unable to allocate ec: exchangeMgr=%p sessionExists? %u, OTA progress cannot continue", - exchangeMgr, session.HasValue()); - return; - } + ChipLogError(SoftwareUpdate, "Failed to start download: %" CHIP_ERROR_FORMAT, err.Format()); + requestorCore->mOtaRequestorDriver->HandleError(UpdateStateEnum::Downloading, err); } - requestorCore->mBdxMessenger.Init(requestorCore->mBdxDownloader, requestorCore->mExchangeCtx); - requestorCore->mBdxDownloader->SetMessageDelegate(&requestorCore->mBdxMessenger); - CHIP_ERROR err = requestorCore->mBdxDownloader->SetBDXParams(initOptions); - VerifyOrReturn(err == CHIP_NO_ERROR, - ChipLogError(SoftwareUpdate, "Error init BDXDownloader: %" CHIP_ERROR_FORMAT, err.Format())); - err = requestorCore->mBdxDownloader->BeginPrepareDownload(); - VerifyOrReturn(err == CHIP_NO_ERROR, - ChipLogError(SoftwareUpdate, "Cannot begin prepare download: %" CHIP_ERROR_FORMAT, err.Format())); break; } case kApplyUpdate: { - ApplyUpdateRequest::Type args; - CHIP_ERROR err = requestorCore->BuildApplyUpdateRequest(args); - VerifyOrReturn(err == CHIP_NO_ERROR, - ChipLogError(SoftwareUpdate, "Failed to build ApplyUpdate command: %" CHIP_ERROR_FORMAT, err.Format())); - - Controller::OtaSoftwareUpdateProviderCluster cluster; - cluster.Associate(deviceProxy, requestorCore->mProviderEndpointId); + CHIP_ERROR err = requestorCore->SendApplyUpdateRequest(*deviceProxy); - err = cluster.InvokeCommand(args, requestorCore, OnApplyUpdateResponse, OnApplyUpdateFailure); - VerifyOrReturn(err == CHIP_NO_ERROR, - ChipLogError(SoftwareUpdate, "Failed to send ApplyUpdate command: %" CHIP_ERROR_FORMAT, err.Format())); + if (err != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "Failed to send ApplyUpdate command: %" CHIP_ERROR_FORMAT, err.Format()); + requestorCore->mOtaRequestorDriver->HandleError(UpdateStateEnum::Applying, err); + } break; } @@ -334,7 +298,7 @@ void OTARequestor::OnConnected(void * context, OperationalDeviceProxy * devicePr } } -OTARequestor::OTATriggerResult OTARequestor::TriggerImmediateQuery() +OTARequestorInterface::OTATriggerResult OTARequestor::TriggerImmediateQuery() { if (mProviderNodeId != kUndefinedNodeId) @@ -350,9 +314,33 @@ OTARequestor::OTATriggerResult OTARequestor::TriggerImmediateQuery() } // Called whenever FindOrEstablishSession fails -void OTARequestor::OnConnectionFailure(void * context, NodeId deviceId, CHIP_ERROR error) +void OTARequestor::OnConnectionFailure(void * context, PeerId peerId, CHIP_ERROR error) +{ + OTARequestor * requestorCore = static_cast(context); + VerifyOrDie(requestorCore != nullptr); + + ChipLogError(SoftwareUpdate, "Failed to connect to node 0x%" PRIX64 ": %" CHIP_ERROR_FORMAT, peerId.GetNodeId(), + error.Format()); + + switch (requestorCore->mOnConnectedAction) + { + case kQueryImage: + requestorCore->mOtaRequestorDriver->HandleError(UpdateStateEnum::Querying, error); + break; + case kStartBDX: + requestorCore->mOtaRequestorDriver->HandleError(UpdateStateEnum::Downloading, error); + break; + case kApplyUpdate: + requestorCore->mOtaRequestorDriver->HandleError(UpdateStateEnum::Applying, error); + break; + default: + break; + } +} + +void OTARequestor::DownloadUpdate() { - ChipLogError(SoftwareUpdate, "Failed to connect to node 0x%" PRIX64 ": %" CHIP_ERROR_FORMAT, deviceId, error.Format()); + ConnectToProvider(kStartBDX); } void OTARequestor::ApplyUpdate() @@ -360,11 +348,27 @@ void OTARequestor::ApplyUpdate() ConnectToProvider(kApplyUpdate); } -CHIP_ERROR OTARequestor::BuildQueryImageRequest(QueryImageRequest & request) +void OTARequestor::OnDownloadStateChanged(OTADownloader::State state) +{ + VerifyOrReturn(mOtaRequestorDriver != nullptr); + + switch (state) + { + case OTADownloader::State::kComplete: + mOtaRequestorDriver->UpdateDownloaded(); + break; + case OTADownloader::State::kIdle: + mOtaRequestorDriver->HandleError(UpdateStateEnum::Downloading, CHIP_ERROR_CONNECTION_ABORTED); + break; + default: + break; + } +} + +CHIP_ERROR OTARequestor::SendQueryImageRequest(OperationalDeviceProxy & deviceProxy) { constexpr EmberAfOTADownloadProtocol kProtocolsSupported[] = { EMBER_ZCL_OTA_DOWNLOAD_PROTOCOL_BDX_SYNCHRONOUS }; - constexpr bool kRequestorCanConsent = false; - QueryImage::Type & args = request.args; + QueryImage::Type args; uint16_t vendorId; VerifyOrReturnError(Basic::Attributes::VendorID::Get(kRootEndpointId, &vendorId) == EMBER_ZCL_STATUS_SUCCESS, @@ -378,7 +382,7 @@ CHIP_ERROR OTARequestor::BuildQueryImageRequest(QueryImageRequest & request) CHIP_ERROR_READ_FAILED); args.protocolsSupported = kProtocolsSupported; - args.requestorCanConsent.SetValue(kRequestorCanConsent); + args.requestorCanConsent.SetValue(mOtaRequestorDriver->CanConsent()); uint16_t hardwareVersion; if (Basic::Attributes::HardwareVersion::Get(kRootEndpointId, &hardwareVersion) == EMBER_ZCL_STATUS_SUCCESS) @@ -386,27 +390,72 @@ CHIP_ERROR OTARequestor::BuildQueryImageRequest(QueryImageRequest & request) args.hardwareVersion.SetValue(hardwareVersion); } - if (Basic::Attributes::Location::Get(kRootEndpointId, MutableCharSpan(request.location)) == EMBER_ZCL_STATUS_SUCCESS) + char location[DeviceLayer::ConfigurationManager::kMaxLocationLength]; + if (Basic::Attributes::Location::Get(kRootEndpointId, MutableCharSpan(location)) == EMBER_ZCL_STATUS_SUCCESS) { - args.location.SetValue(CharSpan(request.location)); + args.location.SetValue(CharSpan(location)); } + Controller::OtaSoftwareUpdateProviderCluster cluster; + cluster.Associate(&deviceProxy, mProviderEndpointId); + + return cluster.InvokeCommand(args, this, OnQueryImageResponse, OnQueryImageFailure); +} + +CHIP_ERROR OTARequestor::ExtractUpdateDescription(const QueryImageResponseDecodableType & response, + UpdateDescription & update) const +{ + NodeId nodeId; + CharSpan fileDesignator; + + VerifyOrReturnError(response.imageURI.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + ReturnErrorOnFailure(bdx::ParseURI(response.imageURI.Value(), nodeId, fileDesignator)); + update.imageURI = response.imageURI.Value(); + + VerifyOrReturnError(response.softwareVersion.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(response.softwareVersionString.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + update.softwareVersion = response.softwareVersion.Value(); + + VerifyOrReturnError(response.updateToken.HasValue(), CHIP_ERROR_INVALID_ARGUMENT); + update.updateToken = response.updateToken.Value(); + + update.userConsentNeeded = response.userConsentNeeded.ValueOr(false); + update.metadataForRequestor = response.metadataForRequestor.ValueOr({}); + return CHIP_NO_ERROR; } -bool OTARequestor::ValidateQueryImageResponse(const QueryImageResponse::DecodableType & response) const +CHIP_ERROR OTARequestor::StartDownload(OperationalDeviceProxy & deviceProxy) { - if (response.status == OTAQueryStatus::kUpdateAvailable) - { - VerifyOrReturnError(response.imageURI.HasValue(), false); - VerifyOrReturnError(response.softwareVersion.HasValue() && response.softwareVersionString.HasValue(), false); - VerifyOrReturnError(response.updateToken.HasValue(), false); - } + VerifyOrReturnError(mBdxDownloader != nullptr, CHIP_ERROR_INCORRECT_STATE); - return true; + // TODO: allow caller to provide their own OTADownloader instance and set BDX parameters + + TransferSession::TransferInitData initOptions; + initOptions.TransferCtlFlags = bdx::TransferControlFlags::kReceiverDrive; + initOptions.MaxBlockSize = mOtaRequestorDriver->GetMaxDownloadBlockSize(); + char testFileDes[9] = { "test.txt" }; + initOptions.FileDesLength = static_cast(strlen(testFileDes)); + initOptions.FileDesignator = reinterpret_cast(testFileDes); + + chip::Messaging::ExchangeManager * exchangeMgr = deviceProxy.GetExchangeManager(); + VerifyOrReturnError(exchangeMgr != nullptr, CHIP_ERROR_INCORRECT_STATE); + + Optional session = deviceProxy.GetSecureSession(); + VerifyOrReturnError(session.HasValue(), CHIP_ERROR_INCORRECT_STATE); + + mExchangeCtx = exchangeMgr->NewContext(session.Value(), &mBdxMessenger); + VerifyOrReturnError(mExchangeCtx != nullptr, CHIP_ERROR_NO_MEMORY); + + mBdxMessenger.Init(mBdxDownloader, mExchangeCtx); + mBdxDownloader->SetMessageDelegate(&mBdxMessenger); + mBdxDownloader->SetStateDelegate(this); + + ReturnErrorOnFailure(mBdxDownloader->SetBDXParams(initOptions)); + return mBdxDownloader->BeginPrepareDownload(); } -CHIP_ERROR OTARequestor::BuildApplyUpdateRequest(ApplyUpdateRequest::Type & args) +CHIP_ERROR OTARequestor::SendApplyUpdateRequest(OperationalDeviceProxy & deviceProxy) { if (mUpdateToken.empty()) { @@ -422,9 +471,14 @@ CHIP_ERROR OTARequestor::BuildApplyUpdateRequest(ApplyUpdateRequest::Type & args mUpdateToken = ByteSpan(mUpdateTokenBuffer, sizeof(NodeId)); } + ApplyUpdateRequest::Type args; args.updateToken = mUpdateToken; args.newVersion = mUpdateVersion; - return CHIP_NO_ERROR; + + Controller::OtaSoftwareUpdateProviderCluster cluster; + cluster.Associate(&deviceProxy, mProviderEndpointId); + + return cluster.InvokeCommand(args, this, OnApplyUpdateResponse, OnApplyUpdateFailure); } } // namespace chip diff --git a/src/app/clusters/ota-requestor/OTARequestor.h b/src/app/clusters/ota-requestor/OTARequestor.h index bd342ceb415540..663ecbce0a2ba6 100644 --- a/src/app/clusters/ota-requestor/OTARequestor.h +++ b/src/app/clusters/ota-requestor/OTARequestor.h @@ -33,7 +33,7 @@ namespace chip { // This class implements all of the core logic of the OTA Requestor -class OTARequestor : public OTARequestorInterface +class OTARequestor : public OTARequestorInterface, public BDXDownloader::StateDelegate { public: // Various actions to take when OnConnected callback is called @@ -48,19 +48,18 @@ class OTARequestor : public OTARequestorInterface // Application interface declarations -- start - // Return value for various trigger-type APIs - enum OTATriggerResult - { - kTriggerSuccessful = 0, - kNoProviderKnown = 1 - }; - // Application directs the Requestor to start the Image Query process // and download the new image if available - OTATriggerResult TriggerImmediateQuery(); + OTATriggerResult TriggerImmediateQuery() override; + + // Initiate download of the new image + void DownloadUpdate() override; // Send ApplyImage - void ApplyUpdate(); + void ApplyUpdate() override; + + // Handle download state change + void OnDownloadStateChanged(OTADownloader::State state) override; // A setter for the delegate class pointer void SetOtaRequestorDriver(OTARequestorDriver * driver) { mOtaRequestorDriver = driver; } @@ -95,7 +94,7 @@ class OTARequestor : public OTARequestorInterface // Handler for the AnnounceOTAProvider command EmberAfStatus HandleAnnounceOTAProvider( app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - const app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::DecodableType & commandData); + const app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::DecodableType & commandData) override; // Virtual functions from OTARequestorInterface -- end /** @@ -120,7 +119,7 @@ class OTARequestor : public OTARequestorInterface * Called to indicate test mode. This is when the Requestor is used as a test tool and the the provider parameters are supplied * explicitly. */ - void TestModeSetProviderParameters(NodeId nodeId, FabricIndex fabIndex, EndpointId endpointId) + void TestModeSetProviderParameters(NodeId nodeId, FabricIndex fabIndex, EndpointId endpointId) override { mProviderNodeId = nodeId; mProviderFabricIndex = fabIndex; @@ -128,7 +127,6 @@ class OTARequestor : public OTARequestorInterface } private: - struct QueryImageRequest; using QueryImageResponseDecodableType = app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType; using ApplyUpdateResponseDecodableType = app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType; @@ -202,25 +200,30 @@ class OTARequestor : public OTARequestorInterface }; /** - * Create a QueryImage request using values from the Basic cluster attributes + * Send QueryImage request using values matching Basic cluster + */ + CHIP_ERROR SendQueryImageRequest(OperationalDeviceProxy & deviceProxy); + + /** + * Validate and extract mandatory information from QueryImageResponse */ - CHIP_ERROR BuildQueryImageRequest(QueryImageRequest & request); + CHIP_ERROR ExtractUpdateDescription(const QueryImageResponseDecodableType & response, UpdateDescription & update) const; /** - * Verify all required fields are present in the QueryImageResponse + * Start download of the software image returned in QueryImageResponse */ - bool ValidateQueryImageResponse(const QueryImageResponseDecodableType & response) const; + CHIP_ERROR StartDownload(OperationalDeviceProxy & deviceProxy); /** - * Create a ApplyUpdate request using values obtained from QueryImageResponse + * Send ApplyUpdate request using values obtained from QueryImageResponse */ - CHIP_ERROR BuildApplyUpdateRequest(app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type & args); + CHIP_ERROR SendApplyUpdateRequest(OperationalDeviceProxy & deviceProxy); /** * Session connection callbacks */ static void OnConnected(void * context, OperationalDeviceProxy * deviceProxy); - static void OnConnectionFailure(void * context, NodeId deviceId, CHIP_ERROR error); + static void OnConnectionFailure(void * context, PeerId peerId, CHIP_ERROR error); Callback::Callback mOnConnectedCallback; Callback::Callback mOnConnectionFailureCallback; diff --git a/src/app/clusters/ota-requestor/ota-requestor-server.cpp b/src/app/clusters/ota-requestor/ota-requestor-server.cpp new file mode 100644 index 00000000000000..a38957ad3cd30b --- /dev/null +++ b/src/app/clusters/ota-requestor/ota-requestor-server.cpp @@ -0,0 +1,107 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* This file contains the glue code for passing the incoming OTA Requestor cluster commands + * to the OTA Requestor object that handles them + */ + +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OtaSoftwareUpdateRequestor; + +namespace { + +class OtaSoftwareUpdateRequestorAttrAccess : public AttributeAccessInterface +{ +public: + // Register for the OTA Requestor Cluster on all endpoints. + OtaSoftwareUpdateRequestorAttrAccess() : + AttributeAccessInterface(Optional::Missing(), OtaSoftwareUpdateRequestor::Id) + {} + + // TODO: Implement Read/Write for OtaSoftwareUpdateRequestorAttrAccess + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; +}; + +OtaSoftwareUpdateRequestorAttrAccess gAttrAccess; + +CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + switch (aPath.mAttributeId) + { + case Attributes::DefaultOtaProviders::Id: + return aEncoder.Encode(DataModel::List()); + default: + break; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OtaSoftwareUpdateRequestorAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + switch (aPath.mAttributeId) + { + case Attributes::DefaultOtaProviders::Id: { + DataModel::DecodableList list; + ReturnErrorOnFailure(aDecoder.Decode(list)); + // Ignore the list for now + break; + } + default: + break; + } + return CHIP_NO_ERROR; +} + +} // namespace + +bool emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::DecodableType & commandData) +{ + EmberAfStatus status; + chip::OTARequestorInterface * requestor = chip::GetRequestorInstance(); + + if (requestor != nullptr) + { + status = requestor->HandleAnnounceOTAProvider(commandObj, commandPath, commandData); + } + else + { + status = EMBER_ZCL_STATUS_FAILURE; + } + + emberAfSendImmediateDefaultResponse(status); + return true; +} + +// ----------------------------------------------------------------------------- +// Plugin initialization + +void MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(void) +{ + registerAttributeAccessOverride(&gAttrAccess); +} diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp index 7fd9581a3d59a6..4a31c0eaa14028 100644 --- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp +++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp @@ -119,7 +119,7 @@ CHIP_ERROR SoftwareDiagosticsAttrAccess::ReadThreadMetrics(AttributeValueEncoder } else { - err = aEncoder.Encode(DataModel::List()); + err = aEncoder.EncodeEmptyList(); } return err; diff --git a/src/app/clusters/switch-server/switch-server.cpp b/src/app/clusters/switch-server/switch-server.cpp new file mode 100644 index 00000000000000..2cab1043dd50d9 --- /dev/null +++ b/src/app/clusters/switch-server/switch-server.cpp @@ -0,0 +1,200 @@ +/** + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::Switch; +using namespace chip::app::Clusters::Switch::Attributes; +using chip::DeviceLayer::DeviceControlServer; + +namespace { + +class SwitchDelegate : public DeviceLayer::SwitchDeviceControlDelegate +{ + /** + * @brief + * Called when the latching switch is moved to a new position. + */ + void OnSwitchLatched(uint8_t newPosition) override + { + ChipLogProgress(Zcl, "SwitchDelegate: OnSwitchLatched"); + + for (auto endpointId : EnabledEndpointsWithServerCluster(Switch::Id)) + { + // Record SwitchLatched event + EventNumber eventNumber; + Events::SwitchLatched::Type event{ newPosition }; + + if (CHIP_NO_ERROR != LogEvent(event, endpointId, eventNumber)) + { + ChipLogError(Zcl, "SwitchDelegate: Failed to record SwitchLatched event"); + } + } + } + + /** + * @brief + * Called when the momentary switch starts to be pressed. + */ + void OnInitialPressed(uint8_t newPosition) override + { + ChipLogProgress(Zcl, "SwitchDelegate: OnInitialPressed"); + + for (auto endpointId : EnabledEndpointsWithServerCluster(Switch::Id)) + { + // Record InitialPress event + EventNumber eventNumber; + Events::InitialPress::Type event{ newPosition }; + + if (CHIP_NO_ERROR != LogEvent(event, endpointId, eventNumber)) + { + ChipLogError(Zcl, "SwitchDelegate: Failed to record InitialPress event"); + } + } + } + + /** + * @brief + * Called when the momentary switch has been pressed for a "long" time. + */ + void OnLongPressed(uint8_t newPosition) override + { + ChipLogProgress(Zcl, "SwitchDelegate: OnLongPressed"); + + for (auto endpointId : EnabledEndpointsWithServerCluster(Switch::Id)) + { + // Record LongPress event + EventNumber eventNumber; + Events::LongPress::Type event{ newPosition }; + + if (CHIP_NO_ERROR != LogEvent(event, endpointId, eventNumber)) + { + ChipLogError(Zcl, "SwitchDelegate: Failed to record LongPress event"); + } + } + } + + /** + * @brief + * Called when the momentary switch has been released. + */ + void OnShortReleased(uint8_t previousPosition) override + { + ChipLogProgress(Zcl, "SwitchDelegate: OnShortReleased"); + + for (auto endpointId : EnabledEndpointsWithServerCluster(Switch::Id)) + { + // Record ShortRelease event + EventNumber eventNumber; + Events::ShortRelease::Type event{ previousPosition }; + + if (CHIP_NO_ERROR != LogEvent(event, endpointId, eventNumber)) + { + ChipLogError(Zcl, "SwitchDelegate: Failed to record ShortRelease event"); + } + } + } + + /** + * @brief + * Called when the momentary switch has been released (after debouncing) + * and after having been pressed for a long time. + */ + void OnLongReleased(uint8_t previousPosition) override + { + ChipLogProgress(Zcl, "SwitchDelegate: OnLongReleased"); + + for (auto endpointId : EnabledEndpointsWithServerCluster(Switch::Id)) + { + // Record LongRelease event + EventNumber eventNumber; + Events::LongRelease::Type event{ previousPosition }; + + if (CHIP_NO_ERROR != LogEvent(event, endpointId, eventNumber)) + { + ChipLogError(Zcl, "SwitchDelegate: Failed to record LongRelease event"); + } + } + } + + /** + * @brief + * Called to indicate how many times the momentary switch has been pressed + * in a multi-press sequence, during that sequence. + */ + void OnMultiPressOngoing(uint8_t newPosition, uint8_t count) override + { + ChipLogProgress(Zcl, "SwitchDelegate: OnMultiPressOngoing"); + + for (auto endpointId : EnabledEndpointsWithServerCluster(Switch::Id)) + { + // Record MultiPressOngoing event + EventNumber eventNumber; + Events::MultiPressOngoing::Type event{ newPosition, count }; + + if (CHIP_NO_ERROR != LogEvent(event, endpointId, eventNumber)) + { + ChipLogError(Zcl, "SwitchDelegate: Failed to record MultiPressOngoing event"); + } + } + } + + /** + * @brief + * Called to indicate how many times the momentary switch has been pressed + * in a multi-press sequence, after it has been detected that the sequence has ended. + */ + void OnMultiPressComplete(uint8_t newPosition, uint8_t count) override + { + ChipLogProgress(Zcl, "SwitchDelegate: OnMultiPressComplete"); + + for (auto endpointId : EnabledEndpointsWithServerCluster(Switch::Id)) + { + // Record MultiPressComplete event + EventNumber eventNumber; + Events::MultiPressComplete::Type event{ newPosition, count }; + + if (CHIP_NO_ERROR != LogEvent(event, endpointId, eventNumber)) + { + ChipLogError(Zcl, "SwitchDelegate: Failed to record MultiPressComplete event"); + } + } + } +}; + +SwitchDelegate gSwitchDelegate; + +} // anonymous namespace + +void MatterSwitchPluginServerInitCallback() +{ + DeviceControlServer::DeviceControlSvr().SetSwitchDelegate(&gSwitchDelegate); +} diff --git a/src/app/clusters/target-navigator-server/target-navigator-delegate.h b/src/app/clusters/target-navigator-server/target-navigator-delegate.h new file mode 100644 index 00000000000000..5c2de2a23d7287 --- /dev/null +++ b/src/app/clusters/target-navigator-server/target-navigator-delegate.h @@ -0,0 +1,47 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace TargetNavigator { + +/** @brief + * Defines methods for implementing application-specific logic for the Target Navigator Cluster. + */ +class Delegate +{ +public: + virtual std::list HandleGetTargetList() = 0; + virtual uint8_t HandleGetCurrentTarget() = 0; + virtual Commands::NavigateTargetResponse::Type HandleNavigateTarget(const uint64_t & target, const chip::CharSpan & data) = 0; + + virtual ~Delegate() = default; +}; + +} // namespace TargetNavigator +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index 7f464c14e13bad..13eb7552d1721d 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -22,48 +22,166 @@ ******************************************************************************* ******************************************************************************/ -#include +#include +#include + +#include #include #include -#include -#include +#include +#include using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::TargetNavigator; -TargetNavigatorResponse targetNavigatorClusterNavigateTarget(chip::EndpointId endpointId, uint8_t target, std::string data); +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::TargetNavigator::Delegate; -void sendResponse(app::CommandHandler * command, TargetNavigatorResponse response) +namespace { + +Delegate * gDelegateTable[EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) { - CHIP_ERROR err = CHIP_NO_ERROR; - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), TargetNavigator::Id, - TargetNavigator::Commands::NavigateTargetResponse::Id }; - TLV::TLVWriter * writer = nullptr; - SuccessOrExit(err = command->PrepareCommand(path)); - VerifyOrExit((writer = command->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - SuccessOrExit(err = writer->Put(TLV::ContextTag(0), response.status)); - SuccessOrExit(err = writer->PutString(TLV::ContextTag(1), reinterpret_cast(response.data))); - SuccessOrExit(err = command->FinishCommand()); -exit: - if (err != CHIP_NO_ERROR) + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::TargetNavigator::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) + { + ChipLogError(Zcl, "Target Navigator has no delegate set for endpoint:%" PRIu16, endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace TargetNavigator { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::TargetNavigator::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else { - ChipLogError(Zcl, "Failed to send NavigateTargetResponse. Error:%s", ErrorStr(err)); } } -bool emberAfTargetNavigatorClusterNavigateTargetCallback(app::CommandHandler * command, - const app::ConcreteCommandPath & commandPath, - const Commands::NavigateTarget::DecodableType & commandData) +} // namespace TargetNavigator +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Attribute Accessor Implementation + +namespace { + +class TargetNavigatorAttrAccess : public app::AttributeAccessInterface { - auto & target = commandData.target; - auto & data = commandData.data; +public: + TargetNavigatorAttrAccess() : + app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::TargetNavigator::Id) + {} + + CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadTargetListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); + CHIP_ERROR ReadCurrentTargetAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); +}; + +TargetNavigatorAttrAccess gTargetNavigatorAttrAccess; + +CHIP_ERROR TargetNavigatorAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +{ + EndpointId endpoint = aPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); + + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + switch (aPath.mAttributeId) + { + case app::Clusters::TargetNavigator::Attributes::TargetNavigatorList::Id: { + return ReadTargetListAttribute(aEncoder, delegate); + } + case app::Clusters::TargetNavigator::Attributes::CurrentNavigatorTarget::Id: { + return ReadCurrentTargetAttribute(aEncoder, delegate); + } + default: { + break; + } + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR TargetNavigatorAttrAccess::ReadTargetListAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + std::list targetList = delegate->HandleGetTargetList(); + return aEncoder.EncodeList([targetList](const auto & encoder) -> CHIP_ERROR { + for (const auto & target : targetList) + { + ReturnErrorOnFailure(encoder.Encode(target)); + } + return CHIP_NO_ERROR; + }); +} + +CHIP_ERROR TargetNavigatorAttrAccess::ReadCurrentTargetAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + uint8_t currentTarget = delegate->HandleGetCurrentTarget(); + return aEncoder.Encode(currentTarget); +} + +} // anonymous namespace + +// ----------------------------------------------------------------------------- +// Matter Framework Callbacks Implementation + +bool emberAfTargetNavigatorClusterNavigateTargetRequestCallback(app::CommandHandler * command, + const app::ConcreteCommandPath & commandPath, + const Commands::NavigateTargetRequest::DecodableType & commandData) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + EndpointId endpoint = commandPath.mEndpointId; + auto & target = commandData.target; + auto & data = commandData.data; + + Delegate * delegate = GetDelegate(endpoint); + VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE); + + { + Commands::NavigateTargetResponse::Type response = delegate->HandleNavigateTarget(target, data); + err = command->AddResponseData(commandPath, response); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "emberAfTargetNavigatorClusterNavigateTargetRequestCallback error: %s", err.AsString()); + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } - // TODO: char is not null terminated, verify this code once #7963 gets merged. - std::string dataString(data.data(), data.size()); - TargetNavigatorResponse response = targetNavigatorClusterNavigateTarget(emberAfCurrentEndpoint(), target, dataString); - sendResponse(command, response); return true; } -void MatterTargetNavigatorPluginServerInitCallback() {} +void MatterTargetNavigatorPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gTargetNavigatorAttrAccess); +} diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.h b/src/app/clusters/target-navigator-server/target-navigator-server.h index 17d77613e0302a..584b2152c19364 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.h +++ b/src/app/clusters/target-navigator-server/target-navigator-server.h @@ -23,8 +23,17 @@ #pragma once -struct TargetNavigatorResponse -{ - uint8_t status; - uint8_t * data; -}; +#include "target-navigator-delegate.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace TargetNavigator { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace TargetNavigator +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp index ee91dbdebabd5b..cb7fddebd7ec67 100644 --- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp +++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp @@ -186,6 +186,13 @@ CHIP_ERROR TestAttrAccess::WriteListInt8uAttribute(AttributeValueDecoder & aDeco ReturnErrorOnFailure(aDecoder.Decode(list)); + size_t size; + ReturnErrorOnFailure(list.ComputeSize(&size)); + + // We never change our length, so fail out attempts to change it. This + // should really return one of the spec errors! + VerifyOrReturnError(size == kAttributeListLength, CHIP_ERROR_INVALID_ARGUMENT); + uint8_t index = 0; auto iter = list.begin(); while (iter.Next()) diff --git a/src/app/clusters/tv-channel-server/tv-channel-server.cpp b/src/app/clusters/tv-channel-server/tv-channel-server.cpp deleted file mode 100644 index 04674ba566095c..00000000000000 --- a/src/app/clusters/tv-channel-server/tv-channel-server.cpp +++ /dev/null @@ -1,98 +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. - */ - -/** - * - * Copyright (c) 2021 Silicon Labs - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/**************************************************************************** - * @file - * @brief Routines for the TV Channel plugin, the - *server implementation of the TV Channel cluster. - ******************************************************************************* - ******************************************************************************/ - -#include -#include -#include -#include -#include - -using namespace chip; -using namespace chip::app::Clusters; -using namespace chip::app::Clusters::TvChannel; - -::TvChannelInfo tvChannelClusterChangeChannel(std::string match); -bool tvChannelClusterChangeChannelByNumber(uint16_t majorNumer, uint16_t minorNumber); -bool tvChannelClusterSkipChannel(uint16_t count); - -bool emberAfTvChannelClusterChangeChannelCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::ChangeChannel::DecodableType & commandData) -{ - Commands::ChangeChannelResponse::Type response; - response.channelMatch.majorNumber = 1; - response.channelMatch.minorNumber = 0; - response.channelMatch.name = chip::CharSpan("name", strlen("name")); - response.channelMatch.callSign = chip::CharSpan("callSign", strlen("callSign")); - response.channelMatch.affiliateCallSign = chip::CharSpan("affiliateCallSign", strlen("affiliateCallSign")); - response.errorType = (TvChannelErrorType) 0; - - CHIP_ERROR err = command->AddResponseData(commandPath, response); - if (err != CHIP_NO_ERROR) - { - emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); - } - return true; -} - -bool emberAfTvChannelClusterChangeChannelByNumberCallback(app::CommandHandler * command, - const app::ConcreteCommandPath & commandPath, - const Commands::ChangeChannelByNumber::DecodableType & commandData) -{ - auto & majorNumber = commandData.majorNumber; - auto & minorNumber = commandData.minorNumber; - - bool success = tvChannelClusterChangeChannelByNumber(majorNumber, minorNumber); - EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; - emberAfSendImmediateDefaultResponse(status); - return true; -} - -bool emberAfTvChannelClusterSkipChannelCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath, - const Commands::SkipChannel::DecodableType & commandData) -{ - auto & count = commandData.count; - - bool success = tvChannelClusterSkipChannel(count); - EmberAfStatus status = success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; - emberAfSendImmediateDefaultResponse(status); - return true; -} - -void MatterTvChannelPluginServerInitCallback() {} diff --git a/src/app/clusters/user-label-server/user-label-server.cpp b/src/app/clusters/user-label-server/user-label-server.cpp index ad3cd4952142a7..56bca08f6654b5 100644 --- a/src/app/clusters/user-label-server/user-label-server.cpp +++ b/src/app/clusters/user-label-server/user-label-server.cpp @@ -45,11 +45,15 @@ class UserLabelAttrAccess : public AttributeAccessInterface UserLabelAttrAccess() : AttributeAccessInterface(Optional::Missing(), UserLabel::Id) {} CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; private: CHIP_ERROR ReadLabelList(EndpointId endpoint, AttributeValueEncoder & aEncoder); + CHIP_ERROR WriteLabelList(EndpointId endpoint, AttributeValueDecoder & aDecoder); }; +UserLabelAttrAccess gAttrAccess; + CHIP_ERROR UserLabelAttrAccess::ReadLabelList(EndpointId endpoint, AttributeValueEncoder & aEncoder) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -68,13 +72,29 @@ CHIP_ERROR UserLabelAttrAccess::ReadLabelList(EndpointId endpoint, AttributeValu } else { - err = aEncoder.Encode(DataModel::List()); + err = aEncoder.EncodeEmptyList(); } return err; } -UserLabelAttrAccess gAttrAccess; +CHIP_ERROR UserLabelAttrAccess::WriteLabelList(EndpointId endpoint, AttributeValueDecoder & aDecoder) +{ + DeviceLayer::LabelList labelList; + LabelList::TypeInfo::DecodableType decodablelist; + + ReturnErrorOnFailure(aDecoder.Decode(decodablelist)); + + auto iter = decodablelist.begin(); + while (iter.Next()) + { + auto & entry = iter.GetValue(); + ReturnErrorOnFailure(labelList.add(entry)); + } + ReturnErrorOnFailure(iter.GetStatus()); + + return DeviceLayer::PlatformMgr().SetUserLabelList(endpoint, labelList); +} CHIP_ERROR UserLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) { @@ -89,6 +109,21 @@ CHIP_ERROR UserLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, At } return CHIP_NO_ERROR; } + +CHIP_ERROR UserLabelAttrAccess::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + VerifyOrDie(aPath.mClusterId == UserLabel::Id); + + switch (aPath.mAttributeId) + { + case LabelList::Id: + return WriteLabelList(aPath.mEndpointId, aDecoder); + default: + break; + } + return CHIP_NO_ERROR; +} + } // anonymous namespace void MatterUserLabelPluginServerInitCallback(void) diff --git a/examples/tv-app/linux/include/application-basic/Application.h b/src/app/clusters/wake-on-lan-server/wake-on-lan-delegate.h similarity index 58% rename from examples/tv-app/linux/include/application-basic/Application.h rename to src/app/clusters/wake-on-lan-server/wake-on-lan-delegate.h index 5de748b900ff38..400dda253a867d 100644 --- a/examples/tv-app/linux/include/application-basic/Application.h +++ b/src/app/clusters/wake-on-lan-server/wake-on-lan-delegate.h @@ -20,16 +20,23 @@ #include -struct Application +namespace chip { +namespace app { +namespace Clusters { +namespace WakeOnLan { + +/** @brief + * Defines methods for implementing application-specific logic for the Wake on LAN Cluster. + */ +class Delegate { - using ApplicationBasicStatus = chip::app::Clusters::ApplicationBasic::ApplicationBasicStatus; - char vendorName[32] = ""; - char name[32] = ""; - char id[32] = ""; - char version[32] = ""; - uint16_t vendorId = 0; - uint16_t productId = 0; - uint16_t catalogVendorId = 0; - uint16_t allowedVendorList[32] = { 123, 456 }; - ApplicationBasicStatus status = ApplicationBasicStatus::kStopped; +public: + virtual chip::CharSpan HandleGetMacAddress() = 0; + + virtual ~Delegate() = default; }; + +} // namespace WakeOnLan +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp new file mode 100644 index 00000000000000..9b6e5d20e9634a --- /dev/null +++ b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.cpp @@ -0,0 +1,138 @@ +/** + * + * 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. + */ + +/**************************************************************************** + * @file + * @brief Routines for the Wake on LAN plugin, the + *server implementation of the Wake on LAN cluster. + ******************************************************************************* + ******************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::WakeOnLan; + +// ----------------------------------------------------------------------------- +// Delegate Implementation + +using chip::app::Clusters::WakeOnLan::Delegate; + +namespace { + +Delegate * gDelegateTable[EMBER_AF_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT] = { nullptr }; + +Delegate * GetDelegate(EndpointId endpoint) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::WakeOnLan::Id); + return (ep == 0xFFFF ? NULL : gDelegateTable[ep]); +} + +bool isDelegateNull(Delegate * delegate, EndpointId endpoint) +{ + if (delegate == nullptr) + { + ChipLogError(Zcl, "WakeOnLan has no delegate set for endpoint:%" PRIu16, endpoint); + return true; + } + return false; +} +} // namespace + +namespace chip { +namespace app { +namespace Clusters { +namespace WakeOnLan { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) +{ + uint16_t ep = emberAfFindClusterServerEndpointIndex(endpoint, chip::app::Clusters::WakeOnLan::Id); + if (ep != 0xFFFF) + { + gDelegateTable[ep] = delegate; + } + else + { + } +} + +} // namespace WakeOnLan +} // namespace Clusters +} // namespace app +} // namespace chip + +// ----------------------------------------------------------------------------- +// Attribute Accessor Implementation + +namespace { + +class WakeOnLanAttrAccess : public app::AttributeAccessInterface +{ +public: + WakeOnLanAttrAccess() : app::AttributeAccessInterface(Optional::Missing(), chip::app::Clusters::WakeOnLan::Id) {} + + CHIP_ERROR Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) override; + +private: + CHIP_ERROR ReadMacAddressAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate); +}; + +WakeOnLanAttrAccess gWakeOnLanAttrAccess; + +CHIP_ERROR WakeOnLanAttrAccess::Read(const app::ConcreteReadAttributePath & aPath, app::AttributeValueEncoder & aEncoder) +{ + EndpointId endpoint = aPath.mEndpointId; + Delegate * delegate = GetDelegate(endpoint); + + if (isDelegateNull(delegate, endpoint)) + { + return CHIP_NO_ERROR; + } + + switch (aPath.mAttributeId) + { + case app::Clusters::WakeOnLan::Attributes::WakeOnLanMacAddress::Id: { + return ReadMacAddressAttribute(aEncoder, delegate); + } + default: { + break; + } + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR WakeOnLanAttrAccess::ReadMacAddressAttribute(app::AttributeValueEncoder & aEncoder, Delegate * delegate) +{ + chip::CharSpan macAddress = delegate->HandleGetMacAddress(); + return aEncoder.Encode(macAddress); +} + +} // anonymous namespace + +void MatterWakeOnLanPluginServerInitCallback() +{ + registerAttributeAccessOverride(&gWakeOnLanAttrAccess); +} diff --git a/src/app/clusters/wake-on-lan-server/wake-on-lan-server.h b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.h new file mode 100644 index 00000000000000..abce9778d93265 --- /dev/null +++ b/src/app/clusters/wake-on-lan-server/wake-on-lan-server.h @@ -0,0 +1,38 @@ +/** + * + * 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. + */ +/**************************************************************************** + * @file + * @brief Routines for the Wake on LAN plugin, the + *server implementation of the Wake on LAN cluster. + ******************************************************************************* + ******************************************************************************/ + +#pragma once + +#include "wake-on-lan-delegate.h" + +namespace chip { +namespace app { +namespace Clusters { +namespace WakeOnLan { + +void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate); + +} // namespace WakeOnLan +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp index 04a65368ba72eb..f04f8d0915f582 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.cpp +++ b/src/app/clusters/window-covering-server/window-covering-server.cpp @@ -15,23 +15,6 @@ * limitations under the License. */ -/** - * - * Copyright (c) 2020 Silicon Labs - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "window-covering-server.h" #include @@ -56,9 +39,10 @@ using namespace chip; using namespace chip::app::Clusters::WindowCovering; +#define WC_PERCENT100THS_MIN 0 #define WC_PERCENT100THS_MAX 10000 -static bool HasFeature(chip::EndpointId endpoint, WindowCoveringFeature feature) +static bool HasFeature(chip::EndpointId endpoint, WcFeature feature) { uint32_t FeatureMap = 0; if (EMBER_ZCL_STATUS_SUCCESS == @@ -72,6 +56,16 @@ static bool HasFeature(chip::EndpointId endpoint, WindowCoveringFeature feature) return false; } +static bool HasFeaturePaLift(chip::EndpointId endpoint) +{ + return (HasFeature(endpoint, WcFeature::kLift) && HasFeature(endpoint, WcFeature::kPositionAwareLift)); +} + +static bool HasFeaturePaTilt(chip::EndpointId endpoint) +{ + return (HasFeature(endpoint, WcFeature::kTilt) && HasFeature(endpoint, WcFeature::kPositionAwareTilt)); +} + static uint16_t ValueToPercent100ths(uint16_t openLimit, uint16_t closedLimit, uint16_t value) { uint16_t minimum = 0, range = UINT16_MAX; @@ -161,48 +155,56 @@ namespace app { namespace Clusters { namespace WindowCovering { -bool IsOpen(chip::EndpointId endpoint) +bool IsLiftOpen(chip::EndpointId endpoint) { - uint16_t liftPosition = 0; - uint16_t liftLimit = 0; - uint16_t tiltPosition = 0; - uint16_t tiltLimit = 0; - bool isOpen = false; + EmberAfStatus status; + app::DataModel::Nullable position; - if (HasFeature(endpoint, WindowCoveringFeature::kLift) && HasFeature(endpoint, WindowCoveringFeature::kPositionAwareLift) && - HasFeature(endpoint, WindowCoveringFeature::kAbsolutePosition) && - EMBER_ZCL_STATUS_SUCCESS == Attributes::TargetPositionLiftPercent100ths::Get(endpoint, &liftPosition) && - EMBER_ZCL_STATUS_SUCCESS == Attributes::InstalledOpenLimitLift::Get(endpoint, &liftLimit)) - { - isOpen = liftPosition == liftLimit; - } - else if (HasFeature(endpoint, WindowCoveringFeature::kLift) && - HasFeature(endpoint, WindowCoveringFeature::kPositionAwareLift) && - EMBER_ZCL_STATUS_SUCCESS == Attributes::TargetPositionLiftPercent100ths::Get(endpoint, &liftPosition)) - { - isOpen = 0 == liftPosition; - } + status = Attributes::TargetPositionLiftPercent100ths::Get(endpoint, position); - if (HasFeature(endpoint, WindowCoveringFeature::kTilt) && HasFeature(endpoint, WindowCoveringFeature::kPositionAwareTilt) && - HasFeature(endpoint, WindowCoveringFeature::kAbsolutePosition) && - EMBER_ZCL_STATUS_SUCCESS == Attributes::TargetPositionTiltPercent100ths::Get(endpoint, &tiltPosition) && - EMBER_ZCL_STATUS_SUCCESS == Attributes::InstalledOpenLimitTilt::Get(endpoint, &tiltLimit)) - { - isOpen = isOpen && tiltPosition == tiltLimit; - } - else if (HasFeature(endpoint, WindowCoveringFeature::kTilt) && - HasFeature(endpoint, WindowCoveringFeature::kPositionAwareTilt) && - EMBER_ZCL_STATUS_SUCCESS == Attributes::TargetPositionTiltPercent100ths::Get(endpoint, &tiltPosition)) - { - isOpen = isOpen && 0 == tiltPosition; - } + if ((status != EMBER_ZCL_STATUS_SUCCESS) || position.IsNull()) + return false; + + return ((position.Value() == WC_PERCENT100THS_MIN)); +} + +bool IsTiltOpen(chip::EndpointId endpoint) +{ + EmberAfStatus status; + app::DataModel::Nullable position; + + status = Attributes::TargetPositionTiltPercent100ths::Get(endpoint, position); + + if ((status != EMBER_ZCL_STATUS_SUCCESS) || position.IsNull()) + return false; + + return ((position.Value() == WC_PERCENT100THS_MIN)); +} + +bool IsLiftClosed(chip::EndpointId endpoint) +{ + EmberAfStatus status; + app::DataModel::Nullable position; - return isOpen; + status = Attributes::TargetPositionLiftPercent100ths::Get(endpoint, position); + + if ((status != EMBER_ZCL_STATUS_SUCCESS) || position.IsNull()) + return false; + + return ((position.Value() == WC_PERCENT100THS_MAX)); } -bool IsClosed(chip::EndpointId endpoint) +bool IsTiltClosed(chip::EndpointId endpoint) { - return !IsOpen(endpoint); + EmberAfStatus status; + app::DataModel::Nullable position; + + status = Attributes::TargetPositionTiltPercent100ths::Get(endpoint, position); + + if ((status != EMBER_ZCL_STATUS_SUCCESS) || position.IsNull()) + return false; + + return ((position.Value() == WC_PERCENT100THS_MAX)); } void TypeSet(chip::EndpointId endpoint, EmberAfWcType type) @@ -425,13 +427,13 @@ bool emberAfWindowCoveringClusterUpOrOpenCallback(app::CommandHandler * commandO EndpointId endpoint = commandPath.mEndpointId; emberAfWindowCoveringClusterPrint("UpOrOpen command received"); - if (HasFeature(endpoint, WindowCoveringFeature::kLift)) + if (HasFeature(endpoint, WcFeature::kLift)) { - Attributes::TargetPositionLiftPercent100ths::Set(endpoint, 0); + Attributes::TargetPositionLiftPercent100ths::Set(endpoint, WC_PERCENT100THS_MIN); } - if (HasFeature(endpoint, WindowCoveringFeature::kTilt)) + if (HasFeature(endpoint, WcFeature::kTilt)) { - Attributes::TargetPositionTiltPercent100ths::Set(endpoint, 0); + Attributes::TargetPositionTiltPercent100ths::Set(endpoint, WC_PERCENT100THS_MIN); } emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); return true; @@ -446,11 +448,11 @@ bool emberAfWindowCoveringClusterDownOrCloseCallback(app::CommandHandler * comma EndpointId endpoint = commandPath.mEndpointId; emberAfWindowCoveringClusterPrint("DownOrClose command received"); - if (HasFeature(endpoint, WindowCoveringFeature::kLift)) + if (HasFeature(endpoint, WcFeature::kLift)) { Attributes::TargetPositionLiftPercent100ths::Set(endpoint, WC_PERCENT100THS_MAX); } - if (HasFeature(endpoint, WindowCoveringFeature::kTilt)) + if (HasFeature(endpoint, WcFeature::kTilt)) { Attributes::TargetPositionTiltPercent100ths::Set(endpoint, WC_PERCENT100THS_MAX); } @@ -466,18 +468,18 @@ emberAfWindowCoveringClusterStopMotionCallback(app::CommandHandler * commandObj, const Commands::StopMotion::DecodableType & fields) { emberAfWindowCoveringClusterPrint("StopMotion command received"); - uint16_t current = 0; + app::DataModel::Nullable current; chip::EndpointId endpoint = commandPath.mEndpointId; - if (HasFeature(endpoint, WindowCoveringFeature::kLift) && HasFeature(endpoint, WindowCoveringFeature::kPositionAwareLift)) + if (HasFeaturePaLift(endpoint)) { - (void) Attributes::CurrentPositionLiftPercent100ths::Get(endpoint, ¤t); + (void) Attributes::CurrentPositionLiftPercent100ths::Get(endpoint, current); (void) Attributes::TargetPositionLiftPercent100ths::Set(endpoint, current); } - if (HasFeature(endpoint, WindowCoveringFeature::kTilt) && HasFeature(endpoint, WindowCoveringFeature::kPositionAwareTilt)) + if (HasFeaturePaTilt(endpoint)) { - (void) Attributes::CurrentPositionTiltPercent100ths::Get(endpoint, ¤t); + (void) Attributes::CurrentPositionTiltPercent100ths::Get(endpoint, current); (void) Attributes::TargetPositionTiltPercent100ths::Set(endpoint, current); } @@ -495,18 +497,15 @@ bool emberAfWindowCoveringClusterGoToLiftValueCallback(app::CommandHandler * com EndpointId endpoint = commandPath.mEndpointId; - bool hasLift = HasFeature(endpoint, WindowCoveringFeature::kLift); - bool isPositionAware = HasFeature(endpoint, WindowCoveringFeature::kPositionAwareLift); - emberAfWindowCoveringClusterPrint("GoToLiftValue Value command received"); - if (hasLift && isPositionAware) + if (HasFeature(endpoint, WcFeature::kAbsolutePosition) && HasFeaturePaLift(endpoint)) { Attributes::TargetPositionLiftPercent100ths::Set(endpoint, LiftToPercent100ths(endpoint, liftValue)); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); } else { - emberAfWindowCoveringClusterPrint("Err Device is not PA=%u or LF=%u", isPositionAware, hasLift); + emberAfWindowCoveringClusterPrint("Err Device is not PA LF"); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_ACTION_DENIED); } return true; @@ -524,11 +523,8 @@ bool emberAfWindowCoveringClusterGoToLiftPercentageCallback(app::CommandHandler EndpointId endpoint = commandPath.mEndpointId; - bool hasLift = HasFeature(endpoint, WindowCoveringFeature::kLift); - bool isPositionAware = HasFeature(endpoint, WindowCoveringFeature::kPositionAwareLift); - emberAfWindowCoveringClusterPrint("GoToLiftPercentage Percentage command received"); - if (hasLift && isPositionAware) + if (HasFeaturePaLift(endpoint)) { Attributes::TargetPositionLiftPercent100ths::Set( endpoint, static_cast(liftPercentageValue > 100 ? liftPercent100thsValue : liftPercentageValue * 100)); @@ -536,7 +532,7 @@ bool emberAfWindowCoveringClusterGoToLiftPercentageCallback(app::CommandHandler } else { - emberAfWindowCoveringClusterPrint("Err Device is not PA=%u or LF=%u", isPositionAware, hasLift); + emberAfWindowCoveringClusterPrint("Err Device is not PA LF"); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_ACTION_DENIED); } return true; @@ -553,18 +549,15 @@ bool emberAfWindowCoveringClusterGoToTiltValueCallback(app::CommandHandler * com EndpointId endpoint = commandPath.mEndpointId; - bool hasTilt = HasFeature(endpoint, WindowCoveringFeature::kTilt); - bool isPositionAware = HasFeature(endpoint, WindowCoveringFeature::kPositionAwareTilt); - emberAfWindowCoveringClusterPrint("GoToTiltValue command received"); - if (hasTilt && isPositionAware) + if (HasFeature(endpoint, WcFeature::kAbsolutePosition) && HasFeaturePaTilt(endpoint)) { Attributes::TargetPositionTiltPercent100ths::Set(endpoint, TiltToPercent100ths(endpoint, tiltValue)); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); } else { - emberAfWindowCoveringClusterPrint("Err Device is not PA=%u or TL=%u", isPositionAware, hasTilt); + emberAfWindowCoveringClusterPrint("Err Device is not PA TL"); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_ACTION_DENIED); } return true; @@ -582,11 +575,8 @@ bool emberAfWindowCoveringClusterGoToTiltPercentageCallback(app::CommandHandler EndpointId endpoint = commandPath.mEndpointId; - bool hasTilt = HasFeature(endpoint, WindowCoveringFeature::kTilt); - bool isPositionAware = HasFeature(endpoint, WindowCoveringFeature::kPositionAwareTilt); - emberAfWindowCoveringClusterPrint("GoToTiltPercentage command received"); - if (hasTilt && isPositionAware) + if (HasFeaturePaTilt(endpoint)) { Attributes::TargetPositionTiltPercent100ths::Set( endpoint, static_cast(tiltPercentageValue > 100 ? tiltPercent100thsValue : tiltPercentageValue * 100)); @@ -594,7 +584,7 @@ bool emberAfWindowCoveringClusterGoToTiltPercentageCallback(app::CommandHandler } else { - emberAfWindowCoveringClusterPrint("Err Device is not PA=%u or TL=%u", isPositionAware, hasTilt); + emberAfWindowCoveringClusterPrint("Err Device is not PA TL"); emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_ACTION_DENIED); } return true; diff --git a/src/app/clusters/window-covering-server/window-covering-server.h b/src/app/clusters/window-covering-server/window-covering-server.h index d0db0bff505b93..9106fed3c72bf8 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.h +++ b/src/app/clusters/window-covering-server/window-covering-server.h @@ -81,8 +81,11 @@ struct SafetyStatus }; static_assert(sizeof(SafetyStatus) == sizeof(uint16_t), "SafetyStatus Size is not correct"); -bool IsOpen(chip::EndpointId endpoint); -bool IsClosed(chip::EndpointId endpoint); +bool IsLiftOpen(chip::EndpointId endpoint); +bool IsLiftClosed(chip::EndpointId endpoint); + +bool IsTiltOpen(chip::EndpointId endpoint); +bool IsTiltClosed(chip::EndpointId endpoint); void TypeSet(chip::EndpointId endpoint, EmberAfWcType type); EmberAfWcType TypeGet(chip::EndpointId endpoint); diff --git a/src/app/clusters/zll-on-off-server/zll-on-off-server.c b/src/app/clusters/zll-on-off-server/zll-on-off-server.c index aab25f9fed728b..dcfe2fb1cddb6f 100644 --- a/src/app/clusters/zll-on-off-server/zll-on-off-server.c +++ b/src/app/clusters/zll-on-off-server/zll-on-off-server.c @@ -175,7 +175,7 @@ bool emberAfOnOffClusterOffWithEffectCallback(app::CommandHandler * commandObj, bool globalSceneControl; uint8_t endpoint = emberAfCurrentEndpoint(); - // Ensure parameters have values withing proper range. + // Ensure parameters have values within proper range. if (effectId > EMBER_ZCL_ON_OFF_EFFECT_IDENTIFIER_DYING_LIGHT || effectVariant > EMBER_ZCL_ON_OFF_DELAYED_ALL_OFF_EFFECT_VARIANT_50_PERCENT_DIM_DOWN_IN_0P8_SECONDS_THEN_FADE_TO_OFF_IN_12_SECONDS || diff --git a/src/app/data-model/List.h b/src/app/data-model/List.h index d5d5c067092c9d..9d805fef9c6f30 100644 --- a/src/app/data-model/List.h +++ b/src/app/data-model/List.h @@ -65,7 +65,7 @@ inline CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, List list) ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Array, type)); for (auto & item : list) { - ReturnErrorOnFailure(Encode(writer, TLV::AnonymousTag, item)); + ReturnErrorOnFailure(Encode(writer, TLV::AnonymousTag(), item)); } ReturnErrorOnFailure(writer.EndContainer(type)); diff --git a/src/app/data-model/TagBoundEncoder.h b/src/app/data-model/TagBoundEncoder.h index 583704e16b87c0..8d844874d58348 100644 --- a/src/app/data-model/TagBoundEncoder.h +++ b/src/app/data-model/TagBoundEncoder.h @@ -61,7 +61,7 @@ class TagBoundEncoder VerifyOrReturnError(mWriter != nullptr, CHIP_ERROR_INCORRECT_STATE); TLV::TLVType outerType; ReturnErrorOnFailure(mWriter->StartContainer(mTag, TLV::kTLVType_Array, outerType)); - ReturnErrorOnFailure(aCallback(TagBoundEncoder(mWriter, TLV::AnonymousTag))); + ReturnErrorOnFailure(aCallback(TagBoundEncoder(mWriter, TLV::AnonymousTag()))); return mWriter->EndContainer(outerType); } diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index 8baa297c0c595e..79471aef7556f6 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -48,20 +48,6 @@ void Engine::Shutdown() mpGlobalDirtySet = nullptr; } -EventNumber Engine::CountEvents(ReadHandler * apReadHandler, EventNumber * apInitialEvents) -{ - EventNumber event_count = 0; - EventNumber * vendedEventNumberList = apReadHandler->GetVendedEventNumberList(); - for (size_t index = 0; index < kNumPriorityLevel; index++) - { - if (vendedEventNumberList[index] > apInitialEvents[index]) - { - event_count += vendedEventNumberList[index] - apInitialEvents[index]; - } - } - return event_count; -} - CHIP_ERROR Engine::RetrieveClusterData(const SubjectDescriptor & aSubjectDescriptor, AttributeReportIBs::Builder & aAttributeReportIBs, const ConcreteReadAttributePath & aPath, AttributeValueEncoder::AttributeEncodeState * aEncoderState) @@ -237,7 +223,7 @@ CHIP_ERROR Engine::BuildSingleReportDataEventReports(ReportDataMessage::Builder TLV::TLVWriter backup; bool eventClean = true; ClusterInfo * clusterInfoList = apReadHandler->GetEventClusterInfolist(); - EventNumber * eventNumberList = apReadHandler->GetVendedEventNumberList(); + EventNumber & eventMin = apReadHandler->GetEventMin(); EventManagement & eventManager = EventManagement::GetInstance(); bool hasMoreChunks = false; @@ -260,52 +246,39 @@ CHIP_ERROR Engine::BuildSingleReportDataEventReports(ReportDataMessage::Builder { EventReportIBs::Builder & eventReportIBs = aReportDataBuilder.CreateEventReports(); SuccessOrExit(err = aReportDataBuilder.GetError()); - while (apReadHandler->GetCurrentPriority() != PriorityLevel::Invalid) - { - uint8_t priorityIndex = static_cast(apReadHandler->GetCurrentPriority()); - err = eventManager.FetchEventsSince(*(eventReportIBs.GetWriter()), clusterInfoList, apReadHandler->GetCurrentPriority(), - eventNumberList[priorityIndex], eventCount); + err = eventManager.FetchEventsSince(*(eventReportIBs.GetWriter()), clusterInfoList, eventMin, eventCount); - if ((err == CHIP_END_OF_TLV) || (err == CHIP_ERROR_TLV_UNDERRUN) || (err == CHIP_NO_ERROR)) + if ((err == CHIP_END_OF_TLV) || (err == CHIP_ERROR_TLV_UNDERRUN) || (err == CHIP_NO_ERROR)) + { + err = CHIP_NO_ERROR; + hasMoreChunks = false; + } + else if ((err == CHIP_ERROR_BUFFER_TOO_SMALL) || (err == CHIP_ERROR_NO_MEMORY)) + { + // when first cluster event is too big to fit in the packet, ignore that cluster event. + if (eventCount == 0) { - // We have successfully reached the end of the log for - // the current priority. Advance to the next - // priority level. + eventMin++; + ChipLogDetail(DataManagement, " first cluster event is too big so that it fails to fit in the packet!"); err = CHIP_NO_ERROR; - apReadHandler->MoveToNextScheduledDirtyPriority(); - hasMoreChunks = false; - } - else if ((err == CHIP_ERROR_BUFFER_TOO_SMALL) || (err == CHIP_ERROR_NO_MEMORY)) - { - // when first cluster event is too big to fit in the packet, ignore that cluster event. - if (eventCount == 0) - { - eventNumberList[priorityIndex]++; - ChipLogDetail(DataManagement, " first cluster event is too big so that it fails to fit in the packet!"); - err = CHIP_NO_ERROR; - } - else - { - // `FetchEventsSince` has filled the available space - // within the allowed buffer before it fit all the - // available events. This is an expected condition, - // so we do not propagate the error to higher levels; - // instead, we terminate the event processing for now - // (we will get another chance immediately afterwards, - // with a ew buffer) and do not advance the processing - // to the next priority level. - err = CHIP_NO_ERROR; - break; - } - hasMoreChunks = true; } else { - // All other errors are propagated to higher level. - // Exiting here and returning an error will lead to - // abandoning subscription. - ExitNow(); + // `FetchEventsSince` has filled the available space + // within the allowed buffer before it fit all the + // available events. This is an expected condition, + // so we do not propagate the error to higher levels; + // instead, we terminate the event processing for now + err = CHIP_NO_ERROR; } + hasMoreChunks = true; + } + else + { + // All other errors are propagated to higher level. + // Exiting here and returning an error will lead to + // abandoning subscription. + ExitNow(); } eventReportIBs.EndOfEventReports(); @@ -459,16 +432,24 @@ CHIP_ERROR Engine::ScheduleRun() return CHIP_NO_ERROR; } - if (InteractionModelEngine::GetInstance()->GetExchangeManager() != nullptr) + Messaging::ExchangeManager * exchangeManager = InteractionModelEngine::GetInstance()->GetExchangeManager(); + if (exchangeManager == nullptr) { - mRunScheduled = true; - return InteractionModelEngine::GetInstance()->GetExchangeManager()->GetSessionManager()->SystemLayer()->ScheduleWork(Run, - this); + return CHIP_ERROR_INCORRECT_STATE; } - else + SessionManager * sessionManager = exchangeManager->GetSessionManager(); + if (sessionManager == nullptr) { return CHIP_ERROR_INCORRECT_STATE; } + System::Layer * systemLayer = sessionManager->SystemLayer(); + if (systemLayer == nullptr) + { + return CHIP_ERROR_INCORRECT_STATE; + } + ReturnErrorOnFailure(systemLayer->ScheduleWork(Run, this)); + mRunScheduled = true; + return CHIP_NO_ERROR; } void Engine::Run() @@ -587,10 +568,45 @@ void Engine::OnReportConfirm() ChipLogDetail(DataManagement, " OnReportConfirm: NumReports = %" PRIu32, mNumReportsInFlight); } +void Engine::GetMinEventLogPosition(uint32_t & aMinLogPosition) +{ + for (auto & handler : InteractionModelEngine::GetInstance()->mReadHandlers) + { + if (handler.IsFree() || handler.IsReadType()) + { + continue; + } + + uint32_t initialWrittenEventsBytes = handler.GetLastWrittenEventsBytes(); + if (initialWrittenEventsBytes < aMinLogPosition) + { + aMinLogPosition = initialWrittenEventsBytes; + } + } +} + +CHIP_ERROR Engine::ScheduleBufferPressureEventDelivery(uint32_t aBytesWritten) +{ + uint32_t minEventLogPosition = aBytesWritten; + GetMinEventLogPosition(minEventLogPosition); + if (aBytesWritten - minEventLogPosition > CHIP_CONFIG_EVENT_LOGGING_BYTE_THRESHOLD) + { + ChipLogProgress(DataManagement, " Buffer overfilled CHIP_CONFIG_EVENT_LOGGING_BYTE_THRESHOLD %d, schedule engine run", + CHIP_CONFIG_EVENT_LOGGING_BYTE_THRESHOLD); + return ScheduleRun(); + } + return CHIP_NO_ERROR; +} + CHIP_ERROR Engine::ScheduleUrgentEventDelivery(ConcreteEventPath & aPath) { for (auto & handler : InteractionModelEngine::GetInstance()->mReadHandlers) { + if (handler.IsFree() || handler.IsReadType()) + { + continue; + } + for (auto clusterInfo = handler.GetEventClusterInfolist(); clusterInfo != nullptr; clusterInfo = clusterInfo->mpNext) { if (clusterInfo->IsEventPathSupersetOf(aPath)) @@ -598,12 +614,26 @@ CHIP_ERROR Engine::ScheduleUrgentEventDelivery(ConcreteEventPath & aPath) ChipLogProgress(DataManagement, " Unblock Urgent Event Delivery for readHandler[%d]", InteractionModelEngine::GetInstance()->GetReadHandlerArrayIndex(&handler)); handler.UnblockUrgentEventDelivery(); + break; } } } return ScheduleRun(); } +CHIP_ERROR Engine::ScheduleEventDelivery(ConcreteEventPath & aPath, EventOptions::Type aUrgent, uint32_t aBytesWritten) +{ + if (aUrgent != EventOptions::Type::kUrgent) + { + return ScheduleBufferPressureEventDelivery(aBytesWritten); + } + else + { + return ScheduleUrgentEventDelivery(aPath); + } + return CHIP_NO_ERROR; +} + }; // namespace reporting } // namespace app } // namespace chip diff --git a/src/app/reporting/Engine.h b/src/app/reporting/Engine.h index c100e007ccadfb..bc0bf6621ed173 100644 --- a/src/app/reporting/Engine.h +++ b/src/app/reporting/Engine.h @@ -91,10 +91,10 @@ class Engine /** * @brief - * Schedule the urgent event delivery + * Schedule the event delivery * */ - CHIP_ERROR ScheduleUrgentEventDelivery(ConcreteEventPath & aPath); + CHIP_ERROR ScheduleEventDelivery(ConcreteEventPath & aPath, EventOptions::Type aUrgent, uint32_t aBytesWritten); private: friend class TestReportingEngine; @@ -112,7 +112,6 @@ class Engine AttributeReportIBs::Builder & aAttributeReportIBs, const ConcreteReadAttributePath & aClusterInfo, AttributeValueEncoder::AttributeEncodeState * apEncoderState); - EventNumber CountEvents(ReadHandler * apReadHandler, EventNumber * apInitialEvents); /** * Check all active subscription, if the subscription has no paths that intersect with global dirty set, @@ -132,6 +131,10 @@ class Engine */ static void Run(System::Layer * aSystemLayer, void * apAppState); + CHIP_ERROR ScheduleUrgentEventDelivery(ConcreteEventPath & aPath); + CHIP_ERROR ScheduleBufferPressureEventDelivery(uint32_t aBytesWritten); + void GetMinEventLogPosition(uint32_t & aMinLogPosition); + /** * Boolean to indicate if ScheduleRun is pending. This flag is used to prevent calling ScheduleRun multiple times * within the same execution context to avoid applying too much pressure on platforms that use small, fixed size event queues. diff --git a/src/app/reporting/reporting.h b/src/app/reporting/reporting.h index 19c34f5b3a816b..f6294c0455cee7 100644 --- a/src/app/reporting/reporting.h +++ b/src/app/reporting/reporting.h @@ -39,6 +39,7 @@ #pragma once +#include #include /** @brief Reporting Attribute Change @@ -55,3 +56,8 @@ void MatterReportingAttributeChangeCallback(chip::EndpointId endpoint, chip::Clu * Same but with just an attribute path and no data available. */ void MatterReportingAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId); + +/* + * Same but with a nicer attribute path. + */ +void MatterReportingAttributeChangeCallback(const chip::app::ConcreteAttributePath & aPath); diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 9c5c4f9f04b125..d5d519581d568a 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -161,7 +161,6 @@ CHIP_ERROR CommissioningWindowManager::OpenCommissioningWindow() ReturnErrorOnFailure(mIDAllocator->Allocate(keyID)); mPairingSession.Clear(); - ReturnErrorOnFailure(mPairingSession.MessageDispatch().Init(&mServer->GetSecureSessionManager())); if (mCommissioningTimeoutSeconds != kNoCommissioningTimeout) { diff --git a/src/app/server/Dnssd.cpp b/src/app/server/Dnssd.cpp index d16c3fa19ff6a0..3ce263b7cf3afc 100644 --- a/src/app/server/Dnssd.cpp +++ b/src/app/server/Dnssd.cpp @@ -338,7 +338,7 @@ CHIP_ERROR DnssdServer::Advertise(bool commissionableNode, chip::Dnssd::Commissi #if CHIP_ENABLE_ROTATING_DEVICE_ID char rotatingDeviceIdHexBuffer[RotatingDeviceId::kHexMaxLength]; ReturnErrorOnFailure(GenerateRotatingDeviceId(rotatingDeviceIdHexBuffer, ArraySize(rotatingDeviceIdHexBuffer))); - advertiseParameters.SetRotatingId(chip::Optional::Value(rotatingDeviceIdHexBuffer)); + advertiseParameters.SetRotatingDeviceId(chip::Optional::Value(rotatingDeviceIdHexBuffer)); #endif advertiseParameters.SetMRPConfig(gDefaultMRPConfig).SetTcpSupported(Optional(INET_CONFIG_ENABLE_TCP_ENDPOINT)); @@ -360,7 +360,7 @@ CHIP_ERROR DnssdServer::Advertise(bool commissionableNode, chip::Dnssd::Commissi } else { - advertiseParameters.SetPairingInstr(chip::Optional::Value(pairingInst)); + advertiseParameters.SetPairingInstruction(chip::Optional::Value(pairingInst)); } } else @@ -380,7 +380,7 @@ CHIP_ERROR DnssdServer::Advertise(bool commissionableNode, chip::Dnssd::Commissi } else { - advertiseParameters.SetPairingInstr(chip::Optional::Value(pairingInst)); + advertiseParameters.SetPairingInstruction(chip::Optional::Value(pairingInst)); } } diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index ba8c981e86037f..48067d02b4d85d 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -75,9 +75,7 @@ Server Server::sServer; static uint8_t sInfoEventBuffer[CHIP_DEVICE_CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE]; static uint8_t sDebugEventBuffer[CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE]; static uint8_t sCritEventBuffer[CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE]; -static ::chip::PersistedCounter sCritEventIdCounter; -static ::chip::PersistedCounter sInfoEventIdCounter; -static ::chip::PersistedCounter sDebugEventIdCounter; +static ::chip::PersistedCounter sGlobalEventIdCounter; static ::chip::app::CircularEventBuffer sLoggingBuffer[CHIP_NUM_EVENT_LOGGING_BUFFERS]; #endif // CHIP_CONFIG_ENABLE_SERVER_IM_EVENT @@ -171,21 +169,18 @@ CHIP_ERROR Server::Init(AppDelegate * delegate, uint16_t secureServicePort, uint #if CHIP_CONFIG_ENABLE_SERVER_IM_EVENT // Initialize event logging subsystem { - ::chip::Platform::PersistedStorage::Key debugEventIdCounterStorageKey = CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY; - ::chip::Platform::PersistedStorage::Key critEventIdCounterStorageKey = CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY; - ::chip::Platform::PersistedStorage::Key infoEventIdCounterStorageKey = CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY; + ::chip::Platform::PersistedStorage::Key globalEventIdCounterStorageKey = + CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_GLOBAL_EIDC_KEY; ::chip::app::LogStorageResources logStorageResources[] = { - { &sDebugEventBuffer[0], sizeof(sDebugEventBuffer), &debugEventIdCounterStorageKey, - CHIP_DEVICE_CONFIG_EVENT_ID_COUNTER_EPOCH, &sDebugEventIdCounter, ::chip::app::PriorityLevel::Debug }, - { &sInfoEventBuffer[0], sizeof(sInfoEventBuffer), &infoEventIdCounterStorageKey, - CHIP_DEVICE_CONFIG_EVENT_ID_COUNTER_EPOCH, &sInfoEventIdCounter, ::chip::app::PriorityLevel::Info }, - { &sCritEventBuffer[0], sizeof(sCritEventBuffer), &critEventIdCounterStorageKey, - CHIP_DEVICE_CONFIG_EVENT_ID_COUNTER_EPOCH, &sCritEventIdCounter, ::chip::app::PriorityLevel::Critical } + { &sDebugEventBuffer[0], sizeof(sDebugEventBuffer), ::chip::app::PriorityLevel::Debug }, + { &sInfoEventBuffer[0], sizeof(sInfoEventBuffer), ::chip::app::PriorityLevel::Info }, + { &sCritEventBuffer[0], sizeof(sCritEventBuffer), ::chip::app::PriorityLevel::Critical } }; chip::app::EventManagement::GetInstance().Init(&mExchangeMgr, CHIP_NUM_EVENT_LOGGING_BUFFERS, &sLoggingBuffer[0], - &logStorageResources[0]); + &logStorageResources[0], &globalEventIdCounterStorageKey, + CHIP_DEVICE_CONFIG_EVENT_ID_COUNTER_EPOCH, &sGlobalEventIdCounter); } #endif // CHIP_CONFIG_ENABLE_SERVER_IM_EVENT @@ -265,7 +260,7 @@ CHIP_ERROR Server::SendUserDirectedCommissioningRequest(chip::Transport::PeerAdd ChipLogDetail(AppServer, "SendUserDirectedCommissioningRequest2"); CHIP_ERROR err; - char nameBuffer[chip::Dnssd::Commissionable::kInstanceNameMaxLength + 1]; + char nameBuffer[chip::Dnssd::Commission::kInstanceNameMaxLength + 1]; err = app::DnssdServer::Instance().GetCommissionableInstanceName(nameBuffer, sizeof(nameBuffer)); if (err != CHIP_NO_ERROR) { diff --git a/src/app/tests/AppTestContext.h b/src/app/tests/AppTestContext.h index 96ce8769a53201..d43ffb067f9ac5 100644 --- a/src/app/tests/AppTestContext.h +++ b/src/app/tests/AppTestContext.h @@ -25,9 +25,9 @@ namespace Test { * @brief The context of test cases for messaging layer. It wil initialize network layer and system layer, and create * two secure sessions, connected with each other. Exchanges can be created for each secure session. */ -class AppContext : public LoopbackMessagingContext +class AppContext : public LoopbackMessagingContext<> { - typedef LoopbackMessagingContext Super; + typedef LoopbackMessagingContext<> Super; public: /// Initialize the underlying layers. diff --git a/src/app/tests/TestAttributeCache.cpp b/src/app/tests/TestAttributeCache.cpp index 09dfe133d40635..d448c3337066f1 100644 --- a/src/app/tests/TestAttributeCache.cpp +++ b/src/app/tests/TestAttributeCache.cpp @@ -148,7 +148,7 @@ void DataSeriesGenerator::Generate() ChipLogProgress(DataManagement, "\t -- Generating A"); Clusters::TestCluster::Attributes::Int16u::TypeInfo::Type value = instruction.mInstructionId; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); break; } @@ -159,7 +159,7 @@ void DataSeriesGenerator::Generate() uint8_t buf[] = { 'h', 'e', 'l', 'l', 'o' }; value = buf; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); break; } @@ -169,7 +169,7 @@ void DataSeriesGenerator::Generate() Clusters::TestCluster::Attributes::StructAttr::TypeInfo::Type value; value.a = instruction.mInstructionId; value.b = true; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); break; } @@ -187,7 +187,7 @@ void DataSeriesGenerator::Generate() path.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; value = buf; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); break; } diff --git a/src/app/tests/TestAttributeValueEncoder.cpp b/src/app/tests/TestAttributeValueEncoder.cpp index ae343b75dc92d7..70022928ebb45d 100644 --- a/src/app/tests/TestAttributeValueEncoder.cpp +++ b/src/app/tests/TestAttributeValueEncoder.cpp @@ -55,7 +55,7 @@ struct LimitedTestSetup writer.Init(buf); { TLVType ignored; - CHIP_ERROR err = writer.StartContainer(AnonymousTag, kTLVType_Structure, ignored); + CHIP_ERROR err = writer.StartContainer(AnonymousTag(), kTLVType_Structure, ignored); NL_TEST_ASSERT(aSuite, err == CHIP_NO_ERROR); } { @@ -216,30 +216,39 @@ void TestEncodeListOfBools2(nlTestSuite * aSuite, void * aContext) VERIFY_BUFFER_STATE(aSuite, test, expected); } -void TestEncodeEmptyList(nlTestSuite * aSuite, void * aContext) +constexpr uint8_t emptyListExpected[] = { + // clang-format off + 0x15, 0x36, 0x01, // Test overhead, Start Anonymous struct + Start 1 byte Tag Array + Tag (01) + 0x15, // Start anonymous struct + 0x35, 0x01, // Start 1 byte tag struct + Tag (01) + 0x24, 0x00, 0x99, // Tag (00) Value (1 byte uint) 0x99 (Attribute Version) + 0x37, 0x01, // Start 1 byte tag list + Tag (01) (Attribute Path) + 0x24, 0x02, 0x55, // Tag (02) Value (1 byte uint) 0x55 + 0x24, 0x03, 0xaa, // Tag (03) Value (1 byte uint) 0xaa + 0x24, 0x04, 0xcc, // Tag (04) Value (1 byte uint) 0xcc + 0x18, // End of container + // Intended empty array + 0x36, 0x02, // Start 1 byte tag array + Tag (02) (Attribute Value) + 0x18, // End of container + 0x18, // End of container + 0x18, // End of container + // clang-format on +}; + +void TestEncodeEmptyList1(nlTestSuite * aSuite, void * aContext) { TestSetup test(aSuite); CHIP_ERROR err = test.encoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { return CHIP_NO_ERROR; }); NL_TEST_ASSERT(aSuite, err == CHIP_NO_ERROR); - const uint8_t expected[] = { - // clang-format off - 0x15, 0x36, 0x01, // Test overhead, Start Anonymous struct + Start 1 byte Tag Array + Tag (01) - 0x15, // Start anonymous struct - 0x35, 0x01, // Start 1 byte tag struct + Tag (01) - 0x24, 0x00, 0x99, // Tag (00) Value (1 byte uint) 0x99 (Attribute Version) - 0x37, 0x01, // Start 1 byte tag list + Tag (01) (Attribute Path) - 0x24, 0x02, 0x55, // Tag (02) Value (1 byte uint) 0x55 - 0x24, 0x03, 0xaa, // Tag (03) Value (1 byte uint) 0xaa - 0x24, 0x04, 0xcc, // Tag (04) Value (1 byte uint) 0xcc - 0x18, // End of container - // Intended empty array - 0x36, 0x02, // Start 1 byte tag array + Tag (02) (Attribute Value) - 0x18, // End of container - 0x18, // End of container - 0x18, // End of container - // clang-format on - }; - VERIFY_BUFFER_STATE(aSuite, test, expected); + VERIFY_BUFFER_STATE(aSuite, test, emptyListExpected); +} + +void TestEncodeEmptyList2(nlTestSuite * aSuite, void * aContext) +{ + TestSetup test(aSuite); + CHIP_ERROR err = test.encoder.EncodeEmptyList(); + NL_TEST_ASSERT(aSuite, err == CHIP_NO_ERROR); + VERIFY_BUFFER_STATE(aSuite, test, emptyListExpected); } void TestEncodeFabricScoped(nlTestSuite * aSuite, void * aContext) @@ -375,17 +384,20 @@ void TestEncodeListChunking(nlTestSuite * aSuite, void * aContext) } } -#undef VERIFY_STATE +#undef VERIFY_BUFFER_STATE } // anonymous namespace namespace { -const nlTest sTests[] = { - NL_TEST_DEF("TestEncodeNothing", TestEncodeNothing), NL_TEST_DEF("TestEncodeBool", TestEncodeBool), - NL_TEST_DEF("TestEncodeEmptyList", TestEncodeEmptyList), NL_TEST_DEF("TestEncodeListOfBools1", TestEncodeListOfBools1), - NL_TEST_DEF("TestEncodeListOfBools2", TestEncodeListOfBools2), NL_TEST_DEF("TestEncodeListChunking", TestEncodeListChunking), - NL_TEST_DEF("TestEncodeFabricScoped", TestEncodeFabricScoped), NL_TEST_SENTINEL() -}; +const nlTest sTests[] = { NL_TEST_DEF("TestEncodeNothing", TestEncodeNothing), + NL_TEST_DEF("TestEncodeBool", TestEncodeBool), + NL_TEST_DEF("TestEncodeEmptyList1", TestEncodeEmptyList1), + NL_TEST_DEF("TestEncodeEmptyList2", TestEncodeEmptyList2), + NL_TEST_DEF("TestEncodeListOfBools1", TestEncodeListOfBools1), + NL_TEST_DEF("TestEncodeListOfBools2", TestEncodeListOfBools2), + NL_TEST_DEF("TestEncodeListChunking", TestEncodeListChunking), + NL_TEST_DEF("TestEncodeFabricScoped", TestEncodeFabricScoped), + NL_TEST_SENTINEL() }; } int TestAttributeValueEncoder() diff --git a/src/app/tests/TestBufferedReadCallback.cpp b/src/app/tests/TestBufferedReadCallback.cpp index e10eb49ce76629..9bccd0eac3edf3 100644 --- a/src/app/tests/TestBufferedReadCallback.cpp +++ b/src/app/tests/TestBufferedReadCallback.cpp @@ -321,7 +321,7 @@ void DataSeriesGenerator::Generate() Clusters::TestCluster::Attributes::Int8u::TypeInfo::Type value = index; path.mAttributeId = Clusters::TestCluster::Attributes::Int8u::Id; path.mListOp = ConcreteDataAttributePath::ListOperation::NotList; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); break; } @@ -331,7 +331,7 @@ void DataSeriesGenerator::Generate() Clusters::TestCluster::Attributes::Int32u::TypeInfo::Type value = index; path.mAttributeId = Clusters::TestCluster::Attributes::Int32u::Id; path.mListOp = ConcreteDataAttributePath::ListOperation::NotList; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); break; } @@ -341,7 +341,7 @@ void DataSeriesGenerator::Generate() Clusters::TestCluster::Attributes::ListStructOctetString::TypeInfo::Type value; path.mAttributeId = Clusters::TestCluster::Attributes::ListStructOctetString::Id; path.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); break; } @@ -361,7 +361,7 @@ void DataSeriesGenerator::Generate() path.mAttributeId = Clusters::TestCluster::Attributes::ListStructOctetString::Id; path.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); break; } @@ -371,7 +371,7 @@ void DataSeriesGenerator::Generate() Clusters::TestCluster::Attributes::ListInt8u::TypeInfo::Type value; path.mAttributeId = Clusters::TestCluster::Attributes::ListInt8u::Id; path.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); break; } @@ -391,7 +391,7 @@ void DataSeriesGenerator::Generate() path.mAttributeId = Clusters::TestCluster::Attributes::ListInt8u::Id; path.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); break; } @@ -426,7 +426,7 @@ void DataSeriesGenerator::Generate() path.mAttributeId = Clusters::TestCluster::Attributes::ListStructOctetString::Id; path.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); writer.Finalize(&handle); reader.Init(std::move(handle)); @@ -449,7 +449,7 @@ void DataSeriesGenerator::Generate() listItem.fabricIndex = (uint64_t) i; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, listItem) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), listItem) == CHIP_NO_ERROR); writer.Finalize(&handle); reader.Init(std::move(handle)); @@ -469,7 +469,7 @@ void DataSeriesGenerator::Generate() path.mAttributeId = Clusters::TestCluster::Attributes::ListInt8u::Id; path.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, value) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), value) == CHIP_NO_ERROR); writer.Finalize(&handle); reader.Init(std::move(handle)); @@ -488,7 +488,7 @@ void DataSeriesGenerator::Generate() path.mAttributeId = Clusters::TestCluster::Attributes::ListInt8u::Id; path.mListOp = ConcreteDataAttributePath::ListOperation::AppendItem; - NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag, (uint8_t)(i)) == CHIP_NO_ERROR); + NL_TEST_ASSERT(gSuite, DataModel::Encode(writer, TLV::AnonymousTag(), (uint8_t)(i)) == CHIP_NO_ERROR); writer.Finalize(&handle); reader.Init(std::move(handle)); diff --git a/src/app/tests/TestCHIPDeviceCallbacksMgr.cpp b/src/app/tests/TestCHIPDeviceCallbacksMgr.cpp index 52b43c1cb19203..a500d79befae11 100644 --- a/src/app/tests/TestCHIPDeviceCallbacksMgr.cpp +++ b/src/app/tests/TestCHIPDeviceCallbacksMgr.cpp @@ -292,149 +292,6 @@ void ShouldFailGetCanceledResponseCallback(nlTestSuite * testSuite, void * apCon } } -void ShouldGetSingleReportCallback(nlTestSuite * testSuite, void * apContext) -{ - auto & callbacks = CHIPDeviceCallbacksMgr::GetInstance(); - - static constexpr NodeId kTestNodeId = 0x9b3780f93739918d; - static constexpr EndpointId kTestEndpointId = 0x20; - static constexpr ClusterId kTestClusterId = 0x9103; - static constexpr AttributeId kTestAttributeId = 0x2232; - - struct CallbackContext - { - nlTestSuite * const testSuite; - } callbackContext = { testSuite }; - - const auto onReport = [](void * opaqueContext, uint64_t value) { - CallbackContext & context = *static_cast(opaqueContext); - - // Not called. - NL_TEST_ASSERT(context.testSuite, false); - }; - - const auto reportFilter = [](TLV::TLVReader * reader, Callback::Cancelable * callback, Callback::Cancelable * failureCallback) { - IgnoreUnusedVariable(reader); - IgnoreUnusedVariable(callback); - IgnoreUnusedVariable(failureCallback); - }; - - Callback::Callback reportCallback{ onReport, &callbackContext }; - - { - Callback::Cancelable * reportCancelable = nullptr; - TLVDataFilter filter = nullptr; - CHIP_ERROR error = - callbacks.GetReportCallback(kTestNodeId, kTestEndpointId, kTestClusterId, kTestAttributeId, &reportCancelable, &filter); - NL_TEST_ASSERT(testSuite, error == CHIP_ERROR_KEY_NOT_FOUND); - NL_TEST_ASSERT(testSuite, reportCancelable == nullptr); - NL_TEST_ASSERT(testSuite, filter == nullptr); - } - - { - CHIP_ERROR error = callbacks.AddReportCallback(kTestNodeId, kTestEndpointId, kTestClusterId, kTestAttributeId, - reportCallback.Cancel(), reportFilter); - NL_TEST_ASSERT(testSuite, error == CHIP_NO_ERROR); - } - - { - Callback::Cancelable * reportCancelable = nullptr; - TLVDataFilter filter = nullptr; - CHIP_ERROR error = - callbacks.GetReportCallback(kTestNodeId, kTestEndpointId, kTestClusterId, kTestAttributeId, &reportCancelable, &filter); - NL_TEST_ASSERT(testSuite, error == CHIP_NO_ERROR); - - auto outReportCallback = decltype(reportCallback)::FromCancelable(reportCancelable); - - NL_TEST_ASSERT(testSuite, outReportCallback == &reportCallback); - NL_TEST_ASSERT(testSuite, filter == reportFilter); - } - - { - Callback::Cancelable * reportCancelable = nullptr; - TLVDataFilter filter = nullptr; - CHIP_ERROR error = - callbacks.GetReportCallback(kTestNodeId, kTestEndpointId, kTestClusterId, kTestAttributeId, &reportCancelable, &filter); - NL_TEST_ASSERT(testSuite, error == CHIP_NO_ERROR); - - auto outReportCallback = decltype(reportCallback)::FromCancelable(reportCancelable); - - NL_TEST_ASSERT(testSuite, outReportCallback == &reportCallback); - NL_TEST_ASSERT(testSuite, filter == reportFilter); - } -} - -void ShouldFailGetCanceledReportCallback(nlTestSuite * testSuite, void * apContext) -{ - auto & callbacks = CHIPDeviceCallbacksMgr::GetInstance(); - - static constexpr NodeId kTestNodeId = 0x9b3780f93739918d; - static constexpr EndpointId kTestEndpointId = 0x20; - static constexpr ClusterId kTestClusterId = 0x9103; - static constexpr AttributeId kTestAttributeId = 0x2232; - - struct CallbackContext - { - nlTestSuite * const testSuite; - } callbackContext = { testSuite }; - - const auto onReport = [](void * opaqueContext, uint64_t value) { - CallbackContext & context = *static_cast(opaqueContext); - - // Not called. - NL_TEST_ASSERT(context.testSuite, false); - }; - - const auto reportFilter = [](TLV::TLVReader * reader, Callback::Cancelable * callback, Callback::Cancelable * failureCallback) { - IgnoreUnusedVariable(reader); - IgnoreUnusedVariable(callback); - IgnoreUnusedVariable(failureCallback); - }; - - Callback::Callback reportCallback{ onReport, &callbackContext }; - - { - Callback::Cancelable * reportCancelable = nullptr; - TLVDataFilter filter = nullptr; - CHIP_ERROR error = - callbacks.GetReportCallback(kTestNodeId, kTestEndpointId, kTestClusterId, kTestAttributeId, &reportCancelable, &filter); - NL_TEST_ASSERT(testSuite, error == CHIP_ERROR_KEY_NOT_FOUND); - NL_TEST_ASSERT(testSuite, reportCancelable == nullptr); - NL_TEST_ASSERT(testSuite, filter == nullptr); - } - - { - CHIP_ERROR error = callbacks.AddReportCallback(kTestNodeId, kTestEndpointId, kTestClusterId, kTestAttributeId, - reportCallback.Cancel(), reportFilter); - NL_TEST_ASSERT(testSuite, error == CHIP_NO_ERROR); - } - - { - Callback::Cancelable * reportCancelable = nullptr; - TLVDataFilter filter = nullptr; - CHIP_ERROR error = - callbacks.GetReportCallback(kTestNodeId, kTestEndpointId, kTestClusterId, kTestAttributeId, &reportCancelable, &filter); - NL_TEST_ASSERT(testSuite, error == CHIP_NO_ERROR); - - auto outReportCallback = decltype(reportCallback)::FromCancelable(reportCancelable); - - NL_TEST_ASSERT(testSuite, outReportCallback == &reportCallback); - NL_TEST_ASSERT(testSuite, filter == reportFilter); - } - - reportCallback.Cancel(); - - { - Callback::Cancelable * reportCancelable = nullptr; - TLVDataFilter filter = nullptr; - CHIP_ERROR error = - callbacks.GetReportCallback(kTestNodeId, kTestEndpointId, kTestClusterId, kTestAttributeId, &reportCancelable, &filter); - NL_TEST_ASSERT(testSuite, error == CHIP_ERROR_KEY_NOT_FOUND); - NL_TEST_ASSERT(testSuite, reportCancelable == nullptr); - NL_TEST_ASSERT(testSuite, filter == nullptr); - } -} - } // namespace } // namespace app } // namespace chip @@ -443,8 +300,6 @@ const nlTest sTests[] = { NL_TEST_DEF("ShouldGetSingleResponseCallback", chip::app::ShouldGetSingleResponseCallback), // NL_TEST_DEF("ShouldGetMultipleResponseCallbacks", chip::app::ShouldGetMultipleResponseCallbacks), // NL_TEST_DEF("ShouldFailGetCanceledResponseCallback", chip::app::ShouldFailGetCanceledResponseCallback), // - NL_TEST_DEF("ShouldGetSingleReportCallback", chip::app::ShouldGetSingleReportCallback), // - NL_TEST_DEF("ShouldFailGetCanceledReportCallback", chip::app::ShouldFailGetCanceledReportCallback), // NL_TEST_SENTINEL(), // }; diff --git a/src/app/tests/TestDataModelSerialization.cpp b/src/app/tests/TestDataModelSerialization.cpp index a86fbae9a56c53..1f7a95465bcdbb 100644 --- a/src/app/tests/TestDataModelSerialization.cpp +++ b/src/app/tests/TestDataModelSerialization.cpp @@ -185,7 +185,7 @@ void TestDataModelSerialization::TestDataModelSerialization_EncAndDecSimpleStruc t.f.Set(TestCluster::SimpleBitmap::kValueC); - err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag, t); + err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag(), t); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); err = _this->mWriter.Finalize(); @@ -246,7 +246,7 @@ void TestDataModelSerialization::TestDataModelSerialization_EncAndDecNestedStruc t.c.e = Span{ strbuf, strlen(strbuf) }; - err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag, t); + err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag(), t); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); err = _this->mWriter.Finalize(); @@ -331,7 +331,7 @@ void TestDataModelSerialization::TestDataModelSerialization_EncAndDecDecodableNe t.c.e = Span{ strbuf, strlen(strbuf) }; t.d = structList; - err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag, t); + err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag(), t); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); err = _this->mWriter.Finalize(); @@ -460,7 +460,7 @@ void TestDataModelSerialization::TestDataModelSerialization_EncAndDecDecodableDo item.d = structList; } - err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag, t); + err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag(), t); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); err = _this->mWriter.Finalize(); @@ -532,7 +532,7 @@ void TestDataModelSerialization::TestDataModelSerialization_OptionalFields(nlTes // Encode every field manually except a. { err = - EncodeStruct(_this->mWriter, TLV::AnonymousTag, + EncodeStruct(_this->mWriter, TLV::AnonymousTag(), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kB)), t.b), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kC)), t.c), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kD)), t.d), @@ -603,7 +603,7 @@ void TestDataModelSerialization::TestDataModelSerialization_ExtraField(nlTestSui // Encode every field + an extra field. { err = EncodeStruct( - _this->mWriter, TLV::AnonymousTag, + _this->mWriter, TLV::AnonymousTag(), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kA)), t.a), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kB)), t.b), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kC)), t.c), @@ -676,7 +676,7 @@ void TestDataModelSerialization::TestDataModelSerialization_InvalidSimpleFieldTy // Encode every field manually except a. { err = EncodeStruct( - _this->mWriter, TLV::AnonymousTag, + _this->mWriter, TLV::AnonymousTag(), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kA)), t.b), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kB)), t.b), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kC)), t.c), @@ -728,7 +728,7 @@ void TestDataModelSerialization::TestDataModelSerialization_InvalidSimpleFieldTy // Encode every field manually except a. { err = EncodeStruct( - _this->mWriter, TLV::AnonymousTag, + _this->mWriter, TLV::AnonymousTag(), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kA)), t.a), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kB)), t.b), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::SimpleStruct::Fields::kC)), t.c), @@ -777,7 +777,7 @@ void TestDataModelSerialization::TestDataModelSerialization_InvalidListType(nlTe // Encode a list of integers for field d instead of a list of structs. { err = EncodeStruct( - _this->mWriter, TLV::AnonymousTag, + _this->mWriter, TLV::AnonymousTag(), MakeTagValuePair(TLV::ContextTag(to_underlying(TestCluster::Structs::NestedStructList::Fields::kD)), t.e)); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); } @@ -922,7 +922,7 @@ void TestDataModelSerialization::NullablesOptionalsEncodeDecodeCheck(nlTestSuite encodable.nullableList.SetNull(); } - CHIP_ERROR err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag, encodable); + CHIP_ERROR err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag(), encodable); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); err = _this->mWriter.Finalize(); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); diff --git a/src/app/tests/TestEventLogging.cpp b/src/app/tests/TestEventLogging.cpp index ebfb3f74877f76..016df1659dcc2f 100644 --- a/src/app/tests/TestEventLogging.cpp +++ b/src/app/tests/TestEventLogging.cpp @@ -66,14 +66,14 @@ class TestContext : public chip::Test::AppContext auto * ctx = static_cast(context); chip::app::LogStorageResources logStorageResources[] = { - { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Debug }, - { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Info }, - { &gCritEventBuffer[0], sizeof(gCritEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Critical }, + { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, + { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), chip::app::PriorityLevel::Info }, + { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), sizeof(logStorageResources) / sizeof(logStorageResources[0]), - gCircularEventBuffer, logStorageResources); + gCircularEventBuffer, logStorageResources, nullptr, 0, nullptr); return SUCCESS; } @@ -129,8 +129,8 @@ static void CheckLogState(nlTestSuite * apSuite, chip::app::EventManagement & aL printf("elementCount vs expectedNumEvents : %zu vs %zu \n", elementCount, expectedNumEvents); } -static void CheckLogReadOut(nlTestSuite * apSuite, chip::app::EventManagement & alogMgmt, chip::app::PriorityLevel priority, - chip::EventNumber startingEventNumber, size_t expectedNumEvents, chip::app::ClusterInfo * clusterInfo) +static void CheckLogReadOut(nlTestSuite * apSuite, chip::app::EventManagement & alogMgmt, chip::EventNumber startingEventNumber, + size_t expectedNumEvents, chip::app::ClusterInfo * clusterInfo) { CHIP_ERROR err; chip::TLV::TLVReader reader; @@ -139,13 +139,16 @@ static void CheckLogReadOut(nlTestSuite * apSuite, chip::app::EventManagement & uint8_t backingStore[1024]; size_t totalNumElements; writer.Init(backingStore, 1024); - err = alogMgmt.FetchEventsSince(writer, clusterInfo, priority, startingEventNumber, eventCount); + err = alogMgmt.FetchEventsSince(writer, clusterInfo, startingEventNumber, eventCount); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR || err == CHIP_END_OF_TLV); reader.Init(backingStore, writer.GetLengthWritten()); err = chip::TLV::Utilities::Count(reader, totalNumElements, false); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + printf("totalNumElements vs expectedNumEvents vs eventCount : %zu vs %zu vs %zu \n", totalNumElements, expectedNumEvents, + eventCount); NL_TEST_ASSERT(apSuite, totalNumElements == expectedNumEvents && totalNumElements == eventCount); reader.Init(backingStore, writer.GetLengthWritten()); chip::TLV::Debug::Dump(reader, SimpleDumpWriter); @@ -228,12 +231,12 @@ static void CheckLogEventWithEvictToNextBuffer(nlTestSuite * apSuite, void * apC testClusterInfo2.mClusterId = kLivenessClusterId; testClusterInfo2.mEventId = kLivenessChangeEvent; - CheckLogReadOut(apSuite, logMgmt, chip::app::PriorityLevel::Info, eid1, 3, &testClusterInfo1); - CheckLogReadOut(apSuite, logMgmt, chip::app::PriorityLevel::Info, eid2, 2, &testClusterInfo1); - CheckLogReadOut(apSuite, logMgmt, chip::app::PriorityLevel::Info, eid3, 1, &testClusterInfo1); - CheckLogReadOut(apSuite, logMgmt, chip::app::PriorityLevel::Info, eid4, 3, &testClusterInfo2); - CheckLogReadOut(apSuite, logMgmt, chip::app::PriorityLevel::Info, eid5, 2, &testClusterInfo2); - CheckLogReadOut(apSuite, logMgmt, chip::app::PriorityLevel::Info, eid6, 1, &testClusterInfo2); + CheckLogReadOut(apSuite, logMgmt, 0, 3, &testClusterInfo1); + CheckLogReadOut(apSuite, logMgmt, 1, 2, &testClusterInfo1); + CheckLogReadOut(apSuite, logMgmt, 2, 1, &testClusterInfo1); + CheckLogReadOut(apSuite, logMgmt, 3, 3, &testClusterInfo2); + CheckLogReadOut(apSuite, logMgmt, 4, 2, &testClusterInfo2); + CheckLogReadOut(apSuite, logMgmt, 5, 1, &testClusterInfo2); } static void CheckLogEventWithDiscardLowEvent(nlTestSuite * apSuite, void * apContext) @@ -249,33 +252,33 @@ static void CheckLogEventWithDiscardLowEvent(nlTestSuite * apSuite, void * apCon testEventGenerator.SetStatus(0); err = logMgmt.LogEvent(&testEventGenerator, options, eid1); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - CheckLogState(apSuite, logMgmt, 4, chip::app::PriorityLevel::Debug); + CheckLogState(apSuite, logMgmt, 3, chip::app::PriorityLevel::Debug); testEventGenerator.SetStatus(1); err = logMgmt.LogEvent(&testEventGenerator, options, eid2); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - CheckLogState(apSuite, logMgmt, 4, chip::app::PriorityLevel::Debug); + CheckLogState(apSuite, logMgmt, 3, chip::app::PriorityLevel::Debug); testEventGenerator.SetStatus(0); err = logMgmt.LogEvent(&testEventGenerator, options, eid3); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - CheckLogState(apSuite, logMgmt, 4, chip::app::PriorityLevel::Debug); - CheckLogState(apSuite, logMgmt, 8, chip::app::PriorityLevel::Info); + CheckLogState(apSuite, logMgmt, 3, chip::app::PriorityLevel::Debug); + CheckLogState(apSuite, logMgmt, 6, chip::app::PriorityLevel::Info); // Start to drop off debug event since debug event can only be saved in debug buffer testEventGenerator.SetStatus(1); err = logMgmt.LogEvent(&testEventGenerator, options, eid4); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - CheckLogState(apSuite, logMgmt, 4, chip::app::PriorityLevel::Debug); - CheckLogState(apSuite, logMgmt, 8, chip::app::PriorityLevel::Info); + CheckLogState(apSuite, logMgmt, 3, chip::app::PriorityLevel::Debug); + CheckLogState(apSuite, logMgmt, 6, chip::app::PriorityLevel::Info); testEventGenerator.SetStatus(0); err = logMgmt.LogEvent(&testEventGenerator, options, eid5); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - CheckLogState(apSuite, logMgmt, 4, chip::app::PriorityLevel::Debug); - CheckLogState(apSuite, logMgmt, 8, chip::app::PriorityLevel::Info); + CheckLogState(apSuite, logMgmt, 3, chip::app::PriorityLevel::Debug); + CheckLogState(apSuite, logMgmt, 6, chip::app::PriorityLevel::Info); testEventGenerator.SetStatus(1); err = logMgmt.LogEvent(&testEventGenerator, options, eid6); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - CheckLogState(apSuite, logMgmt, 4, chip::app::PriorityLevel::Debug); + CheckLogState(apSuite, logMgmt, 3, chip::app::PriorityLevel::Debug); } /** * Test Suite. It lists all the test functions. diff --git a/src/app/tests/TestNumericAttributeTraits.cpp b/src/app/tests/TestNumericAttributeTraits.cpp index e96657563a66fc..4d194a0711fa62 100644 --- a/src/app/tests/TestNumericAttributeTraits.cpp +++ b/src/app/tests/TestNumericAttributeTraits.cpp @@ -38,6 +38,156 @@ using namespace chip::app; namespace { +void Test_UINT8(nlTestSuite * apSuite, void * apContext) +{ + // Unsigned 8-bit Integer : 1 byte, endianness does not matter. + using IntType = NumericAttributeTraits; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = 17; + const WorkingType workingTestUnsignedNullValue = 0xFF; + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 1); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 1); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, &storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == 17); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(&storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + +void Test_SINT8(nlTestSuite * apSuite, void * apContext) +{ + // Signed 8-bit Integer : 1 byte, endianness does not matter. + using IntType = NumericAttributeTraits; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = 17; + const WorkingType workingTestUnsignedNullValue = -128; // 0x80 + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 1); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 1); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, &storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == 17); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(&storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + +enum class SimpleEnum : uint8_t +{ + kZero = 0, + kOne = 1, +}; + +void Test_SimpleEnum(nlTestSuite * apSuite, void * apContext) +{ + // Unsigned 8-bit Integer : 1 byte, endianness does not matter. + using IntType = NumericAttributeTraits; + using StorageType = typename IntType::StorageType; + using WorkingType = typename IntType::WorkingType; + + StorageType sValue; + WorkingType wValue; + StorageType sNullValue; + WorkingType wNullValue; + const StorageType storageTestData = SimpleEnum::kOne; + const WorkingType workingTestUnsignedNullValue = static_cast(0xFF); + + // 1) Verify the size of the types + NL_TEST_ASSERT(apSuite, sizeof(sValue) == 1); + NL_TEST_ASSERT(apSuite, sizeof(wValue) >= 1); + + // Initialize the Storage Value with the test-buffer + memcpy(&sValue, &storageTestData, sizeof(sValue)); + + // Convert the Storage Type to Working Type and + wValue = IntType::StorageToWorking(sValue); + + // 2) Verify that the correct storage format has been used + NL_TEST_ASSERT(apSuite, wValue == SimpleEnum::kOne); + + StorageType sNewValue; + + // Convert back to Storage Value + IntType::WorkingToStorage(wValue, sNewValue); + + // 3) Verify that the bytes are located as intended + NL_TEST_ASSERT(apSuite, memcmp(&storageTestData, &sNewValue, sizeof(sNewValue)) == 0); + + // Set Storage value to Null + IntType::SetNull(sNullValue); + wNullValue = IntType::StorageToWorking(sNullValue); + NL_TEST_ASSERT(apSuite, wNullValue == workingTestUnsignedNullValue); + NL_TEST_ASSERT(apSuite, (IntType::IsNullValue(sNullValue) == true)); + + // Verify that null values can fit into not nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(false, sNullValue) == true)); + + // Verify that null values can't fit into nullable + NL_TEST_ASSERT(apSuite, (IntType::CanRepresentValue(true, sNullValue) == false)); +} + //////////////////////////////////////////////////////////// // ______ __ __ _______ ______ ________ // // / \ / | / | / \ / |/ | // @@ -1009,6 +1159,10 @@ static int TestTeardown(void * inContext) // clang-format off const nlTest sTests[] = { + NL_TEST_DEF("Test_UINT8", Test_UINT8), + NL_TEST_DEF("Test_SINT8", Test_SINT8), + NL_TEST_DEF("Test_SimpleEnum", Test_SimpleEnum), + NL_TEST_DEF("Test_UINT24_LE",Test_UINT24_LE), NL_TEST_DEF("Test_SINT24_LE",Test_SINT24_LE), NL_TEST_DEF("Test_UINT24_BE",Test_UINT24_BE), diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 3e9749da553bf9..7ac4043d85fe02 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -22,6 +22,7 @@ * */ +#include "lib/support/CHIPMem.h" #include #include #include @@ -67,13 +68,13 @@ class TestContext : public chip::Test::AppContext auto * ctx = static_cast(context); chip::app::LogStorageResources logStorageResources[] = { - { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Debug }, - { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Info }, - { &gCritEventBuffer[0], sizeof(gCritEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Critical }, + { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, + { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), chip::app::PriorityLevel::Info }, + { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), ArraySize(logStorageResources), - gCircularEventBuffer, logStorageResources); + gCircularEventBuffer, logStorageResources, nullptr, 0, nullptr); return SUCCESS; } @@ -132,51 +133,13 @@ void GenerateEvents(nlTestSuite * apSuite, void * apContext, bool aIsUrgent = fa NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); } -void GenerateSubscribeResponse(nlTestSuite * apSuite, void * apContext, chip::System::PacketBufferHandle && aPayload) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - chip::System::PacketBufferTLVWriter writer; - writer.Init(std::move(aPayload)); - - chip::app::SubscribeResponseMessage::Builder subscribeResponseBuilder; - - err = subscribeResponseBuilder.Init(&writer); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - - subscribeResponseBuilder.SubscriptionId(0); - NL_TEST_ASSERT(apSuite, subscribeResponseBuilder.GetError() == CHIP_NO_ERROR); - - subscribeResponseBuilder.MinIntervalFloorSeconds(1); - NL_TEST_ASSERT(apSuite, subscribeResponseBuilder.GetError() == CHIP_NO_ERROR); - - subscribeResponseBuilder.MaxIntervalCeilingSeconds(2); - NL_TEST_ASSERT(apSuite, subscribeResponseBuilder.GetError() == CHIP_NO_ERROR); - - subscribeResponseBuilder.EndOfSubscribeResponseMessage(); - NL_TEST_ASSERT(apSuite, subscribeResponseBuilder.GetError() == CHIP_NO_ERROR); - - err = writer.Finalize(&aPayload); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); -} - class MockInteractionModelApp : public chip::app::ReadClient::Callback, public chip::app::InteractionModelDelegate { public: void OnEventData(const chip::app::ReadClient * apReadClient, const chip::app::EventHeader & aEventHeader, chip::TLV::TLVReader * apData, const chip::app::StatusIB * apStatus) override { - static int numDataElementIndex = 0; - - if (numDataElementIndex == 0) - { - VerifyOrReturn(aEventHeader.mPriorityLevel == chip::app::PriorityLevel::Critical); - } - else if (numDataElementIndex == 1) - { - VerifyOrReturn(aEventHeader.mPriorityLevel == chip::app::PriorityLevel::Info); - } - - ++numDataElementIndex; + ++mNumDataElementIndex; mGotEventResponse = true; } @@ -210,6 +173,7 @@ class MockInteractionModelApp : public chip::app::ReadClient::Callback, public c return CHIP_NO_ERROR; } + int mNumDataElementIndex = 0; bool mGotEventResponse = false; int mNumAttributeResponse = 0; bool mGotReport = false; @@ -266,7 +230,6 @@ class TestReadInteraction static void TestReadClientGenerateTwoEventPaths(nlTestSuite * apSuite, void * apContext); static void TestReadClientInvalidReport(nlTestSuite * apSuite, void * apContext); static void TestReadHandlerInvalidAttributePath(nlTestSuite * apSuite, void * apContext); - static void TestProcessSubscribeResponse(nlTestSuite * apSuite, void * apContext); static void TestProcessSubscribeRequest(nlTestSuite * apSuite, void * apContext); static void TestReadRoundtrip(nlTestSuite * apSuite, void * apContext); static void TestReadWildcard(nlTestSuite * apSuite, void * apContext); @@ -278,6 +241,7 @@ class TestReadInteraction static void TestSubscribeInvalidAttributePathRoundtrip(nlTestSuite * apSuite, void * apContext); static void TestReadInvalidAttributePathRoundtrip(nlTestSuite * apSuite, void * apContext); static void TestSubscribeInvalidIterval(nlTestSuite * apSuite, void * apContext); + static void TestReadShutdown(nlTestSuite * apSuite, void * apContext); private: static void GenerateReportData(nlTestSuite * apSuite, void * apContext, System::PacketBufferHandle & aPayload, @@ -365,11 +329,11 @@ void TestReadInteraction::TestReadClient(nlTestSuite * apSuite, void * apContext { CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); - app::ReadClient readClient; MockInteractionModelApp delegate; + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); - err = readClient.Init(&ctx.GetExchangeManager(), &delegate, chip::app::ReadClient::InteractionType::Read); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); err = readClient.SendRequest(readPrepareParams); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -377,8 +341,6 @@ void TestReadInteraction::TestReadClient(nlTestSuite * apSuite, void * apContext GenerateReportData(apSuite, apContext, buf, false /*aNeedInvalidReport*/, true /* aSuppressResponse*/); err = readClient.ProcessReportData(std::move(buf)); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - - readClient.Shutdown(); } void TestReadInteraction::TestReadHandler(nlTestSuite * apSuite, void * apContext) @@ -437,7 +399,6 @@ void TestReadInteraction::TestReadClientGenerateAttributePathList(nlTestSuite * { CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); - app::ReadClient readClient; MockInteractionModelApp delegate; System::PacketBufferHandle msgBuf; System::PacketBufferTLVWriter writer; @@ -448,8 +409,8 @@ void TestReadInteraction::TestReadClientGenerateAttributePathList(nlTestSuite * err = request.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = readClient.Init(&ctx.GetExchangeManager(), &delegate, chip::app::ReadClient::InteractionType::Read); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); AttributePathParams attributePathParams[2]; attributePathParams[0].mAttributeId = 0; @@ -464,7 +425,6 @@ void TestReadInteraction::TestReadClientGenerateInvalidAttributePathList(nlTestS { CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); - app::ReadClient readClient; MockInteractionModelApp delegate; System::PacketBufferHandle msgBuf; System::PacketBufferTLVWriter writer; @@ -472,8 +432,9 @@ void TestReadInteraction::TestReadClientGenerateInvalidAttributePathList(nlTestS msgBuf = System::PacketBufferHandle::New(kMaxSecureSduLengthBytes); NL_TEST_ASSERT(apSuite, !msgBuf.IsNull()); writer.Init(std::move(msgBuf)); - err = readClient.Init(&ctx.GetExchangeManager(), &delegate, chip::app::ReadClient::InteractionType::Read); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); err = request.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); @@ -490,12 +451,12 @@ void TestReadInteraction::TestReadClientInvalidReport(nlTestSuite * apSuite, voi { CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); - app::ReadClient readClient; MockInteractionModelApp delegate; System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); - err = readClient.Init(&ctx.GetExchangeManager(), &delegate, chip::app::ReadClient::InteractionType::Read); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); err = readClient.SendRequest(readPrepareParams); @@ -505,8 +466,6 @@ void TestReadInteraction::TestReadClientInvalidReport(nlTestSuite * apSuite, voi err = readClient.ProcessReportData(std::move(buf)); NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH); - - readClient.Shutdown(); } void TestReadInteraction::TestReadHandlerInvalidAttributePath(nlTestSuite * apSuite, void * apContext) @@ -563,7 +522,6 @@ void TestReadInteraction::TestReadClientGenerateOneEventPaths(nlTestSuite * apSu { CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); - app::ReadClient readClient; MockInteractionModelApp delegate; System::PacketBufferHandle msgBuf; System::PacketBufferTLVWriter writer; @@ -574,8 +532,8 @@ void TestReadInteraction::TestReadClientGenerateOneEventPaths(nlTestSuite * apSu err = request.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = readClient.Init(&ctx.GetExchangeManager(), &delegate, chip::app::ReadClient::InteractionType::Read); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); chip::app::EventPathParams eventPathParams[1]; eventPathParams[0].mEndpointId = 2; @@ -611,7 +569,6 @@ void TestReadInteraction::TestReadClientGenerateTwoEventPaths(nlTestSuite * apSu { CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); - app::ReadClient readClient; MockInteractionModelApp delegate; System::PacketBufferHandle msgBuf; System::PacketBufferTLVWriter writer; @@ -622,8 +579,8 @@ void TestReadInteraction::TestReadClientGenerateTwoEventPaths(nlTestSuite * apSu err = request.Init(&writer); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = readClient.Init(&ctx.GetExchangeManager(), &delegate, chip::app::ReadClient::InteractionType::Read); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); chip::app::EventPathParams eventPathParams[2]; eventPathParams[0].mEndpointId = 2; @@ -695,31 +652,46 @@ void TestReadInteraction::TestReadRoundtrip(nlTestSuite * apSuite, void * apCont readPrepareParams.mEventPathParamsListSize = 1; readPrepareParams.mpAttributePathParamsList = attributePathParams; readPrepareParams.mAttributePathParamsListSize = 2; + readPrepareParams.mEventNumber = 1; - err = chip::app::InteractionModelEngine::GetInstance()->SendReadRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, !delegate.mReadError); + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - delegate.mGotEventResponse = false; - delegate.mNumAttributeResponse = 0; - delegate.mGotReport = false; - err = chip::app::InteractionModelEngine::GetInstance()->SendReadRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, !delegate.mReadError); + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mNumDataElementIndex == 1); + NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, !delegate.mReadError); - // By now we should have closed all exchanges and sent all pending acks, so - // there should be no queued-up things in the retransmit table. - NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + delegate.mGotEventResponse = false; + delegate.mNumAttributeResponse = 0; + delegate.mGotReport = false; + } + + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); + + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, !delegate.mReadError); + + // By now we should have closed all exchanges and sent all pending acks, so + // there should be no queued-up things in the retransmit table. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + } + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadClients() == 0); engine->Shutdown(); } @@ -749,17 +721,25 @@ void TestReadInteraction::TestReadWildcard(nlTestSuite * apSuite, void * apConte readPrepareParams.mEventPathParamsListSize = 0; readPrepareParams.mpAttributePathParamsList = attributePathParams; readPrepareParams.mAttributePathParamsListSize = 1; - err = chip::app::InteractionModelEngine::GetInstance()->SendReadRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 5); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, !delegate.mReadError); - // By now we should have closed all exchanges and sent all pending acks, so - // there should be no queued-up things in the retransmit table. - NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + { + + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); + + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 5); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, !delegate.mReadError); + // By now we should have closed all exchanges and sent all pending acks, so + // there should be no queued-up things in the retransmit table. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + } + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadClients() == 0); engine->Shutdown(); } @@ -792,19 +772,26 @@ void TestReadInteraction::TestReadChunking(nlTestSuite * apSuite, void * apConte readPrepareParams.mEventPathParamsListSize = 0; readPrepareParams.mpAttributePathParamsList = attributePathParams; readPrepareParams.mAttributePathParamsListSize = 1; - err = chip::app::InteractionModelEngine::GetInstance()->SendReadRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 7); // One empty string, with 6 array evelemtns. - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, !delegate.mReadError); - // By now we should have closed all exchanges and sent all pending acks, so - // there should be no queued-up things in the retransmit table. - NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 7); // One empty string, with 6 array evelemtns. + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, !delegate.mReadError); + // By now we should have closed all exchanges and sent all pending acks, so + // there should be no queued-up things in the retransmit table. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + } + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadClients() == 0); engine->Shutdown(); } @@ -838,38 +825,45 @@ void TestReadInteraction::TestSetDirtyBetweenChunks(nlTestSuite * apSuite, void readPrepareParams.mEventPathParamsListSize = 0; readPrepareParams.mpAttributePathParamsList = attributePathParams; readPrepareParams.mAttributePathParamsListSize = 2; - err = chip::app::InteractionModelEngine::GetInstance()->SendReadRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - - ClusterInfo dirtyPath; - dirtyPath.mEndpointId = Test::kMockEndpoint3; - dirtyPath.mClusterId = Test::MockClusterId(2); - dirtyPath.mAttributeId = Test::MockAttributeId(4); - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); - int currentAttributeResponse = delegate.mNumAttributeResponse; + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - // At this time, we should have sent 3 chunks, and are in the middle of report for second item. - InteractionModelEngine::GetInstance()->GetReportingEngine().SetDirty(dirtyPath); + ClusterInfo dirtyPath; + dirtyPath.mEndpointId = Test::kMockEndpoint3; + dirtyPath.mClusterId = Test::MockClusterId(2); + dirtyPath.mAttributeId = Test::MockAttributeId(4); - for (int i = 0; i < 5; i++) - { - // Then start from the beginning. 5 (the loop termination condition) needs to be big enough to let the report engine send - // all report chunks. InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - } + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - // We should receive another 2 * (6 + 1) = 14 attribute reports since the underlying path iterator should be reset. - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == currentAttributeResponse + 14); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, !delegate.mReadError); - // By now we should have closed all exchanges and sent all pending acks, so - // there should be no queued-up things in the retransmit table. - NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + int currentAttributeResponse = delegate.mNumAttributeResponse; + // At this time, we should have sent 3 chunks, and are in the middle of report for second item. + InteractionModelEngine::GetInstance()->GetReportingEngine().SetDirty(dirtyPath); + + for (int i = 0; i < 5; i++) + { + // Then start from the beginning. 5 (the loop termination condition) needs to be big enough to let the report engine + // send all report chunks. + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + } + + // We should receive another 2 * (6 + 1) = 14 attribute reports since the underlying path iterator should be reset. + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == currentAttributeResponse + 14); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, !delegate.mReadError); + // By now we should have closed all exchanges and sent all pending acks, so + // there should be no queued-up things in the retransmit table. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + } + + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadClients() == 0); engine->Shutdown(); } @@ -898,36 +892,23 @@ void TestReadInteraction::TestReadInvalidAttributePathRoundtrip(nlTestSuite * ap ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); readPrepareParams.mpAttributePathParamsList = attributePathParams; readPrepareParams.mAttributePathParamsListSize = 1; - err = chip::app::InteractionModelEngine::GetInstance()->SendReadRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 0); - // By now we should have closed all exchanges and sent all pending acks, so - // there should be no queued-up things in the retransmit table. - NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); - - engine->Shutdown(); -} + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Read); -void TestReadInteraction::TestProcessSubscribeResponse(nlTestSuite * apSuite, void * apContext) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TestContext & ctx = *static_cast(apContext); - app::ReadClient readClient; - MockInteractionModelApp delegate; - System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); - err = readClient.Init(&ctx.GetExchangeManager(), &delegate, chip::app::ReadClient::InteractionType::Subscribe); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - readClient.MoveToState(chip::app::ReadClient::ClientState::AwaitingSubscribeResponse); + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - GenerateSubscribeResponse(apSuite, apContext, buf.Retain()); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 0); + // By now we should have closed all exchanges and sent all pending acks, so + // there should be no queued-up things in the retransmit table. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + } - err = readClient.ProcessSubscribeResponse(std::move(buf)); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - readClient.ShutdownInternal(CHIP_NO_ERROR); + engine->Shutdown(); } void TestReadInteraction::TestProcessSubscribeRequest(nlTestSuite * apSuite, void * apContext) @@ -1033,196 +1014,131 @@ void TestReadInteraction::TestSubscribeRoundtrip(nlTestSuite * apSuite, void * a readPrepareParams.mMaxIntervalCeilingSeconds = 5; printf("\nSend first subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); - err = engine->SendSubscribeRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Subscribe); + + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + } delegate.mNumAttributeResponse = 0; readPrepareParams.mKeepSubscriptions = false; - err = engine->SendSubscribeRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - delegate.mGotReport = false; - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); - NL_TEST_ASSERT(apSuite, delegate.mNumSubscriptions == 1); - - GenerateEvents(apSuite, apContext, true /*aIsUrgent*/); - NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->mHoldReport == false); - NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->mDirty == true); - chip::app::ClusterInfo dirtyPath1; - dirtyPath1.mClusterId = kTestClusterId; - dirtyPath1.mEndpointId = kTestEndpointId; - dirtyPath1.mAttributeId = 1; - - chip::app::ClusterInfo dirtyPath2; - dirtyPath2.mClusterId = kTestClusterId; - dirtyPath2.mEndpointId = kTestEndpointId; - dirtyPath2.mAttributeId = 2; - - chip::app::ClusterInfo dirtyPath3; - dirtyPath3.mClusterId = kTestClusterId; - dirtyPath3.mEndpointId = kTestEndpointId; - dirtyPath3.mAttributeId = 2; - dirtyPath3.mListIndex = 1; - - chip::app::ClusterInfo dirtyPath4; - dirtyPath4.mClusterId = kTestClusterId; - dirtyPath4.mEndpointId = kTestEndpointId; - dirtyPath4.mAttributeId = 3; - - chip::app::ClusterInfo dirtyPath5; - dirtyPath5.mClusterId = kTestClusterId; - dirtyPath5.mEndpointId = kTestEndpointId; - dirtyPath5.mAttributeId = 4; - - // Test report with 2 different path - delegate.mpReadHandler->mHoldReport = false; - delegate.mGotReport = false; - delegate.mNumAttributeResponse = 0; - err = engine->GetReportingEngine().SetDirty(dirtyPath1); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = engine->GetReportingEngine().SetDirty(dirtyPath2); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); - - // Test report with 2 different path, and 1 same path - delegate.mpReadHandler->mHoldReport = false; - delegate.mGotReport = false; - delegate.mNumAttributeResponse = 0; - err = engine->GetReportingEngine().SetDirty(dirtyPath1); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = engine->GetReportingEngine().SetDirty(dirtyPath2); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = engine->GetReportingEngine().SetDirty(dirtyPath2); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); - - // Test report with 3 different path, and one path is overlapped with another - delegate.mpReadHandler->mHoldReport = false; - delegate.mGotReport = false; - delegate.mNumAttributeResponse = 0; - err = engine->GetReportingEngine().SetDirty(dirtyPath1); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = engine->GetReportingEngine().SetDirty(dirtyPath2); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = engine->GetReportingEngine().SetDirty(dirtyPath3); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); - - // Test report with 3 different path, all are not overlapped, one path is not interested for current subscription - delegate.mpReadHandler->mHoldReport = false; - delegate.mGotReport = false; - delegate.mNumAttributeResponse = 0; - err = engine->GetReportingEngine().SetDirty(dirtyPath1); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = engine->GetReportingEngine().SetDirty(dirtyPath2); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - err = engine->GetReportingEngine().SetDirty(dirtyPath4); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); - - // Test empty report - delegate.mpReadHandler->mHoldReport = false; - delegate.mpReadHandler->mHoldSync = false; - delegate.mGotReport = false; - delegate.mNumAttributeResponse = 0; - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 0); - - // Test multiple subscription - delegate.mGotEventResponse = false; - delegate.mNumAttributeResponse = 0; - delegate.mGotReport = false; - ReadPrepareParams readPrepareParams1(ctx.GetSessionBobToAlice()); - chip::app::AttributePathParams attributePathParams1[1]; - readPrepareParams1.mpAttributePathParamsList = attributePathParams1; - readPrepareParams1.mpAttributePathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams1.mpAttributePathParamsList[0].mClusterId = kTestClusterId; - readPrepareParams1.mpAttributePathParamsList[0].mAttributeId = 1; - readPrepareParams1.mAttributePathParamsListSize = 1; - readPrepareParams1.mMinIntervalFloorSeconds = 2; - readPrepareParams1.mMaxIntervalCeilingSeconds = 5; - - printf("\nSend 2nd subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); - - err = engine->SendSubscribeRequest(readPrepareParams1, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 1); - NL_TEST_ASSERT(apSuite, delegate.mNumSubscriptions == 2); - // Test report with 1 path modification for 2 subscription - delegate.mpReadHandler->mHoldReport = false; - delegate.mGotReport = false; - delegate.mNumAttributeResponse = 0; - err = engine->GetReportingEngine().SetDirty(dirtyPath1); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 1); - - delegate.mpReadHandler->mHoldReport = false; - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 1); - - delegate.mNumAttributeResponse = 0; - delegate.mGotReport = false; - ReadPrepareParams readPrepareParams2(ctx.GetSessionBobToAlice()); - chip::app::AttributePathParams attributePathParams2[1]; - readPrepareParams2.mpAttributePathParamsList = attributePathParams2; - readPrepareParams2.mpAttributePathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams2.mpAttributePathParamsList[0].mClusterId = kTestClusterId; - readPrepareParams2.mpAttributePathParamsList[0].mAttributeId = 1; - readPrepareParams2.mAttributePathParamsListSize = 1; - readPrepareParams2.mMinIntervalFloorSeconds = 2; - readPrepareParams2.mMaxIntervalCeilingSeconds = 5; - - printf("\nSend 3rd subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); - - err = engine->SendSubscribeRequest(readPrepareParams2, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 1); - NL_TEST_ASSERT(apSuite, !delegate.mReadError); - - delegate.mNumAttributeResponse = 0; - delegate.mGotReport = false; - ReadPrepareParams readPrepareParams3(ctx.GetSessionBobToAlice()); - chip::app::AttributePathParams attributePathParams3[1]; - readPrepareParams3.mpAttributePathParamsList = attributePathParams3; - readPrepareParams3.mpAttributePathParamsList[0].mEndpointId = kTestEndpointId; - readPrepareParams3.mpAttributePathParamsList[0].mClusterId = kTestClusterId; - readPrepareParams3.mpAttributePathParamsList[0].mAttributeId = 1; - readPrepareParams3.mAttributePathParamsListSize = 1; - readPrepareParams3.mMinIntervalFloorSeconds = 2; - readPrepareParams3.mMaxIntervalCeilingSeconds = 5; - - printf("\nSend 4th subscribe request message to Node: %" PRIu64 ", resource exhausted\n", chip::kTestDeviceNodeId); - - ReadClient readClient3; - readClient3.Init(&ctx.GetExchangeManager(), &delegate, ReadClient::InteractionType::Subscribe); - err = readClient3.SendRequest(readPrepareParams3); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, !delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 0); - NL_TEST_ASSERT(apSuite, delegate.mReadError); + + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Subscribe); + + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + delegate.mGotReport = false; + engine->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); + NL_TEST_ASSERT(apSuite, delegate.mNumSubscriptions == 1); + + GenerateEvents(apSuite, apContext, true /*aIsUrgent*/); + NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->mHoldReport == false); + NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->mDirty == true); + chip::app::ClusterInfo dirtyPath1; + dirtyPath1.mClusterId = kTestClusterId; + dirtyPath1.mEndpointId = kTestEndpointId; + dirtyPath1.mAttributeId = 1; + + chip::app::ClusterInfo dirtyPath2; + dirtyPath2.mClusterId = kTestClusterId; + dirtyPath2.mEndpointId = kTestEndpointId; + dirtyPath2.mAttributeId = 2; + + chip::app::ClusterInfo dirtyPath3; + dirtyPath3.mClusterId = kTestClusterId; + dirtyPath3.mEndpointId = kTestEndpointId; + dirtyPath3.mAttributeId = 2; + dirtyPath3.mListIndex = 1; + + chip::app::ClusterInfo dirtyPath4; + dirtyPath4.mClusterId = kTestClusterId; + dirtyPath4.mEndpointId = kTestEndpointId; + dirtyPath4.mAttributeId = 3; + + chip::app::ClusterInfo dirtyPath5; + dirtyPath5.mClusterId = kTestClusterId; + dirtyPath5.mEndpointId = kTestEndpointId; + dirtyPath5.mAttributeId = 4; + + // Test report with 2 different path + delegate.mpReadHandler->mHoldReport = false; + delegate.mGotReport = false; + delegate.mNumAttributeResponse = 0; + + printf("HereHere\n"); + + err = engine->GetReportingEngine().SetDirty(dirtyPath1); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + err = engine->GetReportingEngine().SetDirty(dirtyPath2); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + engine->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); + + // Test report with 2 different path, and 1 same path + delegate.mpReadHandler->mHoldReport = false; + delegate.mGotReport = false; + delegate.mNumAttributeResponse = 0; + err = engine->GetReportingEngine().SetDirty(dirtyPath1); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + err = engine->GetReportingEngine().SetDirty(dirtyPath2); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + err = engine->GetReportingEngine().SetDirty(dirtyPath2); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + engine->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); + + // Test report with 3 different path, and one path is overlapped with another + delegate.mpReadHandler->mHoldReport = false; + delegate.mGotReport = false; + delegate.mNumAttributeResponse = 0; + err = engine->GetReportingEngine().SetDirty(dirtyPath1); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + err = engine->GetReportingEngine().SetDirty(dirtyPath2); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + err = engine->GetReportingEngine().SetDirty(dirtyPath3); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + engine->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); + + // Test report with 3 different path, all are not overlapped, one path is not interested for current subscription + delegate.mpReadHandler->mHoldReport = false; + delegate.mGotReport = false; + delegate.mNumAttributeResponse = 0; + err = engine->GetReportingEngine().SetDirty(dirtyPath1); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + err = engine->GetReportingEngine().SetDirty(dirtyPath2); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + err = engine->GetReportingEngine().SetDirty(dirtyPath4); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + engine->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); + + // Test empty report + delegate.mpReadHandler->mHoldReport = false; + delegate.mpReadHandler->mHoldSync = false; + delegate.mGotReport = false; + delegate.mNumAttributeResponse = 0; + engine->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 0); + } // By now we should have closed all exchanges and sent all pending acks, so // there should be no queued-up things in the retransmit table. NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadClients() == 0); engine->Shutdown(); } @@ -1255,73 +1171,75 @@ void TestReadInteraction::TestSubscribeWildcard(nlTestSuite * apSuite, void * ap readPrepareParams.mMaxIntervalCeilingSeconds = 5; printf("\nSend subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); - err = engine->SendSubscribeRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - - delegate.mNumAttributeResponse = 0; - readPrepareParams.mKeepSubscriptions = false; - err = engine->SendSubscribeRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - delegate.mGotReport = false; - - for (int i = 0; i < 20 && delegate.mNumSubscriptions == 0; i++) - { - // 20 is a magic number, we assume the initial reports will take no more than 10 chunks. - engine->GetReportingEngine().Run(); - } - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - - // We have 29 attributes in our mock attribute storage. And we subscribed twice. - // And attribute 3/2/4 is a list with 6 elements and list chunking is applied to it, thus we should receive ( 29 + 6 ) * 2 = - // 70 attribute data in total. - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 70); - NL_TEST_ASSERT(apSuite, delegate.mNumSubscriptions == 1); - - // Set a concrete path dirty { - delegate.mpReadHandler->mHoldReport = false; - delegate.mGotReport = false; - delegate.mNumAttributeResponse = 0; + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Subscribe); - ClusterInfo dirtyPath; - dirtyPath.mEndpointId = Test::kMockEndpoint2; - dirtyPath.mClusterId = Test::MockClusterId(3); - dirtyPath.mAttributeId = Test::MockAttributeId(1); + delegate.mGotReport = false; - err = engine->GetReportingEngine().SetDirty(dirtyPath); + err = readClient.SendRequest(readPrepareParams); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - engine->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - // We subscribed wildcard path twice, so we will receive two reports here. - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); - } - // Set a endpoint dirty - { - delegate.mpReadHandler->mHoldReport = false; - delegate.mGotReport = false; - delegate.mNumAttributeResponse = 0; - - ClusterInfo dirtyPath; - dirtyPath.mEndpointId = Test::kMockEndpoint3; + for (int i = 0; i < 20 && delegate.mNumSubscriptions == 0; i++) + { + // 20 is a magic number, we assume the initial reports will take no more than 10 chunks. + engine->GetReportingEngine().Run(); + } + NL_TEST_ASSERT(apSuite, delegate.mGotReport); - err = engine->GetReportingEngine().SetDirty(dirtyPath); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + // We have 29 attributes in our mock attribute storage. And we subscribed twice. + // And attribute 3/2/4 is a list with 6 elements and list chunking is applied to it, thus we should receive ( 29 + 6 ) * 2 = + // 70 attribute data in total. + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 70); + NL_TEST_ASSERT(apSuite, delegate.mNumSubscriptions == 1); - for (int i = 0; i < 10 && delegate.mNumAttributeResponse < 38; i++) + // Set a concrete path dirty { delegate.mpReadHandler->mHoldReport = false; - // 10 is a magic number, we assume the report will use no more than 10 chunks. + delegate.mGotReport = false; + delegate.mNumAttributeResponse = 0; + + ClusterInfo dirtyPath; + dirtyPath.mEndpointId = Test::kMockEndpoint2; + dirtyPath.mClusterId = Test::MockClusterId(3); + dirtyPath.mAttributeId = Test::MockAttributeId(1); + + err = engine->GetReportingEngine().SetDirty(dirtyPath); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); engine->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + // We subscribed wildcard path twice, so we will receive two reports here. + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 2); } - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - // Mock endpoint3 has 13 attributes in total, and we subscribed twice. - // And attribute 3/2/4 is a list with 6 elements and list chunking is applied to it, thus we should receive ( 13 + 6 ) * 2 = - // 28 attribute data in total. - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 38); + // Set a endpoint dirty + { + delegate.mpReadHandler->mHoldReport = false; + delegate.mGotReport = false; + delegate.mNumAttributeResponse = 0; + + ClusterInfo dirtyPath; + dirtyPath.mEndpointId = Test::kMockEndpoint3; + + err = engine->GetReportingEngine().SetDirty(dirtyPath); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + for (int i = 0; i < 10 && delegate.mNumAttributeResponse < 38; i++) + { + delegate.mpReadHandler->mHoldReport = false; + // 10 is a magic number, we assume the report will use no more than 10 chunks. + engine->GetReportingEngine().Run(); + } + + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + // Mock endpoint3 has 13 attributes in total, and we subscribed twice. + // And attribute 3/2/4 is a list with 6 elements and list chunking is applied to it, thus we should receive ( 13 + 6 ) * + // 2 = 28 attribute data in total. + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 38); + } } + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadClients() == 0); engine->Shutdown(); } @@ -1352,22 +1270,25 @@ void TestReadInteraction::TestSubscribeEarlyShutdown(nlTestSuite * apSuite, void readPrepareParams.mKeepSubscriptions = false; printf("Send subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); - NL_TEST_ASSERT(apSuite, engine.SendSubscribeRequest(readPrepareParams, &delegate) == CHIP_NO_ERROR); - engine.GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mGotReport); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 1); - NL_TEST_ASSERT(apSuite, delegate.mNumSubscriptions == 1); - NL_TEST_ASSERT(apSuite, delegate.mpReadHandler != nullptr); + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Subscribe); + + NL_TEST_ASSERT(apSuite, readClient.SendRequest(readPrepareParams) == CHIP_NO_ERROR); - // Shutdown the subscription - uint64_t subscriptionId = 0; - delegate.mpReadHandler->GetSubscriptionId(subscriptionId); + engine.GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mGotReport); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 1); + NL_TEST_ASSERT(apSuite, delegate.mNumSubscriptions == 1); + NL_TEST_ASSERT(apSuite, delegate.mpReadHandler != nullptr); - NL_TEST_ASSERT(apSuite, subscriptionId != 0); - NL_TEST_ASSERT(apSuite, engine.ShutdownSubscription(subscriptionId) == CHIP_NO_ERROR); + // Shutdown the subscription + readClient.Abort(); + } // Cleanup + NL_TEST_ASSERT(apSuite, engine.GetNumActiveReadClients() == 0); NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); engine.Shutdown(); } @@ -1403,15 +1324,60 @@ void TestReadInteraction::TestSubscribeInvalidAttributePathRoundtrip(nlTestSuite readPrepareParams.mMaxIntervalCeilingSeconds = 5; printf("\nSend subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); - err = chip::app::InteractionModelEngine::GetInstance()->SendSubscribeRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - delegate.mNumAttributeResponse = 0; - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 0); - delegate.mpReadHandler->mHoldReport = false; - InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 0); + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Subscribe); + + NL_TEST_ASSERT(apSuite, readClient.SendRequest(readPrepareParams) == CHIP_NO_ERROR); + + delegate.mNumAttributeResponse = 0; + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 0); + delegate.mpReadHandler->mHoldReport = false; + InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + NL_TEST_ASSERT(apSuite, delegate.mNumAttributeResponse == 0); + } + + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadClients() == 0); + engine->Shutdown(); +} + +void TestReadInteraction::TestReadShutdown(nlTestSuite * apSuite, void * apContext) +{ + auto * engine = chip::app::InteractionModelEngine::GetInstance(); + app::ReadClient * pClients[4]; + TestContext & ctx = *static_cast(apContext); + MockInteractionModelApp delegate; + + // + // Allocate a number of clients + // + for (int i = 0; i < 4; i++) + { + pClients[i] = Platform::New(engine, &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Subscribe); + } + + // + // Delete every other client to ensure we test out + // deleting clients from the list of clients tracked by the IM + // + Platform::Delete(pClients[1]); + Platform::Delete(pClients[3]); + + // + // Shutdown the engine first so that we can + // de-activate the internal list. + // engine->Shutdown(); + + // + // Shutdown the read clients. These should + // safely destruct without causing any egregious + // harm + // + Platform::Delete(pClients[0]); + Platform::Delete(pClients[2]); } void TestReadInteraction::TestSubscribeInvalidIterval(nlTestSuite * apSuite, void * apContext) @@ -1443,10 +1409,17 @@ void TestReadInteraction::TestSubscribeInvalidIterval(nlTestSuite * apSuite, voi readPrepareParams.mSessionHandle = ctx.GetSessionBobToAlice(); readPrepareParams.mMinIntervalFloorSeconds = 6; readPrepareParams.mMaxIntervalCeilingSeconds = 5; - printf("\nSend subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); - err = chip::app::InteractionModelEngine::GetInstance()->SendSubscribeRequest(readPrepareParams, &delegate); - NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_INVALID_ARGUMENT); + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Subscribe); + + NL_TEST_ASSERT(apSuite, readClient.SendRequest(readPrepareParams) == CHIP_ERROR_INVALID_ARGUMENT); + + printf("\nSend subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); + } + + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadClients() == 0); engine->Shutdown(); } @@ -1474,7 +1447,6 @@ const nlTest sTests[] = NL_TEST_DEF("TestReadClientGenerateTwoEventPaths", chip::app::TestReadInteraction::TestReadClientGenerateTwoEventPaths), NL_TEST_DEF("TestReadClientInvalidReport", chip::app::TestReadInteraction::TestReadClientInvalidReport), NL_TEST_DEF("TestReadHandlerInvalidAttributePath", chip::app::TestReadInteraction::TestReadHandlerInvalidAttributePath), - NL_TEST_DEF("TestProcessSubscribeResponse", chip::app::TestReadInteraction::TestProcessSubscribeResponse), NL_TEST_DEF("TestProcessSubscribeRequest", chip::app::TestReadInteraction::TestProcessSubscribeRequest), NL_TEST_DEF("TestSubscribeRoundtrip", chip::app::TestReadInteraction::TestSubscribeRoundtrip), NL_TEST_DEF("TestSubscribeWildcard", chip::app::TestReadInteraction::TestSubscribeWildcard), @@ -1482,6 +1454,7 @@ const nlTest sTests[] = NL_TEST_DEF("TestSubscribeInvalidAttributePathRoundtrip", chip::app::TestReadInteraction::TestSubscribeInvalidAttributePathRoundtrip), NL_TEST_DEF("TestReadInvalidAttributePathRoundtrip", chip::app::TestReadInteraction::TestReadInvalidAttributePathRoundtrip), NL_TEST_DEF("TestSubscribeInvalidIterval", chip::app::TestReadInteraction::TestSubscribeInvalidIterval), + NL_TEST_DEF("TestReadShutdown", chip::app::TestReadInteraction::TestReadShutdown), NL_TEST_SENTINEL() }; // clang-format on diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index 26a90c82eeede0..3cc12e88e78c93 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -317,7 +317,7 @@ CHIP_ERROR WriteSingleClusterData(const Access::SubjectDescriptor & aSubjectDesc { TLV::TLVWriter writer; writer.Init(attributeDataTLV); - writer.CopyElement(TLV::AnonymousTag, aReader); + writer.CopyElement(TLV::AnonymousTag(), aReader); attributeDataTLVLen = writer.GetLengthWritten(); return aWriteHandler->AddStatus( AttributePathParams(aClusterInfo.mEndpointId, aClusterInfo.mClusterId, aClusterInfo.mAttributeId), diff --git a/src/app/tests/integration/chip_im_initiator.cpp b/src/app/tests/integration/chip_im_initiator.cpp index 0e6b0ef9ab5ba2..e00e3b8d65576d 100644 --- a/src/app/tests/integration/chip_im_initiator.cpp +++ b/src/app/tests/integration/chip_im_initiator.cpp @@ -160,6 +160,8 @@ class MockInteractionModelApp : public chip::app::InteractionModelDelegate, { HandleReadComplete(); } + + chip::Platform::Delete(apReadClient); } void OnResponse(chip::app::CommandSender * apCommandSender, const chip::app::ConcreteCommandPath & aPath, @@ -184,7 +186,7 @@ class MockInteractionModelApp : public chip::app::InteractionModelDelegate, gLastCommandResult = TestCommandResult::kFailure; printf("CommandResponseError happens with %" CHIP_ERROR_FORMAT, aError.Format()); } - void OnDone(chip::app::CommandSender * apCommandSender) override {} + void OnDone(chip::app::CommandSender * apCommandSender) override { delete apCommandSender; } void OnResponse(const chip::app::WriteClient * apWriteClient, const chip::app::ConcreteAttributePath & path, chip::app::StatusIB status) override @@ -317,8 +319,14 @@ CHIP_ERROR SendReadRequest() readPrepareParams.mAttributePathParamsListSize = 1; readPrepareParams.mpEventPathParamsList = eventPathParams; readPrepareParams.mEventPathParamsListSize = 2; - err = chip::app::InteractionModelEngine::GetInstance()->SendReadRequest(readPrepareParams, &gMockDelegate); - SuccessOrExit(err); + + auto readClient = + chip::Platform::MakeUnique(chip::app::InteractionModelEngine::GetInstance(), &gExchangeManager, + gMockDelegate, chip::app::ReadClient::InteractionType::Read); + + SuccessOrExit(readClient->SendRequest(readPrepareParams)); + + readClient.release(); exit: if (err == CHIP_NO_ERROR) @@ -329,6 +337,7 @@ CHIP_ERROR SendReadRequest() { printf("Send read request failed, err: %s\n", chip::ErrorStr(err)); } + return err; } @@ -394,8 +403,13 @@ CHIP_ERROR SendSubscribeRequest() readPrepareParams.mMaxIntervalCeilingSeconds = 5; printf("\nSend subscribe request message to Node: %" PRIu64 "\n", chip::kTestDeviceNodeId); - err = chip::app::InteractionModelEngine::GetInstance()->SendSubscribeRequest(readPrepareParams, &gMockDelegate); - SuccessOrExit(err); + auto readClient = + chip::Platform::MakeUnique(chip::app::InteractionModelEngine::GetInstance(), &gExchangeManager, + gMockDelegate, chip::app::ReadClient::InteractionType::Subscribe); + + SuccessOrExit(readClient->SendRequest(readPrepareParams)); + + readClient.release(); gSubCount++; @@ -431,6 +445,10 @@ CHIP_ERROR EstablishSecureSession() { printf("Establish secure session succeeded\n"); } + if (testSecurePairingSecret) + { + chip::Platform::Delete(testSecurePairingSecret); + } return err; } diff --git a/src/app/tests/integration/chip_im_responder.cpp b/src/app/tests/integration/chip_im_responder.cpp index 8c8b5f699e19a2..123689a4852cff 100644 --- a/src/app/tests/integration/chip_im_responder.cpp +++ b/src/app/tests/integration/chip_im_responder.cpp @@ -142,13 +142,13 @@ chip::app::CircularEventBuffer gCircularEventBuffer[3]; void InitializeEventLogging(chip::Messaging::ExchangeManager * apMgr) { chip::app::LogStorageResources logStorageResources[] = { - { &gCritEventBuffer[0], sizeof(gDebugEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Debug }, - { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Info }, - { &gDebugEventBuffer[0], sizeof(gCritEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Critical }, + { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), chip::app::PriorityLevel::Debug }, + { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), chip::app::PriorityLevel::Info }, + { &gCritEventBuffer[0], sizeof(gCritEventBuffer), chip::app::PriorityLevel::Critical }, }; chip::app::EventManagement::CreateEventManagement(apMgr, sizeof(logStorageResources) / sizeof(logStorageResources[0]), - gCircularEventBuffer, logStorageResources); + gCircularEventBuffer, logStorageResources, nullptr, 0, nullptr); } void MutateClusterHandler(chip::System::Layer * systemLayer, void * appState) diff --git a/src/app/tests/suites/TV_AccountLoginCluster.yaml b/src/app/tests/suites/TV_AccountLoginCluster.yaml index eb7059c4be80c1..3bfc2195950dc0 100644 --- a/src/app/tests/suites/TV_AccountLoginCluster.yaml +++ b/src/app/tests/suites/TV_AccountLoginCluster.yaml @@ -24,19 +24,19 @@ tests: command: "WaitForCommissionee" - label: "Get Setup PIN Command" - command: "GetSetupPIN" + command: "getSetupPINRequest" + timedInteractionTimeoutMs: 10000 arguments: values: - name: "tempAccountIdentifier" value: "asdf" - - # TODO: Enable these once they are able to work - # response: - # values: - # - name: "setupPIN" - # value: "tempPin123" + response: + values: + - name: "setupPIN" + value: "tempPin123" - label: "Login Command" - command: "Login" + command: "loginRequest" + timedInteractionTimeoutMs: 10000 arguments: values: - name: "tempAccountIdentifier" @@ -45,4 +45,5 @@ tests: value: "tempPin123" - label: "Logout Command" - command: "Logout" + command: "logoutRequest" + timedInteractionTimeoutMs: 10000 diff --git a/src/app/tests/suites/TV_ApplicationBasicCluster.yaml b/src/app/tests/suites/TV_ApplicationBasicCluster.yaml index aca78397852bcf..854b3a34a82c44 100644 --- a/src/app/tests/suites/TV_ApplicationBasicCluster.yaml +++ b/src/app/tests/suites/TV_ApplicationBasicCluster.yaml @@ -23,13 +23,6 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" - - label: "Change Status Command" - command: "ChangeStatus" - arguments: - values: - - name: "status" - value: 1 - # TODO: Support chars validation - label: "Read attribute vendor name" command: "readAttribute" diff --git a/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml b/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml index d91df598a4790a..d0672a9a924720 100644 --- a/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml +++ b/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml @@ -38,7 +38,7 @@ tests: value: { catalogVendorId: 123, applicationId: "applicationId" } - label: "Launch App Command" - command: "LaunchApp" + command: "launchAppRequest" arguments: values: - name: "data" @@ -53,7 +53,7 @@ tests: value: 0 - label: "Stop App Command" - command: "StopApp" + command: "stopAppRequest" arguments: values: - name: "application" @@ -66,7 +66,7 @@ tests: value: 0 - label: "Hide App Command" - command: "HideApp" + command: "hideAppRequest" arguments: values: - name: "application" diff --git a/src/app/tests/suites/TV_AudioOutputCluster.yaml b/src/app/tests/suites/TV_AudioOutputCluster.yaml index 668e8c38c66ef1..633d5420ab7bc3 100644 --- a/src/app/tests/suites/TV_AudioOutputCluster.yaml +++ b/src/app/tests/suites/TV_AudioOutputCluster.yaml @@ -41,14 +41,14 @@ tests: value: 0 - label: "Select Output Command" - command: "SelectOutput" + command: "selectOutputRequest" arguments: values: - name: "index" value: 1 - label: "Rename Output Command" - command: "RenameOutput" + command: "renameOutputRequest" arguments: values: - name: "index" diff --git a/src/app/tests/suites/TV_TvChannelCluster.yaml b/src/app/tests/suites/TV_ChannelCluster.yaml similarity index 93% rename from src/app/tests/suites/TV_TvChannelCluster.yaml rename to src/app/tests/suites/TV_ChannelCluster.yaml index 27e9af3bd4a813..eefe82e06587c0 100644 --- a/src/app/tests/suites/TV_TvChannelCluster.yaml +++ b/src/app/tests/suites/TV_ChannelCluster.yaml @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: TV Channel Cluster Tests +name: Channel Cluster Tests config: - cluster: "TV Channel" + cluster: "Channel" endpoint: 1 tests: @@ -23,7 +23,7 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" - - label: "Read attribute TV Channel list" + - label: "Read attribute Channel list" command: "readAttribute" attribute: "Channel list" response: @@ -74,7 +74,7 @@ tests: } - label: "Change Channel Command" - command: "ChangeChannel" + command: "changeChannelRequest" arguments: values: - name: "match" @@ -94,7 +94,7 @@ tests: } - label: "Change Channel By Number Command" - command: "ChangeChannelByNumber" + command: "changeChannelByNumberRequest" arguments: values: - name: "majorNumber" @@ -103,7 +103,7 @@ tests: value: 2 - label: "Skip Channel Command" - command: "SkipChannel" + command: "skipChannelRequest" arguments: values: - name: "count" diff --git a/src/app/tests/suites/TV_ContentLauncherCluster.yaml b/src/app/tests/suites/TV_ContentLauncherCluster.yaml index 4da7df542fdf81..26c9eff68d165b 100644 --- a/src/app/tests/suites/TV_ContentLauncherCluster.yaml +++ b/src/app/tests/suites/TV_ContentLauncherCluster.yaml @@ -23,11 +23,11 @@ tests: cluster: "DelayCommands" command: "WaitForCommissionee" - - label: "Read attribute accepts header list" + - label: "Read attribute accept header list" command: "readAttribute" - attribute: "accepts header list" + attribute: "accept header list" response: - value: ["example1", "example2"] + value: ["example", "example"] - label: "Read attribute supported streaming protocols" command: "readAttribute" @@ -36,7 +36,7 @@ tests: value: 0 - label: "Launch Content Command" - command: "LaunchContent" + command: "launchContentRequest" arguments: values: - name: "autoPlay" @@ -54,11 +54,11 @@ tests: values: - name: "data" value: "exampleData" - - name: "contentLaunchStatus" + - name: "status" value: 0 - label: "Launch URL Command" - command: "LaunchURL" + command: "launchURLRequest" arguments: values: - name: "contentURL" @@ -104,5 +104,5 @@ tests: values: - name: "data" value: "exampleData" - - name: "contentLaunchStatus" + - name: "status" value: 0 diff --git a/src/app/tests/suites/TV_KeypadInputCluster.yaml b/src/app/tests/suites/TV_KeypadInputCluster.yaml index dcd00ab0400b26..c60851fefc27f4 100644 --- a/src/app/tests/suites/TV_KeypadInputCluster.yaml +++ b/src/app/tests/suites/TV_KeypadInputCluster.yaml @@ -24,7 +24,7 @@ tests: command: "WaitForCommissionee" - label: "Send Key Command" - command: "SendKey" + command: "sendKeyRequest" arguments: values: - name: "keyCode" diff --git a/src/app/tests/suites/TV_LowPowerCluster.yaml b/src/app/tests/suites/TV_LowPowerCluster.yaml index f14c9d47c6a713..ae245e5f6f418a 100644 --- a/src/app/tests/suites/TV_LowPowerCluster.yaml +++ b/src/app/tests/suites/TV_LowPowerCluster.yaml @@ -24,4 +24,4 @@ tests: command: "WaitForCommissionee" - label: "Sleep Input Status Command" - command: "Sleep" + command: "sleep" diff --git a/src/app/tests/suites/TV_MediaInputCluster.yaml b/src/app/tests/suites/TV_MediaInputCluster.yaml index 25f28811f6db0e..53a6844431ecf3 100644 --- a/src/app/tests/suites/TV_MediaInputCluster.yaml +++ b/src/app/tests/suites/TV_MediaInputCluster.yaml @@ -50,20 +50,20 @@ tests: value: 0 - label: "Select Input Command" - command: "SelectInput" + command: "selectInputRequest" arguments: values: - name: "index" value: 1 - label: "Hide Input Status Command" - command: "HideInputStatus" + command: "hideInputStatusRequest" - label: "Show Input Status Command" - command: "ShowInputStatus" + command: "showInputStatusRequest" - label: "Rename Input Command" - command: "RenameInput" + command: "renameInputRequest" arguments: values: - name: "index" diff --git a/src/app/tests/suites/TV_MediaPlaybackCluster.yaml b/src/app/tests/suites/TV_MediaPlaybackCluster.yaml index a324f2009a207d..edafcffe6ae856 100644 --- a/src/app/tests/suites/TV_MediaPlaybackCluster.yaml +++ b/src/app/tests/suites/TV_MediaPlaybackCluster.yaml @@ -33,7 +33,7 @@ tests: command: "readAttribute" attribute: "start time" response: - value: 255 + value: 0 - label: "Read attribute duration" command: "readAttribute" @@ -68,90 +68,90 @@ tests: value: 0 - label: "Media Playback Play Command" - command: "MediaPlay" + command: "playRequest" response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 - label: "Media Playback Pause Command" - command: "MediaPause" + command: "pauseRequest" response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 - label: "Media Playback Stop Command" - command: "MediaStop" + command: "stopRequest" response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 - label: "Media Playback Start Over Command" - command: "MediaStartOver" + command: "startOverRequest" response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 - label: "Media Playback Previous Command" - command: "MediaPrevious" + command: "previousRequest" response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 - label: "Media Playback Next Command" - command: "MediaNext" + command: "nextRequest" response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 - label: "Media Playback Rewind Command" - command: "MediaRewind" + command: "rewindRequest" response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 - label: "Media Playback Fast Forward Command" - command: "MediaFastForward" + command: "fastForwardRequest" response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 - label: "Media Playback Skip Forward Command" - command: "MediaSkipForward" + command: "skipForwardRequest" arguments: values: - name: "deltaPositionMilliseconds" value: 100 response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 - label: "Media Playback Skip Backward Command" - command: "MediaSkipBackward" + command: "skipBackwardRequest" arguments: values: - name: "deltaPositionMilliseconds" value: 100 response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 - label: "Media Playback Seek Command" - command: "MediaSeek" + command: "seekRequest" arguments: values: - name: "position" value: 100 response: values: - - name: "mediaPlaybackStatus" + - name: "status" value: 0 diff --git a/src/app/tests/suites/TV_TargetNavigatorCluster.yaml b/src/app/tests/suites/TV_TargetNavigatorCluster.yaml index 9b167032fe0bf8..eb1c9bde08cfda 100644 --- a/src/app/tests/suites/TV_TargetNavigatorCluster.yaml +++ b/src/app/tests/suites/TV_TargetNavigatorCluster.yaml @@ -39,8 +39,8 @@ tests: response: value: 0 - - label: "Navigate Target Command" - command: "NavigateTarget" + - label: "Navigate Target Request Command" + command: "navigateTargetRequest" arguments: values: - name: "target" diff --git a/src/app/tests/suites/TestBasicInformation.yaml b/src/app/tests/suites/TestBasicInformation.yaml index 8c5c078c9552aa..fb7503668fe81f 100644 --- a/src/app/tests/suites/TestBasicInformation.yaml +++ b/src/app/tests/suites/TestBasicInformation.yaml @@ -22,8 +22,9 @@ tests: - label: "Wait for the commissioned device to be retrieved" cluster: "DelayCommands" command: "WaitForCommissionee" - + #Disabled due to issue-12983 - label: "Read location" + disabled: true command: "readAttribute" attribute: "location" response: @@ -34,8 +35,9 @@ tests: attribute: "location" arguments: value: "us" - + #Disabled due to issue-12983 - label: "Read back location" + disabled: true command: "readAttribute" attribute: "location" response: diff --git a/src/app/tests/suites/TestCluster.yaml b/src/app/tests/suites/TestCluster.yaml index 7123c9092b62f4..f6bb994f02322a 100644 --- a/src/app/tests/suites/TestCluster.yaml +++ b/src/app/tests/suites/TestCluster.yaml @@ -722,6 +722,18 @@ tests: response: value: "Tes\x00ti\x00ng" + - label: "Write attribute OCTET_STRING with weird chars" + command: "writeAttribute" + attribute: "octet_string" + arguments: + value: "\r\n\xff\"\xa0" + + - label: "Read attribute OCTET_STRING with weird chars" + command: "readAttribute" + attribute: "octet_string" + response: + value: "\r\n\xff\"\xa0" + - label: "Write attribute OCTET_STRING" command: "writeAttribute" attribute: "octet_string" @@ -1743,7 +1755,19 @@ tests: response: value: null - # Tests for UInt8 attribute + # Tests for nullable UInt8 attribute + + - label: "Write attribute NULLABLE_INT8U Min Value" + command: "writeAttribute" + attribute: "nullable_int8u" + arguments: + value: 0 + + - label: "Read attribute NULLABLE_INT8U Min Value" + command: "readAttribute" + attribute: "nullable_int8u" + response: + value: 0 - label: "Write attribute NULLABLE_INT8U Max Value" command: "writeAttribute" @@ -1771,6 +1795,13 @@ tests: response: value: 254 + - label: "Read attribute NULLABLE_INT8U unchanged Value with constraint" + command: "readAttribute" + attribute: "nullable_int8u" + response: + constraints: + notValue: null + - label: "Write attribute NULLABLE_INT8U null Value" command: "writeAttribute" attribute: "nullable_int8u" @@ -1783,7 +1814,55 @@ tests: response: value: null - # Tests for UInt16 attribute + - label: "Read attribute NULLABLE_INT8U null Value & range" + command: "readAttribute" + attribute: "nullable_int8u" + response: + constraints: + minValue: 0 + maxValue: 254 + + - label: "Read attribute NULLABLE_INT8U null Value & not" + command: "readAttribute" + attribute: "nullable_int8u" + response: + constraints: + notValue: 254 + + - label: "Write attribute NULLABLE_INT8U Value" + command: "writeAttribute" + attribute: "nullable_int8u" + arguments: + value: 128 + + - label: "Read attribute NULLABLE_INT8U Value in range" + command: "readAttribute" + attribute: "nullable_int8u" + response: + constraints: + minValue: 0 + maxValue: 254 + + - label: "Read attribute NULLABLE_INT8U notValue OK" + command: "readAttribute" + attribute: "nullable_int8u" + response: + constraints: + notValue: 129 + + # Tests for nullable UInt16 attribute + + - label: "Write attribute NULLABLE_INT16U Min Value" + command: "writeAttribute" + attribute: "nullable_int16u" + arguments: + value: 0 + + - label: "Read attribute NULLABLE_INT16U Min Value" + command: "readAttribute" + attribute: "nullable_int16u" + response: + value: 0 - label: "Write attribute NULLABLE_INT16U Max Value" command: "writeAttribute" @@ -1823,7 +1902,55 @@ tests: response: value: null - # Tests for UInt32 attribute + - label: "Read attribute NULLABLE_INT16U null Value & range" + command: "readAttribute" + attribute: "nullable_int16u" + response: + constraints: + minValue: 0 + maxValue: 65534 + + - label: "Read attribute NULLABLE_INT16U null Value & not" + command: "readAttribute" + attribute: "nullable_int16u" + response: + constraints: + notValue: 65534 + + - label: "Write attribute NULLABLE_INT16U Value" + command: "writeAttribute" + attribute: "nullable_int16u" + arguments: + value: 32000 + + - label: "Read attribute NULLABLE_INT16U Value in range" + command: "readAttribute" + attribute: "nullable_int16u" + response: + constraints: + minValue: 0 + maxValue: 65534 + + - label: "Read attribute NULLABLE_INT16U notValue OK" + command: "readAttribute" + attribute: "nullable_int16u" + response: + constraints: + notValue: 32001 + + # Tests for nullable UInt32 attribute + + - label: "Write attribute NULLABLE_INT32U Min Value" + command: "writeAttribute" + attribute: "nullable_int32u" + arguments: + value: 0 + + - label: "Read attribute NULLABLE_INT32U Min Value" + command: "readAttribute" + attribute: "nullable_int32u" + response: + value: 0 - label: "Write attribute NULLABLE_INT32U Max Value" command: "writeAttribute" @@ -1863,7 +1990,55 @@ tests: response: value: null - # Tests for UInt64 attribute + - label: "Read attribute NULLABLE_INT32U null Value & range" + command: "readAttribute" + attribute: "nullable_int32u" + response: + constraints: + minValue: 0 + maxValue: 4294967294 + + - label: "Read attribute NULLABLE_INT32U null Value & not" + command: "readAttribute" + attribute: "nullable_int32u" + response: + constraints: + notValue: 4294967294 + + - label: "Write attribute NULLABLE_INT32U Value" + command: "writeAttribute" + attribute: "nullable_int32u" + arguments: + value: 2147483647 + + - label: "Read attribute NULLABLE_INT32U Value in range" + command: "readAttribute" + attribute: "nullable_int32u" + response: + constraints: + minValue: 0 + maxValue: 4294967294 + + - label: "Read attribute NULLABLE_INT32U notValue OK" + command: "readAttribute" + attribute: "nullable_int32u" + response: + constraints: + notValue: 2147483648 + + # Tests for nullable UInt64 attribute + + - label: "Write attribute NULLABLE_INT64U Min Value" + command: "writeAttribute" + attribute: "nullable_int64u" + arguments: + value: 0 + + - label: "Read attribute NULLABLE_INT64U Min Value" + command: "readAttribute" + attribute: "nullable_int64u" + response: + value: 0 - label: "Write attribute NULLABLE_INT64U Max Value" command: "writeAttribute" @@ -1903,7 +2078,43 @@ tests: response: value: null - # Tests for Int8 attribute + - label: "Read attribute NULLABLE_INT64U null Value & range" + command: "readAttribute" + attribute: "nullable_int64u" + response: + constraints: + minValue: 0 + maxValue: "18446744073709551614" + + - label: "Read attribute NULLABLE_INT64U null Value & not" + command: "readAttribute" + attribute: "nullable_int64u" + response: + constraints: + notValue: "18446744073709551614" + + - label: "Write attribute NULLABLE_INT64U Value" + command: "writeAttribute" + attribute: "nullable_int64u" + arguments: + value: "18000000000000000000" + + - label: "Read attribute NULLABLE_INT64U Value in range" + command: "readAttribute" + attribute: "nullable_int64u" + response: + constraints: + minValue: 0 + maxValue: "18446744073709551614" + + - label: "Read attribute NULLABLE_INT64U notValue OK" + command: "readAttribute" + attribute: "nullable_int64u" + response: + constraints: + notValue: "18000000000000000001" + + # Tests for nullable Int8 attribute - label: "Write attribute NULLABLE_INT8S Min Value" command: "writeAttribute" @@ -1943,7 +2154,43 @@ tests: response: value: null - # Tests for Int16 attribute + - label: "Read attribute NULLABLE_INT8S null Value & range" + command: "readAttribute" + attribute: "nullable_int8s" + response: + constraints: + minValue: -127 + maxValue: 127 + + - label: "Read attribute NULLABLE_INT8S null Value & not" + command: "readAttribute" + attribute: "nullable_int8s" + response: + constraints: + notValue: -127 + + - label: "Write attribute NULLABLE_INT8S Value" + command: "writeAttribute" + attribute: "nullable_int8s" + arguments: + value: -127 + + - label: "Read attribute NULLABLE_INT8S Value in range" + command: "readAttribute" + attribute: "nullable_int8s" + response: + constraints: + minValue: -127 + maxValue: 127 + + - label: "Read attribute NULLABLE_INT8S notValue OK" + command: "readAttribute" + attribute: "nullable_int8s" + response: + constraints: + notValue: -126 + + # Tests for nullable Int16 attribute - label: "Write attribute NULLABLE_INT16S Min Value" command: "writeAttribute" @@ -1983,6 +2230,42 @@ tests: response: value: null + - label: "Read attribute NULLABLE_INT16S null Value & range" + command: "readAttribute" + attribute: "nullable_int16s" + response: + constraints: + minValue: -32767 + maxValue: 32767 + + - label: "Read attribute NULLABLE_INT16S null Value & not" + command: "readAttribute" + attribute: "nullable_int16s" + response: + constraints: + notValue: -32767 + + - label: "Write attribute NULLABLE_INT16S Value" + command: "writeAttribute" + attribute: "nullable_int16s" + arguments: + value: -32767 + + - label: "Read attribute NULLABLE_INT16S Value in range" + command: "readAttribute" + attribute: "nullable_int16s" + response: + constraints: + minValue: -32767 + maxValue: 32767 + + - label: "Read attribute NULLABLE_INT16S notValue OK" + command: "readAttribute" + attribute: "nullable_int16s" + response: + constraints: + notValue: -32766 + # Tests for Int32 attribute - label: "Write attribute NULLABLE_INT32S Min Value" @@ -2023,6 +2306,42 @@ tests: response: value: null + - label: "Read attribute NULLABLE_INT32S null Value & range" + command: "readAttribute" + attribute: "nullable_int32s" + response: + constraints: + minValue: -2147483647 + maxValue: 2147483647 + + - label: "Read attribute NULLABLE_INT32S null Value & not" + command: "readAttribute" + attribute: "nullable_int32s" + response: + constraints: + notValue: -2147483647 + + - label: "Write attribute NULLABLE_INT32S Value" + command: "writeAttribute" + attribute: "nullable_int32s" + arguments: + value: -2147483647 + + - label: "Read attribute NULLABLE_INT32S Value in range" + command: "readAttribute" + attribute: "nullable_int32s" + response: + constraints: + minValue: -2147483647 + maxValue: 2147483647 + + - label: "Read attribute NULLABLE_INT32S notValue OK" + command: "readAttribute" + attribute: "nullable_int32s" + response: + constraints: + notValue: -2147483646 + # Tests for Int64 attribute - label: "Write attribute NULLABLE_INT64S Min Value" @@ -2066,6 +2385,42 @@ tests: response: value: null + - label: "Read attribute NULLABLE_INT64S null Value & range" + command: "readAttribute" + attribute: "nullable_int64s" + response: + constraints: + minValue: "-9223372036854775807" + maxValue: "9223372036854775807" + + - label: "Read attribute NULLABLE_INT64S null Value & not" + command: "readAttribute" + attribute: "nullable_int64s" + response: + constraints: + notValue: "-9223372036854775807" + + - label: "Write attribute NULLABLE_INT64S Value" + command: "writeAttribute" + attribute: "nullable_int64s" + arguments: + value: "-9223372036854775807" + + - label: "Read attribute NULLABLE_INT64S Value in range" + command: "readAttribute" + attribute: "nullable_int64s" + response: + constraints: + minValue: "-9223372036854775807" + maxValue: "9223372036854775807" + + - label: "Read attribute NULLABLE_INT64S notValue OK" + command: "readAttribute" + attribute: "nullable_int64s" + response: + constraints: + notValue: "-9223372036854775806" + # Tests for float attribute - label: "Write attribute NULLABLE_SINGLE medium Value" @@ -2192,6 +2547,18 @@ tests: # Tests for Enum8 attribute + - label: "Write attribute NULLABLE_ENUM8 Min Value" + command: "writeAttribute" + attribute: "nullable_enum8" + arguments: + value: 0 + + - label: "Read attribute NULLABLE_ENUM8 Min Value" + command: "readAttribute" + attribute: "nullable_enum8" + response: + value: 0 + - label: "Write attribute NULLABLE_ENUM8 Max Value" command: "writeAttribute" attribute: "nullable_enum8" @@ -2232,6 +2599,18 @@ tests: # Tests for Enum16 attribute + - label: "Write attribute NULLABLE_ENUM16 Min Value" + command: "writeAttribute" + attribute: "nullable_enum16" + arguments: + value: 0 + + - label: "Read attribute NULLABLE_ENUM16 Min Value" + command: "readAttribute" + attribute: "nullable_enum16" + response: + value: 0 + - label: "Write attribute NULLABLE_ENUM16 Max Value" command: "writeAttribute" attribute: "nullable_enum16" @@ -2270,19 +2649,71 @@ tests: response: value: null - # Tests for Octet String attribute + # Tests for named enum attribute - - label: "Read attribute NULLABLE_OCTET_STRING Default Value" + - label: "Write attribute NULLABLE_SIMPLE_ENUM Min Value" + command: "writeAttribute" + attribute: "nullable_enum_attr" + arguments: + value: 0 + + - label: "Read attribute NULLABLE_SIMPLE_ENUM Min Value" command: "readAttribute" - attribute: "nullable_octet_string" + attribute: "nullable_enum_attr" response: - value: "" + value: 0 - - label: "Write attribute NULLABLE_OCTET_STRING" + - label: "Write attribute NULLABLE_SIMPLE_ENUM Max Value" command: "writeAttribute" - attribute: "nullable_octet_string" + attribute: "nullable_enum_attr" arguments: - value: "TestValue" + value: 254 + + - label: "Read attribute NULLABLE_SIMPLE_ENUM Max Value" + command: "readAttribute" + attribute: "nullable_enum_attr" + response: + value: 254 + + - label: "Write attribute NULLABLE_SIMPLE_ENUM Invalid Value" + command: "writeAttribute" + attribute: "nullable_enum_attr" + arguments: + value: 255 + response: + error: CONSTRAINT_ERROR + + - label: "Read attribute NULLABLE_SIMPLE_ENUM unchanged Value" + command: "readAttribute" + attribute: "nullable_enum_attr" + response: + value: 254 + + - label: "Write attribute NULLABLE_SIMPLE_ENUM null Value" + command: "writeAttribute" + attribute: "nullable_enum_attr" + arguments: + value: null + + - label: "Read attribute NULLABLE_SIMPLE_ENUM null Value" + command: "readAttribute" + attribute: "nullable_enum_attr" + response: + value: null + + # Tests for Octet String attribute + + - label: "Read attribute NULLABLE_OCTET_STRING Default Value" + command: "readAttribute" + attribute: "nullable_octet_string" + response: + value: "" + + - label: "Write attribute NULLABLE_OCTET_STRING" + command: "writeAttribute" + attribute: "nullable_octet_string" + arguments: + value: "TestValue" - label: "Read attribute NULLABLE_OCTET_STRING" command: "readAttribute" @@ -2388,3 +2819,849 @@ tests: values: - name: "arg1" value: 1 + + # Tests for subscription to a complex attribute + - label: "Subscribe to list attribute" + command: "subscribeAttribute" + attribute: "list_int8u" + minInterval: 2 + maxInterval: 10 + response: + value: [1, 2, 3, 4] + + - label: "Write subscribed-to list attribute" + command: "writeAttribute" + attribute: "list_int8u" + arguments: + value: [5, 6, 7, 8] + + - label: "Check for list attribute report" + command: "waitForReport" + attribute: "list_int8u" + response: + value: [5, 6, 7, 8] + + # Tests for range-checking on the server. + - label: "Read range-restricted unsigned 8-bit integer" + command: "readAttribute" + attribute: "range_restricted_int8u" + response: + value: 70 # That's the default. + + - label: "Write min value to a range-restricted unsigned 8-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int8u" + arguments: + value: 0 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-below-range value to a range-restricted unsigned 8-bit + integer" + command: "writeAttribute" + attribute: "range_restricted_int8u" + arguments: + value: 19 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-above-range value to a range-restricted unsigned 8-bit + integer" + command: "writeAttribute" + attribute: "range_restricted_int8u" + arguments: + value: 101 + response: + error: CONSTRAINT_ERROR + + - label: "Write max value to a range-restricted unsigned 8-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int8u" + arguments: + value: 255 + response: + error: CONSTRAINT_ERROR + + - label: + "Verify range-restricted unsigned 8-bit integer value has not changed" + command: "readAttribute" + attribute: "range_restricted_int8u" + response: + value: 70 + + - label: + "Write min valid value to a range-restricted unsigned 8-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int8u" + arguments: + value: 20 + + - label: + "Verify range-restricted unsigned 8-bit integer value is at min valid" + command: "readAttribute" + attribute: "range_restricted_int8u" + response: + value: 20 + + - label: + "Write max valid value to a range-restricted unsigned 8-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int8u" + arguments: + value: 100 + + - label: + "Verify range-restricted unsigned 8-bit integer value is at max valid" + command: "readAttribute" + attribute: "range_restricted_int8u" + response: + value: 100 + + - label: + "Write middle valid value to a range-restricted unsigned 8-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int8u" + arguments: + value: 50 + + - label: + "Verify range-restricted unsigned 8-bit integer value is at mid valid" + command: "readAttribute" + attribute: "range_restricted_int8u" + response: + value: 50 + + - label: "Read range-restricted unsigned 16-bit integer" + command: "readAttribute" + attribute: "range_restricted_int16u" + response: + value: 200 # That's the default. + + - label: "Write min value to a range-restricted unsigned 16-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int16u" + arguments: + value: 0 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-below-range value to a range-restricted unsigned 16-bit + integer" + command: "writeAttribute" + attribute: "range_restricted_int16u" + arguments: + value: 99 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-above-range value to a range-restricted unsigned 16-bit + integer" + command: "writeAttribute" + attribute: "range_restricted_int16u" + arguments: + value: 1001 + response: + error: CONSTRAINT_ERROR + + - label: "Write max value to a range-restricted unsigned 16-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int16u" + arguments: + value: 65535 + response: + error: CONSTRAINT_ERROR + + - label: + "Verify range-restricted unsigned 16-bit integer value has not changed" + command: "readAttribute" + attribute: "range_restricted_int16u" + response: + value: 200 + + - label: + "Write min valid value to a range-restricted unsigned 16-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int16u" + arguments: + value: 100 + + - label: + "Verify range-restricted unsigned 16-bit integer value is at min valid" + command: "readAttribute" + attribute: "range_restricted_int16u" + response: + value: 100 + + - label: + "Write max valid value to a range-restricted unsigned 16-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int16u" + arguments: + value: 1000 + + - label: + "Verify range-restricted unsigned 16-bit integer value is at max valid" + command: "readAttribute" + attribute: "range_restricted_int16u" + response: + value: 1000 + + - label: + "Write middle valid value to a range-restricted unsigned 16-bit + integer" + command: "writeAttribute" + attribute: "range_restricted_int16u" + arguments: + value: 500 + + - label: + "Verify range-restricted unsigned 16-bit integer value is at mid valid" + command: "readAttribute" + attribute: "range_restricted_int16u" + response: + value: 500 + + - label: "Read range-restricted signed 8-bit integer" + command: "readAttribute" + attribute: "range_restricted_int8s" + response: + value: -20 + + - label: "Write min value to a range-restricted signed 8-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int8s" + arguments: + value: -128 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-below-range value to a range-restricted signed 8-bit + integer" + command: "writeAttribute" + attribute: "range_restricted_int8s" + arguments: + value: -41 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-above-range value to a range-restricted signed 8-bit + integer" + command: "writeAttribute" + attribute: "range_restricted_int8s" + arguments: + value: 51 + response: + error: CONSTRAINT_ERROR + + - label: "Write max value to a range-restricted signed 8-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int8s" + arguments: + value: 127 + response: + error: CONSTRAINT_ERROR + + - label: + "Verify range-restricted signed 8-bit integer value has not changed" + command: "readAttribute" + attribute: "range_restricted_int8s" + response: + value: -20 + + - label: "Write min valid value to a range-restricted signed 8-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int8s" + arguments: + value: -40 + + - label: + "Verify range-restricted signed 8-bit integer value is at min valid" + command: "readAttribute" + attribute: "range_restricted_int8s" + response: + value: -40 + + - label: "Write max valid value to a range-restricted signed 8-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int8s" + arguments: + value: 50 + + - label: + "Verify range-restricted signed 8-bit integer value is at max valid" + command: "readAttribute" + attribute: "range_restricted_int8s" + response: + value: 50 + + - label: + "Write middle valid value to a range-restricted signed 8-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int8s" + arguments: + value: 6 + + - label: + "Verify range-restricted signed 8-bit integer value is at mid valid" + command: "readAttribute" + attribute: "range_restricted_int8s" + response: + value: 6 + + - label: "Read range-restricted signed 16-bit integer" + command: "readAttribute" + attribute: "range_restricted_int16s" + response: + value: -100 + + - label: "Write min value to a range-restricted signed 16-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int16s" + arguments: + value: -32768 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-below-range value to a range-restricted signed 16-bit + integer" + command: "writeAttribute" + attribute: "range_restricted_int16s" + arguments: + value: -151 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-above-range value to a range-restricted signed 16-bit + integer" + command: "writeAttribute" + attribute: "range_restricted_int16s" + arguments: + value: 201 + response: + error: CONSTRAINT_ERROR + + - label: "Write max value to a range-restricted signed 16-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int16s" + arguments: + value: 32767 + response: + error: CONSTRAINT_ERROR + + - label: + "Verify range-restricted signed 16-bit integer value has not changed" + command: "readAttribute" + attribute: "range_restricted_int16s" + response: + value: -100 + + - label: "Write min valid value to a range-restricted signed 16-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int16s" + arguments: + value: -150 + + - label: + "Verify range-restricted signed 16-bit integer value is at min valid" + command: "readAttribute" + attribute: "range_restricted_int16s" + response: + value: -150 + + - label: "Write max valid value to a range-restricted signed 16-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int16s" + arguments: + value: 200 + + - label: + "Verify range-restricted signed 16-bit integer value is at max valid" + command: "readAttribute" + attribute: "range_restricted_int16s" + response: + value: 200 + + - label: + "Write middle valid value to a range-restricted signed 16-bit integer" + command: "writeAttribute" + attribute: "range_restricted_int16s" + arguments: + value: 7 + + - label: + "Verify range-restricted signed 16-bit integer value is at mid valid" + command: "readAttribute" + attribute: "range_restricted_int16s" + response: + value: 7 + + # Tests for range-checking for nullable attributes on the server. + - label: "Read nullable range-restricted unsigned 8-bit integer" + command: "readAttribute" + attribute: "nullable_range_restricted_int8u" + response: + value: 70 # That's the default. + + - label: + "Write min value to a nullable range-restricted unsigned 8-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8u" + arguments: + value: 0 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-below-range value to a nullable range-restricted unsigned + 8-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8u" + arguments: + value: 19 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-above-range value to a nullable range-restricted unsigned + 8-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8u" + arguments: + value: 101 + response: + error: CONSTRAINT_ERROR + + - label: + "Write max value to a nullable range-restricted unsigned 8-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8u" + arguments: + value: 254 + response: + error: CONSTRAINT_ERROR + + - label: + "Verify nullable range-restricted unsigned 8-bit integer value has not + changed" + command: "readAttribute" + attribute: "nullable_range_restricted_int8u" + response: + value: 70 + + - label: + "Write min valid value to a nullable range-restricted unsigned 8-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8u" + arguments: + value: 20 + + - label: + "Verify nullable range-restricted unsigned 8-bit integer value is at + min valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int8u" + response: + value: 20 + + - label: + "Write max valid value to a nullable range-restricted unsigned 8-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8u" + arguments: + value: 100 + + - label: + "Verify nullable range-restricted unsigned 8-bit integer value is at + max valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int8u" + response: + value: 100 + + - label: + "Write middle valid value to a nullable range-restricted unsigned + 8-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8u" + arguments: + value: 50 + + - label: + "Verify nullable range-restricted unsigned 8-bit integer value is at + mid valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int8u" + response: + value: 50 + + - label: + "Write null value to a nullable range-restricted unsigned 8-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8u" + arguments: + value: null + + - label: + "Verify nullable range-restricted unsigned 8-bit integer value is null" + command: "readAttribute" + attribute: "nullable_range_restricted_int8u" + response: + value: null + + - label: "Read nullable range-restricted unsigned 16-bit integer" + command: "readAttribute" + attribute: "nullable_range_restricted_int16u" + response: + value: 200 # That's the default. + + - label: + "Write min value to a nullable range-restricted unsigned 16-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16u" + arguments: + value: 0 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-below-range value to a nullable range-restricted unsigned + 16-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16u" + arguments: + value: 99 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-above-range value to a nullable range-restricted unsigned + 16-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16u" + arguments: + value: 1001 + response: + error: CONSTRAINT_ERROR + + - label: + "Write max value to a nullable range-restricted unsigned 16-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16u" + arguments: + value: 65534 + response: + error: CONSTRAINT_ERROR + + - label: + "Verify nullable range-restricted unsigned 16-bit integer value has + not changed" + command: "readAttribute" + attribute: "nullable_range_restricted_int16u" + response: + value: 200 + + - label: + "Write min valid value to a nullable range-restricted unsigned 16-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16u" + arguments: + value: 100 + + - label: + "Verify nullable range-restricted unsigned 16-bit integer value is at + min valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int16u" + response: + value: 100 + + - label: + "Write max valid value to a nullable range-restricted unsigned 16-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16u" + arguments: + value: 1000 + + - label: + "Verify nullable range-restricted unsigned 16-bit integer value is at + max valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int16u" + response: + value: 1000 + + - label: + "Write middle valid value to a nullable range-restricted unsigned + 16-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16u" + arguments: + value: 500 + + - label: + "Verify nullable range-restricted unsigned 16-bit integer value is at + mid valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int16u" + response: + value: 500 + + - label: + "Write null value to a nullable range-restricted unsigned 16-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16u" + arguments: + value: null + + - label: + "Verify nullable range-restricted unsigned 16-bit integer value is + null" + command: "readAttribute" + attribute: "nullable_range_restricted_int16u" + response: + value: null + + - label: "Read nullable range-restricted signed 8-bit integer" + command: "readAttribute" + attribute: "nullable_range_restricted_int8s" + response: + value: -20 + + - label: + "Write min value to a nullable range-restricted signed 8-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8s" + arguments: + value: -127 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-below-range value to a nullable range-restricted signed + 8-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8s" + arguments: + value: -41 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-above-range value to a nullable range-restricted signed + 8-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8s" + arguments: + value: 51 + response: + error: CONSTRAINT_ERROR + + - label: + "Write max value to a nullable range-restricted signed 8-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8s" + arguments: + value: 127 + response: + error: CONSTRAINT_ERROR + + - label: + "Verify nullable range-restricted signed 8-bit integer value has not + changed" + command: "readAttribute" + attribute: "nullable_range_restricted_int8s" + response: + value: -20 + + - label: + "Write min valid value to a nullable range-restricted signed 8-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8s" + arguments: + value: -40 + + - label: + "Verify nullable range-restricted signed 8-bit integer value is at min + valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int8s" + response: + value: -40 + + - label: + "Write max valid value to a nullable range-restricted signed 8-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8s" + arguments: + value: 50 + + - label: + "Verify nullable range-restricted signed 8-bit integer value is at max + valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int8s" + response: + value: 50 + + - label: + "Write middle valid value to a nullable range-restricted signed 8-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8s" + arguments: + value: 6 + + - label: + "Verify nullable range-restricted signed 8-bit integer value is at mid + valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int8s" + response: + value: 6 + + - label: + "Write null value to a nullable range-restricted signed 8-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int8s" + arguments: + value: null + + - label: + "Verify nullable range-restricted signed 8-bit integer value is at + null" + command: "readAttribute" + attribute: "nullable_range_restricted_int8s" + response: + value: null + + - label: "Read nullable range-restricted signed 16-bit integer" + command: "readAttribute" + attribute: "nullable_range_restricted_int16s" + response: + value: -100 + + - label: + "Write min value to a nullable range-restricted signed 16-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16s" + arguments: + value: -32767 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-below-range value to a nullable range-restricted signed + 16-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16s" + arguments: + value: -151 + response: + error: CONSTRAINT_ERROR + + - label: + "Write just-above-range value to a nullable range-restricted signed + 16-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16s" + arguments: + value: 201 + response: + error: CONSTRAINT_ERROR + + - label: + "Write max value to a nullable range-restricted signed 16-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16s" + arguments: + value: 32767 + response: + error: CONSTRAINT_ERROR + + - label: + "Verify nullable range-restricted signed 16-bit integer value has not + changed" + command: "readAttribute" + attribute: "nullable_range_restricted_int16s" + response: + value: -100 + + - label: + "Write min valid value to a nullable range-restricted signed 16-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16s" + arguments: + value: -150 + + - label: + "Verify nullable range-restricted signed 16-bit integer value is at + min valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int16s" + response: + value: -150 + + - label: + "Write max valid value to a nullable range-restricted signed 16-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16s" + arguments: + value: 200 + + - label: + "Verify nullable range-restricted signed 16-bit integer value is at + max valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int16s" + response: + value: 200 + + - label: + "Write middle valid value to a nullable range-restricted signed 16-bit + integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16s" + arguments: + value: 7 + + - label: + "Verify nullable range-restricted signed 16-bit integer value is at + mid valid" + command: "readAttribute" + attribute: "nullable_range_restricted_int16s" + response: + value: 7 + + - label: + "Write null value to a nullable range-restricted signed 16-bit integer" + command: "writeAttribute" + attribute: "nullable_range_restricted_int16s" + arguments: + value: null + + - label: + "Verify nullable range-restricted signed 16-bit integer value is null" + command: "readAttribute" + attribute: "nullable_range_restricted_int16s" + response: + value: null diff --git a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml new file mode 100644 index 00000000000000..e72319faffe01f --- /dev/null +++ b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml @@ -0,0 +1,181 @@ +# 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: GroupKeyManagement Cluster Tests + +config: + cluster: "Group Key Management" + endpoint: 0 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + + - label: "Add Group 1" + disabled: true + cluster: "Groups" + endpoint: 1 + command: "AddGroup" + arguments: + values: + - name: "groupId" + value: 11 + - name: "groupName" + value: "Group #1" + response: + values: + - name: "status" + value: 0 + - name: "groupId" + value: 11 + + - label: "Add Group 2" + disabled: true + cluster: "Groups" + endpoint: 1 + command: "AddGroup" + arguments: + values: + - name: "groupId" + value: 12 + - name: "groupName" + value: "Group #2" + response: + values: + - name: "status" + value: 0 + - name: "groupId" + value: 12 + + - label: "KeySetWrite 1" + disabled: true + command: "KeySetWrite" + arguments: + values: + - name: "groupKeySet" + value: + { + groupKeySetID: 101, + securityPolicy: 0, + epochKey0: + [ + 0xa0, + 0xa1, + 0xa2, + 0xa3, + 0xa4, + 0xa5, + 0xa6, + 0xa7, + 0xa8, + 0xa9, + 0xaa, + 0xab, + 0xac, + 0xad, + 0xae, + 0xaf, + ], + epochStartTime0: 1110000, + epochKey1: + [ + 0xb0, + 0xb1, + 0xb2, + 0xb3, + 0xb4, + 0xb5, + 0xb6, + 0xb7, + 0xb8, + 0xb9, + 0xba, + 0xbb, + 0xbc, + 0xbd, + 0xbe, + 0xbf, + ], + epochStartTime1: 1110001, + epochKey2: + [ + 0xc0, + 0xc1, + 0xc2, + 0xc3, + 0xc4, + 0xc5, + 0xc6, + 0xc7, + 0xc8, + 0xc9, + 0xca, + 0xcb, + 0xcc, + 0xcd, + 0xce, + 0xcf, + ], + epochStartTime2: 1110002, + } + + - label: "Write Group Keys" + disabled: true + command: "writeAttribute" + attribute: "groupKeyMap" + arguments: + value: + [ + { fabricIndex: 1, groupId: 11, groupKeySetID: 101 }, + { fabricIndex: 1, groupId: 12, groupKeySetID: 102 }, + ] + + - label: "Read Group Keys" + disabled: true + command: "readAttribute" + attribute: "groupKeyMap" + response: + value: + [ + { fabricIndex: 1, groupId: 11, groupKeySetID: 101 }, + { fabricIndex: 1, groupId: 12, groupKeySetID: 102 }, + ] + + - label: "Read GroupTable" + disabled: true + command: "readAttribute" + attribute: "groupTable" + response: + value: + [ + { + fabricIndex: 1, + groupId: 11, + endpoints: [1], + groupName: "Group #1", + }, + ] + + - label: "Read maxGroupsPerFabric" + command: "readAttribute" + attribute: "maxGroupsPerFabric" + response: + value: 1 + + - label: "Read maxGroupKeysPerFabric" + command: "readAttribute" + attribute: "maxGroupKeysPerFabric" + response: + value: 1 diff --git a/src/app/tests/suites/TestGroupMessaging.yaml b/src/app/tests/suites/TestGroupMessaging.yaml index 0483ed5a6a9af8..fc9fcc2367af4c 100644 --- a/src/app/tests/suites/TestGroupMessaging.yaml +++ b/src/app/tests/suites/TestGroupMessaging.yaml @@ -33,8 +33,9 @@ tests: groupId: "1234" arguments: value: "us" - + #Disabled due to issue-12983 - label: "Read back Attribute" + disabled: true command: "readAttribute" attribute: "location" response: @@ -46,8 +47,9 @@ tests: groupId: "1234" arguments: value: "" - + #Disabled due to issue-12983 - label: "Read back Attribute" + disabled: true command: "readAttribute" attribute: "location" response: diff --git a/src/app/tests/suites/TestGroupsCluster.yaml b/src/app/tests/suites/TestGroupsCluster.yaml index 992986f10dbaec..3c3031de30775a 100644 --- a/src/app/tests/suites/TestGroupsCluster.yaml +++ b/src/app/tests/suites/TestGroupsCluster.yaml @@ -106,6 +106,8 @@ tests: value: [0x01] - label: "Add Group 2 (new)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "AddGroup" arguments: values: @@ -121,6 +123,8 @@ tests: value: 0x1111 - label: "View Group 2 (new)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "ViewGroup" arguments: values: @@ -149,6 +153,8 @@ tests: value: 0x7fff - label: "Add Group 3 (new)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "AddGroup" arguments: values: @@ -179,6 +185,8 @@ tests: value: "Group #1" - label: "View Group 2 (existing)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "ViewGroup" arguments: values: @@ -194,6 +202,8 @@ tests: value: "Group #2" - label: "Get Group Membership 2" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "GetGroupMembership" arguments: values: @@ -207,6 +217,8 @@ tests: value: [0x7fff] - label: "View Group 3 (new)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "ViewGroup" arguments: values: @@ -248,6 +260,8 @@ tests: value: 0x04 - label: "Remove Group 2 (existing)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "RemoveGroup" arguments: values: @@ -289,6 +303,8 @@ tests: value: 0x1111 - label: "View Group 3 (not removed)" + # https://github.com/project-chip/connectedhomeip/issues/11312 + disabled: true command: "ViewGroup" arguments: values: diff --git a/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml index eac71c19b0cb3d..34e4a4f528f194 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml @@ -34,7 +34,7 @@ tests: response: value: 1 - - label: "Color Loop Set Command - Set all Attributs" + - label: "Color Loop Set Command - Set all Attributes" command: "ColorLoopSet" arguments: values: diff --git a/src/app/tests/suites/certification/Test_TC_DD_1_5.yaml b/src/app/tests/suites/certification/Test_TC_DD_1_5.yaml new file mode 100644 index 00000000000000..e29a76c13bdf87 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_1_5.yaml @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 7.1.5. [TC-DD-1.5] NFC Rules of advertisement and Onboarding + +config: + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Step 1" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: + "Verify that the onboarding payload for NFC tags SHALL use + NDEF URI Record Type Definition as defined by NFC Forum in + URI Record Type Definition RTD URI" diff --git a/src/app/tests/suites/certification/Test_TC_DD_1_6.yaml b/src/app/tests/suites/certification/Test_TC_DD_1_6.yaml new file mode 100644 index 00000000000000..3787682fcd885b --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_1_6.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 7.1.6. [TC-DD-1.6] QR Code Format and Label + +config: + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Step 1" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: "Scan the DUTs QR code using a QR code reader" + + - label: "Step 1 verification" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: + "Verify the QR code gets scanned successfully and the QR + code must be of sufficient size and contrast respective to + surface material as to be readable with standard readers + such as smartphones in normal lighting conditions" + + - label: "Step 2 verificaiton" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: "Verify QR code version is 1 or higher" diff --git a/src/app/tests/suites/certification/Test_TC_DD_1_7.yaml b/src/app/tests/suites/certification/Test_TC_DD_1_7.yaml new file mode 100644 index 00000000000000..6e27e1c6184356 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_1_7.yaml @@ -0,0 +1,41 @@ +# 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: 7.1.7. [TC-DD-1.7] Setup Code Format and Label + +config: + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Precondition" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: + "Verify manual pairing code is printed on the device or in + additional provided materials" + + - label: "Step 1" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: + "Verify that the Manual Pairing Code should be printed using + a minimum font size of 6 points typically producing a + typeface height of 2.1 mm" diff --git a/src/app/tests/suites/certification/Test_TC_DD_1_8.yaml b/src/app/tests/suites/certification/Test_TC_DD_1_8.yaml new file mode 100644 index 00000000000000..eceabeb11df140 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_1_8.yaml @@ -0,0 +1,40 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: + 7.1.8. [TC-DD-1.8] QR Code Onboarding Payload Verification [DUT - + Commissioner] + +config: + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Step 1" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: "Scan the device QR code using DUT" + + - label: "Step 1 verification" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: + "Verify the DUT is able to scan and parse the QR code + successfully to onboard the device onto the CHIP network" diff --git a/src/app/tests/suites/certification/Test_TC_DD_1_9.yaml b/src/app/tests/suites/certification/Test_TC_DD_1_9.yaml new file mode 100644 index 00000000000000..5389207336ece5 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DD_1_9.yaml @@ -0,0 +1,52 @@ +# 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: + 7.1.9. [TC-DD-1.9] Manual Pairing Code Payload Verification [DUT - + Commissioner] + +config: + cluster: "Basic" + endpoint: 0 + +tests: + - label: "Precondition" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: + "Verify that the manual pairing code is printed on the + device or in additional provided materials" + + - label: "Step 1" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: + "Provide the 11 digit or 21 digit pairing code from the + Device in text speech or any format supported by DUT" + + - label: "Step 1 verification" + cluster: "LogCommands" + command: "Log" + arguments: + values: + - name: "message" + value: + "Verify that the manual pairing code can be provided to DUT + and parsed to onboard the device onto the CHIP network" diff --git a/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml b/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml index abdb31ab30773a..2344af16a20d07 100644 --- a/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RH_1_1.yaml @@ -24,7 +24,7 @@ tests: command: "WaitForCommissionee" #issue #12190 as per spec default value is 3 but expecting 2 - #refering default value of Water Content Measurement + #referring default value of Water Content Measurement - label: "read the global attribute: ClusterRevision" disabled: true command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml index 5b502b37d03c41..8846dfd793dd7e 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml @@ -54,7 +54,7 @@ tests: response: value: 2000 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes OccupiedCoolingSetpoint to value below the MinCoolSetpointLimit" @@ -65,7 +65,7 @@ tests: arguments: value: 30 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes OccupiedCoolingSetpoint to value above the MaxCoolSetpointLimit" @@ -125,7 +125,7 @@ tests: response: value: 2100 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes OccupiedHeatingSetpoint to value below the MinHeatSetpointLimit" @@ -136,7 +136,7 @@ tests: arguments: value: 1002 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes OccupiedHeatingSetpoint to value above the MaxHeatSetpointLimit" @@ -196,7 +196,7 @@ tests: response: value: 2000 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes MinHeatSetpointLimit to value below the AbsMinHeatSetpointLimit " @@ -207,7 +207,7 @@ tests: arguments: value: 650 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes MinHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit " @@ -267,7 +267,7 @@ tests: response: value: 2000 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes MaxHeatSetpointLimit to value below the AbsMinHeatSetpointLimit " @@ -278,7 +278,7 @@ tests: arguments: value: 500 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes MaxHeatSetpointLimit to value above the AbsMaxHeatSetpointLimit " @@ -338,7 +338,7 @@ tests: response: value: 2000 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes MinCoolSetpointLimit to value below the AbsMinCoolSetpointLimit " @@ -349,7 +349,7 @@ tests: arguments: value: 1000 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes MinCoolSetpointLimit to value above the MaxCoolSetpointLimit " disabled: true @@ -408,7 +408,7 @@ tests: response: value: 2000 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes MaxCoolSetpointLimit to value below the AbsMinCoolSetpointLimit " @@ -419,7 +419,7 @@ tests: arguments: value: 1000 - #issue #11718 Write command above max and below min value returns Sucess Response + #issue #11718 Write command above max and below min value returns Success Response - label: "Writes MaxCoolSetpointLimit to value above the MaxCoolSetpointLimit " disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_2_1.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_2_1.yaml index bcccec313e5243..cf87152b1ab274 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_2_1.yaml @@ -162,7 +162,7 @@ tests: attribute: "TargetPositionLiftPercent100ths" response: constraints: - type: uint16 + type: Percent100ths minValue: 0 maxValue: 10000 @@ -183,7 +183,7 @@ tests: attribute: "TargetPositionLiftPercent100ths" response: constraints: - type: uint16 + type: Percent100ths notValue: 20000 ### Attribute[ 12]: TargetPositionTiltPercent100ths ==================== @@ -194,7 +194,7 @@ tests: attribute: "TargetPositionTiltPercent100ths" response: constraints: - type: uint16 + type: Percent100ths minValue: 0 maxValue: 10000 @@ -215,7 +215,7 @@ tests: attribute: "TargetPositionTiltPercent100ths" response: constraints: - type: uint16 + type: Percent100ths notValue: 20000 ### Attribute[ 14]: CurrentPositionLiftPercent100ths ==================== @@ -226,7 +226,7 @@ tests: attribute: "CurrentPositionLiftPercent100ths" response: constraints: - type: uint16 + type: Percent100ths minValue: 0 maxValue: 10000 @@ -247,7 +247,7 @@ tests: attribute: "CurrentPositionLiftPercent100ths" response: constraints: - type: uint16 + type: Percent100ths notValue: 20000 ### Attribute[ 15]: CurrentPositionTiltPercent100ths ==================== @@ -258,7 +258,7 @@ tests: attribute: "CurrentPositionTiltPercent100ths" response: constraints: - type: uint16 + type: Percent100ths minValue: 0 maxValue: 10000 @@ -279,7 +279,7 @@ tests: attribute: "CurrentPositionTiltPercent100ths" response: constraints: - type: uint16 + type: Percent100ths notValue: 20000 ### Attribute[ 16]: InstalledOpenLimitLift ==================== @@ -623,7 +623,7 @@ tests: attribute: "CurrentPositionLiftPercentage" response: constraints: - type: uint8 + type: Percent minValue: 0 maxValue: 100 @@ -644,7 +644,7 @@ tests: attribute: "CurrentPositionLiftPercentage" response: constraints: - type: uint8 + type: Percent notValue: 200 ### Attribute[ 9]: CurrentPositionTiltPercentage ==================== @@ -655,7 +655,7 @@ tests: attribute: "CurrentPositionTiltPercentage" response: constraints: - type: uint8 + type: Percent minValue: 0 maxValue: 100 @@ -676,7 +676,7 @@ tests: attribute: "CurrentPositionTiltPercentage" response: constraints: - type: uint8 + type: Percent notValue: 200 ################################################### # FYI Non Tested deprecated attributes diff --git a/src/app/util/CHIPDeviceCallbacksMgr.cpp b/src/app/util/CHIPDeviceCallbacksMgr.cpp index e8b905e00cd271..50849bca93bb73 100644 --- a/src/app/util/CHIPDeviceCallbacksMgr.cpp +++ b/src/app/util/CHIPDeviceCallbacksMgr.cpp @@ -134,80 +134,5 @@ CHIP_ERROR CHIPDeviceCallbacksMgr::GetResponseCallback(NodeId nodeId, uint8_t se return CHIP_NO_ERROR; } -CHIP_ERROR CHIPDeviceCallbacksMgr::SetSubscribeFilter(const ReportCallbackInfo & info, TLVDataFilter filter) -{ - constexpr ReportCallbackInfo kEmptyInfo{ kPlaceholderNodeId, 0, 0, 0 }; - - for (size_t i = 0; i < kTLVFilterPoolSize; i++) - { - if (mReportFilterPool[i].info == info) - { - mReportFilterPool[i].filter = filter; - return CHIP_NO_ERROR; - } - } - - for (size_t i = 0; i < kTLVFilterPoolSize; i++) - { - if (mReportFilterPool[i].info == kEmptyInfo) - { - mReportFilterPool[i].info = info; - mReportFilterPool[i].filter = filter; - return CHIP_NO_ERROR; - } - } - - return CHIP_ERROR_NO_MEMORY; -} - -CHIP_ERROR CHIPDeviceCallbacksMgr::GetSubscribeFilter(const ReportCallbackInfo & info, TLVDataFilter * outFilter) -{ - for (size_t i = 0; i < kTLVFilterPoolSize; i++) - { - if (mReportFilterPool[i].info == info) - { - if (outFilter != nullptr) - { - *outFilter = mReportFilterPool[i].filter; - } - return CHIP_NO_ERROR; - } - } - - return CHIP_ERROR_KEY_NOT_FOUND; -} - -CHIP_ERROR CHIPDeviceCallbacksMgr::AddReportCallback(NodeId nodeId, EndpointId endpointId, ClusterId clusterId, - AttributeId attributeId, Callback::Cancelable * onReportCallback, - TLVDataFilter filter) -{ - VerifyOrReturnError(onReportCallback != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(filter != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - - ReportCallbackInfo info = { nodeId, endpointId, clusterId, attributeId }; - static_assert(sizeof(onReportCallback->mInfo) >= sizeof(info), "Callback info too large"); - memcpy(&onReportCallback->mInfo, &info, sizeof(info)); - - // If a callback has already been registered for the same ReportCallbackInfo, let's cancel it. - CancelCallback(info, mReports); - - ReturnErrorOnFailure(SetSubscribeFilter(info, filter)); - - mReports.Enqueue(onReportCallback); - return CHIP_NO_ERROR; -} - -CHIP_ERROR CHIPDeviceCallbacksMgr::GetReportCallback(NodeId nodeId, EndpointId endpointId, ClusterId clusterId, - AttributeId attributeId, Callback::Cancelable ** onReportCallback, - TLVDataFilter * outFilter) -{ - ReportCallbackInfo info = { nodeId, endpointId, clusterId, attributeId }; - - ReturnErrorOnFailure(GetCallback(info, mReports, onReportCallback)); - ReturnErrorOnFailure(GetSubscribeFilter(info, outFilter)); - - return CHIP_NO_ERROR; -} - } // namespace app } // namespace chip diff --git a/src/app/util/CHIPDeviceCallbacksMgr.h b/src/app/util/CHIPDeviceCallbacksMgr.h index 9d8741cf15bebe..908a4a6e4d8768 100644 --- a/src/app/util/CHIPDeviceCallbacksMgr.h +++ b/src/app/util/CHIPDeviceCallbacksMgr.h @@ -71,11 +71,6 @@ class DLL_EXPORT CHIPDeviceCallbacksMgr CHIP_ERROR GetResponseCallback(NodeId nodeId, uint8_t sequenceNumber, Callback::Cancelable ** onSuccessCallback, Callback::Cancelable ** onFailureCallback, TLVDataFilter * callbackFilter = nullptr); - CHIP_ERROR AddReportCallback(NodeId nodeId, EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, - Callback::Cancelable * onReportCallback, TLVDataFilter callbackFilter); - CHIP_ERROR GetReportCallback(NodeId nodeId, EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, - Callback::Cancelable ** onReportCallback, TLVDataFilter * callbackFilter); - private: CHIPDeviceCallbacksMgr() {} @@ -150,14 +145,9 @@ class DLL_EXPORT CHIPDeviceCallbacksMgr CHIP_ERROR AddResponseFilter(const ResponseCallbackInfo & info, TLVDataFilter callbackFilter); CHIP_ERROR PopResponseFilter(const ResponseCallbackInfo & info, TLVDataFilter * callbackFilter); - CHIP_ERROR SetSubscribeFilter(const ReportCallbackInfo & info, TLVDataFilter callbackFilter); - CHIP_ERROR GetSubscribeFilter(const ReportCallbackInfo & info, TLVDataFilter * callbackFilter); - Callback::CallbackDeque mResponsesSuccess; Callback::CallbackDeque mResponsesFailure; TLVFilterItem mTLVFilterPool[kTLVFilterPoolSize]; - Callback::CallbackDeque mReports; - TLVFilterItem mReportFilterPool[kTLVFilterPoolSize]; }; } // namespace app diff --git a/src/app/util/ContentApp.cpp b/src/app/util/ContentApp.cpp index e8992cc3cb029a..ec02ed1e7d14ad 100644 --- a/src/app/util/ContentApp.cpp +++ b/src/app/util/ContentApp.cpp @@ -132,11 +132,11 @@ EmberAfStatus ApplicationBasic::HandleWriteAttribute(chip::AttributeId attribute { if (*buffer) { - SetApplicationStatus(app::Clusters::ApplicationBasic::ApplicationBasicStatus::kActiveVisibleFocus); + SetApplicationStatus(app::Clusters::ApplicationBasic::ApplicationStatusEnum::kActiveVisibleFocus); } else { - SetApplicationStatus(app::Clusters::ApplicationBasic::ApplicationBasicStatus::kActiveVisibleNotFocus); + SetApplicationStatus(app::Clusters::ApplicationBasic::ApplicationStatusEnum::kActiveVisibleNotFocus); } } else @@ -228,7 +228,7 @@ CHIP_ERROR TargetNavigator::GetTargetInfoList(chip::app::AttributeValueEncoder & { // ReturnErrorOnFailure(encoder.Encode(chip::CharSpan(entry.c_str(), entry.length()))); - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::Type targetInfo; + chip::app::Clusters::TargetNavigator::Structs::TargetInfo::Type targetInfo; targetInfo.name = chip::CharSpan(entry.c_str(), entry.length()); targetInfo.identifier = static_cast(i++); ReturnErrorOnFailure(encoder.Encode(targetInfo)); @@ -237,20 +237,21 @@ CHIP_ERROR TargetNavigator::GetTargetInfoList(chip::app::AttributeValueEncoder & }); } -TargetNavigatorResponse TargetNavigator::NavigateTarget(uint8_t target, std::string data) +app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type TargetNavigator::NavigateTarget(uint8_t target, + std::string data) { ChipLogProgress(DeviceLayer, "TargetNavigator: NavigateTarget target=%d data=\"%s\"", target, data.c_str()); - TargetNavigatorResponse response; - const char * testData = "data response"; - response.data = (uint8_t *) testData; + app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type response; + response.data = chip::CharSpan("data response", strlen("data response")); + if (target >= mTargets.size()) { - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_APP_NOT_AVAILABLE; + response.status = app::Clusters::TargetNavigator::StatusEnum::kAppNotAvailable; } else { - response.status = EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS; + response.status = app::Clusters::TargetNavigator::StatusEnum::kSuccess; mCurrentTarget = target; } return response; diff --git a/src/app/util/ContentApp.h b/src/app/util/ContentApp.h index e9572c0d3dc25c..1c9a9ab1a46815 100644 --- a/src/app/util/ContentApp.h +++ b/src/app/util/ContentApp.h @@ -52,13 +52,13 @@ class DLL_EXPORT ApplicationBasic : public ContentAppCluster public: virtual ~ApplicationBasic() = default; - virtual const char * GetVendorName() = 0; - virtual uint16_t GetVendorId() = 0; - virtual const char * GetApplicationName() = 0; - virtual uint16_t GetProductId() = 0; - virtual app::Clusters::ApplicationBasic::ApplicationBasicStatus GetApplicationStatus() = 0; - virtual const char * GetApplicationVersion() = 0; - virtual void SetApplicationStatus(app::Clusters::ApplicationBasic::ApplicationBasicStatus applicationStatus) = 0; + virtual const char * GetVendorName() = 0; + virtual uint16_t GetVendorId() = 0; + virtual const char * GetApplicationName() = 0; + virtual uint16_t GetProductId() = 0; + virtual app::Clusters::ApplicationBasic::ApplicationStatusEnum GetApplicationStatus() = 0; + virtual const char * GetApplicationVersion() = 0; + virtual void SetApplicationStatus(app::Clusters::ApplicationBasic::ApplicationStatusEnum applicationStatus) = 0; EmberAfStatus HandleReadAttribute(chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength) override; EmberAfStatus HandleWriteAttribute(chip::AttributeId attributeId, uint8_t * buffer) override; @@ -91,7 +91,8 @@ class DLL_EXPORT ApplicationLauncher : public ContentAppCluster public: virtual ~ApplicationLauncher() = default; - virtual ApplicationLauncherResponse LaunchApp(ApplicationLauncherApp application, std::string data) = 0; + virtual app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Type LaunchApp(Application application, + std::string data) = 0; EmberAfStatus HandleReadAttribute(chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength) override; EmberAfStatus HandleWriteAttribute(chip::AttributeId attributeId, uint8_t * buffer) override; @@ -102,8 +103,8 @@ class DLL_EXPORT ContentLauncher : public ContentAppCluster public: virtual ~ContentLauncher() = default; - virtual ContentLaunchResponse LaunchContent(std::list parameterList, bool autoplay, - std::string data) = 0; + virtual app::Clusters::ContentLauncher::Commands::LaunchResponse::Type LaunchContent(std::list parameterList, + bool autoplay, std::string data) = 0; EmberAfStatus HandleReadAttribute(chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength) override; EmberAfStatus HandleWriteAttribute(chip::AttributeId attributeId, uint8_t * buffer) override; @@ -124,7 +125,7 @@ class DLL_EXPORT TargetNavigator : public ContentAppCluster TargetNavigator(std::list targets, uint8_t currentTarget); virtual ~TargetNavigator() = default; - TargetNavigatorResponse NavigateTarget(uint8_t target, std::string data); + app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Type NavigateTarget(uint8_t target, std::string data); CHIP_ERROR GetTargetInfoList(chip::app::AttributeValueEncoder & aEncoder); EmberAfStatus HandleReadAttribute(chip::AttributeId attributeId, uint8_t * buffer, uint16_t maxReadLength) override; diff --git a/src/app/util/ContentAppPlatform.cpp b/src/app/util/ContentAppPlatform.cpp index 3d2acf41d68550..d4b18158a6f33a 100644 --- a/src/app/util/ContentAppPlatform.cpp +++ b/src/app/util/ContentAppPlatform.cpp @@ -235,7 +235,7 @@ ContentApp * AppPlatform::GetLoadContentAppByVendorId(uint16_t vendorId) return NULL; } -ContentApp * AppPlatform::GetLoadContentAppByAppId(ApplicationLauncherApp application) +ContentApp * AppPlatform::GetLoadContentAppByAppId(Application application) { ChipLogProgress(DeviceLayer, "GetLoadContentAppByAppId()"); if (mContentAppFactory != NULL) diff --git a/src/app/util/ContentAppPlatform.h b/src/app/util/ContentAppPlatform.h index 0f64e9532d3298..81de4ebc62b6e2 100644 --- a/src/app/util/ContentAppPlatform.h +++ b/src/app/util/ContentAppPlatform.h @@ -37,9 +37,9 @@ namespace AppPlatform { class DLL_EXPORT ContentAppFactory { public: - virtual ~ContentAppFactory() = default; - virtual ContentApp * LoadContentAppByVendorId(uint16_t vendorId) = 0; - virtual ContentApp * LoadContentAppByAppId(ApplicationLauncherApp application) = 0; + virtual ~ContentAppFactory() = default; + virtual ContentApp * LoadContentAppByVendorId(uint16_t vendorId) = 0; + virtual ContentApp * LoadContentAppByAppId(Application application) = 0; }; class DLL_EXPORT AppPlatform @@ -63,7 +63,7 @@ class DLL_EXPORT AppPlatform // load and unload by vendor id void UnloadContentAppByVendorId(uint16_t vendorId); ContentApp * GetLoadContentAppByVendorId(uint16_t vendorId); - ContentApp * GetLoadContentAppByAppId(ApplicationLauncherApp application); + ContentApp * GetLoadContentAppByAppId(Application application); // helpful method to get a Content App by endpoint in order to perform attribute or command ops ContentApp * GetContentAppByEndpointId(chip::EndpointId id); diff --git a/src/app/util/MatterCallbacks.h b/src/app/util/MatterCallbacks.h index 806c07c567b8ba..3150f8796cafba 100644 --- a/src/app/util/MatterCallbacks.h +++ b/src/app/util/MatterCallbacks.h @@ -34,6 +34,6 @@ CHIP_ERROR MatterPreCommandReceivedCallback(const chip::app::ConcreteCommandPath /** @brief Matter Post Command Received * * This callback is called once the message has been determined to be a command, but - * after it beeing dispatched to the receiver. + * after it being dispatched to the receiver. */ void MatterPostCommandReceivedCallback(const chip::app::ConcreteCommandPath & commandPath); diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h index 3768d4eba21e63..55101cd9833673 100644 --- a/src/app/util/af-types.h +++ b/src/app/util/af-types.h @@ -169,8 +169,10 @@ union EmberAfDefaultOrMinMaxAttributeValue // // Attribute that has this mask is NOT read-only #define ATTRIBUTE_MASK_WRITABLE (0x01) -// Attribute that has this mask is saved to a token -#define ATTRIBUTE_MASK_TOKENIZE (0x02) +// Attribute that has this mask is saved in non-volatile memory +#define ATTRIBUTE_MASK_NONVOLATILE (0x02) +// Alias until ZAP gets updated to output ATTRIBUTE_MASK_NONVOLATILE +#define ATTRIBUTE_MASK_TOKENIZE ATTRIBUTE_MASK_NONVOLATILE // Attribute that has this mask has a min/max values #define ATTRIBUTE_MASK_MIN_MAX (0x04) // Attribute requires a timed interaction to write @@ -228,6 +230,18 @@ struct EmberAfAttributeMetadata * Check whether this attribute requires a timed write. */ bool MustUseTimedWrite() const { return mask & ATTRIBUTE_MASK_MUST_USE_TIMED_WRITE; } + + /** + * Check whether this attibute's storage is managed outside the built-in + * attribute store. + */ + bool IsExternal() const { return mask & ATTRIBUTE_MASK_EXTERNAL_STORAGE; } + + /** + * Check whether this attribute is automatically stored in non-volatile + * memory. + */ + bool IsNonVolatile() const { return (mask & ATTRIBUTE_MASK_NONVOLATILE) && !IsExternal(); } }; /** @@ -869,36 +883,6 @@ typedef void (*EmberAfNetworkEventHandler)(void); */ typedef void (*EmberAfEndpointEventHandler)(chip::EndpointId endpoint); -#ifdef EMBER_AF_PLUGIN_GROUPS_SERVER -/** - * @brief Indicates the absence of a Group table entry. - */ -#define EMBER_AF_GROUP_TABLE_NULL_INDEX 0xFF -/** - * @brief Value used when setting or getting the endpoint in a Group table - * entry. It indicates that the entry is not in use. - */ -#define EMBER_AF_GROUP_TABLE_UNUSED_ENDPOINT_ID 0x00 -/** - * @brief Maximum length of Group names, not including the length byte. - */ -#define ZCL_GROUPS_CLUSTER_MAXIMUM_NAME_LENGTH 16 -/** - * @brief A structure used to store group table entries in RAM or in tokens, - * depending on the platform. If the endpoint field is - * ::EMBER_AF_GROUP_TABLE_UNUSED_ENDPOINT_ID, the entry is unused. - */ -typedef struct -{ - chip::EndpointId endpoint; // 0x00 when not in use - chip::GroupId groupId; - uint8_t bindingIndex; -#ifdef EMBER_AF_PLUGIN_GROUPS_SERVER_NAME_SUPPORT - uint8_t name[ZCL_GROUPS_CLUSTER_MAXIMUM_NAME_LENGTH + 1]; -#endif -} EmberAfGroupTableEntry; -#endif // EMBER_AF_PLUGIN_GROUPS_SERVER - /** * @brief Indicates the absence of a Scene table entry. */ @@ -921,7 +905,7 @@ typedef struct */ #define ZCL_SCENES_GLOBAL_SCENE_SCENE_ID 0x00 /** - * @brief A structure used to store scene table entries in RAM or in tokens, + * @brief A structure used to store scene table entries in RAM or in storage, * depending on a plugin setting. If endpoint field is * ::EMBER_AF_SCENE_TABLE_UNUSED_ENDPOINT_ID, the entry is unused. */ diff --git a/src/app/util/af.h b/src/app/util/af.h index 9520b1ab588c71..16f7be2c4e1dad 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -381,13 +381,6 @@ uint8_t emberAfGetDataSize(uint8_t dataType); */ #define emberAfAttributeIsClient(metadata) (((metadata)->mask & ATTRIBUTE_MASK_CLIENT) != 0) -/** - * @brief macro that returns true if attribute is saved to token. - * - * @param metadata EmberAfAttributeMetadata* to consider. - */ -#define emberAfAttributeIsTokenized(metadata) (((metadata)->mask & ATTRIBUTE_MASK_TOKENIZE) != 0) - /** * @brief macro that returns true if attribute is saved in external storage. * diff --git a/src/app/util/attribute-storage-null-handling.h b/src/app/util/attribute-storage-null-handling.h index 35dc4378cd1a04..720bfa29f91514 100644 --- a/src/app/util/attribute-storage-null-handling.h +++ b/src/app/util/attribute-storage-null-handling.h @@ -74,7 +74,8 @@ struct NumericAttributeTraits template ::value, int> = 0> static constexpr StorageType GetNullValue() { - return GetNullValue>(); + static_assert(!std::is_signed>::value, "Enums must be unsigned"); + return static_cast(std::numeric_limits>::max()); } public: diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index ce507bc0aec556..077a9e63645dca 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -795,9 +795,9 @@ void EnabledEndpointsWithServerCluster::EnsureMatchingEndpoint() continue; } - if (!emberAfContainsServerFromIndex(mEndpointIndex, mClusterId)) + if (emberAfContainsServerFromIndex(mEndpointIndex, mClusterId)) { - continue; + break; } } } @@ -1200,7 +1200,7 @@ void emberAfResetAttributes(EndpointId endpoint) emAfLoadAttributeDefaults(endpoint, true); } -void emAfLoadAttributeDefaults(EndpointId endpoint, bool writeTokens) +void emAfLoadAttributeDefaults(EndpointId endpoint, bool ignoreStorage) { uint16_t ep; uint8_t clusterI, curNetwork = 0 /* emberGetCurrentNetwork() */; @@ -1289,9 +1289,9 @@ void emAfLoadAttributeDefaults(EndpointId endpoint, bool writeTokens) ptr, 0, // buffer size - unused true); // write? - if (writeTokens) + if (ignoreStorage) { - emAfSaveAttributeToToken(ptr, de->endpoint, record.clusterId, am); + emAfSaveAttributeToStorageIfNeeded(ptr, de->endpoint, record.clusterId, am); } } } @@ -1302,13 +1302,13 @@ void emAfLoadAttributeDefaults(EndpointId endpoint, bool writeTokens) } } - if (!writeTokens) + if (!ignoreStorage) { - emAfLoadAttributesFromTokens(endpoint); + emAfLoadAttributesFromStorage(endpoint); } } -void emAfLoadAttributesFromTokens(EndpointId endpoint) +void emAfLoadAttributesFromStorage(EndpointId endpoint) { // On EZSP host we currently do not support this. We need to come up with some // callbacks. @@ -1320,10 +1320,11 @@ void emAfLoadAttributesFromTokens(EndpointId endpoint) // 'data' argument may be null, since we changed the ptrToDefaultValue // to be null instead of pointing to all zeroes. // This function has to be able to deal with that. -void emAfSaveAttributeToToken(uint8_t * data, EndpointId endpoint, ClusterId clusterId, EmberAfAttributeMetadata * metadata) +void emAfSaveAttributeToStorageIfNeeded(uint8_t * data, EndpointId endpoint, ClusterId clusterId, + EmberAfAttributeMetadata * metadata) { - // Get out of here if this attribute doesn't have a token. - if (!emberAfAttributeIsTokenized(metadata)) + // Get out of here if this attribute isn't marked non-volatile. + if (!metadata->IsNonVolatile()) { return; } diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index 873a4eeb437d6c..14284313e249b4 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -208,19 +208,19 @@ EmberAfGenericClusterFunction emberAfFindClusterFunction(EmberAfCluster * cluste void emberAfInitializeAttributes(chip::EndpointId endpoint); void emberAfResetAttributes(chip::EndpointId endpoint); -// Loads the attributes from built-in default and / or tokens -void emAfLoadAttributeDefaults(chip::EndpointId endpoint, bool writeTokens); - -// This function loads from tokens all the attributes that -// are defined to be stored in tokens. -void emAfLoadAttributesFromTokens(chip::EndpointId endpoint); - -// After the RAM value has changed, code should call this -// function. If this attribute has been -// tagged as stored-to-token, then code will store -// the attribute to token. -void emAfSaveAttributeToToken(uint8_t * data, chip::EndpointId endpoint, chip::ClusterId clusterId, - EmberAfAttributeMetadata * metadata); +// Loads the attributes from built-in default and / or storage. If +// ignoreStorage is true, only defaults will be read, and the storage for +// non-volatile attributes will be overwritten with those defaults. +void emAfLoadAttributeDefaults(chip::EndpointId endpoint, bool ignoreStorage); + +// This function loads from storage all the attributes that +// are defined to be non-volatile. +void emAfLoadAttributesFromStorage(chip::EndpointId endpoint); + +// After the RAM value has changed, code should call this function. If this +// attribute has been tagged as non-volatile, its value will be stored. +void emAfSaveAttributeToStorageIfNeeded(uint8_t * data, chip::EndpointId endpoint, chip::ClusterId clusterId, + EmberAfAttributeMetadata * metadata); // Calls the attribute changed callback void emAfClusterAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t clientServerMask); diff --git a/src/app/util/attribute-table.cpp b/src/app/util/attribute-table.cpp index da1e2dfcd0e50b..7b9a07c0995afd 100644 --- a/src/app/util/attribute-table.cpp +++ b/src/app/util/attribute-table.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -286,11 +287,10 @@ void emberAfPrintAttributeTable(void) (emberAfAttributeIsClient(metaData) ? "clnt" : "srvr"), ChipLogValueMEI(metaData->attributeId)); emberAfAttributesPrint("----"); - emberAfAttributesPrint(" / %x (%x) / %p / %p / ", metaData->attributeType, emberAfAttributeSize(metaData), - (metaData->IsReadOnly() ? "RO" : "RW"), - (emberAfAttributeIsTokenized(metaData) - ? " token " - : (emberAfAttributeIsExternal(metaData) ? "extern " : " RAM "))); + emberAfAttributesPrint( + " / %x (%x) / %p / %p / ", metaData->attributeType, emberAfAttributeSize(metaData), + (metaData->IsReadOnly() ? "RO" : "RW"), + (metaData->IsNonVolatile() ? " nonvolatile " : (metaData->IsExternal() ? " extern " : " RAM "))); emberAfAttributesFlush(); status = emAfReadAttribute(ep->endpoint, cluster->clusterId, metaData->attributeId, (emberAfAttributeIsClient(metaData) ? CLUSTER_MASK_CLIENT : CLUSTER_MASK_SERVER), @@ -459,6 +459,62 @@ EmberAfStatus emberAfAppendAttributeReportFields(EndpointId endpoint, ClusterId //------------------------------------------------------------------------------ // Internal Functions +// Helper for determining whether a value is a null value. +template +static bool IsNullValue(const uint8_t * data) +{ + using Traits = app::NumericAttributeTraits; + // We don't know how data is aligned, so safely copy it over to the relevant + // StorageType value. + typename Traits::StorageType val; + memcpy(&val, data, sizeof(val)); + return Traits::IsNullValue(val); +} + +static bool IsNullValue(const uint8_t * data, uint16_t dataLen, bool isAttributeSigned) +{ + if (dataLen > 4) + { + // We don't support this, just like emberAfCompareValues does not. + return false; + } + + switch (dataLen) + { + case 1: { + if (isAttributeSigned) + { + return IsNullValue(data); + } + return IsNullValue(data); + } + case 2: { + if (isAttributeSigned) + { + return IsNullValue(data); + } + return IsNullValue(data); + } + case 3: { + if (isAttributeSigned) + { + return IsNullValue>(data); + } + return IsNullValue>(data); + } + case 4: { + if (isAttributeSigned) + { + return IsNullValue(data); + } + return IsNullValue(data); + } + } + + // Not reached. + return false; +} + // writes an attribute (identified by clusterID and attrID to the given value. // this returns: // - EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE: if attribute isnt supported by the device (the @@ -529,35 +585,37 @@ EmberAfStatus emAfWriteAttribute(EndpointId endpoint, ClusterId cluster, Attribu { EmberAfDefaultAttributeValue minv = metadata->defaultValue.ptrToMinMaxValue->minValue; EmberAfDefaultAttributeValue maxv = metadata->defaultValue.ptrToMinMaxValue->maxValue; - bool isAttributeSigned = emberAfIsTypeSigned(metadata->attributeType); uint16_t dataLen = emberAfAttributeSize(metadata); + const uint8_t * minBytes; + const uint8_t * maxBytes; if (dataLen <= 2) { - int8_t minR, maxR; - uint8_t * minI = (uint8_t *) &(minv.defaultValue); - uint8_t * maxI = (uint8_t *) &(maxv.defaultValue); + minBytes = reinterpret_cast(&(minv.defaultValue)); + maxBytes = reinterpret_cast(&(maxv.defaultValue)); // On big endian cpu with length 1 only the second byte counts #if (BIGENDIAN_CPU) if (dataLen == 1) { - minI++; - maxI++; + minBytes++; + maxBytes++; } #endif // BIGENDIAN_CPU - minR = emberAfCompareValues(minI, data, dataLen, isAttributeSigned); - maxR = emberAfCompareValues(maxI, data, dataLen, isAttributeSigned); - if ((minR == 1) || (maxR == -1)) - { - return EMBER_ZCL_STATUS_INVALID_VALUE; - } } else { - if ((emberAfCompareValues(minv.ptrToDefaultValue, data, dataLen, isAttributeSigned) == 1) || - (emberAfCompareValues(maxv.ptrToDefaultValue, data, dataLen, isAttributeSigned) == -1)) - { - return EMBER_ZCL_STATUS_INVALID_VALUE; - } + minBytes = minv.ptrToDefaultValue; + maxBytes = maxv.ptrToDefaultValue; + } + + bool isAttributeSigned = emberAfIsTypeSigned(metadata->attributeType); + bool isOutOfRange = emberAfCompareValues(minBytes, data, dataLen, isAttributeSigned) == 1 || + emberAfCompareValues(maxBytes, data, dataLen, isAttributeSigned) == -1; + + if (isOutOfRange && + // null value is always in-range for a nullable attribute. + (!metadata->IsNullable() || !IsNullValue(data, dataLen, isAttributeSigned))) + { + return EMBER_ZCL_STATUS_INVALID_VALUE; } } @@ -596,9 +654,9 @@ EmberAfStatus emAfWriteAttribute(EndpointId endpoint, ClusterId cluster, Attribu return status; } - // Save the attribute to token if needed - // Function itself will weed out tokens that are not tokenized. - emAfSaveAttributeToToken(data, endpoint, cluster, metadata); + // Save the attribute to persistent storage if needed + // The callee will weed out attributes that do not need to be stored. + emAfSaveAttributeToStorageIfNeeded(data, endpoint, cluster, metadata); MatterReportingAttributeChangeCallback(endpoint, cluster, attributeID, mask, manufacturerCode, dataType, data); diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 40f8aab8c6a27a..c9e092d82409f0 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -76,18 +76,24 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type) case ZCL_FABRIC_IDX_ATTRIBUTE_TYPE: // Fabric Index case ZCL_BITMAP8_ATTRIBUTE_TYPE: // 8-bit bitmap case ZCL_ENUM8_ATTRIBUTE_TYPE: // 8-bit enumeration + case ZCL_PERCENT_ATTRIBUTE_TYPE: // Percentage + static_assert(std::is_same::value, + "chip::Percent is expected to be uint8_t, change this when necessary"); return ZCL_INT8U_ATTRIBUTE_TYPE; - case ZCL_ENDPOINT_NO_ATTRIBUTE_TYPE: // Endpoint Number - case ZCL_GROUP_ID_ATTRIBUTE_TYPE: // Group Id - case ZCL_VENDOR_ID_ATTRIBUTE_TYPE: // Vendor Id - case ZCL_ENUM16_ATTRIBUTE_TYPE: // 16-bit enumeration - case ZCL_BITMAP16_ATTRIBUTE_TYPE: // 16-bit bitmap - case ZCL_STATUS_ATTRIBUTE_TYPE: // Status Code + case ZCL_ENDPOINT_NO_ATTRIBUTE_TYPE: // Endpoint Number + case ZCL_GROUP_ID_ATTRIBUTE_TYPE: // Group Id + case ZCL_VENDOR_ID_ATTRIBUTE_TYPE: // Vendor Id + case ZCL_ENUM16_ATTRIBUTE_TYPE: // 16-bit enumeration + case ZCL_BITMAP16_ATTRIBUTE_TYPE: // 16-bit bitmap + case ZCL_STATUS_ATTRIBUTE_TYPE: // Status Code + case ZCL_PERCENT100THS_ATTRIBUTE_TYPE: // 100ths of a percent static_assert(std::is_same::value, - "chip::EndpointId is expected to be uint8_t, change this when necessary"); + "chip::EndpointId is expected to be uint16_t, change this when necessary"); static_assert(std::is_same::value, "chip::GroupId is expected to be uint16_t, change this when necessary"); + static_assert(std::is_same::value, + "chip::Percent100ths is expected to be uint16_t, change this when necessary"); return ZCL_INT16U_ATTRIBUTE_TYPE; case ZCL_CLUSTER_ID_ATTRIBUTE_TYPE: // Cluster Id @@ -867,6 +873,7 @@ CHIP_ERROR WriteSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, if (valueDecoder.TriedDecode()) { + MatterReportingAttributeChangeCallback(aPath); return apWriteHandler->AddStatus(attributePathParams, Protocols::InteractionModel::Status::Success); } } @@ -919,3 +926,8 @@ void MatterReportingAttributeChangeCallback(EndpointId endpoint, ClusterId clust // context without requiring any explicit 'start' or 'end' change calls into the engine to book-end the change. InteractionModelEngine::GetInstance()->GetReportingEngine().ScheduleRun(); } + +void MatterReportingAttributeChangeCallback(const ConcreteAttributePath & aPath) +{ + return MatterReportingAttributeChangeCallback(aPath.mEndpointId, aPath.mClusterId, aPath.mAttributeId); +} diff --git a/src/app/util/im-client-callbacks.cpp b/src/app/util/im-client-callbacks.cpp index 662064effb5675..ec50dd0fb31e05 100644 --- a/src/app/util/im-client-callbacks.cpp +++ b/src/app/util/im-client-callbacks.cpp @@ -362,125 +362,6 @@ bool IMWriteResponseCallback(const chip::app::WriteClient * writeClient, chip::P return true; } -bool IMReadReportAttributesResponseCallback(const app::ReadClient * apReadClient, const app::ConcreteAttributePath * aPath, - TLV::TLVReader * apData, Protocols::InteractionModel::Status status) -{ - ChipLogProgress(Zcl, "ReadAttributesResponse:"); - if (aPath != nullptr) - { - ChipLogProgress(Zcl, " ClusterId: " ChipLogFormatMEI, ChipLogValueMEI(aPath->mClusterId)); - } - - Callback::Cancelable * onSuccessCallback = nullptr; - Callback::Cancelable * onFailureCallback = nullptr; - app::TLVDataFilter tlvFilter = nullptr; - // In CHIPClusters.cpp, we are using sequenceNumber as application identifier. - CHIP_ERROR err = CHIP_NO_ERROR; - if (apReadClient->IsSubscriptionType()) - { - if (aPath != nullptr) - { - err = gCallbacks.GetReportCallback(apReadClient->GetPeerNodeId(), aPath->mEndpointId, aPath->mClusterId, - aPath->mAttributeId, &onSuccessCallback, &tlvFilter); - } - } - else - { - err = gCallbacks.GetResponseCallback(reinterpret_cast(apReadClient), 0, &onSuccessCallback, &onFailureCallback, - &tlvFilter); - } - - if (CHIP_NO_ERROR != err) - { - if (onSuccessCallback == nullptr) - { - ChipLogDetail(Zcl, "%s: Missing success callback", __FUNCTION__); - } - - if (onFailureCallback == nullptr && !apReadClient->IsSubscriptionType()) - { - ChipLogDetail(Zcl, "%s: Missing failure callback", __FUNCTION__); - } - - if (tlvFilter == nullptr) - { - ChipLogDetail(Zcl, "%s: Missing TLV Data Filter", __FUNCTION__); - } - return true; - } - - if (aPath != nullptr) - { - ChipLogProgress(Zcl, " attributeId: " ChipLogFormatMEI, ChipLogValueMEI(aPath->mAttributeId)); - } - LogIMStatus(status); - - if (status == Protocols::InteractionModel::Status::Success && apData != nullptr) - { - ChipLogProgress(Zcl, " attribute TLV Type: 0x%02x", apData->GetType()); - tlvFilter(apData, onSuccessCallback, onFailureCallback); - } - else if (onFailureCallback != nullptr) - { - Callback::Callback * cb = - Callback::Callback::FromCancelable(onFailureCallback); - // TODO: Should change failure callbacks to accept uint16 status code. - cb->mCall(cb->mContext, static_cast(to_underlying(status))); - } - - return true; -} - -bool IMSubscribeResponseCallback(const chip::app::ReadClient * apSubscribeClient, EmberAfStatus status) -{ - auto subscriptionId = apSubscribeClient->GetSubscriptionId(); - ChipLogProgress(Zcl, "SubscribeResponse:"); - if (subscriptionId.HasValue()) - { - ChipLogProgress(Zcl, " SubscriptionId: 0x%" PRIx64, subscriptionId.Value()); - } - else - { - ChipLogProgress(Zcl, " SubscriptionId: "); - } - LogStatus(status); - - // In CHIPClusters.cpp, we are using sequenceNumber as application identifier. - CHIP_ERROR err = CHIP_NO_ERROR; - Callback::Cancelable * onSuccessCallback = nullptr; - Callback::Cancelable * onFailureCallback = nullptr; - err = gCallbacks.GetResponseCallback(reinterpret_cast(apSubscribeClient), 0, &onSuccessCallback, &onFailureCallback); - - if (CHIP_NO_ERROR != err) - { - if (onSuccessCallback == nullptr) - { - ChipLogDetail(Zcl, "%s: Missing success callback", __FUNCTION__); - } - - if (onFailureCallback == nullptr) - { - ChipLogDetail(Zcl, "%s: Missing failure callback", __FUNCTION__); - } - return true; - } - - if (status == EMBER_ZCL_STATUS_SUCCESS) - { - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext); - } - else - { - Callback::Callback * cb = - Callback::Callback::FromCancelable(onFailureCallback); - cb->mCall(cb->mContext, static_cast(status)); - } - - return true; -} - bool emberAfDefaultResponseCallback(ClusterId clusterId, CommandId commandId, EmberAfStatus status) { ChipLogProgress(Zcl, "DefaultResponse:"); diff --git a/src/app/util/im-client-callbacks.h b/src/app/util/im-client-callbacks.h index 631b13bef72b91..e42a71e9cd0d0e 100644 --- a/src/app/util/im-client-callbacks.h +++ b/src/app/util/im-client-callbacks.h @@ -30,11 +30,7 @@ // instead of IM status code. // #6308 should handle IM error code on the application side, either modify this function or remove this. bool IMDefaultResponseCallback(const chip::app::CommandSender * commandObj, EmberAfStatus status); -bool IMReadReportAttributesResponseCallback(const chip::app::ReadClient * apReadClient, - const chip::app::ConcreteAttributePath * aPath, chip::TLV::TLVReader * apData, - chip::Protocols::InteractionModel::Status status); bool IMWriteResponseCallback(const chip::app::WriteClient * writeClient, chip::Protocols::InteractionModel::Status status); -bool IMSubscribeResponseCallback(const chip::app::ReadClient * apSubscribeClient, EmberAfStatus status); void LogStatus(uint8_t status); // Global Response Callbacks diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index 4f44413a853b4d..22f6d3794d5c30 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -294,16 +294,12 @@ void emberAfTick(void) void MatterBooleanStatePluginServerInitCallback() {} void MatterBridgedDeviceBasicPluginServerInitCallback() {} void MatterElectricalMeasurementPluginServerInitCallback() {} -void MatterOtaSoftwareUpdateRequestorPluginServerInitCallback() {} -void MatterGroupKeyManagementPluginServerInitCallback() {} void MatterRelativeHumidityMeasurementPluginServerInitCallback() {} -void MatterSwitchPluginServerInitCallback() {} void MatterIlluminanceMeasurementPluginServerInitCallback() {} void MatterBinaryInputBasicPluginServerInitCallback() {} void MatterPressureMeasurementPluginServerInitCallback() {} void MatterTemperatureMeasurementPluginServerInitCallback() {} void MatterFlowMeasurementPluginServerInitCallback() {} -void MatterWakeOnLanPluginServerInitCallback() {} void MatterOnOffSwitchConfigurationPluginServerInitCallback() {} void MatterPowerSourcePluginServerInitCallback() {} void MatterThermostatUserInterfaceConfigurationPluginServerInitCallback() {} diff --git a/src/app/zap-templates/common/ClusterTestGeneration.js b/src/app/zap-templates/common/ClusterTestGeneration.js index b92589239b2a05..47c01a888e4dd4 100644 --- a/src/app/zap-templates/common/ClusterTestGeneration.js +++ b/src/app/zap-templates/common/ClusterTestGeneration.js @@ -597,9 +597,11 @@ function expectedValueHasProp(value, name) function octetStringEscapedForCLiteral(value) { - return value.replace(/\p{Control}/gu, ch => { + // Escape control characters, things outside the ASCII range, and single + // quotes (because that's our string terminator). + return value.replace(/\p{Control}|\P{ASCII}|"/gu, ch => { let code = ch.charCodeAt(0); - code = code.toString(); + code = code.toString(16); if (code.length == 1) { code = "0" + code; } diff --git a/src/app/zap-templates/common/attributes/Accessors.js b/src/app/zap-templates/common/attributes/Accessors.js index 14720743e2621a..8b2687895dd63b 100644 --- a/src/app/zap-templates/common/attributes/Accessors.js +++ b/src/app/zap-templates/common/attributes/Accessors.js @@ -18,6 +18,7 @@ const zapPath = '../../../../../third_party/zap/repo/dist/src-electron/'; const ListHelper = require('../../common/ListHelper.js'); const StringHelper = require('../../common/StringHelper.js'); +const appHelper = require('../../templates/app/helper.js'); const cHelper = require(zapPath + 'generator/helper-c.js') const zclHelper = require(zapPath + 'generator/helper-zcl.js') const templateUtil = require(zapPath + 'generator/template-util.js') @@ -59,8 +60,8 @@ async function accessorGetterType(attr) type = "chip::MutableByteSpan"; } else { mayNeedPointer = true; - const options = { 'hash' : {} }; - type = await zclHelper.asUnderlyingZclType.call(this, attr.type, options); + const options = { 'hash' : { forceNotNullable : true, forceNotOptional : true, ns : this.parent.name } }; + type = await appHelper.zapTypeToEncodableClusterObjectType.call(this, attr.type, options); } if (attr.isNullable) { @@ -84,7 +85,9 @@ async function accessorTraitType(type) return `OddSizedInteger<${size}, ${signed}>`; } } - return zclHelper.asUnderlyingZclType.call(this, type, { 'hash' : {} }); + + const options = { 'hash' : { forceNotNullable : true, forceNotOptional : true, ns : this.parent.name } }; + return appHelper.zapTypeToEncodableClusterObjectType.call(this, type, options); } async function typeAsDelimitedMacro(type) diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt index 9cb96ce81028b3..4e07abd270c089 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt @@ -115,7 +115,7 @@ namespace { } -{{! TODO: These IM related callbacks contains small or no generated code, should be put into seperate file to reduce the size of template. }} +{{! TODO: These IM related callbacks contains small or no generated code, should be put into separate file to reduce the size of template. }} // Singleton instance of the callbacks manager app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); diff --git a/src/app/zap-templates/templates/app/CHIPClusters-src.zapt b/src/app/zap-templates/templates/app/CHIPClusters-src.zapt index d368a6ff73d4c0..127dbc51e36da9 100644 --- a/src/app/zap-templates/templates/app/CHIPClusters-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClusters-src.zapt @@ -74,29 +74,6 @@ exit: } {{/chip_cluster_commands}} -// {{asUpperCamelCase name}} Cluster Attributes -{{#chip_server_cluster_attributes}} -{{#unless (isStrEqual chipCallback.name "Unsupported")}} -{{#if isReportableAttribute}} -{{#unless isList}} -CHIP_ERROR {{asUpperCamelCase parent.name}}Cluster::SubscribeAttribute{{asUpperCamelCase name}}(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = {{#if isGlobalAttribute}}Globals{{else}}{{asUpperCamelCase parent.name}}{{/if}}::Attributes::{{asUpperCamelCase name}}::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR {{asUpperCamelCase parent.name}}Cluster::ReportAttribute{{asUpperCamelCase name}}(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting({{#if isGlobalAttribute}}Globals{{else}}{{asUpperCamelCase parent.name}}{{/if}}::Attributes::{{asUpperCamelCase name}}::Id, onReportCallback, BasicAttributeFilter<{{chipCallback.name}}AttributeCallback>); -} - -{{/unless}} -{{/if}} -{{/unless}} -{{/chip_server_cluster_attributes}} {{/chip_client_clusters}} diff --git a/src/app/zap-templates/templates/app/CHIPClusters.zapt b/src/app/zap-templates/templates/app/CHIPClusters.zapt index 342d396b3a7b4f..33b8fcd023f5d8 100644 --- a/src/app/zap-templates/templates/app/CHIPClusters.zapt +++ b/src/app/zap-templates/templates/app/CHIPClusters.zapt @@ -27,24 +27,6 @@ public: {{/first}} CHIP_ERROR {{asUpperCamelCase name}}(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback{{#chip_cluster_command_arguments_with_structs_expanded}}{{#if_is_struct type}}{{else}}, {{chipType}} {{asLowerCamelCase label}}{{/if_is_struct}}{{/chip_cluster_command_arguments_with_structs_expanded}}); {{/chip_cluster_commands}} - - // Cluster Attributes - {{#chip_server_cluster_attributes}} - {{#unless (isStrEqual chipCallback.name "Unsupported")}} - {{#if isReportableAttribute}} - {{#unless isList}} - CHIP_ERROR SubscribeAttribute{{asUpperCamelCase name}}(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttribute{{asUpperCamelCase name}}(Callback::Cancelable * onReportCallback); - {{/unless}} - {{/if}} - {{/unless}} - {{/chip_server_cluster_attributes}} - {{#chip_cluster_commands}} - {{#first}} - -private: - {{/first}} - {{/chip_cluster_commands}} }; {{/chip_client_clusters}} diff --git a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt index 4a43ca6adbed87..3cc33eb75d7090 100644 --- a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt +++ b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt @@ -58,30 +58,31 @@ EmberAfStatus Get(chip::EndpointId endpoint, {{accessorGetterType this}} value) {{>value}}.reduce_size(length); return status; {{else}} - NumericAttributeTraits<{{accessorTraitType type}}>::StorageType temp; - uint8_t * readable = NumericAttributeTraits<{{accessorTraitType type}}>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits<{{accessorTraitType type}}>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, {{>clusterId}}, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); {{#if isNullable}} - if (NumericAttributeTraits<{{accessorTraitType type}}>::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits<{{accessorTraitType type}}>::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } {{else}} - if (!NumericAttributeTraits<{{accessorTraitType type}}>::CanRepresentValue(/* isNullable = */ {{isNullable}}, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ {{isNullable}}, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits<{{accessorTraitType type}}>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); {{/if}} return status; {{/if}} } -EmberAfStatus Set(chip::EndpointId endpoint, {{asUnderlyingZclType type}} value) +EmberAfStatus Set(chip::EndpointId endpoint, {{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotNullable=true forceNotOptional=true}} value) { {{~#if (isString type)}} {{~#*inline "lengthType"}}uint{{#if (isShortString type)}}8{{else}}16{{/if}}_t{{/inline}} @@ -93,13 +94,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, {{asUnderlyingZclType type}} value) memcpy(&zclString[{{>sizingBytes}}], value.data(), value.size()); return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, zclString, ZCL_{{typeAsDelimitedMacro type}}_ATTRIBUTE_TYPE); {{else}} - if (!NumericAttributeTraits<{{accessorTraitType type}}>::CanRepresentValue(/* isNullable = */ {{isNullable}}, value)) + using Traits = NumericAttributeTraits<{{accessorTraitType type}}>; + if (!Traits::CanRepresentValue(/* isNullable = */ {{isNullable}}, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits<{{accessorTraitType type}}>::StorageType storageValue; - NumericAttributeTraits<{{accessorTraitType type}}>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits<{{accessorTraitType type}}>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, writable, ZCL_{{typeAsDelimitedMacro type}}_ATTRIBUTE_TYPE); {{/if}} } @@ -111,14 +113,15 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) uint8_t zclString[{{>sizingBytes}}] = { {{#if (isShortString type)}}0xFF{{else}}0xFF, 0xFF{{/if}} }; return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, zclString, ZCL_{{typeAsDelimitedMacro type}}_ATTRIBUTE_TYPE); {{else}} - NumericAttributeTraits<{{accessorTraitType type}}>::StorageType value; - NumericAttributeTraits<{{accessorTraitType type}}>::SetNull(value); - uint8_t * writable = NumericAttributeTraits<{{accessorTraitType type}}>::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits<{{accessorTraitType type}}>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, writable, ZCL_{{typeAsDelimitedMacro type}}_ATTRIBUTE_TYPE); {{/if}} } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable<{{asUnderlyingZclType type}}> & value) +EmberAfStatus Set(chip::EndpointId endpoint, {{zapTypeToEncodableClusterObjectType type ns=parent.name isArgument=true forceNotOptional=true}} value) { if (value.IsNull()) { return SetNull(endpoint); diff --git a/src/app/zap-templates/templates/app/attributes/Accessors.zapt b/src/app/zap-templates/templates/app/attributes/Accessors.zapt index 2b5ffea429f67e..a9d96ae336c88a 100644 --- a/src/app/zap-templates/templates/app/attributes/Accessors.zapt +++ b/src/app/zap-templates/templates/app/attributes/Accessors.zapt @@ -9,6 +9,7 @@ #include #include +#include #include namespace chip { @@ -26,10 +27,10 @@ namespace Attributes { {{else if (canHaveSimpleAccessors this)}} namespace {{asUpperCamelCase label}} { EmberAfStatus Get(chip::EndpointId endpoint, {{accessorGetterType this}} value); // {{type}} {{isArray}} -EmberAfStatus Set(chip::EndpointId endpoint, {{asUnderlyingZclType type}} value); +EmberAfStatus Set(chip::EndpointId endpoint, {{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotNullable=true forceNotOptional=true}} value); {{#if isNullable}} EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable<{{asUnderlyingZclType type}}> & value); +EmberAfStatus Set(chip::EndpointId endpoint, {{zapTypeToEncodableClusterObjectType type ns=parent.name isArgument=true forceNotOptional=true}} value); {{/if}} } // namespace {{asUpperCamelCase label}} diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index 4057e7c0c8bc1e..32198df4eb324f 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -171,13 +171,13 @@ namespace {{asUpperCamelCase label}} { {{! forceNotOptional=true because the optionality is on the attribute itself, but we want just the type of the attribute. }} {{#if entryType}} - using Type = {{zapTypeToEncodableClusterObjectType entryType forceNotOptional=true}}; - using DecodableType = {{zapTypeToDecodableClusterObjectType entryType forceNotOptional=true}}; - using DecodableArgType = {{zapTypeToDecodableClusterObjectType entryType forceNotOptional=true isArgument=true}}; + using Type = {{zapTypeToEncodableClusterObjectType entryType ns=parent.name forceNotOptional=true}}; + using DecodableType = {{zapTypeToDecodableClusterObjectType entryType ns=parent.name forceNotOptional=true}}; + using DecodableArgType = {{zapTypeToDecodableClusterObjectType entryType ns=parent.name forceNotOptional=true isArgument=true}}; {{else}} - using Type = {{zapTypeToEncodableClusterObjectType type forceNotOptional=true}}; - using DecodableType = {{zapTypeToDecodableClusterObjectType type forceNotOptional=true}}; - using DecodableArgType = {{zapTypeToDecodableClusterObjectType type forceNotOptional=true isArgument=true}}; + using Type = {{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotOptional=true}}; + using DecodableType = {{zapTypeToDecodableClusterObjectType type ns=parent.name forceNotOptional=true}}; + using DecodableArgType = {{zapTypeToDecodableClusterObjectType type ns=parent.name forceNotOptional=true isArgument=true}}; {{/if}} static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; } diff --git a/src/app/zap-templates/templates/app/helper.js b/src/app/zap-templates/templates/app/helper.js index 8443e8e643326f..c9c2d6ba42330f 100644 --- a/src/app/zap-templates/templates/app/helper.js +++ b/src/app/zap-templates/templates/app/helper.js @@ -109,7 +109,7 @@ var endpointClusterWithInit = [ 'Thermostat', ]; var endpointClusterWithAttributeChanged = [ 'Identify', 'Door Lock', 'Pump Configuration and Control' ]; -var endpointClusterWithPreAttribute = [ 'IAS Zone', 'Thermostat User Interface Configuration' ]; +var endpointClusterWithPreAttribute = [ 'IAS Zone', 'Door Lock', 'Thermostat User Interface Configuration' ]; var endpointClusterWithMessageSent = [ 'IAS Zone' ]; /** @@ -611,9 +611,7 @@ async function getResponseCommandName(responseRef, options) function isWeaklyTypedEnum(label) { return [ - "ApplicationLauncherStatus", "AttributeWritePermission", - "AudioOutputType", "BarrierControlBarrierPosition", "BarrierControlMovingState", "BootReasonType", @@ -645,13 +643,8 @@ function isWeaklyTypedEnum(label) "IdentifyEffectVariant", "IdentifyIdentifyType", "InterfaceType", - "KeypadInputCecKeyCode", - "KeypadInputStatus", "KeypadLockout", "LevelControlOptions", - "MediaInputType", - "MediaPlaybackState", - "MediaPlaybackStatus", "MoveMode", "NetworkFaultType", "NodeOperationalCertStatus", diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index feb167213830c0..36e7de9c6e0905 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -55,7 +55,7 @@ - + diff --git a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml index c111973ef8716a..fe997a4c3cda39 100644 --- a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml @@ -35,9 +35,9 @@ limitations under the License. - - - + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml index 5109dca5284f92..04a414aa340b42 100644 --- a/src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml @@ -25,22 +25,22 @@ limitations under the License. true This cluster provides commands that facilitate user account login on a Content App or a node. For example, a Content App running on a Video Player device, which is represented as an endpoint (see [TV Architecture]), can use this cluster to help make the user account on the Content App match the user account on the Client. - + Upon receipt, the Content App checks if the account associated with the client Temp Account Identifier Rotating ID is the same acount that is active on the given Content App. If the accounts are the same, then the Content App includes the Setup PIN in the GetSetupPIN Response. - + Upon receipt, the Content App checks if the account associated with the client’s Temp Account Identifier (Rotating ID) has a current active Setup PIN with the given value. If the Setup PIN is valid for the user account associated with the Temp Account Identifier, then the Content App MAY make that user account active. - + The purpose of this command is to instruct the Content App to clear the current user account. This command SHOULD be used by clients of a Content App to indicate the end of a user session. - + This message is sent in response to the GetSetupPIN Request, and contains the Setup PIN code, or null when the accounts identified in the request does not match the active account of the running Content App. diff --git a/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml index ed1af1ffc2b694..359d541304d983 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml @@ -28,24 +28,19 @@ limitations under the License. vendor id application name product id - application app - application status + application app + application status application version - - - - Upon receipt, this SHALL change the running status of the application. - - + allowed vendor list - + - + diff --git a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml index 772bd8a06be277..0baa9f4e964998 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml @@ -26,60 +26,53 @@ limitations under the License. This cluster provides an interface for launching content on a media player device such as a TV or Speaker. application launcher list - application launcher app + application launcher app - + Upon receipt, this SHALL launch the specified app with optional data. The TV Device SHALL launch and bring to foreground the identified application in the command if the application is not already launched and in foreground. The TV Device SHALL update state attribute on the Application Basic cluster of the Endpoint corresponding to the launched application. This command returns a Launch Response. - + - + Upon receipt on a Video Player endpoint this SHALL stop the specified application if it is running. - + - + Upon receipt on a Video Player endpoint this SHALL hide the specified application if it is running and visible. - + - + This command SHALL be generated in response to LaunchApp commands. - - - - - - This command SHALL be generated in response to StopApp commands. - - - - - - This command SHALL be generated in response to HideApp commands. - + - + - + - + - + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml index c6a87f87fed805..27f92dbb34554d 100644 --- a/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/audio-output-cluster.xml @@ -25,15 +25,15 @@ limitations under the License. true This cluster provides an interface for controlling the Output on a media device such as a TV. - audio output list + audio output list current audio output - + Upon receipt, this SHALL change the output on the media device to the output at a specific index in the Output List. - + Upon receipt, this SHALL rename the output at a specific index in the Output List. Updates to the output name SHALL appear in the TV settings menus. @@ -41,14 +41,14 @@ limitations under the License. - + - + - + @@ -58,4 +58,9 @@ limitations under the License. + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml index b4b330b3795f3d..620b786ebb092f 100644 --- a/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml @@ -22,7 +22,7 @@ limitations under the License. 0x0028 BASIC_CLUSTER Attributes for determining basic information about a device, and setting user device information such as location. - + InteractionModelVersion VendorName @@ -48,7 +48,7 @@ limitations under the License. The StartUp event SHALL be emitted by a Node as soon as reasonable after completing a boot or reboot process. - + The ShutDown event SHOULD be emitted by a Node prior to any orderly shutdown sequence on a best-effort basis. diff --git a/src/app/zap-templates/zcl/data-model/chip/tv-channel-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml similarity index 59% rename from src/app/zap-templates/zcl/data-model/chip/tv-channel-cluster.xml rename to src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml index 8a19be92066061..b5284916f1e0d5 100644 --- a/src/app/zap-templates/zcl/data-model/chip/tv-channel-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml @@ -18,42 +18,42 @@ limitations under the License. Media - TV Channel + Channel 0x0504 - TV_CHANNEL_CLUSTER + CHANNEL_CLUSTER true true - This cluster provides an interface for controlling the current TV Channel on a device. - channel list - channel lineup - current channel + This cluster provides an interface for controlling the current Channel on a device. + channel list + channel lineup + current channel - - Change the channel on the TV to the channel case-insensitive exact matching the value passed as an argument. + + Change the channel on the media player to the channel case-insensitive exact matching the value passed as an argument. - - Change the channel on the TV to the channel with the given Number in the ChannelList attribute. + + Change the channel on the media plaeyer to the channel with the given Number in the ChannelList attribute. - + This command provides channel up and channel down functionality, but allows channel index jumps of size Count. When the value of the increase or decrease is larger than the number of channels remaining in the given direction, then the behavior SHALL be to return to the beginning (or end) of the channel list and continue. For example, if the current channel is at index 0 and count value of -1 is given, then the current channel should change to the last channel. - + Upon receipt, this SHALL display the active status of the input list on screen. - - + + - + @@ -62,23 +62,29 @@ limitations under the License. - + - + - + - + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml b/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml index 8532dc4f7bc4e1..4abaa4849b326c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chip-ota.xml @@ -39,7 +39,7 @@ limitations under the License. OTA Software Update Provider CHIP - + Provides an interface for providing OTA software updates 0x0029 OTA_PROVIDER_CLUSTER true @@ -52,35 +52,35 @@ limitations under the License. - + - - Determine next action to take for a new Software Image - - - - - Notify OTA Provider that an update was applied - - - - + Response to QueryImage command - + - + - + + Determine next action to take for a downloaded Software Image + + + + Reponse to ApplyUpdateRequest command + + Notify OTA Provider that an update was applied + + + @@ -107,42 +107,51 @@ limitations under the License. - + + + + + + + OTA Software Update Requestor CHIP - TODO + Provides an interface for downloading and applying OTA software updates 0x002a OTA_REQUESTOR_CLUSTER true true - default ota provider - update possible - - Notify OTA Provider that an update was applied - - + DefaultOtaProviders + UpdatePossible + UpdateState + UpdateStateProgress + + Announce the presence of an OTA Provider + + + This event SHALL be generated when a change of the UpdateState attribute occurs due to an OTA Requestor moving through the states necessary to query for updates. - + - + This event SHALL be generated whenever a new version starts executing after being applied due to a software update. - + This event SHALL be generated whenever an error occurs during OTA Requestor download operation. - - + + diff --git a/src/app/zap-templates/zcl/data-model/chip/commissioning.xml b/src/app/zap-templates/zcl/data-model/chip/commissioning.xml index c46e0c537ae901..d798e1d9c47c09 100644 --- a/src/app/zap-templates/zcl/data-model/chip/commissioning.xml +++ b/src/app/zap-templates/zcl/data-model/chip/commissioning.xml @@ -32,6 +32,14 @@ limitations under the License. + + + + + + + + @@ -44,8 +52,8 @@ limitations under the License. - - + + @@ -92,8 +100,8 @@ limitations under the License. TODO - - + + TODO diff --git a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml index 23a618b0002422..d42d97d0622b9b 100644 --- a/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/content-launch-cluster.xml @@ -26,75 +26,74 @@ limitations under the License. This cluster provides an interface for launching content on a media player device such as a TV or Speaker. - accepts header list + accept header list supported streaming protocols - + Upon receipt, this SHALL launch the specified content with optional search criteria. - + - + Upon receipt, this SHALL launch content from the specified URL. - + - + This command SHALL be generated in response to LaunchContent command. - - - - - - This command SHALL be generated in response to LaunchURL command. - + - + + + + + + - + - + - + - + - + - + - - - - - + + + + + - + @@ -111,17 +110,29 @@ limitations under the License. - + - + - + - + + + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml index b57c7b0e2dccac..02c69600c0104e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml @@ -67,7 +67,7 @@ limitations under the License. - Signals the Commissionee that the Commissioner has sucessfully completed all steps of commissioning + Signals the Commissionee that the Commissioner has successfully completed all steps of commissioning Sender expects CommissioningCompleteResponse command if the CommissioningComplete command was correctly received diff --git a/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml index 72be9b90fd368d..b77a31d37bb6ab 100644 --- a/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/group-key-mgmt-cluster.xml @@ -17,26 +17,37 @@ limitations under the License. - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + - - - + + + @@ -45,7 +56,44 @@ limitations under the License. 0x003F GROUP_KEY_MANAGEMENT_CLUSTER The Group Key Management Cluster is the mechanism by which group keys are managed. - groups - group keys + groupKeyMap + groupTable + maxGroupsPerFabric + maxGroupKeysPerFabric + + + Revoke a Root Key from a Group + + + + + Revoke a Root Key from a Group + + + + + + Response to KeySetRead + + + + + + Revoke a Root Key from a Group + + + + + Revoke a Root Key from a Group + + + + + + Reseponse to KeySetReadAllIndices + + + + \ No newline at end of file diff --git a/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml index a87cb4e6ae4788..6022d3bd9972c9 100644 --- a/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/keypad-input-cluster.xml @@ -26,26 +26,26 @@ limitations under the License. This cluster provides an interface for controlling a device like a TV using action commands such as UP, DOWN, and SELECT. - + Upon receipt, this SHALL process a keycode as input to the media device. - + - + This command SHALL be generated in response to a SendKey Request command. - + - + - + @@ -140,7 +140,12 @@ limitations under the License. - + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml index b75e94bca0b0c0..f4a3962e9ac8d2 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-input-cluster.xml @@ -25,23 +25,23 @@ limitations under the License. true This cluster provides an interface for controlling the Input Selector on a media device such as a TV. - media input list + media input list current media input - + Upon receipt, this SHALL change the input on the media device to the input at a specific index in the Input List. - + Upon receipt, this SHALL display the active status of the input list on screen. - + Upon receipt, this SHALL hide the input list from the screen. - + Upon receipt, this SHALL rename the input at a specific index in the Input List. Updates to the input name SHALL appear in the TV settings menus. @@ -49,15 +49,15 @@ limitations under the License. - + - + - + @@ -73,4 +73,9 @@ limitations under the License. + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml index ca451e2f41dcb1..e9b4dde1249ef6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/media-playback-cluster.xml @@ -26,126 +26,76 @@ limitations under the License. This cluster provides an interface for controlling Media Playback (PLAY, PAUSE, etc) on a media device such as a TV or Speaker. - playback state - start time + playback state + start time duration - position + position playback speed seek range end seek range start - + Upon receipt, this SHALL play media. - + Upon receipt, this SHALL pause media. - + Upon receipt, this SHALL stop media. User experience is context-specific. This will often navigate the user back to the location where media was originally launched. - + Upon receipt, this SHALL Start Over with the current media playback item. - + Upon receipt, this SHALL cause the handler to be invoked for "Previous". User experience is context-specific. This will often Go back to the previous media playback item. - + Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. - + Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). - + Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). - + Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: - + Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: - + Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: - - Upon receipt, this SHALL play media. - - - - - Upon receipt, this SHALL pause media. - - - - - Upon receipt, this SHALL stop media. User experience is context-specific. This will often navigate the user back to the location where media was originally launched. - - - - - Upon receipt, this SHALL Start Over with the current media playback item. - - - - - Upon receipt, this SHALL cause the handler to be invoked for "Previous". User experience is context-specific. This will often Go back to the previous media playback item. - - - - - Upon receipt, this SHALL cause the handler to be invoked for "Next". User experience is context-specific. This will often Go forward to the next media playback item. - - - - - Upon receipt, this SHALL Rewind through media. Different Rewind speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). - - - - - Upon receipt, this SHALL Advance through media. Different FF speeds can be used on the TV based upon the number of sequential calls to this function. This is to avoid needing to define every speed now (multiple fast, slow motion, etc). - - - - - Upon receipt, this SHALL Skip forward in the media by the given number of seconds, using the data as follows: - - - - - Upon receipt, this SHALL Skip backward in the media by the given number of seconds, using the data as follows: - - - - - Upon receipt, this SHALL change the playback position in the media to the given position using data as follows: - + + This command SHALL be generated in response to various Playback Request commands. + - + - + @@ -153,7 +103,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml index 1fb16d28ab5740..24477d624342ab 100644 --- a/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/target-navigator-cluster.xml @@ -25,30 +25,30 @@ limitations under the License. true This cluster provides an interface for UX navigation within a set of targets on a device or endpoint. - target navigator list + target navigator list current navigator target - + Upon receipt, this SHALL navigation the UX to the target identified. - + This command SHALL be generated in response to NavigateTarget commands. - + - + - + diff --git a/src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml index e945f714de41b2..d54cdef16e1f5c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/user-label-cluster.xml @@ -29,6 +29,6 @@ limitations under the License. 0x0041 USER_LABEL_CLUSTER The User Label Cluster provides a feature to tag an endpoint with zero or more labels. - label list + label list diff --git a/src/app/zap-templates/zcl/data-model/chip/window-covering.xml b/src/app/zap-templates/zcl/data-model/chip/window-covering.xml index eeff24927ab8a2..da40584f80ab81 100644 --- a/src/app/zap-templates/zcl/data-model/chip/window-covering.xml +++ b/src/app/zap-templates/zcl/data-model/chip/window-covering.xml @@ -16,49 +16,82 @@ limitations under the License. Window Covering Closures - Provides an interface for controlling and adjusting automatic window coverings. 0x0102 WINDOW_COVERING_CLUSTER - true - true + Provides an interface for controlling and adjusting automatic window coverings. + + - + - + + + true + true + + + + Type - PhysicalClosedLimitLift - PhysicalClosedLimitTilt - CurrentPositionLift - CurrentPositionTilt - NumberOfActuationsLift - NumberOfActuationsTilt + + PhysicalClosedLimitLift + + PhysicalClosedLimitTilt + + CurrentPositionLift + + CurrentPositionTilt + + NumberOfActuationsLift + + NumberOfActuationsTilt + ConfigStatus - CurrentPositionLiftPercentage - CurrentPositionTiltPercentage - OperationalStatus - TargetPositionLiftPercent100ths - TargetPositionTiltPercent100ths - EndProductType - CurrentPositionLiftPercent100ths - CurrentPositionTiltPercent100ths + + CurrentPositionLiftPercentage + + CurrentPositionTiltPercentage + + OperationalStatus + + TargetPositionLiftPercent100ths + + TargetPositionTiltPercent100ths + + EndProductType + + CurrentPositionLiftPercent100ths + + CurrentPositionTiltPercent100ths - InstalledOpenLimitLift - InstalledClosedLimitLift - InstalledOpenLimitTilt - InstalledClosedLimitTilt - VelocityLift - AccelerationTimeLift - DecelerationTimeLift - Mode - IntermediateSetpointsLift - IntermediateSetpointsTilt - SafetyStatus + + InstalledOpenLimitLift + InstalledClosedLimitLift + + InstalledOpenLimitTilt + InstalledClosedLimitTilt + + + + + + + Mode + + + + + + + + SafetyStatus + Moves window covering to InstalledOpenLimitLift and InstalledOpenLimitTilt @@ -68,23 +101,27 @@ limitations under the License. Stop any adjusting of window covering + Go to lift value specified + Go to lift percentage specified - - + + + Go to tilt value specified + Go to tilt percentage specified - - + + @@ -104,7 +141,7 @@ limitations under the License. - + @@ -130,7 +167,7 @@ limitations under the License. - + @@ -174,7 +211,7 @@ limitations under the License. - + diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 6ef03a94167223..23e5d63e6840de 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -15,6 +15,7 @@ "bridged-device-basic.xml", "chip-ota.xml", "chip-types.xml", + "channel-cluster.xml", "clusters-extensions.xml", "commissioning.xml", "content-launch-cluster.xml", @@ -57,7 +58,6 @@ "thermostat-cluster.xml", "thread-network-diagnostics-cluster.xml", "time-synchronization-cluster.xml", - "tv-channel-cluster.xml", "user-label-cluster.xml", "wake-on-lan-cluster.xml", "wifi-network-diagnostics-cluster.xml", diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index 990d882af6dae9..efea6547296770 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -23,6 +23,7 @@ 'BOOLEAN_STATE_CLUSTER': [], 'BRIDGED_ACTIONS_CLUSTER': [], 'BRIDGED_DEVICE_BASIC_CLUSTER': [], + 'CHANNEL_CLUSTER': ['channel-server'], 'COLOR_CONTROL_CLUSTER': ['color-control-server'], 'COMMISSIONING_CLUSTER': [], 'CONTENT_LAUNCH_CLUSTER': ['content-launch-server'], @@ -36,7 +37,7 @@ 'FLOW_MEASUREMENT_CLUSTER': [], 'GENERAL_COMMISSIONING_CLUSTER': ['general-commissioning-server'], 'GENERAL_DIAGNOSTICS_CLUSTER': ['general-diagnostics-server'], - 'GROUP_KEY_MANAGEMENT_CLUSTER': [], + 'GROUP_KEY_MANAGEMENT_CLUSTER': ['group-key-mgmt-server'], 'GROUPS_CLUSTER': ['groups-server'], 'IAS_ZONE_CLUSTER': ['ias-zone-server'], 'IDENTIFY_CLUSTER': ['identify-server'], @@ -50,7 +51,8 @@ 'MEDIA_INPUT_CLUSTER': ['media-input-server'], 'MEDIA_PLAYBACK_CLUSTER': ['media-playback-server'], 'MODE_SELECT_CLUSTER': ['mode-select-server'], - 'NETWORK_COMMISSIONING_CLUSTER': ['network-commissioning'], + # network-commissioning-old is the old, not spec compliant implementation. + 'NETWORK_COMMISSIONING_CLUSTER': ['network-commissioning', 'network-commissioning-old'], 'OCCUPANCY_SENSING_CLUSTER': ['occupancy-sensor-server'], 'ON_OFF_CLUSTER': ['on-off-server'], 'ON_OFF_SWITCH_CONFIG_CLUSTER': [], @@ -72,7 +74,7 @@ 'RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER': [], 'SCENES_CLUSTER': ['scenes'], 'SOFTWARE_DIAGNOSTICS_CLUSTER': ['software-diagnostics-server'], - 'SWITCH_CLUSTER': [], + 'SWITCH_CLUSTER': ['switch-server'], 'TARGET_NAVIGATOR_CLUSTER': ['target-navigator-server'], 'TEMP_MEASUREMENT_CLUSTER': [], 'TEST_CLUSTER': ['test-cluster-server'], @@ -81,9 +83,8 @@ 'THREAD_NETWORK_DIAGNOSTICS_CLUSTER': ['thread-network-diagnostics-server'], 'TIME_CLUSTER': [], 'TIME_SYNCHRONIZATION_CLUSTER': [], - 'TV_CHANNEL_CLUSTER': ['tv-channel-server'], 'USER_LABEL_CLUSTER': ['user-label-server'], - 'WAKE_ON_LAN_CLUSTER': [], + 'WAKE_ON_LAN_CLUSTER': ['wake-on-lan-server'], 'WIFI_NETWORK_DIAGNOSTICS_CLUSTER': ['wifi-network-diagnostics-server'], 'WINDOW_COVERING_CLUSTER': ['window-covering-server'], 'ZLL_COMMISSIONING_CLUSTER': [] @@ -105,6 +106,7 @@ 'BOOLEAN_STATE_CLUSTER': [], 'BRIDGED_ACTIONS_CLUSTER': [], 'BRIDGED_DEVICE_BASIC_CLUSTER': [], + 'CHANNEL_CLUSTER': [], 'COLOR_CONTROL_CLUSTER': [], 'COMMISSIONING_CLUSTER': [], 'CONTENT_LAUNCH_CLUSTER': [], @@ -164,7 +166,6 @@ 'TIME_CLUSTER': [], 'TIME_SYNCHRONIZATION_CLUSTER': [], 'TRUSTED_ROOT_CERTIFICATES_CLUSTER': [], - 'TV_CHANNEL_CLUSTER': [], 'USER_LABEL_CLUSTER': [], 'WAKE_ON_LAN_CLUSTER': [], 'WIFI_NETWORK_DIAGNOSTICS_CLUSTER': [], diff --git a/src/ble/BLEEndPoint.cpp b/src/ble/BLEEndPoint.cpp index 2cfb38014c92e7..7b05ea8113a495 100644 --- a/src/ble/BLEEndPoint.cpp +++ b/src/ble/BLEEndPoint.cpp @@ -85,7 +85,7 @@ * * @brief * This is amount of time, in milliseconds, which a BLE end point will wait for an unsubscribe operation to complete - * before it automatically releases its BLE connection and frees itself. The default value of 5 seconds is arbitary. + * before it automatically releases its BLE connection and frees itself. The default value of 5 seconds is arbitrary. * */ #define BLE_UNSUBSCRIBE_TIMEOUT_MS 5000 // 5 seconds diff --git a/src/ble/BLEEndPoint.h b/src/ble/BLEEndPoint.h index b36748d3601abf..e5ed0232ce769a 100644 --- a/src/ble/BLEEndPoint.h +++ b/src/ble/BLEEndPoint.h @@ -153,7 +153,7 @@ class DLL_EXPORT BLEEndPoint // connection is established. PacketBufferHandle mSendQueue; - // Pending stand-alone BTP acknolwedgement. Pre-empts regular send queue or fragmented message transmission in + // Pending stand-alone BTP acknowledgement. Pre-empts regular send queue or fragmented message transmission in // progress. PacketBufferHandle mAckToSend; diff --git a/src/ble/BleApplicationDelegate.h b/src/ble/BleApplicationDelegate.h index 04084cd8ab5264..542e46b64c4888 100644 --- a/src/ble/BleApplicationDelegate.h +++ b/src/ble/BleApplicationDelegate.h @@ -39,7 +39,7 @@ class DLL_EXPORT BleApplicationDelegate // CHIP calls this function once it closes the last BLEEndPoint associated with a BLE given connection object. // A call to this function means CHIP no longer cares about the state of the given BLE connection. - // The application can use this callback to e.g. close the underlying BLE conection if it is no longer needed, + // The application can use this callback to e.g. close the underlying BLE connection if it is no longer needed, // decrement the connection's refcount if it has one, or perform any other sort of cleanup as desired. virtual void NotifyChipConnectionClosed(BLE_CONNECTION_OBJECT connObj) = 0; }; diff --git a/src/ble/BleLayer.h b/src/ble/BleLayer.h index efe27033d8618f..cbef971029a463 100644 --- a/src/ble/BleLayer.h +++ b/src/ble/BleLayer.h @@ -246,8 +246,8 @@ class DLL_EXPORT BleLayer CHIP_ERROR CancelBleIncompleteConnection(); CHIP_ERROR NewBleConnectionByDiscriminator(uint16_t connDiscriminator, void * appState = nullptr, - BleConnectionDelegate::OnConnectionCompleteFunct onSucess = OnConnectionComplete, - BleConnectionDelegate::OnConnectionErrorFunct onError = OnConnectionError); + BleConnectionDelegate::OnConnectionCompleteFunct onSuccess = OnConnectionComplete, + BleConnectionDelegate::OnConnectionErrorFunct onError = OnConnectionError); CHIP_ERROR NewBleConnectionByObject(BLE_CONNECTION_OBJECT connObj); CHIP_ERROR NewBleEndPoint(BLEEndPoint ** retEndPoint, BLE_CONNECTION_OBJECT connObj, BleRole role, bool autoClose); @@ -298,7 +298,7 @@ class DLL_EXPORT BleLayer /// Call when an outstanding GATT write request receives a positive receipt confirmation. bool HandleWriteConfirmation(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId); - /// Call when an oustanding GATT indication receives a positive receipt confirmation. + /// Call when an outstanding GATT indication receives a positive receipt confirmation. bool HandleIndicationConfirmation(BLE_CONNECTION_OBJECT connObj, const ChipBleUUID * svcId, const ChipBleUUID * charId); /// Call when a GATT read request is received. diff --git a/src/ble/BtpEngine.cpp b/src/ble/BtpEngine.cpp index a9882ee974ef43..aeba2672b19e9f 100644 --- a/src/ble/BtpEngine.cpp +++ b/src/ble/BtpEngine.cpp @@ -182,10 +182,10 @@ CHIP_ERROR BtpEngine::HandleAckReceived(SequenceNumber_t ack_num) { mTxOldestUnackedSeqNum = ack_num; - // All oustanding fragments have been acknowledged. + // All outstanding fragments have been acknowledged. mExpectingAck = false; } - else // If ack is valid, but not for newest oustanding unacknowledged fragment... + else // If ack is valid, but not for newest outstanding unacknowledged fragment... { // Update newest unacknowledged fragment to one past that which was just acknowledged. mTxOldestUnackedSeqNum = ack_num; @@ -196,7 +196,7 @@ CHIP_ERROR BtpEngine::HandleAckReceived(SequenceNumber_t ack_num) } // Calling convention: -// EncodeStandAloneAck may only be called if data arg is commited for immediate, synchronous subsequent transmission. +// EncodeStandAloneAck may only be called if data arg is committed for immediate, synchronous subsequent transmission. CHIP_ERROR BtpEngine::EncodeStandAloneAck(const PacketBufferHandle & data) { // Ensure enough headroom exists for the lower BLE layers. @@ -412,7 +412,7 @@ PacketBufferHandle BtpEngine::TakeRxPacket() } // Calling convention: -// May only be called if data arg is commited for immediate, synchronous subsequent transmission. +// May only be called if data arg is committed for immediate, synchronous subsequent transmission. // Returns false on error. Caller must free data arg on error. bool BtpEngine::HandleCharacteristicSend(System::PacketBufferHandle data, bool send_ack) { diff --git a/src/controller/AutoCommissioner.cpp b/src/controller/AutoCommissioner.cpp index b7ebb6f8e0cf07..2c83beeffc5a64 100644 --- a/src/controller/AutoCommissioner.cpp +++ b/src/controller/AutoCommissioner.cpp @@ -23,6 +23,35 @@ namespace chip { namespace Controller { +CHIP_ERROR AutoCommissioner::SetCommissioningParameters(const CommissioningParameters & params) +{ + mParams = params; + if (params.HasThreadOperationalDataset()) + { + ByteSpan dataset = params.GetThreadOperationalDataset().Value(); + if (dataset.size() > CommissioningParameters::kMaxCredentialsLen) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + memcpy(mThreadOperationalDataset, dataset.data(), dataset.size()); + mParams.SetThreadOperationalDataset(ByteSpan(mThreadOperationalDataset, dataset.size())); + } + if (params.HasWifiCredentials()) + { + WifiCredentials creds = params.GetWifiCredentials().Value(); + if (creds.ssid.size() > CommissioningParameters::kMaxSsidLen || + creds.credentials.size() > CommissioningParameters::kMaxCredentialsLen) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + memcpy(mSsid, creds.ssid.data(), creds.ssid.size()); + memcpy(mCredentials, creds.credentials.data(), creds.credentials.size()); + mParams.SetWifiCredentials( + WifiCredentials(ByteSpan(mSsid, creds.ssid.size()), ByteSpan(mCredentials, creds.credentials.size()))); + } + return CHIP_NO_ERROR; +} + CommissioningStage AutoCommissioner::GetNextCommissioningStage(CommissioningStage currentStage) { switch (currentStage) @@ -37,12 +66,52 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStage(CommissioningStag // TODO(cecille): device attestation casues operational cert provisioinging to happen, This should be a separate stage. // For thread and wifi, this should go to network setup then enable. For on-network we can skip right to finding the // operational network because the provisioning of certificates will trigger the device to start operational advertising. + if (mParams.HasWifiCredentials()) + { + return CommissioningStage::kWifiNetworkSetup; + } + else if (mParams.HasThreadOperationalDataset()) + { + return CommissioningStage::kThreadNetworkSetup; + } + else + { #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD - return CommissioningStage::kFindOperational; // TODO : once case is working, need to add stages to find and reconnect - // here. + return CommissioningStage::kFindOperational; #else - return CommissioningStage::kSendComplete; + return CommissioningStage::kSendComplete; #endif + } + case CommissioningStage::kWifiNetworkSetup: + if (mParams.HasThreadOperationalDataset()) + { + return CommissioningStage::kThreadNetworkSetup; + } + else + { + return CommissioningStage::kWifiNetworkEnable; + } + case CommissioningStage::kThreadNetworkSetup: + if (mParams.HasWifiCredentials()) + { + return CommissioningStage::kWifiNetworkEnable; + } + else + { + return CommissioningStage::kThreadNetworkEnable; + } + + case CommissioningStage::kWifiNetworkEnable: + if (mParams.HasThreadOperationalDataset()) + { + return CommissioningStage::kThreadNetworkEnable; + } + else + { + return CommissioningStage::kFindOperational; + } + case CommissioningStage::kThreadNetworkEnable: + return CommissioningStage::kFindOperational; case CommissioningStage::kFindOperational: return CommissioningStage::kSendComplete; case CommissioningStage::kSendComplete: @@ -50,9 +119,6 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStage(CommissioningStag // Currently unimplemented. case CommissioningStage::kConfigACL: - case CommissioningStage::kNetworkSetup: - case CommissioningStage::kNetworkEnable: - case CommissioningStage::kScanNetworks: case CommissioningStage::kCheckCertificates: return CommissioningStage::kError; // Neither of these have a next stage so return kError; diff --git a/src/controller/AutoCommissioner.h b/src/controller/AutoCommissioner.h index 1c8877685612e4..5b65674709a150 100644 --- a/src/controller/AutoCommissioner.h +++ b/src/controller/AutoCommissioner.h @@ -29,7 +29,7 @@ class AutoCommissioner : public CommissioningDelegate { public: AutoCommissioner(DeviceCommissioner * commissioner) : mCommissioner(commissioner) {} - void SetCommissioningParameters(CommissioningParameters & params) { mParams = params; } + CHIP_ERROR SetCommissioningParameters(const CommissioningParameters & params); void StartCommissioning(CommissioneeDeviceProxy * proxy); void CommissioningStepFinished(CHIP_ERROR err, CommissioningDelegate::CommissioningReport report) override; @@ -40,6 +40,11 @@ class AutoCommissioner : public CommissioningDelegate CommissioneeDeviceProxy * mCommissioneeDeviceProxy = nullptr; OperationalDeviceProxy * mOperationalDeviceProxy = nullptr; CommissioningParameters mParams = CommissioningParameters(); + // Memory space for the commisisoning parameters that come in as ByteSpans - the caller is not guaranteed to retain this memory + // TODO(cecille): Include memory from CommissioneeDeviceProxy once BLE is moved over + uint8_t mSsid[CommissioningParameters::kMaxSsidLen]; + uint8_t mCredentials[CommissioningParameters::kMaxCredentialsLen]; + uint8_t mThreadOperationalDataset[CommissioningParameters::kMaxThreadDatasetLen]; }; } // namespace Controller diff --git a/src/controller/CHIPCluster.cpp b/src/controller/CHIPCluster.cpp index f985b1596e8a4b..4d2ca1ddf44446 100644 --- a/src/controller/CHIPCluster.cpp +++ b/src/controller/CHIPCluster.cpp @@ -79,15 +79,5 @@ void ClusterBase::Dissociate() mDevice = nullptr; } -CHIP_ERROR ClusterBase::RequestAttributeReporting(AttributeId attributeId, Callback::Cancelable * onReportCallback, - app::TLVDataFilter tlvDataFilter) -{ - VerifyOrReturnError(onReportCallback != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(tlvDataFilter != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - mDevice->AddReportHandler(mEndpoint, mClusterId, attributeId, onReportCallback, tlvDataFilter); - - return CHIP_NO_ERROR; -} - } // namespace Controller } // namespace chip diff --git a/src/controller/CHIPCluster.h b/src/controller/CHIPCluster.h index c8112a4f773192..4d9452def8f0d0 100644 --- a/src/controller/CHIPCluster.h +++ b/src/controller/CHIPCluster.h @@ -259,21 +259,6 @@ class DLL_EXPORT ClusterBase protected: ClusterBase(uint16_t cluster) : mClusterId(cluster) {} - /** - * @brief - * Request attribute reports from the device. Add a callback - * handler, that'll be called when the reports are received from the device. - * - * @param[in] attributeId The report target attribute id - * @param[in] reportHandler The handler function that's called on receiving attribute reports - * The reporting handler continues to be called as long as the callback - * is active. The user can stop the reporting by cancelling the callback. - * Reference: chip::Callback::Cancel() - * @param[in] tlvDataFilter Filter interface for processing data from TLV - */ - CHIP_ERROR RequestAttributeReporting(AttributeId attributeId, Callback::Cancelable * reportHandler, - app::TLVDataFilter tlvDataFilter); - const ClusterId mClusterId; DeviceProxy * mDevice; EndpointId mEndpoint; diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 1480d8fca7467d..161a15465b2ce4 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -264,10 +265,10 @@ void DeviceController::ReleaseOperationalDevice(NodeId remoteDeviceId) { VerifyOrReturn(mState == State::Initialized, ChipLogError(Controller, "ReleaseOperationalDevice was called in incorrect state")); - mCASESessionManager->ReleaseSession(remoteDeviceId); + mCASESessionManager->ReleaseSession(mFabricInfo->GetPeerIdForNode(remoteDeviceId)); } -void DeviceController::OnSessionReleased(SessionHandle session) +void DeviceController::OnSessionReleased(const SessionHandle & session) { VerifyOrReturn(mState == State::Initialized, ChipLogError(Controller, "OnConnectionExpired was called in incorrect state")); mCASESessionManager->OnSessionReleased(session); @@ -351,7 +352,7 @@ CHIP_ERROR DeviceController::GetPeerAddressAndPort(PeerId peerId, Inet::IPAddres { VerifyOrReturnError(mState == State::Initialized, CHIP_ERROR_INCORRECT_STATE); Transport::PeerAddress peerAddr; - ReturnErrorOnFailure(mCASESessionManager->GetPeerAddress(mFabricInfo, peerId.GetNodeId(), peerAddr)); + ReturnErrorOnFailure(mCASESessionManager->GetPeerAddress(peerId, peerAddr)); addr = peerAddr.GetIPAddress(); port = peerAddr.GetPort(); return CHIP_NO_ERROR; @@ -378,7 +379,7 @@ void DeviceController::OnVIDReadResponse(void * context, uint16_t value) controller->mSetupPayload.vendorID = value; OperationalDeviceProxy * device = - controller->mCASESessionManager->FindExistingSession(controller->mDeviceWithCommissioningWindowOpen); + controller->mCASESessionManager->FindExistingSession(controller->GetPeerIdWithCommissioningWindowOpen()); if (device == nullptr) { ChipLogError(Controller, "Could not find device for opening commissioning window"); @@ -467,6 +468,7 @@ CHIP_ERROR DeviceController::OpenCommissioningWindowWithCallback(NodeId deviceId break; case 2: mCommissioningWindowOption = CommissioningWindowOption::kTokenWithProvidedPIN; + mSetupPayload.setUpPINCode = mSuggestedSetUpPINCode; break; default: ChipLogError(Controller, "Invalid Pairing Window option"); @@ -475,7 +477,7 @@ CHIP_ERROR DeviceController::OpenCommissioningWindowWithCallback(NodeId deviceId if (callback != nullptr && mCommissioningWindowOption != CommissioningWindowOption::kOriginalSetupCode && readVIDPIDAttributes) { - OperationalDeviceProxy * device = mCASESessionManager->FindExistingSession(mDeviceWithCommissioningWindowOpen); + OperationalDeviceProxy * device = mCASESessionManager->FindExistingSession(GetPeerIdWithCommissioningWindowOpen()); VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); constexpr EndpointId kBasicClusterEndpoint = 0; @@ -494,7 +496,7 @@ CHIP_ERROR DeviceController::OpenCommissioningWindowInternal() ChipLogProgress(Controller, "OpenCommissioningWindow for device ID %" PRIu64, mDeviceWithCommissioningWindowOpen); VerifyOrReturnError(mState == State::Initialized, CHIP_ERROR_INCORRECT_STATE); - OperationalDeviceProxy * device = mCASESessionManager->FindExistingSession(mDeviceWithCommissioningWindowOpen); + OperationalDeviceProxy * device = mCASESessionManager->FindExistingSession(GetPeerIdWithCommissioningWindowOpen()); VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); constexpr EndpointId kAdministratorCommissioningClusterEndpoint = 0; @@ -683,7 +685,7 @@ CHIP_ERROR DeviceCommissioner::Shutdown() return CHIP_NO_ERROR; } -void DeviceCommissioner::OnSessionReleased(SessionHandle session) +void DeviceCommissioner::OnSessionReleased(const SessionHandle & session) { VerifyOrReturn(mState == State::Initialized, ChipLogError(Controller, "OnConnectionExpired was called in incorrect state")); @@ -693,7 +695,7 @@ void DeviceCommissioner::OnSessionReleased(SessionHandle session) device->OnSessionReleased(session); } -CommissioneeDeviceProxy * DeviceCommissioner::FindCommissioneeDevice(SessionHandle session) +CommissioneeDeviceProxy * DeviceCommissioner::FindCommissioneeDevice(const SessionHandle & session) { CommissioneeDeviceProxy * foundDevice = nullptr; mCommissioneeDevicePool.ForEachActiveObject([&](auto * deviceProxy) { @@ -814,9 +816,6 @@ CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, Re device->Init(GetControllerDeviceInitParams(), remoteDeviceId, peerAddress, fabric->GetFabricIndex()); - err = device->GetPairing().MessageDispatch().Init(mSystemState->SessionMgr()); - SuccessOrExit(err); - if (params.GetPeerAddress().GetTransportType() != Transport::Type::kBle) { device->SetAddress(params.GetPeerAddress().GetIPAddress()); @@ -892,6 +891,11 @@ CHIP_ERROR DeviceCommissioner::Commission(NodeId remoteDeviceId, CommissioningPa ChipLogError(Controller, "Commissioning already in progress - not restarting"); return CHIP_ERROR_INCORRECT_STATE; } + if (!params.HasWifiCredentials() && !params.HasThreadOperationalDataset() && !mIsIPRendezvous) + { + ChipLogError(Controller, "Network commissioning parameters are required for BLE auto commissioning."); + return CHIP_ERROR_INVALID_ARGUMENT; + } // If the CSRNonce is passed in, using that else using a random one.. // TODO(cecille): Once the commissioning stages are separated, this can be removed from the device and moved down into the // approprirate commissioning step. @@ -961,7 +965,7 @@ void DeviceCommissioner::RendezvousCleanup(CHIP_ERROR status) { FreeRendezvousSession(); - if (mDeviceBeingCommissioned != nullptr && mIsIPRendezvous) + if (mDeviceBeingCommissioned != nullptr) { // Release the commissionee device. For BLE, this is stored, // for IP commissioning, we have taken a reference to the @@ -1019,22 +1023,8 @@ void DeviceCommissioner::OnSessionEstablished() // For IP rendezvous, this is sent as part of the state machine. if (mRunCommissioningAfterConnection) { - mRunCommissioningAfterConnection = false; - bool usingLegacyFlowWithImmediateStart = !mIsIPRendezvous; - if (usingLegacyFlowWithImmediateStart) - { - err = SendCertificateChainRequestCommand(mDeviceBeingCommissioned, CertificateType::kPAI); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Ble, "Failed in sending 'Certificate Chain request' command to the device: err %s", ErrorStr(err)); - OnSessionEstablishmentError(err); - return; - } - } - else - { - mAutoCommissioner.StartCommissioning(mDeviceBeingCommissioned); - } + mRunCommissioningAfterConnection = false; + mAutoCommissioner.StartCommissioning(mDeviceBeingCommissioned); } else { @@ -1190,7 +1180,7 @@ CHIP_ERROR DeviceCommissioner::ValidateAttestationInfo(const ByteSpan & attestat { ChipLogError(Controller, "Failed in verifying 'Attestation Information' command received from the device due to default " - "DeviceAttestationVerifier Class not being overriden by a real implementation."); + "DeviceAttestationVerifier Class not being overridden by a real implementation."); return CHIP_ERROR_NOT_IMPLEMENTED; } else @@ -1247,6 +1237,11 @@ CHIP_ERROR DeviceCommissioner::SendOperationalCertificateSigningRequestCommand(C Callback::Cancelable * successCallback = mOpCSRResponseCallback.Cancel(); Callback::Cancelable * failureCallback = mOnCSRFailureCallback.Cancel(); + uint8_t csrNonceBuf[kOpCSRNonceLength]; + MutableByteSpan csrNonce(csrNonceBuf); + ReturnErrorOnFailure(mOperationalCredentialsDelegate->ObtainCsrNonce(csrNonce)); + ReturnErrorOnFailure(device->SetCSRNonce(csrNonce)); + ReturnErrorOnFailure(cluster.OpCSRRequest(successCallback, failureCallback, device->GetCSRNonce())); ChipLogDetail(Controller, "Sent OpCSR request, waiting for the CSR"); @@ -1349,12 +1344,27 @@ CHIP_ERROR DeviceCommissioner::ProcessOpCSR(const ByteSpan & NOCSRElements, cons ChipLogProgress(Controller, "Getting certificate chain for the device from the issuer"); + DeviceAttestationVerifier * dacVerifier = GetDeviceAttestationVerifier(); + + P256PublicKey dacPubkey; + ReturnErrorOnFailure(ExtractPubkeyFromX509Cert(device->GetDAC(), dacPubkey)); + + // Retrieve attestation challenge + ByteSpan attestationChallenge = mSystemState->SessionMgr() + ->GetSecureSession(device->GetSecureSession().Value()) + ->GetCryptoContext() + .GetAttestationChallenge(); + + // The operational CA should also verify this on its end during NOC generation, if end-to-end attestation is desired. + ReturnErrorOnFailure(dacVerifier->VerifyNodeOperationalCSRInformation(NOCSRElements, attestationChallenge, AttestationSignature, + dacPubkey, device->GetCSRNonce())); + mOperationalCredentialsDelegate->SetNodeIdForNextNOCRequest(device->GetDeviceId()); FabricInfo * fabric = mSystemState->Fabrics()->FindFabricWithIndex(mFabricIndex); mOperationalCredentialsDelegate->SetFabricIdForNextNOCRequest(fabric->GetFabricId()); - return mOperationalCredentialsDelegate->GenerateNOCChain(NOCSRElements, AttestationSignature, ByteSpan(), ByteSpan(), + return mOperationalCredentialsDelegate->GenerateNOCChain(NOCSRElements, AttestationSignature, device->GetDAC(), ByteSpan(), ByteSpan(), &mDeviceNOCChainCallback); } @@ -1515,14 +1525,7 @@ CHIP_ERROR DeviceCommissioner::OnOperationalCredentialsProvisioningCompletion(Co { mPairingDelegate->OnStatusUpdate(DevicePairingDelegate::SecurePairingSuccess); } - if (mIsIPRendezvous) - { - CommissioningStageComplete(CHIP_NO_ERROR); - } - else - { - RendezvousCleanup(CHIP_NO_ERROR); - } + CommissioningStageComplete(CHIP_NO_ERROR); return CHIP_NO_ERROR; } @@ -1651,6 +1654,7 @@ void DeviceCommissioner::OnNodeIdResolved(const chip::Dnssd::ResolvedNodeData & if (mDeviceBeingCommissioned != nullptr && mDeviceBeingCommissioned->GetDeviceId() == nodeData.mPeerId.GetNodeId()) { + RendezvousCleanup(CHIP_NO_ERROR); // Let's release the device that's being paired, if pairing was successful, // and the device is available on the operational network. ReleaseCommissioneeDevice(mDeviceBeingCommissioned); @@ -1659,8 +1663,7 @@ void DeviceCommissioner::OnNodeIdResolved(const chip::Dnssd::ResolvedNodeData & mDNSCache.Insert(nodeData); - mCASESessionManager->FindOrEstablishSession(mFabricInfo, nodeData.mPeerId.GetNodeId(), &mOnDeviceConnectedCallback, - &mOnDeviceConnectionFailureCallback); + mCASESessionManager->FindOrEstablishSession(nodeData.mPeerId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback); DeviceController::OnNodeIdResolved(nodeData); } @@ -1684,33 +1687,25 @@ void DeviceCommissioner::OnDeviceConnectedFn(void * context, OperationalDevicePr DeviceCommissioner * commissioner = static_cast(context); VerifyOrReturn(commissioner != nullptr, ChipLogProgress(Controller, "Device connected callback with null context. Ignoring")); - if (commissioner->mIsIPRendezvous) + if (commissioner->mCommissioningStage == CommissioningStage::kFindOperational) { - if (commissioner->mCommissioningStage == CommissioningStage::kFindOperational) - { - if (commissioner->mCommissioningDelegate != nullptr) - { - CommissioningDelegate::CommissioningReport report; - report.stageCompleted = CommissioningStage::kFindOperational; - report.OperationalNodeFoundData.operationalProxy = device; - commissioner->mCommissioningDelegate->CommissioningStepFinished(CHIP_NO_ERROR, report); - } - } - else + if (commissioner->mCommissioningDelegate != nullptr) { - commissioner->mPairingDelegate->OnPairingComplete(CHIP_NO_ERROR); + CommissioningDelegate::CommissioningReport report; + report.stageCompleted = CommissioningStage::kFindOperational; + report.OperationalNodeFoundData.operationalProxy = device; + commissioner->mCommissioningDelegate->CommissioningStepFinished(CHIP_NO_ERROR, report); } - // For IP rendezvous, we don't want to call commissioning complete below because IP commissioning - // has more steps currently. - return; } - - VerifyOrReturn(commissioner->mPairingDelegate != nullptr, - ChipLogProgress(Controller, "Device connected callback with null pairing delegate. Ignoring")); - commissioner->mPairingDelegate->OnCommissioningComplete(device->GetDeviceId(), CHIP_NO_ERROR); + else + { + VerifyOrReturn(commissioner->mPairingDelegate != nullptr, + ChipLogProgress(Controller, "Device connected callback with null pairing delegate. Ignoring")); + commissioner->mPairingDelegate->OnPairingComplete(CHIP_NO_ERROR); + } } -void DeviceCommissioner::OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR error) +void DeviceCommissioner::OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error) { DeviceCommissioner * commissioner = static_cast(context); ChipLogProgress(Controller, "Device connection failed. Error %s", ErrorStr(error)); @@ -1718,7 +1713,7 @@ void DeviceCommissioner::OnDeviceConnectionFailureFn(void * context, NodeId devi ChipLogProgress(Controller, "Device connection failure callback with null context. Ignoring")); VerifyOrReturn(commissioner->mPairingDelegate != nullptr, ChipLogProgress(Controller, "Device connection failure callback with null pairing delegate. Ignoring")); - commissioner->mPairingDelegate->OnCommissioningComplete(deviceId, error); + commissioner->mPairingDelegate->OnCommissioningComplete(peerId.GetNodeId(), error); } void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, CommissioningStage step, CommissioningParameters & params, @@ -1726,10 +1721,6 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio { // For now, we ignore errors coming in from the device since not all commissioning clusters are implemented on the device // side. - if (!mIsIPRendezvous) - { - return; - } mCommissioningStage = step; mCommissioningDelegate = delegate; @@ -1830,23 +1821,73 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio // Once these are implemented through the clusters, these should be moved into their separate stages and the callbacks // should advance the commissioning stage. case CommissioningStage::kConfigACL: - case CommissioningStage::kNetworkSetup: - case CommissioningStage::kScanNetworks: // TODO: Implement break; - case CommissioningStage::kNetworkEnable: { - ChipLogProgress(Controller, "Enabling Network"); - // For on-network, this is a NO-OP becuase we now start operational advertising once credentials are provisioned. - // This is a placeholder for thread and wifi networks once that is implemented. + case CommissioningStage::kWifiNetworkSetup: { + if (!params.HasWifiCredentials()) + { + CommissioningDelegate::CommissioningReport report; + report.stageCompleted = step; + mCommissioningDelegate->CommissioningStepFinished(CHIP_ERROR_INVALID_ARGUMENT, report); + return; + } + ChipLogProgress(Controller, "Adding wifi network"); + NetworkCommissioningCluster netCom; + netCom.Associate(proxy, 0); + netCom.AddOrUpdateWiFiNetwork(mSuccess.Cancel(), mFailure.Cancel(), params.GetWifiCredentials().Value().ssid, + params.GetWifiCredentials().Value().credentials, breadcrumb); + } + break; + case CommissioningStage::kThreadNetworkSetup: { + if (!params.HasThreadOperationalDataset()) + { + CommissioningDelegate::CommissioningReport report; + report.stageCompleted = step; + mCommissioningDelegate->CommissioningStepFinished(CHIP_ERROR_INVALID_ARGUMENT, report); + return; + } + ChipLogProgress(Controller, "Adding thread network"); + NetworkCommissioningCluster netCom; + netCom.Associate(proxy, 0); + netCom.AddOrUpdateThreadNetwork(mSuccess.Cancel(), mFailure.Cancel(), params.GetThreadOperationalDataset().Value(), + breadcrumb); + } + break; + case CommissioningStage::kWifiNetworkEnable: { + if (!params.HasWifiCredentials()) + { + CommissioningDelegate::CommissioningReport report; + report.stageCompleted = step; + mCommissioningDelegate->CommissioningStepFinished(CHIP_ERROR_INVALID_ARGUMENT, report); + return; + } + ChipLogProgress(Controller, "Enabling wifi network"); + NetworkCommissioningCluster netCom; + netCom.Associate(proxy, 0); + netCom.ConnectNetwork(mSuccess.Cancel(), mFailure.Cancel(), params.GetWifiCredentials().Value().ssid, breadcrumb); + } + break; + case CommissioningStage::kThreadNetworkEnable: { + ByteSpan extendedPanId; + chip::Thread::OperationalDataset operationalDataset; + if (!params.HasThreadOperationalDataset() || + operationalDataset.Init(params.GetThreadOperationalDataset().Value()) != CHIP_NO_ERROR || + operationalDataset.GetExtendedPanIdAsByteSpan(extendedPanId) != CHIP_NO_ERROR) + { + ChipLogError(Controller, "Unable to get extended pan ID for thread operational dataset\n"); + CommissioningDelegate::CommissioningReport report; + report.stageCompleted = step; + mCommissioningDelegate->CommissioningStepFinished(CHIP_ERROR_INVALID_ARGUMENT, report); + return; + } + ChipLogProgress(Controller, "Enabling thread network"); + NetworkCommissioningCluster netCom; + netCom.Associate(proxy, 0); + netCom.ConnectNetwork(mSuccess.Cancel(), mFailure.Cancel(), extendedPanId, breadcrumb); } break; case CommissioningStage::kFindOperational: { - PeerId peerId = PeerId().SetCompressedFabricId(GetCompressedFabricId()).SetNodeId(proxy->GetDeviceId()); - RendezvousCleanup(CHIP_NO_ERROR); -#if CHIP_DEVICE_CONFIG_ENABLE_DNSSD - ChipLogProgress(Controller, "Finding node on operational network"); - mDNSResolver.ResolveNodeId(peerId, Inet::IPAddressType::kAny); -#endif + UpdateDevice(proxy->GetDeviceId()); } break; case CommissioningStage::kSendComplete: { diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index cfcb0cb8861e5f..22cdf05e2bc74e 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -200,7 +200,7 @@ class DLL_EXPORT DeviceController : public SessionReleaseDelegate, * grab the CHIP stack lock. * * This will also not stop the CHIP event queue / thread (if one exists). Consumers are expected to - * ensure this happend before calling this method. + * ensure this happened before calling this method. */ virtual CHIP_ERROR Shutdown(); @@ -221,7 +221,7 @@ class DLL_EXPORT DeviceController : public SessionReleaseDelegate, Callback::Callback * onFailure) { VerifyOrReturnError(mState == State::Initialized, CHIP_ERROR_INCORRECT_STATE); - return mCASESessionManager->FindOrEstablishSession(mFabricInfo, deviceId, onConnection, onFailure); + return mCASESessionManager->FindOrEstablishSession(mFabricInfo->GetPeerIdForNode(deviceId), onConnection, onFailure); } /** @@ -269,7 +269,7 @@ class DLL_EXPORT DeviceController : public SessionReleaseDelegate, * @param[in] option The commissioning window can be opened using the original setup code, or an * onboarding token can be generated using a random setup PIN code (or with * the PIN code provied in the setupPayload). - * @param[out] payload The generated setup payload. + * @param[in,out] payload The generated setup payload. * - The payload is generated only if the user didn't ask for using the original setup code. * - If the user asked to use the provided setup PIN, the PIN must be provided as part of * this payload @@ -279,7 +279,10 @@ class DLL_EXPORT DeviceController : public SessionReleaseDelegate, CHIP_ERROR OpenCommissioningWindow(NodeId deviceId, uint16_t timeout, uint16_t iteration, uint16_t discriminator, uint8_t option, SetupPayload & payload) { - return OpenCommissioningWindowWithCallback(deviceId, timeout, iteration, discriminator, option, nullptr); + mSuggestedSetUpPINCode = payload.setUpPINCode; + ReturnErrorOnFailure(OpenCommissioningWindowWithCallback(deviceId, timeout, iteration, discriminator, option, nullptr)); + payload = mSetupPayload; + return CHIP_NO_ERROR; } /** @@ -375,7 +378,7 @@ class DLL_EXPORT DeviceController : public SessionReleaseDelegate, ReliableMessageProtocolConfig mMRPConfig = gDefaultMRPConfig; //////////// SessionReleaseDelegate Implementation /////////////// - void OnSessionReleased(SessionHandle session) override; + void OnSessionReleased(const SessionHandle & session) override; //////////// SessionRecoveryDelegate Implementation /////////////// void OnFirstMessageDeliveryFailed(const SessionHandle & session) override; @@ -399,10 +402,13 @@ class DLL_EXPORT DeviceController : public SessionReleaseDelegate, CHIP_ERROR OpenCommissioningWindowInternal(); + PeerId GetPeerIdWithCommissioningWindowOpen() { return mFabricInfo->GetPeerIdForNode(mDeviceWithCommissioningWindowOpen); } + // TODO - Support opening commissioning window simultaneously on multiple devices Callback::Callback * mCommissioningWindowCallback = nullptr; SetupPayload mSetupPayload; NodeId mDeviceWithCommissioningWindowOpen; + uint32_t mSuggestedSetUpPINCode = 0; uint16_t mCommissioningWindowTimeout; uint16_t mCommissioningWindowIteration; @@ -682,7 +688,7 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, void OnSessionEstablishmentTimeout(); //////////// SessionReleaseDelegate Implementation /////////////// - void OnSessionReleased(SessionHandle session) override; + void OnSessionReleased(const SessionHandle & session) override; static void OnSessionEstablishmentTimeoutCallback(System::Layer * aLayer, void * aAppState); @@ -695,22 +701,22 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, */ CHIP_ERROR SendAttestationRequestCommand(CommissioneeDeviceProxy * device, const ByteSpan & attestationNonce); /* This function sends an OpCSR request to the device. - The function does not hold a refernce to the device object. + The function does not hold a reference to the device object. */ CHIP_ERROR SendOperationalCertificateSigningRequestCommand(CommissioneeDeviceProxy * device); /* This function sends the operational credentials to the device. - The function does not hold a refernce to the device object. + The function does not hold a reference to the device object. */ CHIP_ERROR SendOperationalCertificate(CommissioneeDeviceProxy * device, const ByteSpan & nocCertBuf, const ByteSpan & icaCertBuf); /* This function sends the trusted root certificate to the device. - The function does not hold a refernce to the device object. + The function does not hold a reference to the device object. */ CHIP_ERROR SendTrustedRootCertificate(CommissioneeDeviceProxy * device, const ByteSpan & rcac); /* This function is called by the commissioner code when the device completes the operational credential provisioning process. - The function does not hold a refernce to the device object. + The function does not hold a reference to the device object. */ CHIP_ERROR OnOperationalCredentialsProvisioningCompletion(CommissioneeDeviceProxy * device); @@ -745,7 +751,7 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, static void OnRootCertFailureResponse(void * context, uint8_t status); static void OnDeviceConnectedFn(void * context, OperationalDeviceProxy * device); - static void OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR error); + static void OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error); static void OnDeviceNOCChainGeneration(void * context, CHIP_ERROR status, const ByteSpan & noc, const ByteSpan & icac, const ByteSpan & rcac); @@ -777,7 +783,7 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, void HandleAttestationResult(CHIP_ERROR err); - CommissioneeDeviceProxy * FindCommissioneeDevice(SessionHandle session); + CommissioneeDeviceProxy * FindCommissioneeDevice(const SessionHandle & session); CommissioneeDeviceProxy * FindCommissioneeDevice(NodeId id); void ReleaseCommissioneeDevice(CommissioneeDeviceProxy * device); diff --git a/src/controller/CHIPDeviceControllerFactory.h b/src/controller/CHIPDeviceControllerFactory.h index 115c2caf04c670..87e1fb79426545 100644 --- a/src/controller/CHIPDeviceControllerFactory.h +++ b/src/controller/CHIPDeviceControllerFactory.h @@ -31,6 +31,7 @@ #include #include +#include namespace chip { @@ -61,6 +62,8 @@ struct SetupParams // The Device Pairing Delegated used to initialize a Commissioner DevicePairingDelegate * pairingDelegate = nullptr; + + Credentials::DeviceAttestationVerifier * deviceAttestationVerifier = nullptr; }; // TODO everything other than the fabric storage here should be removed. diff --git a/src/controller/CommissioneeDeviceProxy.cpp b/src/controller/CommissioneeDeviceProxy.cpp index b90cb6f31d2eff..5c33fb2834a62c 100644 --- a/src/controller/CommissioneeDeviceProxy.cpp +++ b/src/controller/CommissioneeDeviceProxy.cpp @@ -86,7 +86,7 @@ CHIP_ERROR CommissioneeDeviceProxy::SendCommands(app::CommandSender * commandObj return commandObj->SendCommandRequest(mSecureSession.Get()); } -void CommissioneeDeviceProxy::OnSessionReleased(SessionHandle session) +void CommissioneeDeviceProxy::OnSessionReleased(const SessionHandle & session) { VerifyOrReturn(mSecureSession.Contains(session), ChipLogDetail(Controller, "Connection expired, but it doesn't match the current session")); diff --git a/src/controller/CommissioneeDeviceProxy.h b/src/controller/CommissioneeDeviceProxy.h index c29d2c2875e475..b8183bee02a11f 100644 --- a/src/controller/CommissioneeDeviceProxy.h +++ b/src/controller/CommissioneeDeviceProxy.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -54,7 +55,6 @@ namespace chip { -constexpr size_t kOpCSRNonceLength = 32; constexpr size_t kAttestationNonceLength = 32; using DeviceIPTransportMgr = TransportMgr GetSecureSession() const override { return mSecureSession.ToOptional(); } @@ -328,7 +328,7 @@ class CommissioneeDeviceProxy : public DeviceProxy, public SessionReleaseDelegat FabricIndex mFabricIndex = kUndefinedFabricIndex; // TODO: Offload Nonces and DAC/PAI into a new struct - uint8_t mCSRNonce[kOpCSRNonceLength]; + uint8_t mCSRNonce[Controller::kOpCSRNonceLength]; uint8_t mAttestationNonce[kAttestationNonceLength]; uint8_t * mDAC = nullptr; diff --git a/src/controller/CommissioningDelegate.h b/src/controller/CommissioningDelegate.h index 55a1e82509a996..bc31c32ac60de8 100644 --- a/src/controller/CommissioningDelegate.h +++ b/src/controller/CommissioningDelegate.h @@ -35,14 +35,70 @@ enum CommissioningStage : uint8_t kDeviceAttestation, kCheckCertificates, kConfigACL, - kNetworkSetup, - kScanNetworks, // optional stage if network setup fails (not yet implemented) - kNetworkEnable, + kWifiNetworkSetup, + kThreadNetworkSetup, + kWifiNetworkEnable, + kThreadNetworkEnable, kFindOperational, kSendComplete, kCleanup, }; +struct WifiCredentials +{ + ByteSpan ssid; + // TODO(cecille): We should add a PII bytespan concept. + ByteSpan credentials; + WifiCredentials(ByteSpan newSsid, ByteSpan newCreds) : ssid(newSsid), credentials(newCreds) {} +}; +class CommissioningParameters +{ +public: + static constexpr size_t kMaxThreadDatasetLen = 254; + static constexpr size_t kMaxSsidLen = 32; + static constexpr size_t kMaxCredentialsLen = 64; + bool HasCSRNonce() const { return mCSRNonce.HasValue(); } + bool HasAttestationNonce() const { return mAttestationNonce.HasValue(); } + bool HasWifiCredentials() const { return mWifiCreds.HasValue(); } + bool HasThreadOperationalDataset() const { return mThreadOperationalDataset.HasValue(); } + const Optional GetCSRNonce() const { return mCSRNonce; } + const Optional GetAttestationNonce() const { return mAttestationNonce; } + const Optional GetWifiCredentials() const { return mWifiCreds; } + const Optional GetThreadOperationalDataset() const { return mThreadOperationalDataset; } + + // The lifetime of the buffer csrNonce is pointing to, should exceed the lifetime of CommissioningParameters object. + CommissioningParameters & SetCSRNonce(ByteSpan csrNonce) + { + mCSRNonce.SetValue(csrNonce); + return *this; + } + + // The lifetime of the buffer attestationNonce is pointing to, should exceed the lifetime of CommissioningParameters object. + CommissioningParameters & SetAttestationNonce(ByteSpan attestationNonce) + { + mAttestationNonce.SetValue(attestationNonce); + return *this; + } + CommissioningParameters & SetWifiCredentials(WifiCredentials wifiCreds) + { + mWifiCreds.SetValue(wifiCreds); + return *this; + } + + CommissioningParameters & SetThreadOperationalDataset(ByteSpan threadOperationalDataset) + { + + mThreadOperationalDataset.SetValue(threadOperationalDataset); + return *this; + } + +private: + Optional mCSRNonce; ///< CSR Nonce passed by the commissioner + Optional mAttestationNonce; ///< Attestation Nonce passed by the commissioner + Optional mWifiCreds; + Optional mThreadOperationalDataset; +}; + class CommissioningDelegate { public: diff --git a/src/controller/ExampleOperationalCredentialsIssuer.cpp b/src/controller/ExampleOperationalCredentialsIssuer.cpp index 54752fc2c801dd..c06a4d5c56d5cd 100644 --- a/src/controller/ExampleOperationalCredentialsIssuer.cpp +++ b/src/controller/ExampleOperationalCredentialsIssuer.cpp @@ -153,7 +153,7 @@ CHIP_ERROR ExampleOperationalCredentialsIssuer::GenerateNOCChain(const ByteSpan } VerifyOrReturnError(reader.GetType() == kTLVType_Structure, CHIP_ERROR_WRONG_TLV_TYPE); - VerifyOrReturnError(reader.GetTag() == AnonymousTag, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrReturnError(reader.GetTag() == AnonymousTag(), CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); TLVType containerType; ReturnErrorOnFailure(reader.EnterContainer(containerType)); diff --git a/src/controller/InvokeInteraction.h b/src/controller/InvokeInteraction.h index 856b8a64323db6..817433c060d73c 100644 --- a/src/controller/InvokeInteraction.h +++ b/src/controller/InvokeInteraction.h @@ -44,7 +44,7 @@ namespace Controller { */ template CHIP_ERROR -InvokeCommandRequest(Messaging::ExchangeManager * aExchangeMgr, SessionHandle sessionHandle, chip::EndpointId endpointId, +InvokeCommandRequest(Messaging::ExchangeManager * aExchangeMgr, const SessionHandle & sessionHandle, chip::EndpointId endpointId, const RequestObjectT & requestCommandData, typename TypedCommandCallback::OnSuccessCallbackType onSuccessCb, typename TypedCommandCallback::OnErrorCallbackType onErrorCb, @@ -78,8 +78,8 @@ InvokeCommandRequest(Messaging::ExchangeManager * aExchangeMgr, SessionHandle se ReturnErrorOnFailure(commandSender->SendCommandRequest(sessionHandle)); // - // We've effectively transfered ownership of the above allocated objects to CommandSender, and we need to wait for it to call us - // back when processing is completed (through OnDone) to eventually free up resources. + // We've effectively transferred ownership of the above allocated objects to CommandSender, and we need to wait for it to call + // us back when processing is completed (through OnDone) to eventually free up resources. // // So signal that by releasing the smart pointer. // @@ -91,7 +91,7 @@ InvokeCommandRequest(Messaging::ExchangeManager * aExchangeMgr, SessionHandle se template CHIP_ERROR -InvokeCommandRequest(Messaging::ExchangeManager * exchangeMgr, SessionHandle sessionHandle, chip::EndpointId endpointId, +InvokeCommandRequest(Messaging::ExchangeManager * exchangeMgr, const SessionHandle & sessionHandle, chip::EndpointId endpointId, const RequestObjectT & requestCommandData, typename TypedCommandCallback::OnSuccessCallbackType onSuccessCb, typename TypedCommandCallback::OnErrorCallbackType onErrorCb, @@ -103,7 +103,7 @@ InvokeCommandRequest(Messaging::ExchangeManager * exchangeMgr, SessionHandle ses template = 0> CHIP_ERROR -InvokeCommandRequest(Messaging::ExchangeManager * exchangeMgr, SessionHandle sessionHandle, chip::EndpointId endpointId, +InvokeCommandRequest(Messaging::ExchangeManager * exchangeMgr, const SessionHandle & sessionHandle, chip::EndpointId endpointId, const RequestObjectT & requestCommandData, typename TypedCommandCallback::OnSuccessCallbackType onSuccessCb, typename TypedCommandCallback::OnErrorCallbackType onErrorCb) diff --git a/src/controller/OperationalCredentialsDelegate.h b/src/controller/OperationalCredentialsDelegate.h index fed605aab208b4..cc82faec4f20d8 100644 --- a/src/controller/OperationalCredentialsDelegate.h +++ b/src/controller/OperationalCredentialsDelegate.h @@ -33,6 +33,7 @@ typedef void (*OnNOCChainGeneration)(void * context, CHIP_ERROR status, const By const ByteSpan & rcac); constexpr uint32_t kMaxCHIPDERCertLength = 600; +constexpr size_t kOpCSRNonceLength = 32; /// Callbacks for CHIP operational credentials generation class DLL_EXPORT OperationalCredentialsDelegate @@ -76,6 +77,13 @@ class DLL_EXPORT OperationalCredentialsDelegate * fabric ID. */ virtual void SetFabricIdForNextNOCRequest(FabricId fabricId) {} + + virtual CHIP_ERROR ObtainCsrNonce(MutableByteSpan & csrNonce) + { + VerifyOrReturnError(csrNonce.size() == kOpCSRNonceLength, CHIP_ERROR_INVALID_ARGUMENT); + ReturnErrorOnFailure(Crypto::DRBG_get_bytes(csrNonce.data(), csrNonce.size())); + return CHIP_NO_ERROR; + } }; } // namespace Controller diff --git a/src/controller/ReadInteraction.h b/src/controller/ReadInteraction.h index 59759a1830b076..7aced25d55fef5 100644 --- a/src/controller/ReadInteraction.h +++ b/src/controller/ReadInteraction.h @@ -30,7 +30,10 @@ namespace detail { template struct ReportAttributeParams : public app::ReadPrepareParams { - ReportAttributeParams(SessionHandle sessionHandle) : app::ReadPrepareParams(sessionHandle) { mKeepSubscriptions = false; } + ReportAttributeParams(const SessionHandle & sessionHandle) : app::ReadPrepareParams(sessionHandle) + { + mKeepSubscriptions = false; + } typename TypedReadAttributeCallback::OnSuccessCallbackType mOnReportCb; typename TypedReadAttributeCallback::OnErrorCallbackType mOnErrorCb; typename TypedReadAttributeCallback::OnSubscriptionEstablishedCallbackType @@ -43,7 +46,6 @@ CHIP_ERROR ReportAttribute(Messaging::ExchangeManager * exchangeMgr, EndpointId AttributeId attributeId, ReportAttributeParams && readParams) { app::AttributePathParams attributePath(endpointId, clusterId, attributeId); - app::ReadClient * readClient = nullptr; app::InteractionModelEngine * engine = app::InteractionModelEngine::GetInstance(); CHIP_ERROR err = CHIP_NO_ERROR; @@ -51,6 +53,7 @@ CHIP_ERROR ReportAttribute(Messaging::ExchangeManager * exchangeMgr, EndpointId readParams.mAttributePathParamsListSize = 1; auto onDone = [](app::ReadClient * apReadClient, TypedReadAttributeCallback * callback) { + chip::Platform::Delete(apReadClient); chip::Platform::Delete(callback); }; @@ -58,15 +61,10 @@ CHIP_ERROR ReportAttribute(Messaging::ExchangeManager * exchangeMgr, EndpointId clusterId, attributeId, readParams.mOnReportCb, readParams.mOnErrorCb, onDone, readParams.mOnSubscriptionEstablishedCb); VerifyOrReturnError(callback != nullptr, CHIP_ERROR_NO_MEMORY); - ReturnErrorOnFailure(engine->NewReadClient(&readClient, readParams.mReportType, &(callback->GetBufferedCallback()))); - - err = readClient->SendRequest(readParams); + auto readClient = + chip::Platform::MakeUnique(engine, exchangeMgr, callback->GetBufferedCallback(), readParams.mReportType); - if (err != CHIP_NO_ERROR) - { - readClient->Shutdown(); - return err; - } + ReturnErrorOnFailure(readClient->SendRequest(readParams)); // // At this point, we'll get a callback through the OnDone callback above regardless of success or failure @@ -74,6 +72,8 @@ CHIP_ERROR ReportAttribute(Messaging::ExchangeManager * exchangeMgr, EndpointId // object now to prevent it from being reclaimed at the end of this scoped block. // callback.release(); + readClient.release(); + return err; } @@ -84,7 +84,7 @@ CHIP_ERROR ReportAttribute(Messaging::ExchangeManager * exchangeMgr, EndpointId * basis, we have a helper that's just templated on the type. */ template -CHIP_ERROR ReadAttribute(Messaging::ExchangeManager * exchangeMgr, const SessionHandle sessionHandle, EndpointId endpointId, +CHIP_ERROR ReadAttribute(Messaging::ExchangeManager * exchangeMgr, const SessionHandle & sessionHandle, EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, typename TypedReadAttributeCallback::OnSuccessCallbackType onSuccessCb, typename TypedReadAttributeCallback::OnErrorCallbackType onErrorCb) @@ -106,7 +106,7 @@ CHIP_ERROR ReadAttribute(Messaging::ExchangeManager * exchangeMgr, const Session */ template CHIP_ERROR -ReadAttribute(Messaging::ExchangeManager * exchangeMgr, const SessionHandle sessionHandle, EndpointId endpointId, +ReadAttribute(Messaging::ExchangeManager * exchangeMgr, const SessionHandle & sessionHandle, EndpointId endpointId, typename TypedReadAttributeCallback::OnSuccessCallbackType onSuccessCb, typename TypedReadAttributeCallback::OnErrorCallbackType onErrorCb) { @@ -117,7 +117,7 @@ ReadAttribute(Messaging::ExchangeManager * exchangeMgr, const SessionHandle sess // Helper for SubscribeAttribute to reduce the amount of code generated. template -CHIP_ERROR SubscribeAttribute(Messaging::ExchangeManager * exchangeMgr, const SessionHandle sessionHandle, EndpointId endpointId, +CHIP_ERROR SubscribeAttribute(Messaging::ExchangeManager * exchangeMgr, const SessionHandle & sessionHandle, EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, typename TypedReadAttributeCallback::OnSuccessCallbackType onReportCb, typename TypedReadAttributeCallback::OnErrorCallbackType onErrorCb, @@ -142,7 +142,7 @@ CHIP_ERROR SubscribeAttribute(Messaging::ExchangeManager * exchangeMgr, const Se */ template CHIP_ERROR SubscribeAttribute( - Messaging::ExchangeManager * exchangeMgr, const SessionHandle sessionHandle, EndpointId endpointId, + Messaging::ExchangeManager * exchangeMgr, const SessionHandle & sessionHandle, EndpointId endpointId, typename TypedReadAttributeCallback::OnSuccessCallbackType onReportCb, typename TypedReadAttributeCallback::OnErrorCallbackType onErrorCb, uint16_t aMinIntervalFloorSeconds, uint16_t aMaxIntervalCeilingSeconds, @@ -159,7 +159,7 @@ namespace detail { template struct ReportEventParams : public app::ReadPrepareParams { - ReportEventParams(SessionHandle sessionHandle) : app::ReadPrepareParams(sessionHandle) { mKeepSubscriptions = false; } + ReportEventParams(const SessionHandle & sessionHandle) : app::ReadPrepareParams(sessionHandle) { mKeepSubscriptions = false; } typename TypedReadEventCallback::OnSuccessCallbackType mOnReportCb; typename TypedReadEventCallback::OnErrorCallbackType mOnErrorCb; typename TypedReadEventCallback::OnSubscriptionEstablishedCallbackType mOnSubscriptionEstablishedCb = @@ -174,7 +174,6 @@ CHIP_ERROR ReportEvent(Messaging::ExchangeManager * apExchangeMgr, EndpointId en ClusterId clusterId = DecodableEventType::GetClusterId(); EventId eventId = DecodableEventType::GetEventId(); app::EventPathParams eventPath(endpointId, clusterId, eventId); - app::ReadClient * readClient = nullptr; app::InteractionModelEngine * engine = app::InteractionModelEngine::GetInstance(); CHIP_ERROR err = CHIP_NO_ERROR; @@ -182,6 +181,7 @@ CHIP_ERROR ReportEvent(Messaging::ExchangeManager * apExchangeMgr, EndpointId en readParams.mEventPathParamsListSize = 1; auto onDone = [](app::ReadClient * apReadClient, TypedReadEventCallback * callback) { + chip::Platform::Delete(apReadClient); chip::Platform::Delete(callback); }; @@ -190,14 +190,8 @@ CHIP_ERROR ReportEvent(Messaging::ExchangeManager * apExchangeMgr, EndpointId en VerifyOrReturnError(callback != nullptr, CHIP_ERROR_NO_MEMORY); - ReturnErrorOnFailure(engine->NewReadClient(&readClient, readParams.mReportType, callback.get())); - - err = readClient->SendRequest(readParams); - if (err != CHIP_NO_ERROR) - { - readClient->Shutdown(); - return err; - } + auto readClient = chip::Platform::MakeUnique(engine, apExchangeMgr, *callback.get(), readParams.mReportType); + ReturnErrorOnFailure(readClient->SendRequest(readParams)); // // At this point, we'll get a callback through the OnDone callback above regardless of success or failure @@ -205,6 +199,8 @@ CHIP_ERROR ReportEvent(Messaging::ExchangeManager * apExchangeMgr, EndpointId en // object now to prevent it from being reclaimed at the end of this scoped block. // callback.release(); + readClient.release(); + return err; } @@ -220,7 +216,7 @@ CHIP_ERROR ReportEvent(Messaging::ExchangeManager * apExchangeMgr, EndpointId en * GetEventId() methods is expected to work. */ template -CHIP_ERROR ReadEvent(Messaging::ExchangeManager * exchangeMgr, const SessionHandle sessionHandle, EndpointId endpointId, +CHIP_ERROR ReadEvent(Messaging::ExchangeManager * exchangeMgr, const SessionHandle & sessionHandle, EndpointId endpointId, typename TypedReadEventCallback::OnSuccessCallbackType onSuccessCb, typename TypedReadEventCallback::OnErrorCallbackType onErrorCb) { @@ -235,7 +231,7 @@ CHIP_ERROR ReadEvent(Messaging::ExchangeManager * exchangeMgr, const SessionHand * similarly to ReadEvent but keeps reporting events as they are emitted. */ template -CHIP_ERROR SubscribeEvent(Messaging::ExchangeManager * exchangeMgr, const SessionHandle sessionHandle, EndpointId endpointId, +CHIP_ERROR SubscribeEvent(Messaging::ExchangeManager * exchangeMgr, const SessionHandle & sessionHandle, EndpointId endpointId, typename TypedReadEventCallback::OnSuccessCallbackType onReportCb, typename TypedReadEventCallback::OnErrorCallbackType onErrorCb, uint16_t minIntervalFloorSeconds, uint16_t maxIntervalCeilingSeconds, diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index e9b5a0110138dc..a53c4fdcb2fa37 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -107,7 +107,7 @@ CHIP_ERROR SetUpCodePairer::StopConnectOverBle() CHIP_ERROR SetUpCodePairer::StartDiscoverOverIP(uint16_t discriminator, bool isShort) { #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD - currentFilter.type = isShort ? Dnssd::DiscoveryFilterType::kShort : Dnssd::DiscoveryFilterType::kLong; + currentFilter.type = isShort ? Dnssd::DiscoveryFilterType::kShortDiscriminator : Dnssd::DiscoveryFilterType::kLongDiscriminator; currentFilter.code = discriminator; return mCommissioner->DiscoverCommissionableNodes(currentFilter); #else @@ -166,9 +166,9 @@ bool SetUpCodePairer::NodeMatchesCurrentFilter(const Dnssd::DiscoveredNodeData & { switch (currentFilter.type) { - case Dnssd::DiscoveryFilterType::kShort: + case Dnssd::DiscoveryFilterType::kShortDiscriminator: return ((nodeData.longDiscriminator >> 8) & 0x0F) == currentFilter.code; - case Dnssd::DiscoveryFilterType::kLong: + case Dnssd::DiscoveryFilterType::kLongDiscriminator: return nodeData.longDiscriminator == currentFilter.code; default: return false; diff --git a/src/controller/WriteInteraction.h b/src/controller/WriteInteraction.h index 59c49761484135..a79d820616f954 100644 --- a/src/controller/WriteInteraction.h +++ b/src/controller/WriteInteraction.h @@ -95,8 +95,8 @@ class WriteCallback final : public app::WriteClient::Callback * with a small number of instantiations (one per type). */ template -CHIP_ERROR WriteAttribute(SessionHandle sessionHandle, chip::EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, - const AttrType & requestData, WriteCallback::OnSuccessCallbackType onSuccessCb, +CHIP_ERROR WriteAttribute(const SessionHandle & sessionHandle, chip::EndpointId endpointId, ClusterId clusterId, + AttributeId attributeId, const AttrType & requestData, WriteCallback::OnSuccessCallbackType onSuccessCb, WriteCallback::OnErrorCallbackType onErrorCb, const Optional & aTimedWriteTimeoutMs, WriteCallback::OnDoneCallbackType onDoneCb = nullptr) { @@ -106,6 +106,11 @@ CHIP_ERROR WriteAttribute(SessionHandle sessionHandle, chip::EndpointId endpoint VerifyOrReturnError(callback != nullptr, CHIP_ERROR_NO_MEMORY); ReturnErrorOnFailure(app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, callback.get(), aTimedWriteTimeoutMs)); + + // At this point the handle will ensure our callback's OnDone is always + // called. + callback.release(); + if (sessionHandle.IsGroupSession()) { ReturnErrorOnFailure( @@ -119,12 +124,11 @@ CHIP_ERROR WriteAttribute(SessionHandle sessionHandle, chip::EndpointId endpoint ReturnErrorOnFailure(handle.SendWriteRequest(sessionHandle)); - callback.release(); return CHIP_NO_ERROR; } template -CHIP_ERROR WriteAttribute(SessionHandle sessionHandle, chip::EndpointId endpointId, +CHIP_ERROR WriteAttribute(const SessionHandle & sessionHandle, chip::EndpointId endpointId, const typename AttributeInfo::Type & requestData, WriteCallback::OnSuccessCallbackType onSuccessCb, WriteCallback::OnErrorCallbackType onErrorCb, const Optional & aTimedWriteTimeoutMs, WriteCallback::OnDoneCallbackType onDoneCb = nullptr) @@ -134,7 +138,7 @@ CHIP_ERROR WriteAttribute(SessionHandle sessionHandle, chip::EndpointId endpoint } template -CHIP_ERROR WriteAttribute(SessionHandle sessionHandle, chip::EndpointId endpointId, +CHIP_ERROR WriteAttribute(const SessionHandle & sessionHandle, chip::EndpointId endpointId, const typename AttributeInfo::Type & requestData, WriteCallback::OnSuccessCallbackType onSuccessCb, WriteCallback::OnErrorCallbackType onErrorCb, uint16_t aTimedWriteTimeoutMs, WriteCallback::OnDoneCallbackType onDoneCb = nullptr) @@ -144,7 +148,7 @@ CHIP_ERROR WriteAttribute(SessionHandle sessionHandle, chip::EndpointId endpoint } template = 0> -CHIP_ERROR WriteAttribute(SessionHandle sessionHandle, chip::EndpointId endpointId, +CHIP_ERROR WriteAttribute(const SessionHandle & sessionHandle, chip::EndpointId endpointId, const typename AttributeInfo::Type & requestData, WriteCallback::OnSuccessCallbackType onSuccessCb, WriteCallback::OnErrorCallbackType onErrorCb, WriteCallback::OnDoneCallbackType onDoneCb = nullptr) { diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index cd2ee0e48eb350..4b93e00304b3b4 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -2232,7 +2232,7 @@ }, { "name": "ApplyUpdateRequest", - "code": 1, + "code": 2, "mfgCode": null, "source": "client", "incoming": 0, @@ -2240,7 +2240,7 @@ }, { "name": "NotifyUpdateApplied", - "code": 2, + "code": 4, "mfgCode": null, "source": "client", "incoming": 0, @@ -2248,6 +2248,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -2275,7 +2290,7 @@ "commands": [ { "name": "QueryImageResponse", - "code": 3, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -2283,7 +2298,7 @@ }, { "name": "ApplyUpdateResponse", - "code": 4, + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -2336,11 +2351,26 @@ "code": 0, "mfgCode": null, "source": "client", - "incoming": 0, + "incoming": 1, "outgoing": 1 } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -2368,35 +2398,65 @@ "commands": [], "attributes": [ { - "name": "default ota provider", + "name": "DefaultOtaProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", "code": 1, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "update possible", + "name": "UpdateState", "code": 2, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -6112,7 +6172,40 @@ "define": "GROUP_KEY_MANAGEMENT_CLUSTER", "side": "client", "enabled": 1, - "commands": [], + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], "attributes": [ { "name": "ClusterRevision", @@ -6138,15 +6231,32 @@ "define": "GROUP_KEY_MANAGEMENT_CLUSTER", "side": "server", "enabled": 0, - "commands": [], + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], "attributes": [ { - "name": "groups", + "name": "groupKeyMap", "code": 0, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -6156,12 +6266,12 @@ "reportableChange": 0 }, { - "name": "group keys", + "name": "groupTable", "code": 1, "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -6170,6 +6280,36 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "maxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "maxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -10560,6 +10700,21 @@ "enabled": 1, "commands": [], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -10634,15 +10789,15 @@ ] }, { - "name": "TV Channel", + "name": "Channel", "code": 1284, "mfgCode": null, - "define": "TV_CHANNEL_CLUSTER", + "define": "CHANNEL_CLUSTER", "side": "client", "enabled": 1, "commands": [ { - "name": "ChangeChannel", + "name": "ChangeChannelRequest", "code": 0, "mfgCode": null, "source": "client", @@ -10650,16 +10805,16 @@ "outgoing": 1 }, { - "name": "ChangeChannelByNumber", - "code": 1, + "name": "ChangeChannelByNumberRequest", + "code": 2, "mfgCode": null, "source": "client", "incoming": 0, "outgoing": 1 }, { - "name": "SkipChannel", - "code": 2, + "name": "SkipChannelRequest", + "code": 3, "mfgCode": null, "source": "client", "incoming": 0, @@ -10685,16 +10840,16 @@ ] }, { - "name": "TV Channel", + "name": "Channel", "code": 1284, "mfgCode": null, - "define": "TV_CHANNEL_CLUSTER", + "define": "CHANNEL_CLUSTER", "side": "server", "enabled": 0, "commands": [ { "name": "ChangeChannelResponse", - "code": 0, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -10788,7 +10943,7 @@ "enabled": 1, "commands": [ { - "name": "NavigateTarget", + "name": "NavigateTargetRequest", "code": 0, "mfgCode": null, "source": "client", @@ -10797,6 +10952,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -10824,7 +10994,7 @@ "commands": [ { "name": "NavigateTargetResponse", - "code": 0, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -10857,7 +11027,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x00", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -10877,6 +11047,21 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -10903,7 +11088,7 @@ "enabled": 1, "commands": [ { - "name": "MediaPlay", + "name": "PlayRequest", "code": 0, "mfgCode": null, "source": "client", @@ -10911,7 +11096,7 @@ "outgoing": 1 }, { - "name": "MediaPause", + "name": "PauseRequest", "code": 1, "mfgCode": null, "source": "client", @@ -10919,7 +11104,7 @@ "outgoing": 1 }, { - "name": "MediaStop", + "name": "StopRequest", "code": 2, "mfgCode": null, "source": "client", @@ -10927,7 +11112,7 @@ "outgoing": 1 }, { - "name": "MediaStartOver", + "name": "StartOverRequest", "code": 3, "mfgCode": null, "source": "client", @@ -10935,7 +11120,7 @@ "outgoing": 1 }, { - "name": "MediaPrevious", + "name": "PreviousRequest", "code": 4, "mfgCode": null, "source": "client", @@ -10943,7 +11128,7 @@ "outgoing": 1 }, { - "name": "MediaNext", + "name": "NextRequest", "code": 5, "mfgCode": null, "source": "client", @@ -10951,7 +11136,7 @@ "outgoing": 1 }, { - "name": "MediaRewind", + "name": "RewindRequest", "code": 6, "mfgCode": null, "source": "client", @@ -10959,7 +11144,7 @@ "outgoing": 1 }, { - "name": "MediaFastForward", + "name": "FastForwardRequest", "code": 7, "mfgCode": null, "source": "client", @@ -10967,7 +11152,7 @@ "outgoing": 1 }, { - "name": "MediaSkipForward", + "name": "SkipForwardRequest", "code": 8, "mfgCode": null, "source": "client", @@ -10975,7 +11160,7 @@ "outgoing": 1 }, { - "name": "MediaSkipBackward", + "name": "SkipBackwardRequest", "code": 9, "mfgCode": null, "source": "client", @@ -10983,8 +11168,8 @@ "outgoing": 1 }, { - "name": "MediaSeek", - "code": 10, + "name": "SeekRequest", + "code": 11, "mfgCode": null, "source": "client", "incoming": 0, @@ -10992,6 +11177,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11018,113 +11218,33 @@ "enabled": 0, "commands": [ { - "name": "MediaPlayResponse", - "code": 0, + "name": "PlaybackResponse", + "code": 10, "mfgCode": null, "source": "server", "incoming": 1, "outgoing": 0 - }, + } + ], + "attributes": [ { - "name": "MediaPauseResponse", - "code": 1, + "name": "playback state", + "code": 0, "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 }, { - "name": "MediaStopResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaStartOverResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaPreviousResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaNextResponse", - "code": 5, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaRewindResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaFastForwardResponse", - "code": 7, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaSkipForwardResponse", - "code": 8, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaSkipBackwardResponse", - "code": 9, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MediaSeekResponse", - "code": 11, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "playback state", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "start time", - "code": 1, + "name": "start time", + "code": 1, "mfgCode": null, "side": "server", "included": 1, @@ -11227,6 +11347,21 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11253,7 +11388,7 @@ "enabled": 1, "commands": [ { - "name": "SelectInput", + "name": "SelectInputRequest", "code": 0, "mfgCode": null, "source": "client", @@ -11261,7 +11396,7 @@ "outgoing": 1 }, { - "name": "ShowInputStatus", + "name": "ShowInputStatusRequest", "code": 1, "mfgCode": null, "source": "client", @@ -11269,7 +11404,7 @@ "outgoing": 1 }, { - "name": "HideInputStatus", + "name": "HideInputStatusRequest", "code": 2, "mfgCode": null, "source": "client", @@ -11277,7 +11412,7 @@ "outgoing": 1 }, { - "name": "RenameInput", + "name": "RenameInputRequest", "code": 3, "mfgCode": null, "source": "client", @@ -11286,6 +11421,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11357,6 +11507,21 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11392,6 +11557,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11459,7 +11639,7 @@ "enabled": 1, "commands": [ { - "name": "SendKey", + "name": "SendKeyRequest", "code": 0, "mfgCode": null, "source": "client", @@ -11468,6 +11648,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11495,7 +11690,7 @@ "commands": [ { "name": "SendKeyResponse", - "code": 0, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -11544,7 +11739,7 @@ "enabled": 1, "commands": [ { - "name": "LaunchContent", + "name": "LaunchContentRequest", "code": 0, "mfgCode": null, "source": "client", @@ -11552,7 +11747,7 @@ "outgoing": 1 }, { - "name": "LaunchURL", + "name": "LaunchURLRequest", "code": 1, "mfgCode": null, "source": "client", @@ -11561,6 +11756,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11587,16 +11797,8 @@ "enabled": 0, "commands": [ { - "name": "LaunchContentResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "LaunchURLResponse", - "code": 1, + "name": "LaunchResponse", + "code": 2, "mfgCode": null, "source": "server", "incoming": 1, @@ -11605,7 +11807,7 @@ ], "attributes": [ { - "name": "accepts header list", + "name": "accept header list", "code": 0, "mfgCode": null, "side": "server", @@ -11675,7 +11877,7 @@ "enabled": 1, "commands": [ { - "name": "SelectOutput", + "name": "SelectOutputRequest", "code": 0, "mfgCode": null, "source": "client", @@ -11683,7 +11885,7 @@ "outgoing": 1 }, { - "name": "RenameOutput", + "name": "RenameOutputRequest", "code": 1, "mfgCode": null, "source": "client", @@ -11692,6 +11894,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11789,7 +12006,7 @@ "enabled": 1, "commands": [ { - "name": "LaunchApp", + "name": "LaunchAppRequest", "code": 0, "mfgCode": null, "source": "client", @@ -11797,7 +12014,7 @@ "outgoing": 1 }, { - "name": "StopApp", + "name": "StopAppRequest", "code": 1, "mfgCode": null, "source": "client", @@ -11805,7 +12022,7 @@ "outgoing": 1 }, { - "name": "HideApp", + "name": "HideAppRequest", "code": 2, "mfgCode": null, "source": "client", @@ -11814,6 +12031,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11840,24 +12072,8 @@ "enabled": 0, "commands": [ { - "name": "LaunchAppResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StopAppResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "HideAppResponse", - "code": 2, + "name": "LauncherResponse", + "code": 3, "mfgCode": null, "source": "server", "incoming": 1, @@ -11910,6 +12126,21 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11934,17 +12165,23 @@ "define": "APPLICATION_BASIC_CLUSTER", "side": "client", "enabled": 1, - "commands": [ + "commands": [], + "attributes": [ { - "name": "ChangeStatus", - "code": 0, + "name": "FeatureMap", + "code": 65532, "mfgCode": null, - "source": "client", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12076,6 +12313,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "allowed vendor list", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AttributeList", "code": 65531, @@ -12117,7 +12369,7 @@ "enabled": 1, "commands": [ { - "name": "GetSetupPIN", + "name": "GetSetupPINRequest", "code": 0, "mfgCode": null, "source": "client", @@ -12125,16 +12377,16 @@ "outgoing": 1 }, { - "name": "Login", - "code": 1, + "name": "LoginRequest", + "code": 2, "mfgCode": null, "source": "client", "incoming": 0, "outgoing": 1 }, { - "name": "Logout", - "code": 2, + "name": "LogoutRequest", + "code": 3, "mfgCode": null, "source": "client", "incoming": 0, @@ -12142,6 +12394,21 @@ } ], "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -12169,7 +12436,7 @@ "commands": [ { "name": "GetSetupPINResponse", - "code": 0, + "code": 1, "mfgCode": null, "source": "server", "incoming": 1, @@ -12994,7 +13261,7 @@ "reportableChange": 0 }, { - "name": "struct", + "name": "struct_attr", "code": 37, "mfgCode": null, "side": "server", diff --git a/src/controller/java/AndroidCallbacks.cpp b/src/controller/java/AndroidCallbacks.cpp index d4b844a6b04a22..33a5b9578dc044 100644 --- a/src/controller/java/AndroidCallbacks.cpp +++ b/src/controller/java/AndroidCallbacks.cpp @@ -65,7 +65,7 @@ void GetConnectedDeviceCallback::OnDeviceConnectedFn(void * context, Operational env->CallVoidMethod(javaCallback, successMethod, reinterpret_cast(device)); } -void GetConnectedDeviceCallback::OnDeviceConnectionFailureFn(void * context, NodeId nodeId, CHIP_ERROR error) +void GetConnectedDeviceCallback::OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); auto * self = static_cast(context); @@ -92,5 +92,5 @@ void GetConnectedDeviceCallback::OnDeviceConnectionFailureFn(void * context, Nod jmethodID exceptionConstructor = env->GetMethodID(controllerExceptionCls, "", "(ILjava/lang/String;)V"); jobject exception = env->NewObject(controllerExceptionCls, exceptionConstructor, error, env->NewStringUTF(ErrorStr(error))); - env->CallVoidMethod(javaCallback, failureMethod, nodeId, exception); + env->CallVoidMethod(javaCallback, failureMethod, peerId.GetNodeId(), exception); } diff --git a/src/controller/java/AndroidCallbacks.h b/src/controller/java/AndroidCallbacks.h index 9691e77f5fd770..3ccdacc198eb39 100644 --- a/src/controller/java/AndroidCallbacks.h +++ b/src/controller/java/AndroidCallbacks.h @@ -29,7 +29,7 @@ struct GetConnectedDeviceCallback ~GetConnectedDeviceCallback(); static void OnDeviceConnectedFn(void * context, OperationalDeviceProxy * device); - static void OnDeviceConnectionFailureFn(void * context, NodeId nodeId, CHIP_ERROR error); + static void OnDeviceConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error); Callback::Callback mOnSuccess; Callback::Callback mOnFailure; diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index b194804831c081..49acd3e06b92de 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -131,7 +131,7 @@ CHIP_ERROR AndroidDeviceControllerWrapper::GenerateNOCChain(const ByteSpan & csr } VerifyOrReturnError(reader.GetType() == kTLVType_Structure, CHIP_ERROR_WRONG_TLV_TYPE); - VerifyOrReturnError(reader.GetTag() == AnonymousTag, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrReturnError(reader.GetTag() == AnonymousTag(), CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); TLVType containerType; ReturnErrorOnFailure(reader.EnterContainer(containerType)); diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index 144d091e4a943e..f5bc93df478426 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -334,6 +334,13 @@ JNI_METHOD(void, shutdownSubscriptions)(JNIEnv * env, jobject self, jlong handle chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); + + // + // We should move away from this model of shutting down subscriptions in this manner and instead, + // have Java own the ReadClient objects directly and manage their lifetimes. + // + // #13163 tracks this issue. + // device->ShutdownSubscriptions(); } diff --git a/src/controller/java/templates/CHIPClusters-JNI.zapt b/src/controller/java/templates/CHIPClusters-JNI.zapt index bc4867ec2d1825..ef79115b3c2e99 100644 --- a/src/controller/java/templates/CHIPClusters-JNI.zapt +++ b/src/controller/java/templates/CHIPClusters-JNI.zapt @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -125,38 +126,34 @@ JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase na JNI_METHOD(void, {{asCamelCased ../name false}}Cluster, subscribe{{asCamelCased name false}}Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); + {{~#*inline "callbackName"~}} + {{~#if_in_global_responses~}} + CHIP{{chipCallback.name}}AttributeCallback + {{~else~}} + CHIP{{asCamelCased parent.name false}}{{asCamelCased name false}}AttributeCallback + {{~/if_in_global_responses~}} + {{~/inline}} + + std::unique_ptr<{{>callbackName}}, void (*)({{>callbackName}} *)> onSuccess(Platform::New<{{>callbackName}}>(callback, true), chip::Platform::Delete<{{>callbackName}}>); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure(Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure(Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; {{asCamelCased ../name false}}Cluster * cppCluster = reinterpret_cast<{{asCamelCased ../name false}}Cluster *>(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttribute{{asCamelCased name false}}(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), static_cast(maxInterval), {{>callbackName}}::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, {{asCamelCased ../name false}}Cluster, report{{asCamelCased name false}}Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport(Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - {{asCamelCased ../name false}}Cluster * cppCluster = reinterpret_cast<{{asCamelCased ../name false}}Cluster *>(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttribute{{asCamelCased name false}}(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} {{/unless}} {{/if}} {{/unless}} diff --git a/src/controller/java/templates/CHIPReadCallbacks-src.zapt b/src/controller/java/templates/CHIPReadCallbacks-src.zapt index d7c33c21f61a58..d103662136f3ee 100644 --- a/src/controller/java/templates/CHIPReadCallbacks-src.zapt +++ b/src/controller/java/templates/CHIPReadCallbacks-src.zapt @@ -4,9 +4,9 @@ #include +#include #include #include -#include #include #include diff --git a/src/controller/java/templates/CHIPReadCallbacks.zapt b/src/controller/java/templates/CHIPReadCallbacks.zapt index af0f4163ded96f..93212260740cd7 100644 --- a/src/controller/java/templates/CHIPReadCallbacks.zapt +++ b/src/controller/java/templates/CHIPReadCallbacks.zapt @@ -2,7 +2,10 @@ {{#if (chip_has_client_clusters)}} #include "CHIPCallbackTypes.h" +#include #include +#include +#include #include {{#chip_server_global_responses}} @@ -21,6 +24,10 @@ public: } static void CallbackFn(void * context, {{chipCallback.type}} value); + static void OnSubscriptionEstablished(void * context) { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -49,6 +56,10 @@ public: } static void CallbackFn(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} {{#if isList}}list{{else}}value{{/if}}); + static void OnSubscriptionEstablished(void * context) { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished(reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; diff --git a/src/controller/java/templates/ChipClusters-java.zapt b/src/controller/java/templates/ChipClusters-java.zapt index 298b64052546a1..7d330d4eb30e70 100644 --- a/src/controller/java/templates/ChipClusters-java.zapt +++ b/src/controller/java/templates/ChipClusters-java.zapt @@ -19,37 +19,44 @@ public class ChipClusters { /** Indicates a successful read for a CHAR_STRING attribute. */ void onSuccess(String value); void onError(Exception error); + default void onSubscriptionEstablished() {} } public interface OctetStringAttributeCallback { /** Indicates a successful read for an OCTET_STRING attribute. */ void onSuccess(byte[] value); void onError(Exception error); + default void onSubscriptionEstablished() {} } public interface IntegerAttributeCallback { void onSuccess(int value); void onError(Exception error); + default void onSubscriptionEstablished() {} } public interface LongAttributeCallback { void onSuccess(long value); void onError(Exception error); + default void onSubscriptionEstablished() {} } public interface BooleanAttributeCallback { void onSuccess(boolean value); void onError(Exception error); + default void onSubscriptionEstablished() {} } public interface FloatAttributeCallback { void onSuccess(float value); void onError(Exception error); + default void onSubscriptionEstablished() {} } public interface DoubleAttributeCallback { void onSuccess(double value); void onError(Exception error); + default void onSubscriptionEstablished() {} } public static abstract class BaseChipCluster { @@ -207,11 +214,13 @@ public class ChipClusters { public interface {{asUpperCamelCase name}}AttributeCallback { void onSuccess(List<{{#>list_attribute_callback_type}}{{/list_attribute_callback_type}}> valueList); void onError(Exception ex); + default void onSubscriptionEstablished() {} } {{else}} public interface {{asUpperCamelCase name}}AttributeCallback { void onSuccess({{#>list_attribute_callback_type}}{{/list_attribute_callback_type}} value); void onError(Exception ex); + default void onSubscriptionEstablished() {} } {{/if}} {{/if_in_global_responses}} @@ -241,13 +250,15 @@ public class ChipClusters { {{/if}} {{#if isReportableAttribute}} {{#unless isList}} - public void subscribe{{asCamelCased name false}}Attribute(DefaultClusterCallback callback, int minInterval, int maxInterval) { + public void subscribe{{asCamelCased name false}}Attribute( + {{#if_in_global_responses}} + {{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback callback + {{else}} + {{asUpperCamelCase name}}AttributeCallback callback + {{/if_in_global_responses}}, + int minInterval, int maxInterval) { subscribe{{asCamelCased name false}}Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - - public void report{{asCamelCased name false}}Attribute({{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback callback) { - report{{asCamelCased name false}}Attribute(chipClusterPtr, callback); - } {{/unless}} {{/if}} {{/unless}} @@ -272,9 +283,12 @@ public class ChipClusters { {{/if}} {{#if isReportableAttribute}} {{#unless isList}} - private native void subscribe{{asCamelCased name false}}Attribute(long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void report{{asCamelCased name false}}Attribute(long chipClusterPtr, {{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback callback); + private native void subscribe{{asCamelCased name false}}Attribute(long chipClusterPtr, + {{#if_in_global_responses}} + {{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback callback + {{else}} + {{asUpperCamelCase name}}AttributeCallback callback + {{/if_in_global_responses}}, int minInterval, int maxInterval); {{/unless}} {{/if}} {{/unless}} diff --git a/src/controller/java/templates/ClusterInfo-java.zapt b/src/controller/java/templates/ClusterInfo-java.zapt index 7440c4188c51b4..f2b5a8e1590e49 100644 --- a/src/controller/java/templates/ClusterInfo-java.zapt +++ b/src/controller/java/templates/ClusterInfo-java.zapt @@ -255,7 +255,7 @@ public class ClusterInfoMapping { {{#if (isOctetString type)}} CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); {{else if (isCharString type)}} - // Add String field here after ByteSpan is properly emitted in C++ layer + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); {{else}} {{! NOTE: asJavaBasicTypeForZclType does not handle isArray well, so add an inline partial to force isArray to false when we want the diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 30ed8dc34d05b5..3fc0d5c6385238 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -64,16 +64,14 @@ typedef void (*CHIPApplicationBasicClusterApplicationStatusAttributeCallbackType void *, chip::app::Clusters::ApplicationBasic::Attributes::ApplicationStatus::TypeInfo::DecodableArgType); typedef void (*CHIPApplicationBasicClusterApplicationVersionAttributeCallbackType)( void *, chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType); +typedef void (*CHIPApplicationBasicClusterAllowedVendorListAttributeCallbackType)( + void *, const chip::app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::TypeInfo::DecodableType &); typedef void (*CHIPApplicationBasicClusterAttributeListAttributeCallbackType)( void *, const chip::app::Clusters::ApplicationBasic::Attributes::AttributeList::TypeInfo::DecodableType &); typedef void (*CHIPApplicationBasicClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::ApplicationBasic::Attributes::ClusterRevision::TypeInfo::DecodableArgType); -typedef void (*CHIPApplicationLauncherClusterHideAppResponseCallbackType)( - void *, const chip::app::Clusters::ApplicationLauncher::Commands::HideAppResponse::DecodableType &); -typedef void (*CHIPApplicationLauncherClusterLaunchAppResponseCallbackType)( - void *, const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType &); -typedef void (*CHIPApplicationLauncherClusterStopAppResponseCallbackType)( - void *, const chip::app::Clusters::ApplicationLauncher::Commands::StopAppResponse::DecodableType &); +typedef void (*CHIPApplicationLauncherClusterLauncherResponseCallbackType)( + void *, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType &); typedef void (*CHIPApplicationLauncherClusterApplicationLauncherListAttributeCallbackType)( void *, const chip::app::Clusters::ApplicationLauncher::Attributes::ApplicationLauncherList::TypeInfo::DecodableType &); @@ -185,6 +183,15 @@ typedef void (*CHIPBridgedDeviceBasicClusterAttributeListAttributeCallbackType)( void *, const chip::app::Clusters::BridgedDeviceBasic::Attributes::AttributeList::TypeInfo::DecodableType &); typedef void (*CHIPBridgedDeviceBasicClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::BridgedDeviceBasic::Attributes::ClusterRevision::TypeInfo::DecodableArgType); +typedef void (*CHIPChannelClusterChangeChannelResponseCallbackType)( + void *, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType &); + +typedef void (*CHIPChannelClusterChannelListAttributeCallbackType)( + void *, const chip::app::Clusters::Channel::Attributes::ChannelList::TypeInfo::DecodableType &); +typedef void (*CHIPChannelClusterAttributeListAttributeCallbackType)( + void *, const chip::app::Clusters::Channel::Attributes::AttributeList::TypeInfo::DecodableType &); +typedef void (*CHIPChannelClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::Channel::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPColorControlClusterCurrentHueAttributeCallbackType)( void *, chip::app::Clusters::ColorControl::Attributes::CurrentHue::TypeInfo::DecodableArgType); @@ -294,13 +301,11 @@ typedef void (*CHIPColorControlClusterAttributeListAttributeCallbackType)( void *, const chip::app::Clusters::ColorControl::Attributes::AttributeList::TypeInfo::DecodableType &); typedef void (*CHIPColorControlClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::ColorControl::Attributes::ClusterRevision::TypeInfo::DecodableArgType); -typedef void (*CHIPContentLauncherClusterLaunchContentResponseCallbackType)( - void *, const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType &); -typedef void (*CHIPContentLauncherClusterLaunchURLResponseCallbackType)( - void *, const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType &); +typedef void (*CHIPContentLauncherClusterLaunchResponseCallbackType)( + void *, const chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::DecodableType &); -typedef void (*CHIPContentLauncherClusterAcceptsHeaderListAttributeCallbackType)( - void *, const chip::app::Clusters::ContentLauncher::Attributes::AcceptsHeaderList::TypeInfo::DecodableType &); +typedef void (*CHIPContentLauncherClusterAcceptHeaderListAttributeCallbackType)( + void *, const chip::app::Clusters::ContentLauncher::Attributes::AcceptHeaderList::TypeInfo::DecodableType &); typedef void (*CHIPContentLauncherClusterSupportedStreamingProtocolsAttributeCallbackType)( void *, chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableArgType); typedef void (*CHIPContentLauncherClusterAttributeListAttributeCallbackType)( @@ -480,11 +485,19 @@ typedef void (*CHIPGeneralDiagnosticsClusterAttributeListAttributeCallbackType)( void *, const chip::app::Clusters::GeneralDiagnostics::Attributes::AttributeList::TypeInfo::DecodableType &); typedef void (*CHIPGeneralDiagnosticsClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo::DecodableArgType); +typedef void (*CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterKeySetReadResponseCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &); -typedef void (*CHIPGroupKeyManagementClusterGroupsAttributeCallbackType)( - void *, const chip::app::Clusters::GroupKeyManagement::Attributes::Groups::TypeInfo::DecodableType &); -typedef void (*CHIPGroupKeyManagementClusterGroupKeysAttributeCallbackType)( - void *, const chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeys::TypeInfo::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterGroupKeyMapAttributeCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterGroupTableAttributeCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Attributes::GroupTable::TypeInfo::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterMaxGroupsPerFabricAttributeCallbackType)( + void *, chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo::DecodableArgType); +typedef void (*CHIPGroupKeyManagementClusterMaxGroupKeysPerFabricAttributeCallbackType)( + void *, chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo::DecodableArgType); typedef void (*CHIPGroupKeyManagementClusterAttributeListAttributeCallbackType)( void *, const chip::app::Clusters::GroupKeyManagement::Attributes::AttributeList::TypeInfo::DecodableType &); typedef void (*CHIPGroupKeyManagementClusterClusterRevisionAttributeCallbackType)( @@ -584,28 +597,8 @@ typedef void (*CHIPMediaInputClusterAttributeListAttributeCallbackType)( void *, const chip::app::Clusters::MediaInput::Attributes::AttributeList::TypeInfo::DecodableType &); typedef void (*CHIPMediaInputClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::MediaInput::Attributes::ClusterRevision::TypeInfo::DecodableArgType); -typedef void (*CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaNextResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaPauseResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaPlayResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaPreviousResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaRewindResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaSeekResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaStartOverResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaStopResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterPlaybackResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType &); typedef void (*CHIPMediaPlaybackClusterPlaybackStateAttributeCallbackType)( void *, chip::app::Clusters::MediaPlayback::Attributes::PlaybackState::TypeInfo::DecodableArgType); @@ -675,10 +668,14 @@ typedef void (*CHIPOtaSoftwareUpdateProviderClusterAttributeListAttributeCallbac typedef void (*CHIPOtaSoftwareUpdateProviderClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::ClusterRevision::TypeInfo::DecodableArgType); -typedef void (*CHIPOtaSoftwareUpdateRequestorClusterDefaultOtaProviderAttributeCallbackType)( - void *, chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::TypeInfo::DecodableArgType); +typedef void (*CHIPOtaSoftwareUpdateRequestorClusterDefaultOtaProvidersAttributeCallbackType)( + void *, const chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProviders::TypeInfo::DecodableType &); typedef void (*CHIPOtaSoftwareUpdateRequestorClusterUpdatePossibleAttributeCallbackType)( void *, chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::TypeInfo::DecodableArgType); +typedef void (*CHIPOtaSoftwareUpdateRequestorClusterUpdateStateAttributeCallbackType)( + void *, chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateState::TypeInfo::DecodableArgType); +typedef void (*CHIPOtaSoftwareUpdateRequestorClusterUpdateStateProgressAttributeCallbackType)( + void *, chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo::DecodableArgType); typedef void (*CHIPOtaSoftwareUpdateRequestorClusterAttributeListAttributeCallbackType)( void *, const chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::AttributeList::TypeInfo::DecodableType &); typedef void (*CHIPOtaSoftwareUpdateRequestorClusterClusterRevisionAttributeCallbackType)( @@ -909,15 +906,6 @@ typedef void (*CHIPSwitchClusterFeatureMapAttributeCallbackType)( void *, chip::app::Clusters::Switch::Attributes::FeatureMap::TypeInfo::DecodableArgType); typedef void (*CHIPSwitchClusterClusterRevisionAttributeCallbackType)( void *, chip::app::Clusters::Switch::Attributes::ClusterRevision::TypeInfo::DecodableArgType); -typedef void (*CHIPTvChannelClusterChangeChannelResponseCallbackType)( - void *, const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType &); - -typedef void (*CHIPTvChannelClusterChannelListAttributeCallbackType)( - void *, const chip::app::Clusters::TvChannel::Attributes::ChannelList::TypeInfo::DecodableType &); -typedef void (*CHIPTvChannelClusterAttributeListAttributeCallbackType)( - void *, const chip::app::Clusters::TvChannel::Attributes::AttributeList::TypeInfo::DecodableType &); -typedef void (*CHIPTvChannelClusterClusterRevisionAttributeCallbackType)( - void *, chip::app::Clusters::TvChannel::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPTargetNavigatorClusterNavigateTargetResponseCallbackType)( void *, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &); diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 49665acc0a27f3..291208fb681d2a 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -67,14 +68,14 @@ JNI_METHOD(jlong, AccountLoginCluster, initWithDevice)(JNIEnv * env, jobject sel return reinterpret_cast(cppCluster); } -JNI_METHOD(void, AccountLoginCluster, getSetupPIN) +JNI_METHOD(void, AccountLoginCluster, getSetupPINRequest) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring tempAccountIdentifier) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; AccountLoginCluster * cppCluster; - chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type request; + chip::app::Clusters::AccountLogin::Commands::GetSetupPINRequest::Type request; request.tempAccountIdentifier = chip::JniUtfString(env, static_cast(tempAccountIdentifier)).charSpan(); @@ -100,7 +101,7 @@ JNI_METHOD(void, AccountLoginCluster, getSetupPIN) chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, 10000); VerifyOrReturn(err == CHIP_NO_ERROR, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", CHIP_ERROR_INCORRECT_STATE)); @@ -108,14 +109,14 @@ JNI_METHOD(void, AccountLoginCluster, getSetupPIN) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, AccountLoginCluster, login) +JNI_METHOD(void, AccountLoginCluster, loginRequest) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring tempAccountIdentifier, jstring setupPIN) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; AccountLoginCluster * cppCluster; - chip::app::Clusters::AccountLogin::Commands::Login::Type request; + chip::app::Clusters::AccountLogin::Commands::LoginRequest::Type request; request.tempAccountIdentifier = chip::JniUtfString(env, static_cast(tempAccountIdentifier)).charSpan(); request.setupPIN = chip::JniUtfString(env, static_cast(setupPIN)).charSpan(); @@ -147,13 +148,13 @@ JNI_METHOD(void, AccountLoginCluster, login) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, AccountLoginCluster, logout)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, AccountLoginCluster, logoutRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; AccountLoginCluster * cppCluster; - chip::app::Clusters::AccountLogin::Commands::Logout::Type request; + chip::app::Clusters::AccountLogin::Commands::LogoutRequest::Type request; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -174,7 +175,7 @@ JNI_METHOD(void, AccountLoginCluster, logout)(JNIEnv * env, jobject self, jlong auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, 10000); VerifyOrReturn(err == CHIP_NO_ERROR, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", CHIP_ERROR_INCORRECT_STATE)); @@ -186,14 +187,14 @@ JNI_METHOD(void, AccountLoginCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -204,8 +205,14 @@ JNI_METHOD(void, AccountLoginCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::AccountLogin::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -213,30 +220,6 @@ JNI_METHOD(void, AccountLoginCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, AccountLoginCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - AccountLoginCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, AdministratorCommissioningCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -372,14 +355,14 @@ JNI_METHOD(void, AdministratorCommissioningCluster, subscribeClusterRevisionAttr (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -390,8 +373,15 @@ JNI_METHOD(void, AdministratorCommissioningCluster, subscribeClusterRevisionAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::AdministratorCommissioning::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -399,30 +389,6 @@ JNI_METHOD(void, AdministratorCommissioningCluster, subscribeClusterRevisionAttr onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, AdministratorCommissioningCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - AdministratorCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, ApplicationBasicCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -432,56 +398,18 @@ JNI_METHOD(jlong, ApplicationBasicCluster, initWithDevice)(JNIEnv * env, jobject return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ApplicationBasicCluster, changeStatus) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject status) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationBasicCluster * cppCluster; - - chip::app::Clusters::ApplicationBasic::Commands::ChangeStatus::Type request; - - request.status = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(status)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} JNI_METHOD(void, ApplicationBasicCluster, subscribeVendorNameAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -492,8 +420,14 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeVendorNameAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -501,41 +435,18 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeVendorNameAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ApplicationBasicCluster, reportVendorNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeVendorName(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, ApplicationBasicCluster, subscribeVendorIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -546,8 +457,14 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeVendorIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::VendorId::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -555,41 +472,18 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeVendorIdAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ApplicationBasicCluster, reportVendorIdAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeVendorId(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, ApplicationBasicCluster, subscribeApplicationNameAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -600,8 +494,14 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeApplicationNameAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeApplicationName(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -609,42 +509,18 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeApplicationNameAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ApplicationBasicCluster, reportApplicationNameAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeApplicationName(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, ApplicationBasicCluster, subscribeProductIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -655,8 +531,14 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeProductIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeProductId(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::ProductId::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -664,41 +546,18 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeProductIdAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ApplicationBasicCluster, reportProductIdAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeProductId(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, ApplicationBasicCluster, subscribeApplicationStatusAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -709,8 +568,14 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeApplicationStatusAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeApplicationStatus(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::ApplicationStatus::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -718,42 +583,18 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeApplicationStatusAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ApplicationBasicCluster, reportApplicationStatusAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeApplicationStatus(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, ApplicationBasicCluster, subscribeApplicationVersionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -764,8 +605,14 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeApplicationVersionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeApplicationVersion(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -773,42 +620,18 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeApplicationVersionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ApplicationBasicCluster, reportApplicationVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeApplicationVersion(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, ApplicationBasicCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -819,8 +642,14 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -828,30 +657,6 @@ JNI_METHOD(void, ApplicationBasicCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ApplicationBasicCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, ApplicationLauncherCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -861,21 +666,21 @@ JNI_METHOD(jlong, ApplicationLauncherCluster, initWithDevice)(JNIEnv * env, jobj return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ApplicationLauncherCluster, hideApp) +JNI_METHOD(void, ApplicationLauncherCluster, hideAppRequest) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject catalogVendorId, jstring applicationId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ApplicationLauncherCluster * cppCluster; - chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type request; + chip::app::Clusters::ApplicationLauncher::Commands::HideAppRequest::Type request; - request.application = chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApp::Type(); + request.application = chip::app::Clusters::ApplicationLauncher::Structs::Application::Type(); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -891,7 +696,7 @@ JNI_METHOD(void, ApplicationLauncherCluster, hideApp) env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -902,22 +707,22 @@ JNI_METHOD(void, ApplicationLauncherCluster, hideApp) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ApplicationLauncherCluster, launchApp) +JNI_METHOD(void, ApplicationLauncherCluster, launchAppRequest) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring data, jobject catalogVendorId, jstring applicationId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ApplicationLauncherCluster * cppCluster; - chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type request; + chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppRequest::Type request; request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); - request.application = chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApp::Type(); + request.application = chip::app::Clusters::ApplicationLauncher::Structs::Application::Type(); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -933,7 +738,7 @@ JNI_METHOD(void, ApplicationLauncherCluster, launchApp) env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -944,21 +749,21 @@ JNI_METHOD(void, ApplicationLauncherCluster, launchApp) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ApplicationLauncherCluster, stopApp) +JNI_METHOD(void, ApplicationLauncherCluster, stopAppRequest) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject catalogVendorId, jstring applicationId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; ApplicationLauncherCluster * cppCluster; - chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type request; + chip::app::Clusters::ApplicationLauncher::Commands::StopAppRequest::Type request; - request.application = chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApp::Type(); + request.application = chip::app::Clusters::ApplicationLauncher::Structs::Application::Type(); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -974,7 +779,7 @@ JNI_METHOD(void, ApplicationLauncherCluster, stopApp) env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -989,14 +794,14 @@ JNI_METHOD(void, ApplicationLauncherCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1007,8 +812,14 @@ JNI_METHOD(void, ApplicationLauncherCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ApplicationLauncher::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1016,30 +827,6 @@ JNI_METHOD(void, ApplicationLauncherCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ApplicationLauncherCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ApplicationLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, AudioOutputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -1049,14 +836,14 @@ JNI_METHOD(jlong, AudioOutputCluster, initWithDevice)(JNIEnv * env, jobject self return reinterpret_cast(cppCluster); } -JNI_METHOD(void, AudioOutputCluster, renameOutput) +JNI_METHOD(void, AudioOutputCluster, renameOutputRequest) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index, jstring name) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; AudioOutputCluster * cppCluster; - chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type request; + chip::app::Clusters::AudioOutput::Commands::RenameOutputRequest::Type request; request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); request.name = chip::JniUtfString(env, static_cast(name)).charSpan(); @@ -1088,13 +875,14 @@ JNI_METHOD(void, AudioOutputCluster, renameOutput) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, AudioOutputCluster, selectOutput)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index) +JNI_METHOD(void, AudioOutputCluster, selectOutputRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; AudioOutputCluster * cppCluster; - chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type request; + chip::app::Clusters::AudioOutput::Commands::SelectOutputRequest::Type request; request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); @@ -1129,14 +917,14 @@ JNI_METHOD(void, AudioOutputCluster, subscribeCurrentAudioOutputAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1147,8 +935,14 @@ JNI_METHOD(void, AudioOutputCluster, subscribeCurrentAudioOutputAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentAudioOutput(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::AudioOutput::Attributes::CurrentAudioOutput::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1156,42 +950,18 @@ JNI_METHOD(void, AudioOutputCluster, subscribeCurrentAudioOutputAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, AudioOutputCluster, reportCurrentAudioOutputAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - AudioOutputCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCurrentAudioOutput(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, AudioOutputCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1202,8 +972,14 @@ JNI_METHOD(void, AudioOutputCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::AudioOutput::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1211,29 +987,6 @@ JNI_METHOD(void, AudioOutputCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, AudioOutputCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - AudioOutputCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, BarrierControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -1321,14 +1074,14 @@ JNI_METHOD(void, BarrierControlCluster, subscribeBarrierMovingStateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1339,8 +1092,14 @@ JNI_METHOD(void, BarrierControlCluster, subscribeBarrierMovingStateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBarrierMovingState(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BarrierControl::Attributes::BarrierMovingState::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1348,42 +1107,18 @@ JNI_METHOD(void, BarrierControlCluster, subscribeBarrierMovingStateAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BarrierControlCluster, reportBarrierMovingStateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BarrierControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeBarrierMovingState(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BarrierControlCluster, subscribeBarrierSafetyStatusAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1394,8 +1129,14 @@ JNI_METHOD(void, BarrierControlCluster, subscribeBarrierSafetyStatusAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBarrierSafetyStatus(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BarrierControl::Attributes::BarrierSafetyStatus::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1403,42 +1144,18 @@ JNI_METHOD(void, BarrierControlCluster, subscribeBarrierSafetyStatusAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BarrierControlCluster, reportBarrierSafetyStatusAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BarrierControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeBarrierSafetyStatus(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BarrierControlCluster, subscribeBarrierCapabilitiesAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1449,8 +1166,14 @@ JNI_METHOD(void, BarrierControlCluster, subscribeBarrierCapabilitiesAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBarrierCapabilities(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BarrierControl::Attributes::BarrierCapabilities::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1458,42 +1181,18 @@ JNI_METHOD(void, BarrierControlCluster, subscribeBarrierCapabilitiesAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BarrierControlCluster, reportBarrierCapabilitiesAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BarrierControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeBarrierCapabilities(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BarrierControlCluster, subscribeBarrierPositionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1504,8 +1203,14 @@ JNI_METHOD(void, BarrierControlCluster, subscribeBarrierPositionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBarrierPosition(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BarrierControl::Attributes::BarrierPosition::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1513,42 +1218,18 @@ JNI_METHOD(void, BarrierControlCluster, subscribeBarrierPositionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BarrierControlCluster, reportBarrierPositionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BarrierControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeBarrierPosition(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BarrierControlCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1559,8 +1240,14 @@ JNI_METHOD(void, BarrierControlCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BarrierControl::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1568,30 +1255,6 @@ JNI_METHOD(void, BarrierControlCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BarrierControlCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BarrierControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, BasicCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -1640,14 +1303,14 @@ JNI_METHOD(void, BasicCluster, subscribeInteractionModelVersionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1658,8 +1321,14 @@ JNI_METHOD(void, BasicCluster, subscribeInteractionModelVersionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInteractionModelVersion( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::InteractionModelVersion::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1667,42 +1336,18 @@ JNI_METHOD(void, BasicCluster, subscribeInteractionModelVersionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportInteractionModelVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeInteractionModelVersion(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeVendorNameAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1713,8 +1358,13 @@ JNI_METHOD(void, BasicCluster, subscribeVendorNameAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::VendorName::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1722,41 +1372,18 @@ JNI_METHOD(void, BasicCluster, subscribeVendorNameAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportVendorNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeVendorName(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeVendorIDAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1767,8 +1394,13 @@ JNI_METHOD(void, BasicCluster, subscribeVendorIDAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::VendorID::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1776,41 +1408,18 @@ JNI_METHOD(void, BasicCluster, subscribeVendorIDAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportVendorIDAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeVendorID(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeProductNameAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1821,8 +1430,14 @@ JNI_METHOD(void, BasicCluster, subscribeProductNameAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeProductName(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::ProductName::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1830,41 +1445,18 @@ JNI_METHOD(void, BasicCluster, subscribeProductNameAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportProductNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeProductName(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeProductIDAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1875,8 +1467,13 @@ JNI_METHOD(void, BasicCluster, subscribeProductIDAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeProductID(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::ProductID::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1885,29 +1482,6 @@ JNI_METHOD(void, BasicCluster, subscribeProductIDAttribute) onFailure.release(); } -JNI_METHOD(void, BasicCluster, reportProductIDAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeProductID(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - JNI_METHOD(void, BasicCluster, writeNodeLabelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { @@ -1949,14 +1523,14 @@ JNI_METHOD(void, BasicCluster, subscribeNodeLabelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -1967,8 +1541,13 @@ JNI_METHOD(void, BasicCluster, subscribeNodeLabelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNodeLabel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::NodeLabel::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -1977,29 +1556,6 @@ JNI_METHOD(void, BasicCluster, subscribeNodeLabelAttribute) onFailure.release(); } -JNI_METHOD(void, BasicCluster, reportNodeLabelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNodeLabel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - JNI_METHOD(void, BasicCluster, writeLocationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { @@ -2041,14 +1597,14 @@ JNI_METHOD(void, BasicCluster, subscribeLocationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2059,8 +1615,13 @@ JNI_METHOD(void, BasicCluster, subscribeLocationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeLocation(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::Location::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2068,41 +1629,18 @@ JNI_METHOD(void, BasicCluster, subscribeLocationAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportLocationAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeLocation(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeHardwareVersionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2113,8 +1651,14 @@ JNI_METHOD(void, BasicCluster, subscribeHardwareVersionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::HardwareVersion::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2122,41 +1666,18 @@ JNI_METHOD(void, BasicCluster, subscribeHardwareVersionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportHardwareVersionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeHardwareVersion(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeHardwareVersionStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2167,8 +1688,14 @@ JNI_METHOD(void, BasicCluster, subscribeHardwareVersionStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeHardwareVersionString( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::HardwareVersionString::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2176,41 +1703,18 @@ JNI_METHOD(void, BasicCluster, subscribeHardwareVersionStringAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportHardwareVersionStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeHardwareVersionString(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeSoftwareVersionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2221,8 +1725,14 @@ JNI_METHOD(void, BasicCluster, subscribeSoftwareVersionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::SoftwareVersion::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2230,41 +1740,18 @@ JNI_METHOD(void, BasicCluster, subscribeSoftwareVersionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportSoftwareVersionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSoftwareVersion(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeSoftwareVersionStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2275,8 +1762,14 @@ JNI_METHOD(void, BasicCluster, subscribeSoftwareVersionStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSoftwareVersionString( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::SoftwareVersionString::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2284,41 +1777,18 @@ JNI_METHOD(void, BasicCluster, subscribeSoftwareVersionStringAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportSoftwareVersionStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSoftwareVersionString(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeManufacturingDateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2329,8 +1799,14 @@ JNI_METHOD(void, BasicCluster, subscribeManufacturingDateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeManufacturingDate(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::ManufacturingDate::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2338,41 +1814,18 @@ JNI_METHOD(void, BasicCluster, subscribeManufacturingDateAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportManufacturingDateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeManufacturingDate(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribePartNumberAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2383,8 +1836,13 @@ JNI_METHOD(void, BasicCluster, subscribePartNumberAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePartNumber(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::PartNumber::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2392,41 +1850,18 @@ JNI_METHOD(void, BasicCluster, subscribePartNumberAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportPartNumberAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributePartNumber(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeProductURLAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2437,8 +1872,13 @@ JNI_METHOD(void, BasicCluster, subscribeProductURLAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeProductURL(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::ProductURL::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2446,41 +1886,18 @@ JNI_METHOD(void, BasicCluster, subscribeProductURLAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportProductURLAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeProductURL(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeProductLabelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2491,8 +1908,14 @@ JNI_METHOD(void, BasicCluster, subscribeProductLabelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeProductLabel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::ProductLabel::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2500,41 +1923,18 @@ JNI_METHOD(void, BasicCluster, subscribeProductLabelAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportProductLabelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeProductLabel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BasicCluster, subscribeSerialNumberAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2545,8 +1945,14 @@ JNI_METHOD(void, BasicCluster, subscribeSerialNumberAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSerialNumber(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::SerialNumber::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2555,29 +1961,6 @@ JNI_METHOD(void, BasicCluster, subscribeSerialNumberAttribute) onFailure.release(); } -JNI_METHOD(void, BasicCluster, reportSerialNumberAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSerialNumber(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - JNI_METHOD(void, BasicCluster, writeLocalConfigDisabledAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { @@ -2619,14 +2002,14 @@ JNI_METHOD(void, BasicCluster, subscribeLocalConfigDisabledAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2637,8 +2020,14 @@ JNI_METHOD(void, BasicCluster, subscribeLocalConfigDisabledAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeLocalConfigDisabled(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::LocalConfigDisabled::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2646,15 +2035,21 @@ JNI_METHOD(void, BasicCluster, subscribeLocalConfigDisabledAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportLocalConfigDisabledAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, BasicCluster, subscribeReachableAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; BasicCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -2662,25 +2057,32 @@ JNI_METHOD(void, BasicCluster, reportLocalConfigDisabledAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeLocalConfigDisabled(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Basic::Attributes::Reachable::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, BasicCluster, subscribeReachableAttribute) +JNI_METHOD(void, BasicCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2691,62 +2093,14 @@ JNI_METHOD(void, BasicCluster, subscribeReachableAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeReachable(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, BasicCluster, reportReachableAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeReachable(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, BasicCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::Basic::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2754,29 +2108,6 @@ JNI_METHOD(void, BasicCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BasicCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, BinaryInputBasicCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -2827,14 +2158,14 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribeOutOfServiceAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2845,8 +2176,14 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribeOutOfServiceAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOutOfService(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::OutOfService::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2855,30 +2192,6 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribeOutOfServiceAttribute) onFailure.release(); } -JNI_METHOD(void, BinaryInputBasicCluster, reportOutOfServiceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BinaryInputBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOutOfService(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - JNI_METHOD(void, BinaryInputBasicCluster, writePresentValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { @@ -2920,14 +2233,14 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribePresentValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2938,8 +2251,14 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribePresentValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePresentValue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::PresentValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -2947,42 +2266,18 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribePresentValueAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BinaryInputBasicCluster, reportPresentValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BinaryInputBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributePresentValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BinaryInputBasicCluster, subscribeStatusFlagsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -2993,8 +2288,14 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribeStatusFlagsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeStatusFlags(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::StatusFlags::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -3002,42 +2303,18 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribeStatusFlagsAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BinaryInputBasicCluster, reportStatusFlagsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BinaryInputBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeStatusFlags(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BinaryInputBasicCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -3048,8 +2325,14 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -3057,30 +2340,6 @@ JNI_METHOD(void, BinaryInputBasicCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BinaryInputBasicCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BinaryInputBasicCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, BindingCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -3180,14 +2439,14 @@ JNI_METHOD(void, BindingCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -3198,8 +2457,14 @@ JNI_METHOD(void, BindingCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Binding::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -3207,29 +2472,6 @@ JNI_METHOD(void, BindingCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BindingCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BindingCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, BooleanStateCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -3243,14 +2485,14 @@ JNI_METHOD(void, BooleanStateCluster, subscribeStateValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -3261,8 +2503,14 @@ JNI_METHOD(void, BooleanStateCluster, subscribeStateValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeStateValue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BooleanState::Attributes::StateValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -3270,41 +2518,18 @@ JNI_METHOD(void, BooleanStateCluster, subscribeStateValueAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BooleanStateCluster, reportStateValueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BooleanStateCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeStateValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BooleanStateCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -3315,8 +2540,14 @@ JNI_METHOD(void, BooleanStateCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BooleanState::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -3324,30 +2555,6 @@ JNI_METHOD(void, BooleanStateCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BooleanStateCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BooleanStateCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, BridgedActionsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -3859,14 +3066,14 @@ JNI_METHOD(void, BridgedActionsCluster, subscribeSetupUrlAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -3877,8 +3084,14 @@ JNI_METHOD(void, BridgedActionsCluster, subscribeSetupUrlAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSetupUrl(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BridgedActions::Attributes::SetupUrl::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -3886,41 +3099,18 @@ JNI_METHOD(void, BridgedActionsCluster, subscribeSetupUrlAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BridgedActionsCluster, reportSetupUrlAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedActionsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSetupUrl(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, BridgedActionsCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -3931,8 +3121,14 @@ JNI_METHOD(void, BridgedActionsCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BridgedActions::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -3940,30 +3136,6 @@ JNI_METHOD(void, BridgedActionsCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, BridgedActionsCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedActionsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(jlong, BridgedDeviceBasicCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; @@ -3977,14 +3149,14 @@ JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -3995,8 +3167,14 @@ JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::BridgedDeviceBasic::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -4004,29 +3182,169 @@ JNI_METHOD(void, BridgedDeviceBasicCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, ChannelCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + ChannelCluster * cppCluster = new ChannelCluster(); -JNI_METHOD(void, BridgedDeviceBasicCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, ChannelCluster, changeChannelByNumberRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject majorNumber, jobject minorNumber) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + ChannelCluster * cppCluster; + + chip::app::Clusters::Channel::Commands::ChangeChannelByNumberRequest::Type request; + + request.majorNumber = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(majorNumber)); + request.minorNumber = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(minorNumber)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, ChannelCluster, changeChannelRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring match) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + ChannelCluster * cppCluster; + + chip::app::Clusters::Channel::Commands::ChangeChannelRequest::Type request; + + request.match = chip::JniUtfString(env, static_cast(match)).charSpan(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, ChannelCluster, skipChannelRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject count) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + ChannelCluster * cppCluster; + + chip::app::Clusters::Channel::Commands::SkipChannelRequest::Type request; + + request.count = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(count)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, ChannelCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - BridgedDeviceBasicCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ChannelCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Channel::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } JNI_METHOD(jlong, ColorControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { @@ -4914,14 +4232,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeCurrentHueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -4932,8 +4250,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeCurrentHueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CurrentHue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -4941,15 +4265,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeCurrentHueAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportCurrentHueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeCurrentSaturationAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -4957,25 +4287,33 @@ JNI_METHOD(void, ColorControlCluster, reportCurrentHueAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeCurrentHue(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CurrentSaturation::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeCurrentSaturationAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeRemainingTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -4986,8 +4324,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeCurrentSaturationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentSaturation(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::RemainingTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -4995,16 +4339,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeCurrentSaturationAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportCurrentSaturationAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeCurrentXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5012,25 +4361,33 @@ JNI_METHOD(void, ColorControlCluster, reportCurrentSaturationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeCurrentSaturation(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CurrentX::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeRemainingTimeAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeCurrentYAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5041,8 +4398,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeRemainingTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CurrentY::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5050,15 +4413,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeRemainingTimeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportRemainingTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeDriftCompensationAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5066,25 +4435,33 @@ JNI_METHOD(void, ColorControlCluster, reportRemainingTimeAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRemainingTime(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::DriftCompensation::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeCurrentXAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeCompensationTextAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5095,8 +4472,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeCurrentXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CompensationText::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5104,15 +4487,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeCurrentXAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportCurrentXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorTemperatureAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5120,25 +4509,33 @@ JNI_METHOD(void, ColorControlCluster, reportCurrentXAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeCurrentX(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorTemperature::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeCurrentYAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5149,8 +4546,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeCurrentYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5159,32 +4562,15 @@ JNI_METHOD(void, ColorControlCluster, subscribeCurrentYAttribute) onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, reportCurrentYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, writeColorControlOptionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorControlOptions::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeCurrentY(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeDriftCompensationAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -5203,25 +4589,31 @@ JNI_METHOD(void, ColorControlCluster, subscribeDriftCompensationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeDriftCompensation(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportDriftCompensationAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorControlOptionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5229,25 +4621,33 @@ JNI_METHOD(void, ColorControlCluster, reportDriftCompensationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeDriftCompensation(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorControlOptions::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeCompensationTextAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeNumberOfPrimariesAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5258,8 +4658,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeCompensationTextAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCompensationText(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::NumberOfPrimaries::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5267,16 +4673,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeCompensationTextAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportCompensationTextAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribePrimary1XAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5284,25 +4695,33 @@ JNI_METHOD(void, ColorControlCluster, reportCompensationTextAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeCompensationText(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary1X::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorTemperatureAttribute) +JNI_METHOD(void, ColorControlCluster, subscribePrimary1YAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5313,8 +4732,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorTemperatureAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeColorTemperature(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary1Y::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5322,16 +4747,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorTemperatureAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorTemperatureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribePrimary1IntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5339,25 +4769,33 @@ JNI_METHOD(void, ColorControlCluster, reportColorTemperatureAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeColorTemperature(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary1Intensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorModeAttribute) +JNI_METHOD(void, ColorControlCluster, subscribePrimary2XAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5368,8 +4806,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeColorMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary2X::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5377,15 +4821,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorModeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribePrimary2YAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5393,31 +4843,33 @@ JNI_METHOD(void, ColorControlCluster, reportColorModeAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeColorMode(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary2Y::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeColorControlOptionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ColorControlCluster, subscribePrimary2IntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorControlOptions::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5428,28 +4880,33 @@ JNI_METHOD(void, ColorControlCluster, writeColorControlOptionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary2Intensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorControlOptionsAttribute) +JNI_METHOD(void, ColorControlCluster, subscribePrimary3XAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5460,8 +4917,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorControlOptionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary3X::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5469,16 +4932,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorControlOptionsAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorControlOptionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribePrimary3YAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5486,25 +4954,33 @@ JNI_METHOD(void, ColorControlCluster, reportColorControlOptionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeColorControlOptions(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary3Y::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeNumberOfPrimariesAttribute) +JNI_METHOD(void, ColorControlCluster, subscribePrimary3IntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5515,8 +4991,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeNumberOfPrimariesAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNumberOfPrimaries(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary3Intensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5524,16 +5006,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeNumberOfPrimariesAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportNumberOfPrimariesAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribePrimary4XAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5541,25 +5028,33 @@ JNI_METHOD(void, ColorControlCluster, reportNumberOfPrimariesAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeNumberOfPrimaries(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary4X::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary1XAttribute) +JNI_METHOD(void, ColorControlCluster, subscribePrimary4YAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5570,8 +5065,14 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary1XAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary1X(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary4Y::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5579,15 +5080,21 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary1XAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary1XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribePrimary4IntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5595,25 +5102,33 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary1XAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary1X(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary4Intensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary1YAttribute) +JNI_METHOD(void, ColorControlCluster, subscribePrimary5XAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5624,8 +5139,14 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary1YAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary1Y(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary5X::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5633,15 +5154,21 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary1YAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary1YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribePrimary5YAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5649,25 +5176,33 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary1YAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary1Y(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary5Y::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary1IntensityAttribute) +JNI_METHOD(void, ColorControlCluster, subscribePrimary5IntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5678,8 +5213,14 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary1IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary1Intensity(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary5Intensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5687,16 +5228,21 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary1IntensityAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary1IntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribePrimary6XAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5704,25 +5250,33 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary1IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary1Intensity(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary6X::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary2XAttribute) +JNI_METHOD(void, ColorControlCluster, subscribePrimary6YAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -5733,8 +5287,14 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary2XAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary2X(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary6Y::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -5742,15 +5302,21 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary2XAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary2XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribePrimary6IntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5758,17 +5324,31 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary2XAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary2X(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary6Intensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary2YAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ColorControlCluster, writeWhitePointXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -5787,24 +5367,31 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary2YAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary2Y(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary2YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeWhitePointXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5812,17 +5399,31 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary2YAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary2Y(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointX::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary2IntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ColorControlCluster, writeWhitePointYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -5841,25 +5442,31 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary2IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary2Intensity(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary2IntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeWhitePointYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5867,17 +5474,31 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary2IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary2Intensity(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointY::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary3XAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ColorControlCluster, writeColorPointRXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -5896,24 +5517,31 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary3XAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary3X(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary3XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointRXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5921,17 +5549,31 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary3XAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary3X(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRX::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary3YAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ColorControlCluster, writeColorPointRYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -5950,24 +5592,31 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary3YAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary3Y(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary3YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointRYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -5975,17 +5624,31 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary3YAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary3Y(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRY::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary3IntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ColorControlCluster, writeColorPointRIntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6004,25 +5667,31 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary3IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary3Intensity(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary3IntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointRIntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -6030,17 +5699,31 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary3IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary3Intensity(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary4XAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ColorControlCluster, writeColorPointGXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6059,24 +5742,31 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary4XAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary4X(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary4XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointGXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -6084,17 +5774,31 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary4XAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary4X(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGX::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary4YAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ColorControlCluster, writeColorPointGYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6113,42 +5817,63 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary4YAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary4Y(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary4YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointGYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary4Y(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGY::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary4IntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ColorControlCluster, writeColorPointGIntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6167,51 +5892,28 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary4IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary4Intensity(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary4IntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributePrimary4Intensity(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribePrimary5XAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointGIntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6222,8 +5924,14 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary5XAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary5X(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6232,32 +5940,15 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary5XAttribute) onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, reportPrimary5XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, writeColorPointBXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBX::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributePrimary5X(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribePrimary5YAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6276,24 +5967,31 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary5YAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary5Y(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary5YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointBXAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -6301,17 +5999,31 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary5YAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary5Y(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBX::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary5IntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ColorControlCluster, writeColorPointBYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6330,25 +6042,31 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary5IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary5Intensity(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary5IntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointBYAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -6356,17 +6074,31 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary5IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary5Intensity(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBY::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary6XAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ColorControlCluster, writeColorPointBIntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6385,24 +6117,31 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary6XAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary6X(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary6XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorPointBIntensityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -6410,25 +6149,33 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary6XAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary6X(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary6YAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeEnhancedCurrentHueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6439,8 +6186,14 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary6YAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary6Y(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::EnhancedCurrentHue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6448,15 +6201,21 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary6YAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary6YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeEnhancedColorModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -6464,25 +6223,33 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary6YAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary6Y(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::EnhancedColorMode::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribePrimary6IntensityAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorLoopActiveAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6493,8 +6260,14 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary6IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePrimary6Intensity(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopActive::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6502,16 +6275,21 @@ JNI_METHOD(void, ColorControlCluster, subscribePrimary6IntensityAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportPrimary6IntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeColorLoopDirectionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -6519,31 +6297,33 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary6IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePrimary6Intensity(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopDirection::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, writeWhitePointXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ColorControlCluster, subscribeColorLoopTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointX::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6554,28 +6334,33 @@ JNI_METHOD(void, ColorControlCluster, writeWhitePointXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeWhitePointXAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorLoopStartEnhancedHueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6586,8 +6371,15 @@ JNI_METHOD(void, ColorControlCluster, subscribeWhitePointXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopStartEnhancedHue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6595,47 +6387,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeWhitePointXAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportWhitePointXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeWhitePointX(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ColorControlCluster, writeWhitePointYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ColorControlCluster, subscribeColorLoopStoredEnhancedHueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointY::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6646,28 +6409,34 @@ JNI_METHOD(void, ColorControlCluster, writeWhitePointYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopStoredEnhancedHue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeWhitePointYAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorCapabilitiesAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6678,8 +6447,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeWhitePointYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorCapabilities::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6687,47 +6462,18 @@ JNI_METHOD(void, ColorControlCluster, subscribeWhitePointYAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportWhitePointYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeWhitePointY(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ColorControlCluster, writeColorPointRXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ColorControlCluster, subscribeColorTempPhysicalMinAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRX::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6738,28 +6484,33 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointRXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMin::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointRXAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeColorTempPhysicalMaxAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6770,8 +6521,14 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointRXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMax::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6779,15 +6536,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointRXAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorPointRXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeCoupleColorTempToLevelMinMiredsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -6795,19 +6558,28 @@ JNI_METHOD(void, ColorControlCluster, reportColorPointRXAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeColorPointRX(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, writeColorPointRYAttribute) +JNI_METHOD(void, ColorControlCluster, writeStartUpColorTemperatureMiredsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRY::TypeInfo; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; TypeInfo::Type cppValue; cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); @@ -6840,18 +6612,18 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointRYAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointRYAttribute) +JNI_METHOD(void, ColorControlCluster, subscribeStartUpColorTemperatureMiredsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -6862,8 +6634,15 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointRYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -6871,15 +6650,21 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointRYAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorPointRYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ColorControlCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -6887,115 +6672,124 @@ JNI_METHOD(void, ColorControlCluster, reportColorPointRYAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeColorPointRY(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(jlong, ContentLauncherCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + ContentLauncherCluster * cppCluster = new ContentLauncherCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ColorControlCluster, writeColorPointRIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ContentLauncherCluster, launchContentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject autoPlay, jstring data, jobject parameterList) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + ContentLauncherCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::ContentLauncher::Commands::LaunchContentRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.autoPlay = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(autoPlay)); + request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); + request.search = chip::app::DataModel::List(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointRIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ContentLauncherCluster, launchURLRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring contentURL, jstring displayString, jstring providerName, + jobject background, jobject logo, jobject progressBar, jobject splash, jobject waterMark) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ContentLauncherCluster * cppCluster; + + chip::app::Clusters::ContentLauncher::Commands::LaunchURLRequest::Type request; + + request.contentURL = chip::JniUtfString(env, static_cast(contentURL)).charSpan(); + request.displayString = chip::JniUtfString(env, static_cast(displayString)).charSpan(); + request.brandingInformation = chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::Type(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeColorPointRIntensity( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, reportColorPointRIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorPointRIntensity(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ColorControlCluster, writeColorPointGXAttribute) +JNI_METHOD(void, ContentLauncherCluster, writeSupportedStreamingProtocolsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGX::TypeInfo; + using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -7009,8 +6803,8 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointGXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -7025,30 +6819,37 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointGXAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointGXAttribute) +JNI_METHOD(void, ContentLauncherCluster, subscribeSupportedStreamingProtocolsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, + CHIP_ERROR err = CHIP_NO_ERROR; + ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -7056,91 +6857,82 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointGXAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorPointGXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorPointGX(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ColorControlCluster, writeColorPointGYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ContentLauncherCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGY::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointGYAttribute) +JNI_METHOD(jlong, DescriptorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + DescriptorCluster * cppCluster = new DescriptorCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, DescriptorCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DescriptorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Descriptor::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -7148,8721 +6940,378 @@ JNI_METHOD(void, ColorControlCluster, subscribeColorPointGYAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorPointGYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, DiagnosticLogsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorPointGY(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + DiagnosticLogsCluster * cppCluster = new DiagnosticLogsCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ColorControlCluster, writeColorPointGIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, DiagnosticLogsCluster, retrieveLogsRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject intent, jobject requestedProtocol, + jbyteArray transferFileDesignator) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + DiagnosticLogsCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.intent = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(intent)); + request.requestedProtocol = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(requestedProtocol)); + request.transferFileDesignator = chip::JniByteArray(env, static_cast(transferFileDesignator)).byteSpan(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeColorPointGIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeColorPointGIntensity( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorPointGIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, DoorLockCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorPointGIntensity(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + DoorLockCluster * cppCluster = new DoorLockCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ColorControlCluster, writeColorPointBXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, DoorLockCluster, clearCredential) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject credentialType, jobject credentialIndex) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBX::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::DoorLock::Commands::ClearCredential::Type request; + + request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointBXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, DoorLockCluster, clearUser)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userIndex) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; + + chip::app::Clusters::DoorLock::Commands::ClearUser::Type request; + + request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorPointBXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorPointBX(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ColorControlCluster, writeColorPointBYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, DoorLockCluster, getCredentialStatus) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject credentialType, jobject credentialIndex) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBY::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointBYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, DoorLockCluster, getUser)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userIndex) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; + + chip::app::Clusters::DoorLock::Commands::GetUser::Type request; + request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); + + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorPointBYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, DoorLockCluster, lockDoor)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject pinCode) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorPointBY(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; -JNI_METHOD(void, ColorControlCluster, writeColorPointBIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::TypeInfo; - TypeInfo::Type cppValue; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type request; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::JniReferences::GetInstance().GetOptionalValue(pinCode, pinCode); + request.pinCode = chip::Optional(chip::JniByteArray(env, static_cast(pinCode)).byteSpan()); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ColorControlCluster, subscribeColorPointBIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, DoorLockCluster, setCredential) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject operationType, jobject credentialType, + jobject credentialIndex, jbyteArray credentialData, jobject userIndex, jobject userStatus) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; + + chip::app::Clusters::DoorLock::Commands::SetCredential::Type request; + + request.operationType = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(operationType)); + request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); + request.credentialData = chip::JniByteArray(env, static_cast(credentialData)).byteSpan(); + request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); + request.userStatus = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userStatus)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeColorPointBIntensity( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ColorControlCluster, reportColorPointBIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, DoorLockCluster, setUser) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject operationType, jobject userIndex, jstring userName, + jobject userUniqueId, jobject userStatus, jobject userType, jobject credentialRule) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::DoorLock::Commands::SetUser::Type request; - err = cppCluster->ReportAttributeColorPointBIntensity(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.operationType = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(operationType)); + request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); + chip::CharSpan userNameValue; + if (userName != nullptr) + { + userNameValue = chip::JniUtfString(env, static_cast(userName)).charSpan(); + } + request.userName = userName == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(userNameValue); + uint32_t userUniqueIdValue; + if (userUniqueId != nullptr) + { + userUniqueIdValue = chip::JniReferences::GetInstance().LongToPrimitive(userUniqueId); + } + request.userUniqueId = userUniqueId == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(userUniqueIdValue); + request.userStatus = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userStatus)); + request.userType = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userType)); + request.credentialRule = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(credentialRule)); - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeEnhancedCurrentHueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeEnhancedCurrentHue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportEnhancedCurrentHueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeEnhancedCurrentHue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeEnhancedColorModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeEnhancedColorMode(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportEnhancedColorModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeEnhancedColorMode(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeColorLoopActiveAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeColorLoopActive(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportColorLoopActiveAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorLoopActive(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeColorLoopDirectionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeColorLoopDirection(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportColorLoopDirectionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorLoopDirection(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeColorLoopTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeColorLoopTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportColorLoopTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorLoopTime(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeColorLoopStartEnhancedHueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeColorLoopStartEnhancedHue( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportColorLoopStartEnhancedHueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorLoopStartEnhancedHue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeColorLoopStoredEnhancedHueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeColorLoopStoredEnhancedHue( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportColorLoopStoredEnhancedHueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorLoopStoredEnhancedHue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeColorCapabilitiesAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeColorCapabilities(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportColorCapabilitiesAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorCapabilities(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeColorTempPhysicalMinAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeColorTempPhysicalMin( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportColorTempPhysicalMinAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorTempPhysicalMin(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeColorTempPhysicalMaxAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeColorTempPhysicalMax( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportColorTempPhysicalMaxAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeColorTempPhysicalMax(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeCoupleColorTempToLevelMinMiredsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeCoupleColorTempToLevelMinMireds( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportCoupleColorTempToLevelMinMiredsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCoupleColorTempToLevelMinMireds(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ColorControlCluster, writeStartUpColorTemperatureMiredsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeStartUpColorTemperatureMiredsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeStartUpColorTemperatureMireds( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportStartUpColorTemperatureMiredsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeStartUpColorTemperatureMireds(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ColorControlCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ColorControlCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ColorControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, ContentLauncherCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - ContentLauncherCluster * cppCluster = new ContentLauncherCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, ContentLauncherCluster, launchContent) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject autoPlay, jstring data, jobject type, jstring value, - jobject externalIDList) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster; - - chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type request; - - request.autoPlay = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(autoPlay)); - request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); - request.search = - chip::app::DataModel::List(); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ContentLauncherCluster, launchURL) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring contentURL, jstring displayString, jstring providerName, - jobject background, jobject logo, jobject progressBar, jobject splash, jobject waterMark) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster; - - chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type request; - - request.contentURL = chip::JniUtfString(env, static_cast(contentURL)).charSpan(); - request.displayString = chip::JniUtfString(env, static_cast(displayString)).charSpan(); - request.brandingInformation = - chip::app::DataModel::List(); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ContentLauncherCluster, writeSupportedStreamingProtocolsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ContentLauncherCluster, subscribeSupportedStreamingProtocolsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeSupportedStreamingProtocols( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ContentLauncherCluster, reportSupportedStreamingProtocolsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSupportedStreamingProtocols(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ContentLauncherCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ContentLauncherCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ContentLauncherCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, DescriptorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - DescriptorCluster * cppCluster = new DescriptorCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, DescriptorCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DescriptorCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DescriptorCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DescriptorCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, DiagnosticLogsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - DiagnosticLogsCluster * cppCluster = new DiagnosticLogsCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, DiagnosticLogsCluster, retrieveLogsRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject intent, jobject requestedProtocol, - jbyteArray transferFileDesignator) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DiagnosticLogsCluster * cppCluster; - - chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsRequest::Type request; - - request.intent = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(intent)); - request.requestedProtocol = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(requestedProtocol)); - request.transferFileDesignator = chip::JniByteArray(env, static_cast(transferFileDesignator)).byteSpan(); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(jlong, DoorLockCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - DoorLockCluster * cppCluster = new DoorLockCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, DoorLockCluster, clearCredential) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject credentialType, jobject credentialIndex) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::ClearCredential::Type request; - - request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, clearUser)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userIndex) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::ClearUser::Type request; - - request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, getCredentialStatus) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject credentialType, jobject credentialIndex) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type request; - - request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, getUser)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject userIndex) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::GetUser::Type request; - - request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); - - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, lockDoor)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject pinCode) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::LockDoor::Type request; - - chip::JniReferences::GetInstance().GetOptionalValue(pinCode, pinCode); - request.pinCode = chip::Optional(chip::JniByteArray(env, static_cast(pinCode)).byteSpan()); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, setCredential) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject operationType, jobject credentialType, - jobject credentialIndex, jbyteArray credentialData, jobject userIndex, jobject userStatus) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::SetCredential::Type request; - - request.operationType = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(operationType)); - request.credential = chip::app::Clusters::DoorLock::Structs::DlCredential::Type(); - request.credentialData = chip::JniByteArray(env, static_cast(credentialData)).byteSpan(); - request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); - request.userStatus = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userStatus)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, setUser) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject operationType, jobject userIndex, jstring userName, - jobject userUniqueId, jobject userStatus, jobject userType, jobject credentialRule) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::SetUser::Type request; - - request.operationType = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(operationType)); - request.userIndex = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userIndex)); - chip::CharSpan userNameValue; - if (userName != nullptr) - { - userNameValue = chip::JniUtfString(env, static_cast(userName)).charSpan(); - } - request.userName = userName == nullptr ? chip::app::DataModel::Nullable() - : chip::app::DataModel::Nullable(userNameValue); - uint32_t userUniqueIdValue; - if (userUniqueId != nullptr) - { - userUniqueIdValue = chip::JniReferences::GetInstance().LongToPrimitive(userUniqueId); - } - request.userUniqueId = userUniqueId == nullptr ? chip::app::DataModel::Nullable() - : chip::app::DataModel::Nullable(userUniqueIdValue); - request.userStatus = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userStatus)); - request.userType = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(userType)); - request.credentialRule = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(credentialRule)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, unlockDoor)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject pinCode) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster; - - chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type request; - - chip::JniReferences::GetInstance().GetOptionalValue(pinCode, pinCode); - request.pinCode = chip::Optional(chip::JniByteArray(env, static_cast(pinCode)).byteSpan()); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeLockStateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeLockState(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportLockStateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeLockState(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeLockTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeLockType(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportLockTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeLockType(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeActuatorEnabledAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeActuatorEnabled(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportActuatorEnabledAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeActuatorEnabled(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeDoorStateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeDoorState(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportDoorStateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeDoorState(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, DoorLockCluster, writeLanguageAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::Language::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeLanguageAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeLanguage(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportLanguageAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeLanguage(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, DoorLockCluster, writeAutoRelockTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::AutoRelockTime::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeAutoRelockTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeAutoRelockTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportAutoRelockTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeAutoRelockTime(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, DoorLockCluster, writeSoundVolumeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::SoundVolume::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeSoundVolumeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeSoundVolume(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportSoundVolumeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSoundVolume(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, DoorLockCluster, writeOperatingModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::OperatingMode::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeOperatingModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeOperatingMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportOperatingModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOperatingMode(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, DoorLockCluster, writeEnableOneTouchLockingAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeEnableOneTouchLockingAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeEnableOneTouchLocking( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportEnableOneTouchLockingAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeEnableOneTouchLocking(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, DoorLockCluster, writeEnablePrivacyModeButtonAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeEnablePrivacyModeButtonAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeEnablePrivacyModeButton( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportEnablePrivacyModeButtonAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeEnablePrivacyModeButton(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, DoorLockCluster, writeWrongCodeEntryLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeWrongCodeEntryLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeWrongCodeEntryLimit(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportWrongCodeEntryLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeWrongCodeEntryLimit(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, DoorLockCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, DoorLockCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, ElectricalMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - ElectricalMeasurementCluster * cppCluster = new ElectricalMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeMeasurementTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMeasurementType(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportMeasurementTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMeasurementType(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeTotalActivePowerAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeTotalActivePower(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportTotalActivePowerAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTotalActivePower(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeRmsVoltage(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportRmsVoltageAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRmsVoltage(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMinAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeRmsVoltageMin(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportRmsVoltageMinAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRmsVoltageMin(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMaxAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeRmsVoltageMax(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportRmsVoltageMaxAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRmsVoltageMax(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeRmsCurrent(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportRmsCurrentAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRmsCurrent(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMinAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeRmsCurrentMin(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportRmsCurrentMinAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRmsCurrentMin(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMaxAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeRmsCurrentMax(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportRmsCurrentMaxAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRmsCurrentMax(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeActivePower(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportActivePowerAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeActivePower(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMinAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeActivePowerMin(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportActivePowerMinAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeActivePowerMin(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMaxAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeActivePowerMax(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportActivePowerMaxAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeActivePowerMax(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ElectricalMeasurementCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, ElectricalMeasurementCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, EthernetNetworkDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - EthernetNetworkDiagnosticsCluster * cppCluster = new EthernetNetworkDiagnosticsCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, resetCounts)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster; - - chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePHYRateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributePHYRate(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, reportPHYRateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributePHYRate(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeFullDuplexAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeFullDuplex(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, reportFullDuplexAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeFullDuplex(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePacketRxCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributePacketRxCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, reportPacketRxCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributePacketRxCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePacketTxCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributePacketTxCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, reportPacketTxCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributePacketTxCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeTxErrCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeTxErrCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, reportTxErrCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTxErrCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeCollisionCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeCollisionCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, reportCollisionCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCollisionCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeOverrunCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeOverrunCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, reportOverrunCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOverrunCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeCarrierDetectAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeCarrierDetect(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, reportCarrierDetectAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCarrierDetect(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeTimeSinceResetAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeTimeSinceReset(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, reportTimeSinceResetAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTimeSinceReset(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, FixedLabelCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - FixedLabelCluster * cppCluster = new FixedLabelCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, FixedLabelCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FixedLabelCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, FixedLabelCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FixedLabelCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, FlowMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - FlowMeasurementCluster * cppCluster = new FlowMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, FlowMeasurementCluster, subscribeMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, FlowMeasurementCluster, reportMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, FlowMeasurementCluster, subscribeMinMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, FlowMeasurementCluster, reportMinMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMinMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, FlowMeasurementCluster, subscribeMaxMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, FlowMeasurementCluster, reportMaxMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, FlowMeasurementCluster, subscribeToleranceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, FlowMeasurementCluster, reportToleranceAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTolerance(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, FlowMeasurementCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, FlowMeasurementCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, GeneralCommissioningCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - GeneralCommissioningCluster * cppCluster = new GeneralCommissioningCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, GeneralCommissioningCluster, armFailSafe) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject expiryLengthSeconds, jobject breadcrumb, jobject timeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster; - - chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type request; - - request.expiryLengthSeconds = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(expiryLengthSeconds)); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GeneralCommissioningCluster, commissioningComplete)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster; - - chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GeneralCommissioningCluster, setRegulatoryConfig) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject location, jstring countryCode, jobject breadcrumb, - jobject timeoutMs) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster; - - chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type request; - - request.location = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(location)); - request.countryCode = chip::JniUtfString(env, static_cast(countryCode)).charSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GeneralCommissioningCluster, writeBreadcrumbAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GeneralCommissioningCluster, subscribeBreadcrumbAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GeneralCommissioningCluster, reportBreadcrumbAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeBreadcrumb(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, GeneralCommissioningCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GeneralCommissioningCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, GeneralDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - GeneralDiagnosticsCluster * cppCluster = new GeneralDiagnosticsCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeRebootCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeRebootCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GeneralDiagnosticsCluster, reportRebootCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRebootCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeUpTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeUpTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GeneralDiagnosticsCluster, reportUpTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeUpTime(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeTotalOperationalHoursAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeTotalOperationalHours( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GeneralDiagnosticsCluster, reportTotalOperationalHoursAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTotalOperationalHours(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeBootReasonsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeBootReasons(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GeneralDiagnosticsCluster, reportBootReasonsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeBootReasons(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GeneralDiagnosticsCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, GroupKeyManagementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - GroupKeyManagementCluster * cppCluster = new GroupKeyManagementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, GroupKeyManagementCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GroupKeyManagementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GroupKeyManagementCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GroupKeyManagementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, GroupsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - GroupsCluster * cppCluster = new GroupsCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, GroupsCluster, addGroup) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jstring groupName) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; - - chip::app::Clusters::Groups::Commands::AddGroup::Type request; - - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.groupName = chip::JniUtfString(env, static_cast(groupName)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GroupsCluster, addGroupIfIdentifying) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jstring groupName) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; - - chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::Type request; - - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.groupName = chip::JniUtfString(env, static_cast(groupName)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GroupsCluster, getGroupMembership) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupList) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; - - chip::app::Clusters::Groups::Commands::GetGroupMembership::Type request; - - request.groupList = chip::app::DataModel::List(); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GroupsCluster, removeAllGroups)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; - - chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GroupsCluster, removeGroup)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; - - chip::app::Clusters::Groups::Commands::RemoveGroup::Type request; - - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GroupsCluster, viewGroup)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster; - - chip::app::Clusters::Groups::Commands::ViewGroup::Type request; - - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, GroupsCluster, subscribeNameSupportAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GroupsCluster, reportNameSupportAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNameSupport(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, GroupsCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, GroupsCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - GroupsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, IdentifyCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - IdentifyCluster * cppCluster = new IdentifyCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, IdentifyCluster, identify)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject identifyTime) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster; - - chip::app::Clusters::Identify::Commands::Identify::Type request; - - request.identifyTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(identifyTime)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, IdentifyCluster, identifyQuery)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster; - - chip::app::Clusters::Identify::Commands::IdentifyQuery::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, IdentifyCluster, triggerEffect) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject effectIdentifier, jobject effectVariant) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster; - - chip::app::Clusters::Identify::Commands::TriggerEffect::Type request; - - request.effectIdentifier = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectIdentifier)); - request.effectVariant = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, IdentifyCluster, writeIdentifyTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyTime::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, IdentifyCluster, subscribeIdentifyTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, IdentifyCluster, reportIdentifyTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeIdentifyTime(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, IdentifyCluster, subscribeIdentifyTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeIdentifyType(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, IdentifyCluster, reportIdentifyTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeIdentifyType(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, IdentifyCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, IdentifyCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, IlluminanceMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - IlluminanceMeasurementCluster * cppCluster = new IlluminanceMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, IlluminanceMeasurementCluster, reportMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMinMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, IlluminanceMeasurementCluster, reportMinMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMinMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMaxMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, IlluminanceMeasurementCluster, reportMaxMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeToleranceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, IlluminanceMeasurementCluster, reportToleranceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTolerance(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeLightSensorTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeLightSensorType(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, IlluminanceMeasurementCluster, reportLightSensorTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeLightSensorType(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, IlluminanceMeasurementCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, KeypadInputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - KeypadInputCluster * cppCluster = new KeypadInputCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, KeypadInputCluster, sendKey)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject keyCode) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - KeypadInputCluster * cppCluster; - - chip::app::Clusters::KeypadInput::Commands::SendKey::Type request; - - request.keyCode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(keyCode)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, KeypadInputCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - KeypadInputCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, KeypadInputCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - KeypadInputCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, LevelControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - LevelControlCluster * cppCluster = new LevelControlCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, LevelControlCluster, move) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject optionMask, - jobject optionOverride) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::Move::Type request; - - request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); - request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); - request.optionMask = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); - request.optionOverride = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, moveToLevel) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject level, jobject transitionTime, jobject optionMask, - jobject optionOverride) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type request; - - request.level = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(level)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); - request.optionMask = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); - request.optionOverride = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, moveToLevelWithOnOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject level, jobject transitionTime) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type request; - - request.level = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(level)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, moveWithOnOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type request; - - request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); - request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, step) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, - jobject optionMask, jobject optionOverride) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::Step::Type request; - - request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); - request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); - request.optionMask = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); - request.optionOverride = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, stepWithOnOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type request; - - request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); - request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, stop) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject optionMask, jobject optionOverride) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::Stop::Type request; - - request.optionMask = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); - request.optionOverride = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, stopWithOnOff)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster; - - chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeCurrentLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeCurrentLevel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportCurrentLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCurrentLevel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeRemainingTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportRemainingTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRemainingTime(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeMinLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMinLevel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportMinLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMinLevel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeMaxLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMaxLevel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportMaxLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxLevel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeCurrentFrequencyAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeCurrentFrequency(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportCurrentFrequencyAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCurrentFrequency(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeMinFrequencyAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMinFrequency(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportMinFrequencyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMinFrequency(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeMaxFrequencyAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeMaxFrequency(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportMaxFrequencyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxFrequency(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, LevelControlCluster, writeOptionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeOptionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeOptions(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportOptionsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOptions(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, LevelControlCluster, writeOnOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeOnOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeOnOffTransitionTime(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportOnOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOnOffTransitionTime(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, LevelControlCluster, writeOnLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo; - TypeInfo::Type cppValue; - - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeOnLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeOnLevel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportOnLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOnLevel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, LevelControlCluster, writeOnTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo; - TypeInfo::Type cppValue; - - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeOnTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeOnTransitionTime(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportOnTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOnTransitionTime(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, LevelControlCluster, writeOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo; - TypeInfo::Type cppValue; - - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeOffTransitionTime(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOffTransitionTime(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, LevelControlCluster, writeDefaultMoveRateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo; - TypeInfo::Type cppValue; - - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeDefaultMoveRateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeDefaultMoveRate(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportDefaultMoveRateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeDefaultMoveRate(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, LevelControlCluster, writeStartUpCurrentLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeStartUpCurrentLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeStartUpCurrentLevel(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportStartUpCurrentLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeStartUpCurrentLevel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, LevelControlCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LevelControlCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, LowPowerCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - LowPowerCluster * cppCluster = new LowPowerCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, LowPowerCluster, sleep)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - LowPowerCluster * cppCluster; - - chip::app::Clusters::LowPower::Commands::Sleep::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, LowPowerCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LowPowerCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, LowPowerCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - LowPowerCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, MediaInputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - MediaInputCluster * cppCluster = new MediaInputCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, MediaInputCluster, hideInputStatus)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster; - - chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaInputCluster, renameInput) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index, jstring name) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster; - - chip::app::Clusters::MediaInput::Commands::RenameInput::Type request; - - request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); - request.name = chip::JniUtfString(env, static_cast(name)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaInputCluster, selectInput)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster; - - chip::app::Clusters::MediaInput::Commands::SelectInput::Type request; - - request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaInputCluster, showInputStatus)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster; - - chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaInputCluster, subscribeCurrentMediaInputAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeCurrentMediaInput(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, MediaInputCluster, reportCurrentMediaInputAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCurrentMediaInput(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, MediaInputCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, MediaInputCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaInputCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, MediaPlaybackCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - MediaPlaybackCluster * cppCluster = new MediaPlaybackCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, MediaPlaybackCluster, mediaFastForward)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaFastForward::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, mediaNext)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaNext::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, mediaPause)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaPause::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, mediaPlay)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaPlay::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, mediaPrevious)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaPrevious::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, mediaRewind)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaRewind::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, mediaSeek)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject position) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaSeek::Type request; - - request.position = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(position)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, mediaSkipBackward) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject deltaPositionMilliseconds) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackward::Type request; - - request.deltaPositionMilliseconds = static_cast( - chip::JniReferences::GetInstance().LongToPrimitive(deltaPositionMilliseconds)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, mediaSkipForward) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject deltaPositionMilliseconds) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaSkipForward::Type request; - - request.deltaPositionMilliseconds = static_cast( - chip::JniReferences::GetInstance().LongToPrimitive(deltaPositionMilliseconds)); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, mediaStartOver)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaStartOver::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, mediaStop)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster; - - chip::app::Clusters::MediaPlayback::Commands::MediaStop::Type request; - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, subscribePlaybackStateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributePlaybackState(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, MediaPlaybackCluster, reportPlaybackStateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributePlaybackState(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, subscribeStartTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeStartTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, MediaPlaybackCluster, reportStartTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeStartTime(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, subscribeDurationAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeDuration(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, MediaPlaybackCluster, reportDurationAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeDuration(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeEndAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeSeekRangeEnd(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, MediaPlaybackCluster, reportSeekRangeEndAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSeekRangeEnd(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeStartAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeSeekRangeStart(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, MediaPlaybackCluster, reportSeekRangeStartAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSeekRangeStart(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, MediaPlaybackCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, MediaPlaybackCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - onReport.release(); -} -JNI_METHOD(jlong, ModeSelectCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - ModeSelectCluster * cppCluster = new ModeSelectCluster(); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, ModeSelectCluster, changeToMode)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject newMode) +JNI_METHOD(void, DoorLockCluster, unlockDoor)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject pinCode) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster; + DoorLockCluster * cppCluster; - chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type request; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type request; - request.newMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(newMode)); + chip::JniReferences::GetInstance().GetOptionalValue(pinCode, pinCode); + request.pinCode = chip::Optional(chip::JniByteArray(env, static_cast(pinCode)).byteSpan()); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -15875,7 +7324,7 @@ JNI_METHOD(void, ModeSelectCluster, changeToMode)(JNIEnv * env, jobject self, jl AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -15891,30 +7340,37 @@ JNI_METHOD(void, ModeSelectCluster, changeToMode)(JNIEnv * env, jobject self, jl onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ModeSelectCluster, subscribeCurrentModeAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeLockStateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::LockState::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPDoorLockLockStateAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -15922,91 +7378,111 @@ JNI_METHOD(void, ModeSelectCluster, subscribeCurrentModeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ModeSelectCluster, reportCurrentModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, DoorLockCluster, subscribeLockTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeCurrentMode(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::LockType::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, DoorLockCluster, subscribeActuatorEnabledAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::ActuatorEnabled::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ModeSelectCluster, subscribeOnModeAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeDoorStateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOnMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::DoorState::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPDoorLockDoorStateAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -16015,32 +7491,15 @@ JNI_METHOD(void, ModeSelectCluster, subscribeOnModeAttribute) onFailure.release(); } -JNI_METHOD(void, ModeSelectCluster, reportOnModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, DoorLockCluster, writeLanguageAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::Language::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeOnMode(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - onReport.release(); -} -JNI_METHOD(void, ModeSelectCluster, subscribeStartUpModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -16053,48 +7512,69 @@ JNI_METHOD(void, ModeSelectCluster, subscribeStartUpModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeStartUpMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ModeSelectCluster, reportStartUpModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, DoorLockCluster, subscribeLanguageAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeStartUpMode(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::Language::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ModeSelectCluster, subscribeDescriptionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, DoorLockCluster, writeAutoRelockTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::AutoRelockTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -16107,48 +7587,69 @@ JNI_METHOD(void, ModeSelectCluster, subscribeDescriptionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeDescription(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ModeSelectCluster, reportDescriptionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, DoorLockCluster, subscribeAutoRelockTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeDescription(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::AutoRelockTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ModeSelectCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, DoorLockCluster, writeSoundVolumeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::SoundVolume::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -16161,317 +7662,293 @@ JNI_METHOD(void, ModeSelectCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ModeSelectCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, DoorLockCluster, subscribeSoundVolumeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::SoundVolume::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, NetworkCommissioningCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - NetworkCommissioningCluster * cppCluster = new NetworkCommissioningCluster(); + env, callback, "Error subscribing to attribute", err)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateThreadNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray operationalDataset, jobject breadcrumb) + +JNI_METHOD(void, DoorLockCluster, writeOperatingModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::OperatingMode::TypeInfo; + TypeInfo::Type cppValue; - chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Type request; + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - request.operationalDataset = chip::JniByteArray(env, static_cast(operationalDataset)).byteSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateWiFiNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jbyteArray credentials, jobject breadcrumb) +JNI_METHOD(void, DoorLockCluster, subscribeOperatingModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; - - chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Type request; - - request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); - request.credentials = chip::JniByteArray(env, static_cast(credentials)).byteSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::OperatingMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, connectNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb) + +JNI_METHOD(void, DoorLockCluster, writeEnableOneTouchLockingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; + TypeInfo::Type cppValue; - chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetwork::Type request; + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, removeNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb) +JNI_METHOD(void, DoorLockCluster, subscribeEnableOneTouchLockingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; - - chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::Type request; - - request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, reorderNetwork) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject networkIndex, jobject breadcrumb) + +JNI_METHOD(void, DoorLockCluster, writeEnablePrivacyModeButtonAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; + TypeInfo::Type cppValue; - chip::app::Clusters::NetworkCommissioning::Commands::ReorderNetwork::Type request; + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); - request.networkIndex = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(networkIndex)); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, scanNetworks) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jobject breadcrumb) +JNI_METHOD(void, DoorLockCluster, subscribeEnablePrivacyModeButtonAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster; - - chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::Type request; - - request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); - request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, writeInterfaceEnabledAttribute) +JNI_METHOD(void, DoorLockCluster, writeWrongCodeEntryLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::InterfaceEnabled::TypeInfo; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -16485,8 +7962,8 @@ JNI_METHOD(void, NetworkCommissioningCluster, writeInterfaceEnabledAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -16501,30 +7978,36 @@ JNI_METHOD(void, NetworkCommissioningCluster, writeInterfaceEnabledAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, NetworkCommissioningCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeWrongCodeEntryLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -16532,54 +8015,36 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeFeatureMapAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, NetworkCommissioningCluster, reportFeatureMapAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeFeatureMap(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, NetworkCommissioningCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, DoorLockCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + DoorLockCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -16587,351 +8052,268 @@ JNI_METHOD(void, NetworkCommissioningCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, NetworkCommissioningCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, OtaSoftwareUpdateProviderCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, ElectricalMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - OtaSoftwareUpdateProviderCluster * cppCluster = new OtaSoftwareUpdateProviderCluster(); + ElectricalMeasurementCluster * cppCluster = new ElectricalMeasurementCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, applyUpdateRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jobject newVersion) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeMeasurementTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateProviderCluster * cppCluster; - - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type request; - - request.updateToken = chip::JniByteArray(env, static_cast(updateToken)).byteSpan(); - request.newVersion = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(newVersion)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::MeasurementType::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, notifyUpdateApplied) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jobject softwareVersion) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeTotalActivePowerAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateProviderCluster * cppCluster; - - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type request; - - request.updateToken = chip::JniByteArray(env, static_cast(updateToken)).byteSpan(); - request.softwareVersion = - static_cast(chip::JniReferences::GetInstance().LongToPrimitive(softwareVersion)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, queryImage) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject vendorId, jobject productId, jobject softwareVersion, - jobject protocolsSupported, jobject hardwareVersion, jobject location, jobject requestorCanConsent, jobject metadataForProvider) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateProviderCluster * cppCluster; - - chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type request; - - request.vendorId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(vendorId)); - request.productId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(productId)); - request.softwareVersion = - static_cast(chip::JniReferences::GetInstance().LongToPrimitive(softwareVersion)); - request.protocolsSupported = - chip::app::DataModel::List(); - chip::JniReferences::GetInstance().GetOptionalValue(hardwareVersion, hardwareVersion); - request.hardwareVersion = chip::Optional( - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(hardwareVersion))); - chip::JniReferences::GetInstance().GetOptionalValue(location, location); - request.location = chip::Optional(chip::JniUtfString(env, static_cast(location)).charSpan()); - chip::JniReferences::GetInstance().GetOptionalValue(requestorCanConsent, requestorCanConsent); - request.requestorCanConsent = chip::Optional(static_cast( - chip::JniReferences::GetInstance().BooleanToPrimitive(requestorCanConsent))); - chip::JniReferences::GetInstance().GetOptionalValue(metadataForProvider, metadataForProvider); - request.metadataForProvider = - chip::Optional(chip::JniByteArray(env, static_cast(metadataForProvider)).byteSpan()); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMinAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateProviderCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateProviderCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, OtaSoftwareUpdateRequestorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - OtaSoftwareUpdateRequestorCluster * cppCluster = new OtaSoftwareUpdateRequestorCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} + env, callback, "Error subscribing to attribute", err)); -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, announceOtaProvider) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject providerLocation, jobject vendorId, - jobject announcementReason, jobject metadataForNode) + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsVoltageMaxAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster; - - chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Type request; - - request.providerLocation = - static_cast(chip::JniReferences::GetInstance().LongToPrimitive(providerLocation)); - request.vendorId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(vendorId)); - request.announcementReason = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(announcementReason)); - chip::JniReferences::GetInstance().GetOptionalValue(metadataForNode, metadataForNode); - request.metadataForNode = - chip::Optional(chip::JniByteArray(env, static_cast(metadataForNode)).byteSpan()); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, writeDefaultOtaProviderAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeDefaultOtaProviderAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMinAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeDefaultOtaProvider(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -16939,54 +8321,73 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeDefaultOtaProviderA onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, reportDefaultOtaProviderAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeRmsCurrentMaxAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeDefaultOtaProvider(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdatePossibleAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeUpdatePossible(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePower::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -16994,54 +8395,73 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdatePossibleAttri onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, reportUpdatePossibleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMinAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeUpdatePossible(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeActivePowerMaxAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17049,117 +8469,154 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeClusterRevisionAttr onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ElectricalMeasurementCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ElectricalMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(jlong, OccupancySensingCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, EthernetNetworkDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - OccupancySensingCluster * cppCluster = new OccupancySensingCluster(); + EthernetNetworkDiagnosticsCluster * cppCluster = new EthernetNetworkDiagnosticsCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancyAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, resetCounts)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster; + + chip::app::Clusters::EthernetNetworkDiagnostics::Commands::ResetCounts::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeOccupancy(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OccupancySensingCluster, reportOccupancyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePHYRateAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeOccupancy(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PHYRate::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeFullDuplexAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOccupancySensorType(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17167,54 +8624,75 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OccupancySensingCluster, reportOccupancySensorTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePacketRxCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeOccupancySensorType(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeBitmapAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribePacketTxCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOccupancySensorTypeBitmap( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17222,54 +8700,74 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeBitmapAttr onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OccupancySensingCluster, reportOccupancySensorTypeBitmapAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeTxErrCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeOccupancySensorTypeBitmap(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OccupancySensingCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeCollisionCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17277,285 +8775,280 @@ JNI_METHOD(void, OccupancySensingCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OccupancySensingCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeOverrunCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, OnOffCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - OnOffCluster * cppCluster = new OnOffCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, OnOffCluster, off)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; - - chip::app::Clusters::OnOff::Commands::Off::Type request; + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, offWithEffect) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject effectId, jobject effectVariant) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeCarrierDetectAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; - - chip::app::Clusters::OnOff::Commands::OffWithEffect::Type request; - - request.effectId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectId)); - request.effectVariant = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, on)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeTimeSinceResetAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; - - chip::app::Clusters::OnOff::Commands::On::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, onWithRecallGlobalScene)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; - - chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + EthernetNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, onWithTimedOff) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject onOffControl, jobject onTime, jobject offWaitTime) +JNI_METHOD(jlong, FixedLabelCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; + FixedLabelCluster * cppCluster = new FixedLabelCluster(); - chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type request; + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} - request.onOffControl = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(onOffControl)); - request.onTime = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(onTime)); - request.offWaitTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(offWaitTime)); +JNI_METHOD(void, FixedLabelCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + FixedLabelCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::FixedLabel::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, toggle)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, FlowMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster; + FlowMeasurementCluster * cppCluster = new FlowMeasurementCluster(); - chip::app::Clusters::OnOff::Commands::Toggle::Type request; + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); +JNI_METHOD(void, FlowMeasurementCluster, subscribeMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeOnOffAttribute) +JNI_METHOD(void, FlowMeasurementCluster, subscribeMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MinMeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17563,53 +9056,73 @@ JNI_METHOD(void, OnOffCluster, subscribeOnOffAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffCluster, reportOnOffAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, FlowMeasurementCluster, subscribeMaxMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeOnOff(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeGlobalSceneControlAttribute) +JNI_METHOD(void, FlowMeasurementCluster, subscribeToleranceAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeGlobalSceneControl(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::Tolerance::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17617,129 +9130,190 @@ JNI_METHOD(void, OnOffCluster, subscribeGlobalSceneControlAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffCluster, reportGlobalSceneControlAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, FlowMeasurementCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeGlobalSceneControl(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(jlong, GeneralCommissioningCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + GeneralCommissioningCluster * cppCluster = new GeneralCommissioningCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, OnOffCluster, writeOnTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, GeneralCommissioningCluster, armFailSafe) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject expiryLengthSeconds, jobject breadcrumb, jobject timeoutMs) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.expiryLengthSeconds = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(expiryLengthSeconds)); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeOnTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, GeneralCommissioningCluster, commissioningComplete)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster; + + chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeOnTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffCluster, reportOnTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, GeneralCommissioningCluster, setRegulatoryConfig) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject location, jstring countryCode, jobject breadcrumb, + jobject timeoutMs) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::Type request; + + request.location = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(location)); + request.countryCode = chip::JniUtfString(env, static_cast(countryCode)).charSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); + request.timeoutMs = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(timeoutMs)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeOnTime(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OnOffCluster, writeOffWaitTimeAttribute) +JNI_METHOD(void, GeneralCommissioningCluster, writeBreadcrumbAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo; + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -17753,8 +9327,8 @@ JNI_METHOD(void, OnOffCluster, writeOffWaitTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -17769,30 +9343,36 @@ JNI_METHOD(void, OnOffCluster, writeOffWaitTimeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeOffWaitTimeAttribute) +JNI_METHOD(void, GeneralCommissioningCluster, subscribeBreadcrumbAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOffWaitTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17800,91 +9380,119 @@ JNI_METHOD(void, OnOffCluster, subscribeOffWaitTimeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffCluster, reportOffWaitTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, GeneralCommissioningCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeOffWaitTime(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, OnOffCluster, writeStartUpOnOffAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(jlong, GeneralDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo; - TypeInfo::Type cppValue; + GeneralDiagnosticsCluster * cppCluster = new GeneralDiagnosticsCluster(); - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); +JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeRebootCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::RebootCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeStartUpOnOffAttribute) +JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeUpTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeStartUpOnOff(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::UpTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17892,53 +9500,37 @@ JNI_METHOD(void, OnOffCluster, subscribeStartUpOnOffAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffCluster, reportStartUpOnOffAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeStartUpOnOff(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, OnOffCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeTotalOperationalHoursAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::TotalOperationalHours::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -17946,53 +9538,73 @@ JNI_METHOD(void, OnOffCluster, subscribeFeatureMapAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffCluster, reportFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeBootReasonsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeFeatureMap(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::BootReasons::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OnOffCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, GeneralDiagnosticsCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GeneralDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18000,155 +9612,208 @@ JNI_METHOD(void, OnOffCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, GroupKeyManagementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + GroupKeyManagementCluster * cppCluster = new GroupKeyManagementCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} -JNI_METHOD(void, OnOffCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, GroupKeyManagementCluster, keySetRead) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type request; + + request.groupKeySetID = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupKeySetID)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(jlong, OnOffSwitchConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(void, GroupKeyManagementCluster, keySetReadAllIndices) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetIDs) { chip::DeviceLayer::StackLock lock; - OnOffSwitchConfigurationCluster * cppCluster = new OnOffSwitchConfigurationCluster(); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster; - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} + chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type request; -JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.groupKeySetIDs = chip::app::DataModel::List(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeSwitchType(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffSwitchConfigurationCluster, reportSwitchTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, GroupKeyManagementCluster, keySetRemove) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type request; + + request.groupKeySetID = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupKeySetID)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeSwitchType(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, OnOffSwitchConfigurationCluster, writeSwitchActionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, GroupKeyManagementCluster, keySetWrite) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupKeySetID, jobject securityPolicy, + jbyteArray epochKey0, jobject epochStartTime0, jbyteArray epochKey1, jobject epochStartTime1, jbyteArray epochKey2, + jobject epochStartTime2) { - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; - TypeInfo::Type cppValue; + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type request; + + request.groupKeySet = chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::Type(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchActionsAttribute) +JNI_METHOD(void, GroupKeyManagementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupKeyManagementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSwitchActions(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18156,117 +9821,109 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchActionsAttribut onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffSwitchConfigurationCluster, reportSwitchActionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, GroupsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSwitchActions(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + GroupsCluster * cppCluster = new GroupsCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, GroupsCluster, addGroup) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jstring groupName) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster; + chip::app::Clusters::Groups::Commands::AddGroup::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.groupName = chip::JniUtfString(env, static_cast(groupName)).charSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OnOffSwitchConfigurationCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, GroupsCluster, addGroupIfIdentifying) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jstring groupName) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::Groups::Commands::AddGroupIfIdentifying::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.groupName = chip::JniUtfString(env, static_cast(groupName)).charSpan(); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - onReport.release(); -} -JNI_METHOD(jlong, OperationalCredentialsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - OperationalCredentialsCluster * cppCluster = new OperationalCredentialsCluster(); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, OperationalCredentialsCluster, addNOC) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jobject ICACValue, jbyteArray IPKValue, - jobject caseAdminNode, jobject adminVendorId) +JNI_METHOD(void, GroupsCluster, getGroupMembership) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupList) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; + GroupsCluster * cppCluster; - chip::app::Clusters::OperationalCredentials::Commands::AddNOC::Type request; + chip::app::Clusters::Groups::Commands::GetGroupMembership::Type request; - request.NOCValue = chip::JniByteArray(env, static_cast(NOCValue)).byteSpan(); - chip::JniReferences::GetInstance().GetOptionalValue(ICACValue, ICACValue); - request.ICACValue = chip::Optional(chip::JniByteArray(env, static_cast(ICACValue)).byteSpan()); - request.IPKValue = chip::JniByteArray(env, static_cast(IPKValue)).byteSpan(); - request.caseAdminNode = - static_cast(chip::JniReferences::GetInstance().LongToPrimitive(caseAdminNode)); - request.adminVendorId = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(adminVendorId)); + request.groupList = chip::app::DataModel::List(); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -18276,13 +9933,13 @@ JNI_METHOD(void, OperationalCredentialsCluster, addNOC) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -18293,16 +9950,13 @@ JNI_METHOD(void, OperationalCredentialsCluster, addNOC) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, addTrustedRootCertificate) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray rootCertificate) +JNI_METHOD(void, GroupsCluster, removeAllGroups)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::Type request; + GroupsCluster * cppCluster; - request.rootCertificate = chip::JniByteArray(env, static_cast(rootCertificate)).byteSpan(); + chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type request; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -18315,7 +9969,7 @@ JNI_METHOD(void, OperationalCredentialsCluster, addTrustedRootCertificate) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -18331,21 +9985,19 @@ JNI_METHOD(void, OperationalCredentialsCluster, addTrustedRootCertificate) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, attestationRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray attestationNonce) +JNI_METHOD(void, GroupsCluster, removeGroup)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; + GroupsCluster * cppCluster; - chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::Type request; + chip::app::Clusters::Groups::Commands::RemoveGroup::Type request; - request.attestationNonce = chip::JniByteArray(env, static_cast(attestationNonce)).byteSpan(); + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -18355,13 +10007,13 @@ JNI_METHOD(void, OperationalCredentialsCluster, attestationRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -18372,22 +10024,19 @@ JNI_METHOD(void, OperationalCredentialsCluster, attestationRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, certificateChainRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject certificateType) +JNI_METHOD(void, GroupsCluster, viewGroup)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; + GroupsCluster * cppCluster; - chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::Type request; + chip::app::Clusters::Groups::Commands::ViewGroup::Type request; - request.certificateType = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(certificateType)); + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -18397,14 +10046,12 @@ JNI_METHOD(void, OperationalCredentialsCluster, certificateChainRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -18415,99 +10062,99 @@ JNI_METHOD(void, OperationalCredentialsCluster, certificateChainRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, opCSRRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray CSRNonce) +JNI_METHOD(void, GroupsCluster, subscribeNameSupportAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::OpCSRRequest::Type request; - - request.CSRNonce = chip::JniByteArray(env, static_cast(CSRNonce)).byteSpan(); - - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::Groups::Attributes::NameSupport::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, removeFabric) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject fabricIndex) +JNI_METHOD(void, GroupsCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type request; - - request.fabricIndex = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(fabricIndex)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + GroupsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::Groups::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, removeTrustedRootCertificate) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray trustedRootIdentifier) +JNI_METHOD(jlong, IdentifyCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + IdentifyCluster * cppCluster = new IdentifyCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, IdentifyCluster, identify)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject identifyTime) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; + IdentifyCluster * cppCluster; - chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::Type request; + chip::app::Clusters::Identify::Commands::Identify::Type request; - request.trustedRootIdentifier = chip::JniByteArray(env, static_cast(trustedRootIdentifier)).byteSpan(); + request.identifyTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(identifyTime)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -18520,7 +10167,7 @@ JNI_METHOD(void, OperationalCredentialsCluster, removeTrustedRootCertificate) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -18536,21 +10183,17 @@ JNI_METHOD(void, OperationalCredentialsCluster, removeTrustedRootCertificate) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, updateFabricLabel) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring label) +JNI_METHOD(void, IdentifyCluster, identifyQuery)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; - - chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type request; + IdentifyCluster * cppCluster; - request.label = chip::JniUtfString(env, static_cast(label)).charSpan(); + chip::app::Clusters::Identify::Commands::IdentifyQuery::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -18560,13 +10203,13 @@ JNI_METHOD(void, OperationalCredentialsCluster, updateFabricLabel) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -18577,23 +10220,22 @@ JNI_METHOD(void, OperationalCredentialsCluster, updateFabricLabel) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, updateNOC) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jobject ICACValue) +JNI_METHOD(void, IdentifyCluster, triggerEffect) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject effectIdentifier, jobject effectVariant) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster; + IdentifyCluster * cppCluster; - chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Type request; + chip::app::Clusters::Identify::Commands::TriggerEffect::Type request; - request.NOCValue = chip::JniByteArray(env, static_cast(NOCValue)).byteSpan(); - chip::JniReferences::GetInstance().GetOptionalValue(ICACValue, ICACValue); - request.ICACValue = chip::Optional(chip::JniByteArray(env, static_cast(ICACValue)).byteSpan()); + request.effectIdentifier = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectIdentifier)); + request.effectVariant = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -18603,13 +10245,12 @@ JNI_METHOD(void, OperationalCredentialsCluster, updateNOC) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -18620,10 +10261,16 @@ JNI_METHOD(void, OperationalCredentialsCluster, updateNOC) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, subscribeSupportedFabricsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, IdentifyCluster, writeIdentifyTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -18636,14 +10283,52 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeSupportedFabricsAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, IdentifyCluster, subscribeIdentifyTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSupportedFabrics(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18651,54 +10336,73 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeSupportedFabricsAttribu onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OperationalCredentialsCluster, reportSupportedFabricsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, IdentifyCluster, subscribeIdentifyTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeSupportedFabrics(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyType::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, subscribeCommissionedFabricsAttribute) +JNI_METHOD(void, IdentifyCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IdentifyCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCommissionedFabrics(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Identify::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18706,54 +10410,87 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeCommissionedFabricsAttr onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, IlluminanceMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + IlluminanceMeasurementCluster * cppCluster = new IlluminanceMeasurementCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} -JNI_METHOD(void, OperationalCredentialsCluster, reportCommissionedFabricsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeCommissionedFabrics(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPIlluminanceMeasurementMeasuredValueAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, subscribeCurrentFabricIndexAttribute) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentFabricIndex(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MinMeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18761,54 +10498,76 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeCurrentFabricIndexAttri onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OperationalCredentialsCluster, reportCurrentFabricIndexAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeMaxMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeCurrentFabricIndex(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, OperationalCredentialsCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeToleranceAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::Tolerance::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18816,63 +10575,77 @@ JNI_METHOD(void, OperationalCredentialsCluster, subscribeClusterRevisionAttribut onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, OperationalCredentialsCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeLightSensorTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, PowerSourceCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - PowerSourceCluster * cppCluster = new PowerSourceCluster(); + env, callback, "Error subscribing to attribute", err)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, PowerSourceCluster, subscribeStatusAttribute) +JNI_METHOD(void, IlluminanceMeasurementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + IlluminanceMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeStatus(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18880,53 +10653,85 @@ JNI_METHOD(void, PowerSourceCluster, subscribeStatusAttribute) onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, KeypadInputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + KeypadInputCluster * cppCluster = new KeypadInputCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} -JNI_METHOD(void, PowerSourceCluster, reportStatusAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, KeypadInputCluster, sendKeyRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject keyCode) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + KeypadInputCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::KeypadInput::Commands::SendKeyRequest::Type request; + + request.keyCode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(keyCode)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeStatus(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeOrderAttribute) +JNI_METHOD(void, KeypadInputCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + KeypadInputCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOrder(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::KeypadInput::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -18934,435 +10739,376 @@ JNI_METHOD(void, PowerSourceCluster, subscribeOrderAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PowerSourceCluster, reportOrderAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, LevelControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOrder(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + LevelControlCluster * cppCluster = new LevelControlCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, PowerSourceCluster, subscribeDescriptionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, LevelControlCluster, move) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate, jobject optionMask, + jobject optionOverride) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; + + chip::app::Clusters::LevelControl::Commands::Move::Type request; + + request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); + request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeDescription(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PowerSourceCluster, reportDescriptionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, moveToLevel) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject level, jobject transitionTime, jobject optionMask, + jobject optionOverride) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::LevelControl::Commands::MoveToLevel::Type request; - err = cppCluster->ReportAttributeDescription(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.level = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(level)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); - onReport.release(); -} -JNI_METHOD(void, PowerSourceCluster, subscribeBatteryVoltageAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBatteryVoltage(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PowerSourceCluster, reportBatteryVoltageAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, moveToLevelWithOnOff) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject level, jobject transitionTime) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::LevelControl::Commands::MoveToLevelWithOnOff::Type request; - err = cppCluster->ReportAttributeBatteryVoltage(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.level = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(level)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); - onReport.release(); -} -JNI_METHOD(void, PowerSourceCluster, subscribeBatteryPercentRemainingAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeBatteryPercentRemaining( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PowerSourceCluster, reportBatteryPercentRemainingAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, moveWithOnOff) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject moveMode, jobject rate) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::LevelControl::Commands::MoveWithOnOff::Type request; - err = cppCluster->ReportAttributeBatteryPercentRemaining(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.moveMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(moveMode)); + request.rate = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(rate)); - onReport.release(); -} -JNI_METHOD(void, PowerSourceCluster, subscribeBatteryTimeRemainingAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeBatteryTimeRemaining( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PowerSourceCluster, reportBatteryTimeRemainingAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, step) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime, + jobject optionMask, jobject optionOverride) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::LevelControl::Commands::Step::Type request; - err = cppCluster->ReportAttributeBatteryTimeRemaining(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); + request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); - onReport.release(); -} -JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeBatteryChargeLevel(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PowerSourceCluster, reportBatteryChargeLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, stepWithOnOff) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject stepMode, jobject stepSize, jobject transitionTime) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type request; - err = cppCluster->ReportAttributeBatteryChargeLevel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.stepMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepMode)); + request.stepSize = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(stepSize)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); - onReport.release(); -} -JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeStateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeBatteryChargeState(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PowerSourceCluster, reportBatteryChargeStateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, stop) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject optionMask, jobject optionOverride) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::LevelControl::Commands::Stop::Type request; - err = cppCluster->ReportAttributeBatteryChargeState(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.optionMask = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionMask)); + request.optionOverride = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(optionOverride)); - onReport.release(); -} -JNI_METHOD(void, PowerSourceCluster, subscribeFeatureMapAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PowerSourceCluster, reportFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, stopWithOnOff)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::LevelControl::Commands::StopWithOnOff::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeFeatureMap(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, PowerSourceCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeCurrentLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19370,71 +11116,36 @@ JNI_METHOD(void, PowerSourceCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PowerSourceCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, PowerSourceConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - PowerSourceConfigurationCluster * cppCluster = new PowerSourceConfigurationCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(jlong, PressureMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - PressureMeasurementCluster * cppCluster = new PressureMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, PressureMeasurementCluster, subscribeMeasuredValueAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeRemainingTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::RemainingTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19442,54 +11153,36 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PressureMeasurementCluster, reportMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, PressureMeasurementCluster, subscribeMinMeasuredValueAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeMinLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19497,54 +11190,36 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeMinMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PressureMeasurementCluster, reportMinMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMinMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, PressureMeasurementCluster, subscribeMaxMeasuredValueAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeMaxLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19552,54 +11227,36 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeMaxMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PressureMeasurementCluster, reportMaxMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, PressureMeasurementCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeCurrentFrequencyAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19607,63 +11264,36 @@ JNI_METHOD(void, PressureMeasurementCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PressureMeasurementCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, PumpConfigurationAndControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - PumpConfigurationAndControlCluster * cppCluster = new PumpConfigurationAndControlCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxPressureAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeMinFrequencyAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxPressure(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MinFrequency::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19671,54 +11301,36 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxPressureAttribu onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMaxPressureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxPressure(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxSpeedAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeMaxFrequencyAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxSpeed(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MaxFrequency::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19727,33 +11339,15 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxSpeedAttribute) onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMaxSpeedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, writeOptionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeMaxSpeed(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxFlowAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -19766,69 +11360,52 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxFlowAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxFlow(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMaxFlowAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxFlow(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstPressureAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeOptionsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinConstPressure(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19837,33 +11414,15 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstPressureAt onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMinConstPressureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, writeOnOffTransitionTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeMinConstPressure(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstPressureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -19876,69 +11435,52 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstPressureAt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxConstPressure(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMaxConstPressureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxConstPressure(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinCompPressureAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeOnOffTransitionTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinCompPressure(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -19947,53 +11489,79 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinCompPressureAtt onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMinCompPressureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, writeOnLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeMinCompPressure(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxCompPressureAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeOnLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxCompPressure(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPLevelControlOnLevelAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20002,53 +11570,80 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxCompPressureAtt onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMaxCompPressureAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, writeOnTransitionTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeMaxCompPressure(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstSpeedAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeOnTransitionTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinConstSpeed(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPLevelControlOnTransitionTimeAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20057,53 +11652,80 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstSpeedAttri onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMinConstSpeedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, writeOffTransitionTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeMinConstSpeed(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstSpeedAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeOffTransitionTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxConstSpeed(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPLevelControlOffTransitionTimeAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20112,53 +11734,79 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstSpeedAttri onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMaxConstSpeedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, writeDefaultMoveRateAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeMaxConstSpeed(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstFlowAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeDefaultMoveRateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinConstFlow(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPLevelControlDefaultMoveRateAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20167,33 +11815,15 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstFlowAttrib onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMinConstFlowAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, writeStartUpCurrentLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeMinConstFlow(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstFlowAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -20206,69 +11836,89 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstFlowAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxConstFlow(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMaxConstFlowAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LevelControlCluster, subscribeStartUpCurrentLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeMaxConstFlow(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstTempAttribute) +JNI_METHOD(void, LevelControlCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LevelControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinConstTemp(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20276,54 +11926,80 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstTempAttrib onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, LowPowerCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + LowPowerCluster * cppCluster = new LowPowerCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMinConstTempAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, LowPowerCluster, sleep)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + LowPowerCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::LowPower::Commands::Sleep::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeMinConstTemp(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstTempAttribute) +JNI_METHOD(void, LowPowerCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + LowPowerCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxConstTemp(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::LowPower::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20331,219 +12007,192 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstTempAttrib onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportMaxConstTempAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, MediaInputCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxConstTemp(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + MediaInputCluster * cppCluster = new MediaInputCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePumpStatusAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, MediaInputCluster, hideInputStatusRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster; + + chip::app::Clusters::MediaInput::Commands::HideInputStatusRequest::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributePumpStatus(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportPumpStatusAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, MediaInputCluster, renameInputRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index, jstring name) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::MediaInput::Commands::RenameInputRequest::Type request; - err = cppCluster->ReportAttributePumpStatus(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); + request.name = chip::JniUtfString(env, static_cast(name)).charSpan(); - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveOperationModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeEffectiveOperationMode( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportEffectiveOperationModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, MediaInputCluster, selectInputRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject index) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster; - err = cppCluster->ReportAttributeEffectiveOperationMode(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + chip::app::Clusters::MediaInput::Commands::SelectInputRequest::Type request; - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveControlModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.index = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(index)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeEffectiveControlMode( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportEffectiveControlModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, MediaInputCluster, showInputStatusRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::MediaInput::Commands::ShowInputStatusRequest::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeEffectiveControlMode(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeCapacityAttribute) +JNI_METHOD(void, MediaInputCluster, subscribeCurrentMediaInputAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCapacity(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::MediaInput::Attributes::CurrentMediaInput::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20551,54 +12200,36 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeCapacityAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportCapacityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCapacity(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeSpeedAttribute) +JNI_METHOD(void, MediaInputCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaInputCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSpeed(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::MediaInput::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -20606,436 +12237,463 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeSpeedAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportSpeedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, MediaPlaybackCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSpeed(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + MediaPlaybackCluster * cppCluster = new MediaPlaybackCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, writeLifetimeRunningHoursAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, MediaPlaybackCluster, fastForwardRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; - TypeInfo::Type cppValue; - - uint32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + chip::app::Clusters::MediaPlayback::Commands::FastForwardRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeRunningHoursAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, MediaPlaybackCluster, nextRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; + chip::app::Clusters::MediaPlayback::Commands::NextRequest::Type request; + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeLifetimeRunningHours( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportLifetimeRunningHoursAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, MediaPlaybackCluster, pauseRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeLifetimeRunningHours(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePowerAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + chip::app::Clusters::MediaPlayback::Commands::PauseRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributePower(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportPowerAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, MediaPlaybackCluster, playRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::MediaPlayback::Commands::PlayRequest::Type request; + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributePower(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, writeLifetimeEnergyConsumedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, MediaPlaybackCluster, previousRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo; - TypeInfo::Type cppValue; - - uint32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + chip::app::Clusters::MediaPlayback::Commands::PreviousRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeEnergyConsumedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, MediaPlaybackCluster, rewindRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; + + chip::app::Clusters::MediaPlayback::Commands::RewindRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeLifetimeEnergyConsumed( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportLifetimeEnergyConsumedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, MediaPlaybackCluster, seekRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject position) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::MediaPlayback::Commands::SeekRequest::Type request; + + request.position = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(position)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeLifetimeEnergyConsumed(onReport->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, writeOperationModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, MediaPlaybackCluster, skipBackwardRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject deltaPositionMilliseconds) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::MediaPlayback::Commands::SkipBackwardRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.deltaPositionMilliseconds = static_cast( + chip::JniReferences::GetInstance().LongToPrimitive(deltaPositionMilliseconds)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeOperationModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, MediaPlaybackCluster, skipForwardRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject deltaPositionMilliseconds) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; + + chip::app::Clusters::MediaPlayback::Commands::SkipForwardRequest::Type request; + + request.deltaPositionMilliseconds = static_cast( + chip::JniReferences::GetInstance().LongToPrimitive(deltaPositionMilliseconds)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeOperationMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportOperationModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, MediaPlaybackCluster, startOverRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::MediaPlayback::Commands::StartOverRequest::Type request; + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeOperationMode(onReport->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, writeControlModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, MediaPlaybackCluster, stopRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + chip::app::Clusters::MediaPlayback::Commands::StopRequest::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeControlModeAttribute) +JNI_METHOD(void, MediaPlaybackCluster, subscribePlaybackStateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeControlMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::PlaybackState::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21043,54 +12701,36 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeControlModeAttribu onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportControlModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeControlMode(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeAlarmMaskAttribute) +JNI_METHOD(void, MediaPlaybackCluster, subscribeStartTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeAlarmMask(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21098,54 +12738,36 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeAlarmMaskAttribute onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportAlarmMaskAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeAlarmMask(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeFeatureMapAttribute) +JNI_METHOD(void, MediaPlaybackCluster, subscribeDurationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21153,54 +12775,73 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeFeatureMapAttribut onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportFeatureMapAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeEndAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeFeatureMap(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, MediaPlaybackCluster, subscribeSeekRangeStartAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21208,118 +12849,119 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeClusterRevisionAtt onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, PumpConfigurationAndControlCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, MediaPlaybackCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + MediaPlaybackCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(jlong, RelativeHumidityMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, ModeSelectCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - RelativeHumidityMeasurementCluster * cppCluster = new RelativeHumidityMeasurementCluster(); + ModeSelectCluster * cppCluster = new ModeSelectCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ModeSelectCluster, changeToMode)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject newMode) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster; + + chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type request; + + request.newMode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(newMode)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, RelativeHumidityMeasurementCluster, reportMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMinMeasuredValueAttribute) +JNI_METHOD(void, ModeSelectCluster, subscribeCurrentModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::CurrentMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21328,33 +12970,15 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMinMeasuredValueAt onFailure.release(); } -JNI_METHOD(void, RelativeHumidityMeasurementCluster, reportMinMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeMinMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - onReport.release(); -} -JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMaxMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -21367,69 +12991,52 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMaxMeasuredValueAt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, RelativeHumidityMeasurementCluster, reportMaxMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxMeasuredValue(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeToleranceAttribute) +JNI_METHOD(void, ModeSelectCluster, subscribeOnModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21437,54 +13044,73 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeToleranceAttribute onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, RelativeHumidityMeasurementCluster, reportToleranceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ModeSelectCluster, subscribeStartUpModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTolerance(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::StartUpMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, ModeSelectCluster, subscribeDescriptionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::Description::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21492,99 +13118,68 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeClusterRevisionAtt onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, RelativeHumidityMeasurementCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ModeSelectCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ModeSelectCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(jlong, ScenesCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, NetworkCommissioningCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - ScenesCluster * cppCluster = new ScenesCluster(); + NetworkCommissioningCluster * cppCluster = new NetworkCommissioningCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ScenesCluster, addScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject transitionTime, - jstring sceneName, jobject clusterId, jobject length, jobject value) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; - - chip::app::Clusters::Scenes::Commands::AddScene::Type request; - - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); - request.sceneName = chip::JniUtfString(env, static_cast(sceneName)).charSpan(); - request.extensionFieldSets = - chip::app::DataModel::List(); - - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ScenesCluster, getSceneMembership)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) +JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateThreadNetwork) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray operationalDataset, jobject breadcrumb) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::GetSceneMembership::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.operationalDataset = chip::JniByteArray(env, static_cast(operationalDataset)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -21594,13 +13189,13 @@ JNI_METHOD(void, ScenesCluster, getSceneMembership)(JNIEnv * env, jobject self, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -21611,22 +13206,23 @@ JNI_METHOD(void, ScenesCluster, getSceneMembership)(JNIEnv * env, jobject self, onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, recallScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject transitionTime) +JNI_METHOD(void, NetworkCommissioningCluster, addOrUpdateWiFiNetwork) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jbyteArray credentials, jobject breadcrumb) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::RecallScene::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); - request.transitionTime = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); + request.credentials = chip::JniByteArray(env, static_cast(credentials)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -21636,12 +13232,13 @@ JNI_METHOD(void, ScenesCluster, recallScene) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -21652,19 +13249,22 @@ JNI_METHOD(void, ScenesCluster, recallScene) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, removeAllScenes)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) +JNI_METHOD(void, NetworkCommissioningCluster, connectNetwork) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::RemoveAllScenes::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetwork::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -21674,13 +13274,13 @@ JNI_METHOD(void, ScenesCluster, removeAllScenes)(JNIEnv * env, jobject self, jlo AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -21691,21 +13291,22 @@ JNI_METHOD(void, ScenesCluster, removeAllScenes)(JNIEnv * env, jobject self, jlo onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, removeScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId) +JNI_METHOD(void, NetworkCommissioningCluster, removeNetwork) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject breadcrumb) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::RemoveScene::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::RemoveNetwork::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -21715,13 +13316,13 @@ JNI_METHOD(void, ScenesCluster, removeScene) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -21732,21 +13333,24 @@ JNI_METHOD(void, ScenesCluster, removeScene) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, storeScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId) +JNI_METHOD(void, NetworkCommissioningCluster, reorderNetwork) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray networkID, jobject networkIndex, jobject breadcrumb) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::StoreScene::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::ReorderNetwork::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.networkID = chip::JniByteArray(env, static_cast(networkID)).byteSpan(); + request.networkIndex = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(networkIndex)); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -21756,12 +13360,13 @@ JNI_METHOD(void, ScenesCluster, storeScene) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -21772,21 +13377,22 @@ JNI_METHOD(void, ScenesCluster, storeScene) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, viewScene) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId) +JNI_METHOD(void, NetworkCommissioningCluster, scanNetworks) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray ssid, jobject breadcrumb) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster; + NetworkCommissioningCluster * cppCluster; - chip::app::Clusters::Scenes::Commands::ViewScene::Type request; + chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworks::Type request; - request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); - request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.ssid = chip::JniByteArray(env, static_cast(ssid)).byteSpan(); + request.breadcrumb = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(breadcrumb)); - std::unique_ptr onSuccess( - Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -21796,12 +13402,13 @@ JNI_METHOD(void, ScenesCluster, viewScene) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -21812,64 +13419,16 @@ JNI_METHOD(void, ScenesCluster, viewScene) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ScenesCluster, subscribeSceneCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeSceneCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, ScenesCluster, reportSceneCountAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, NetworkCommissioningCluster, writeInterfaceEnabledAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::InterfaceEnabled::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeSceneCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); - onReport.release(); -} -JNI_METHOD(void, ScenesCluster, subscribeCurrentSceneAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -21882,68 +13441,52 @@ JNI_METHOD(void, ScenesCluster, subscribeCurrentSceneAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentScene(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ScenesCluster, reportCurrentSceneAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCurrentScene(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ScenesCluster, subscribeCurrentGroupAttribute) +JNI_METHOD(void, NetworkCommissioningCluster, subscribeFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentGroup(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::FeatureMap::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -21951,53 +13494,36 @@ JNI_METHOD(void, ScenesCluster, subscribeCurrentGroupAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ScenesCluster, reportCurrentGroupAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCurrentGroup(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ScenesCluster, subscribeSceneValidAttribute) +JNI_METHOD(void, NetworkCommissioningCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + NetworkCommissioningCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSceneValid(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22005,156 +13531,129 @@ JNI_METHOD(void, ScenesCluster, subscribeSceneValidAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ScenesCluster, reportSceneValidAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, OtaSoftwareUpdateProviderCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSceneValid(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + OtaSoftwareUpdateProviderCluster * cppCluster = new OtaSoftwareUpdateProviderCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ScenesCluster, subscribeNameSupportAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, applyUpdateRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jobject newVersion) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateProviderCluster * cppCluster; + + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Type request; + + request.updateToken = chip::JniByteArray(env, static_cast(updateToken)).byteSpan(); + request.newVersion = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(newVersion)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ScenesCluster, reportNameSupportAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, notifyUpdateApplied) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray updateToken, jobject softwareVersion) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateProviderCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Type request; - err = cppCluster->ReportAttributeNameSupport(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.updateToken = chip::JniByteArray(env, static_cast(updateToken)).byteSpan(); + request.softwareVersion = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(softwareVersion)); - onReport.release(); -} -JNI_METHOD(void, ScenesCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ScenesCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, SoftwareDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - SoftwareDiagnosticsCluster * cppCluster = new SoftwareDiagnosticsCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, SoftwareDiagnosticsCluster, resetWatermarks)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, queryImage) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject vendorId, jobject productId, jobject softwareVersion, + jobject protocolsSupported, jobject hardwareVersion, jobject location, jobject requestorCanConsent, jobject metadataForProvider) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster; + OtaSoftwareUpdateProviderCluster * cppCluster; - chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Type request; + chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + request.vendorId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(vendorId)); + request.productId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(productId)); + request.softwareVersion = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(softwareVersion)); + request.protocolsSupported = + chip::app::DataModel::List(); + chip::JniReferences::GetInstance().GetOptionalValue(hardwareVersion, hardwareVersion); + request.hardwareVersion = chip::Optional( + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(hardwareVersion))); + chip::JniReferences::GetInstance().GetOptionalValue(location, location); + request.location = chip::Optional(chip::JniUtfString(env, static_cast(location)).charSpan()); + chip::JniReferences::GetInstance().GetOptionalValue(requestorCanConsent, requestorCanConsent); + request.requestorCanConsent = chip::Optional(static_cast( + chip::JniReferences::GetInstance().BooleanToPrimitive(requestorCanConsent))); + chip::JniReferences::GetInstance().GetOptionalValue(metadataForProvider, metadataForProvider); + request.metadataForProvider = + chip::Optional(chip::JniByteArray(env, static_cast(metadataForProvider)).byteSpan()); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -22164,12 +13663,13 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, resetWatermarks)(JNIEnv * env, jobj AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -22180,30 +13680,37 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, resetWatermarks)(JNIEnv * env, jobj onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapFreeAttribute) +JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateProviderCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentHeapFree(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22211,164 +13718,93 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapFreeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, SoftwareDiagnosticsCluster, reportCurrentHeapFreeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCurrentHeapFree(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapUsedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(jlong, OtaSoftwareUpdateRequestorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeCurrentHeapUsed(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + OtaSoftwareUpdateRequestorCluster * cppCluster = new OtaSoftwareUpdateRequestorCluster(); - onSuccess.release(); - onFailure.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, SoftwareDiagnosticsCluster, reportCurrentHeapUsedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, announceOtaProvider) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject providerNodeId, jobject vendorId, + jobject announcementReason, jobject metadataForNode, jobject endpoint) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateRequestorCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Type request; - err = cppCluster->ReportAttributeCurrentHeapUsed(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.providerNodeId = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(providerNodeId)); + request.vendorId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(vendorId)); + request.announcementReason = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(announcementReason)); + chip::JniReferences::GetInstance().GetOptionalValue(metadataForNode, metadataForNode); + request.metadataForNode = + chip::Optional(chip::JniByteArray(env, static_cast(metadataForNode)).byteSpan()); + request.endpoint = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(endpoint)); - onReport.release(); -} -JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapHighWatermarkAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeCurrentHeapHighWatermark( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, SoftwareDiagnosticsCluster, reportCurrentHeapHighWatermarkAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCurrentHeapHighWatermark(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdatePossibleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22376,63 +13812,37 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, SoftwareDiagnosticsCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, SwitchCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - SwitchCluster * cppCluster = new SwitchCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, SwitchCluster, subscribeNumberOfPositionsAttribute) +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdateStateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNumberOfPositions(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateState::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22440,53 +13850,40 @@ JNI_METHOD(void, SwitchCluster, subscribeNumberOfPositionsAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, SwitchCluster, reportNumberOfPositionsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNumberOfPositions(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, SwitchCluster, subscribeCurrentPositionAttribute) +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeUpdateStateProgressAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentPosition(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22494,53 +13891,37 @@ JNI_METHOD(void, SwitchCluster, subscribeCurrentPositionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, SwitchCluster, reportCurrentPositionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCurrentPosition(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, SwitchCluster, subscribeMultiPressMaxAttribute) +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OtaSoftwareUpdateRequestorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMultiPressMax(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22548,53 +13929,45 @@ JNI_METHOD(void, SwitchCluster, subscribeMultiPressMaxAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, SwitchCluster, reportMultiPressMaxAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, OccupancySensingCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMultiPressMax(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + OccupancySensingCluster * cppCluster = new OccupancySensingCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, SwitchCluster, subscribeFeatureMapAttribute) + +JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancyAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::Occupancy::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22602,53 +13975,74 @@ JNI_METHOD(void, SwitchCluster, subscribeFeatureMapAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, SwitchCluster, reportFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeFeatureMap(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorType::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, SwitchCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, OccupancySensingCluster, subscribeOccupancySensorTypeBitmapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorTypeBitmap::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -22656,52 +14050,62 @@ JNI_METHOD(void, SwitchCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, SwitchCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OccupancySensingCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OccupancySensingCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(jlong, TvChannelCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, OnOffCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - TvChannelCluster * cppCluster = new TvChannelCluster(); + OnOffCluster * cppCluster = new OnOffCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, TvChannelCluster, changeChannel)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring match) +JNI_METHOD(void, OnOffCluster, off)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TvChannelCluster * cppCluster; - - chip::app::Clusters::TvChannel::Commands::ChangeChannel::Type request; + OnOffCluster * cppCluster; - request.match = chip::JniUtfString(env, static_cast(match)).charSpan(); + chip::app::Clusters::OnOff::Commands::Off::Type request; - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -22711,13 +14115,12 @@ JNI_METHOD(void, TvChannelCluster, changeChannel)(JNIEnv * env, jobject self, jl AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -22728,19 +14131,18 @@ JNI_METHOD(void, TvChannelCluster, changeChannel)(JNIEnv * env, jobject self, jl onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TvChannelCluster, changeChannelByNumber) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject majorNumber, jobject minorNumber) +JNI_METHOD(void, OnOffCluster, offWithEffect) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject effectId, jobject effectVariant) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TvChannelCluster * cppCluster; + OnOffCluster * cppCluster; - chip::app::Clusters::TvChannel::Commands::ChangeChannelByNumber::Type request; + chip::app::Clusters::OnOff::Commands::OffWithEffect::Type request; - request.majorNumber = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(majorNumber)); - request.minorNumber = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(minorNumber)); + request.effectId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectId)); + request.effectVariant = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(effectVariant)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -22753,7 +14155,7 @@ JNI_METHOD(void, TvChannelCluster, changeChannelByNumber) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -22769,15 +14171,13 @@ JNI_METHOD(void, TvChannelCluster, changeChannelByNumber) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TvChannelCluster, skipChannel)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject count) +JNI_METHOD(void, OnOffCluster, on)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TvChannelCluster * cppCluster; - - chip::app::Clusters::TvChannel::Commands::SkipChannel::Type request; + OnOffCluster * cppCluster; - request.count = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(count)); + chip::app::Clusters::OnOff::Commands::On::Type request; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -22790,7 +14190,7 @@ JNI_METHOD(void, TvChannelCluster, skipChannel)(JNIEnv * env, jobject self, jlon AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -22806,85 +14206,58 @@ JNI_METHOD(void, TvChannelCluster, skipChannel)(JNIEnv * env, jobject self, jlon onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TvChannelCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, OnOffCluster, onWithRecallGlobalScene)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster; + + chip::app::Clusters::OnOff::Commands::OnWithRecallGlobalScene::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TvChannelCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TvChannelCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TvChannelCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, TargetNavigatorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - TargetNavigatorCluster * cppCluster = new TargetNavigatorCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, TargetNavigatorCluster, navigateTarget) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject target, jstring data) +JNI_METHOD(void, OnOffCluster, onWithTimedOff) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject onOffControl, jobject onTime, jobject offWaitTime) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TargetNavigatorCluster * cppCluster; + OnOffCluster * cppCluster; - chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type request; + chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type request; - request.target = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(target)); - request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); + request.onOffControl = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(onOffControl)); + request.onTime = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(onTime)); + request.offWaitTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(offWaitTime)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -22894,13 +14267,12 @@ JNI_METHOD(void, TargetNavigatorCluster, navigateTarget) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -22911,94 +14283,70 @@ JNI_METHOD(void, TargetNavigatorCluster, navigateTarget) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TargetNavigatorCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, OnOffCluster, toggle)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster; + + chip::app::Clusters::OnOff::Commands::Toggle::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TargetNavigatorCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TargetNavigatorCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - CHIP_ERROR err = CHIP_NO_ERROR; - TargetNavigatorCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, TemperatureMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - TemperatureMeasurementCluster * cppCluster = new TemperatureMeasurementCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); -JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMeasuredValueAttribute) + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, OnOffCluster, subscribeOnOffAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnOff::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -23006,34 +14354,52 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMeasuredValueAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TemperatureMeasurementCluster, reportMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OnOffCluster, subscribeGlobalSceneControlAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeMeasuredValue(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMinMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, OnOffCluster, writeOnTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23046,49 +14412,68 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMinMeasuredValueAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TemperatureMeasurementCluster, reportMinMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OnOffCluster, subscribeOnTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeMinMeasuredValue(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMaxMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, OnOffCluster, writeOffWaitTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23101,49 +14486,69 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMaxMeasuredValueAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TemperatureMeasurementCluster, reportMaxMeasuredValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OnOffCluster, subscribeOffWaitTimeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeMaxMeasuredValue(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, TemperatureMeasurementCluster, subscribeToleranceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, OnOffCluster, writeStartUpOnOffAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23156,69 +14561,88 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeToleranceAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TemperatureMeasurementCluster, reportToleranceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OnOffCluster, subscribeStartUpOnOffAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTolerance(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, TemperatureMeasurementCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, OnOffCluster, subscribeFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::FeatureMap::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -23226,213 +14650,235 @@ JNI_METHOD(void, TemperatureMeasurementCluster, subscribeClusterRevisionAttribut onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TemperatureMeasurementCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OnOffCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::OnOff::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(jlong, TestClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +JNI_METHOD(jlong, OnOffSwitchConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - TestClusterCluster * cppCluster = new TestClusterCluster(); + OnOffSwitchConfigurationCluster * cppCluster = new OnOffSwitchConfigurationCluster(); cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); return reinterpret_cast(cppCluster); } -JNI_METHOD(void, TestClusterCluster, simpleStructEchoRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, - jobject f, jobject g, jobject h) +JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type request; - - request.arg1 = chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchType::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, test)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) + +JNI_METHOD(void, OnOffSwitchConfigurationCluster, writeSwitchActionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; + TypeInfo::Type cppValue; - chip::app::Clusters::TestCluster::Commands::Test::Type request; + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testAddArguments) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2) +JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeSwitchActionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type request; - - request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); - request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testEnumsRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2) +JNI_METHOD(void, OnOffSwitchConfigurationCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type request; - - request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); - request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OnOffSwitchConfigurationCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::ClusterRevision::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testListInt8UArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) +JNI_METHOD(jlong, OperationalCredentialsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + OperationalCredentialsCluster * cppCluster = new OperationalCredentialsCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, OperationalCredentialsCluster, addNOC) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jobject ICACValue, jbyteArray IPKValue, + jobject caseAdminNode, jobject adminVendorId) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type request; + chip::app::Clusters::OperationalCredentials::Commands::AddNOC::Type request; - request.arg1 = chip::app::DataModel::List(); + request.NOCValue = chip::JniByteArray(env, static_cast(NOCValue)).byteSpan(); + chip::JniReferences::GetInstance().GetOptionalValue(ICACValue, ICACValue); + request.ICACValue = chip::Optional(chip::JniByteArray(env, static_cast(ICACValue)).byteSpan()); + request.IPKValue = chip::JniByteArray(env, static_cast(IPKValue)).byteSpan(); + request.caseAdminNode = + static_cast(chip::JniReferences::GetInstance().LongToPrimitive(caseAdminNode)); + request.adminVendorId = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(adminVendorId)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23442,13 +14888,13 @@ JNI_METHOD(void, TestClusterCluster, testListInt8UArgumentRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -23459,21 +14905,19 @@ JNI_METHOD(void, TestClusterCluster, testListInt8UArgumentRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testListInt8UReverseRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) +JNI_METHOD(void, OperationalCredentialsCluster, addTrustedRootCertificate) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray rootCertificate) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type request; + chip::app::Clusters::OperationalCredentials::Commands::AddTrustedRootCertificate::Type request; - request.arg1 = chip::app::DataModel::List(); + request.rootCertificate = chip::JniByteArray(env, static_cast(rootCertificate)).byteSpan(); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23483,13 +14927,12 @@ JNI_METHOD(void, TestClusterCluster, testListInt8UReverseRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -23500,21 +14943,21 @@ JNI_METHOD(void, TestClusterCluster, testListInt8UReverseRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testListNestedStructListArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jobject d, jobject e, - jbyteArray f, jobject g) +JNI_METHOD(void, OperationalCredentialsCluster, attestationRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray attestationNonce) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type request; + chip::app::Clusters::OperationalCredentials::Commands::AttestationRequest::Type request; - request.arg1 = chip::app::DataModel::List(); + request.attestationNonce = chip::JniByteArray(env, static_cast(attestationNonce)).byteSpan(); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23524,13 +14967,13 @@ JNI_METHOD(void, TestClusterCluster, testListNestedStructListArgumentRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -23541,21 +14984,22 @@ JNI_METHOD(void, TestClusterCluster, testListNestedStructListArgumentRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testListStructArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, - jobject f, jobject g, jobject h) +JNI_METHOD(void, OperationalCredentialsCluster, certificateChainRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject certificateType) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type request; + chip::app::Clusters::OperationalCredentials::Commands::CertificateChainRequest::Type request; - request.arg1 = chip::app::DataModel::List(); + request.certificateType = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(certificateType)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23565,13 +15009,14 @@ JNI_METHOD(void, TestClusterCluster, testListStructArgumentRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -23582,20 +15027,21 @@ JNI_METHOD(void, TestClusterCluster, testListStructArgumentRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testNestedStructArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c) +JNI_METHOD(void, OperationalCredentialsCluster, opCSRRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray CSRNonce) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type request; + chip::app::Clusters::OperationalCredentials::Commands::OpCSRRequest::Type request; - request.arg1 = chip::app::Clusters::TestCluster::Structs::NestedStruct::Type(); + request.CSRNonce = chip::JniByteArray(env, static_cast(CSRNonce)).byteSpan(); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23605,13 +15051,13 @@ JNI_METHOD(void, TestClusterCluster, testNestedStructArgumentRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -23622,21 +15068,22 @@ JNI_METHOD(void, TestClusterCluster, testNestedStructArgumentRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testNestedStructListArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jobject d, jobject e, - jbyteArray f, jobject g) +JNI_METHOD(void, OperationalCredentialsCluster, removeFabric) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject fabricIndex) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type request; + chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type request; - request.arg1 = chip::app::Clusters::TestCluster::Structs::NestedStructList::Type(); + request.fabricIndex = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(fabricIndex)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23646,13 +15093,13 @@ JNI_METHOD(void, TestClusterCluster, testNestedStructListArgumentRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -23663,13 +15110,16 @@ JNI_METHOD(void, TestClusterCluster, testNestedStructListArgumentRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testNotHandled)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OperationalCredentialsCluster, removeTrustedRootCertificate) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray trustedRootIdentifier) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type request; + chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::Type request; + + request.trustedRootIdentifier = chip::JniByteArray(env, static_cast(trustedRootIdentifier)).byteSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -23682,7 +15132,7 @@ JNI_METHOD(void, TestClusterCluster, testNotHandled)(JNIEnv * env, jobject self, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -23698,28 +15148,21 @@ JNI_METHOD(void, TestClusterCluster, testNotHandled)(JNIEnv * env, jobject self, onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testNullableOptionalRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) +JNI_METHOD(void, OperationalCredentialsCluster, updateFabricLabel) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring label) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type request; + chip::app::Clusters::OperationalCredentials::Commands::UpdateFabricLabel::Type request; - chip::JniReferences::GetInstance().GetOptionalValue(arg1, arg1); - uint8_t arg1Value; - if (arg1 != nullptr) - { - arg1Value = chip::JniReferences::GetInstance().IntegerToPrimitive(arg1); - } - request.arg1 = chip::Optional>( - arg1 == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(arg1Value)); + request.label = chip::JniUtfString(env, static_cast(label)).charSpan(); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23729,13 +15172,13 @@ JNI_METHOD(void, TestClusterCluster, testNullableOptionalRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( - onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -23746,21 +15189,23 @@ JNI_METHOD(void, TestClusterCluster, testNullableOptionalRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testSimpleOptionalArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) +JNI_METHOD(void, OperationalCredentialsCluster, updateNOC) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray NOCValue, jobject ICACValue) { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; + OperationalCredentialsCluster * cppCluster; - chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type request; + chip::app::Clusters::OperationalCredentials::Commands::UpdateNOC::Type request; - chip::JniReferences::GetInstance().GetOptionalValue(arg1, arg1); - request.arg1 = - chip::Optional(static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(arg1))); + request.NOCValue = chip::JniByteArray(env, static_cast(NOCValue)).byteSpan(); + chip::JniReferences::GetInstance().GetOptionalValue(ICACValue, ICACValue); + request.ICACValue = chip::Optional(chip::JniByteArray(env, static_cast(ICACValue)).byteSpan()); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23770,12 +15215,13 @@ JNI_METHOD(void, TestClusterCluster, testSimpleOptionalArgumentRequest) AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -23786,217 +15232,274 @@ JNI_METHOD(void, TestClusterCluster, testSimpleOptionalArgumentRequest) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testSpecific)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OperationalCredentialsCluster, subscribeSupportedFabricsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestSpecific::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::SupportedFabrics::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testStructArgumentRequest) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, - jobject f, jobject g, jobject h) +JNI_METHOD(void, OperationalCredentialsCluster, subscribeCommissionedFabricsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type request; - - request.arg1 = chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::CommissionedFabrics::TypeInfo; auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, testUnknownCommand)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OperationalCredentialsCluster, subscribeCurrentFabricIndexAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TestUnknownCommand::Type request; + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::CurrentFabricIndex::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, timedInvokeRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, OperationalCredentialsCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster; - - chip::app::Clusters::TestCluster::Commands::TimedInvokeRequest::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + OperationalCredentialsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, 10000); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, PowerSourceCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + PowerSourceCluster * cppCluster = new PowerSourceCluster(); -JNI_METHOD(void, TestClusterCluster, writeBooleanAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, PowerSourceCluster, subscribeStatusAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Boolean::TypeInfo; - TypeInfo::Type cppValue; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + CHIP_ERROR err = CHIP_NO_ERROR; + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Status::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, PowerSourceCluster, subscribeOrderAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Order::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeBooleanAttribute) +JNI_METHOD(void, PowerSourceCluster, subscribeDescriptionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBoolean(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Description::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24004,91 +15507,110 @@ JNI_METHOD(void, TestClusterCluster, subscribeBooleanAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportBooleanAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PowerSourceCluster, subscribeBatteryVoltageAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeBoolean(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryVoltage::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeBitmap8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, PowerSourceCluster, subscribeBatteryPercentRemainingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap8::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeBitmap8Attribute) +JNI_METHOD(void, PowerSourceCluster, subscribeBatteryTimeRemainingAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBitmap8(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24096,91 +15618,110 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap8Attribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportBitmap8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeLevelAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeBitmap8(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryChargeLevel::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeBitmap16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, PowerSourceCluster, subscribeBatteryChargeStateAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap16::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryChargeState::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeBitmap16Attribute) +JNI_METHOD(void, PowerSourceCluster, subscribeFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBitmap16(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::FeatureMap::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24188,91 +15729,128 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap16Attribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportBitmap16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PowerSourceCluster, subscribeClusterRevisionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + PowerSourceCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeBitmap16(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } +JNI_METHOD(jlong, PowerSourceConfigurationCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + PowerSourceConfigurationCluster * cppCluster = new PowerSourceConfigurationCluster(); -JNI_METHOD(void, TestClusterCluster, writeBitmap32Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(jlong, PressureMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap32::TypeInfo; - TypeInfo::Type cppValue; + PressureMeasurementCluster * cppCluster = new PressureMeasurementCluster(); - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); +JNI_METHOD(void, PressureMeasurementCluster, subscribeMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeBitmap32Attribute) +JNI_METHOD(void, PressureMeasurementCluster, subscribeMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBitmap32(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MinMeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24280,91 +15858,73 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap32Attribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportBitmap32Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeBitmap32(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeBitmap64Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, PressureMeasurementCluster, subscribeMaxMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap64::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeBitmap64Attribute) +JNI_METHOD(void, PressureMeasurementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PressureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBitmap64(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24372,91 +15932,83 @@ JNI_METHOD(void, TestClusterCluster, subscribeBitmap64Attribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportBitmap64Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, PumpConfigurationAndControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeBitmap64(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + PumpConfigurationAndControlCluster * cppCluster = new PumpConfigurationAndControlCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, TestClusterCluster, writeInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxPressureAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxPressure::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt8uAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxSpeedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt8u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxSpeed::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24464,91 +16016,112 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt8uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt8uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxFlowAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt8u(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxFlow::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstPressureAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstPressure::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt16uAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstPressureAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt16u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstPressure::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24556,91 +16129,113 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt16uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt16uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinCompPressureAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt16u(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinCompPressure::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt24uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxCompPressureAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxCompPressure::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt24uAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstSpeedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt24u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstSpeed::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24648,91 +16243,113 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt24uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt24uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstSpeedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt24u(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstSpeed::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt32uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstFlowAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstFlow::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt32uAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstFlowAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt32u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstFlow::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24740,91 +16357,113 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt32uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt32uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMinConstTempAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt32u(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstTemp::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt40uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeMaxConstTempAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstTemp::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt40uAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePumpStatusAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt40u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::PumpStatus::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24832,91 +16471,112 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt40uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt40uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveOperationModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt40u(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveOperationMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt48uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeEffectiveControlModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48u::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveControlMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt48uAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeCapacityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt48u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Capacity::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -24924,38 +16584,57 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt48uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt48uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeSpeedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt48u(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Speed::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, writeInt56uAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, writeLifetimeRunningHoursAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56u::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -24969,8 +16648,8 @@ JNI_METHOD(void, TestClusterCluster, writeInt56uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -24985,30 +16664,40 @@ JNI_METHOD(void, TestClusterCluster, writeInt56uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt56uAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeRunningHoursAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt56u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -25016,38 +16705,57 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt56uAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt56uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribePowerAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt56u(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Power::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, writeInt64uAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, writeLifetimeEnergyConsumedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64u::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -25061,8 +16769,8 @@ JNI_METHOD(void, TestClusterCluster, writeInt64uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -25077,30 +16785,40 @@ JNI_METHOD(void, TestClusterCluster, writeInt64uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt64uAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeLifetimeEnergyConsumedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt64u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -25109,34 +16827,11 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt64uAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportInt64uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeInt64u(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeInt8sAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, writeOperationModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8s::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; TypeInfo::Type cppValue; cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); @@ -25153,8 +16848,8 @@ JNI_METHOD(void, TestClusterCluster, writeInt8sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -25169,66 +16864,50 @@ JNI_METHOD(void, TestClusterCluster, writeInt8sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeInt8s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, reportInt8sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeOperationModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt8s(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, writeInt16sAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, writeControlModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16s::TypeInfo; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; TypeInfo::Type cppValue; cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); @@ -25245,8 +16924,8 @@ JNI_METHOD(void, TestClusterCluster, writeInt16sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -25261,30 +16940,37 @@ JNI_METHOD(void, TestClusterCluster, writeInt16sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt16sAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeControlModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt16s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -25292,91 +16978,112 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt16sAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt16sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeAlarmMaskAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt16s(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::AlarmMask::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt24sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeFeatureMapAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::FeatureMap::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt24sAttribute) +JNI_METHOD(void, PumpConfigurationAndControlCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + PumpConfigurationAndControlCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt24s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -25384,91 +17091,84 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt24sAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt24sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, RelativeHumidityMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeInt24s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + RelativeHumidityMeasurementCluster * cppCluster = new RelativeHumidityMeasurementCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, TestClusterCluster, writeInt32sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt32sAttribute) +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt32s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -25476,91 +17176,112 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt32sAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt32sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeMaxMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt32s(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt40sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeToleranceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::Tolerance::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt40sAttribute) +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInt40s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -25568,367 +17289,369 @@ JNI_METHOD(void, TestClusterCluster, subscribeInt40sAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt40sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, ScenesCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeInt40s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + ScenesCluster * cppCluster = new ScenesCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, TestClusterCluster, writeInt48sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ScenesCluster, addScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject transitionTime, + jstring sceneName, jobject clusterId, jobject length, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48s::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + chip::app::Clusters::Scenes::Commands::AddScene::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); + request.sceneName = chip::JniUtfString(env, static_cast(sceneName)).charSpan(); + request.extensionFieldSets = + chip::app::DataModel::List(); + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt48sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ScenesCluster, getSceneMembership)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; + + chip::app::Clusters::Scenes::Commands::GetSceneMembership::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeInt48s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt48sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ScenesCluster, recallScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId, jobject transitionTime) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeInt48s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; -JNI_METHOD(void, TestClusterCluster, writeInt56sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56s::TypeInfo; - TypeInfo::Type cppValue; + chip::app::Clusters::Scenes::Commands::RecallScene::Type request; - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + request.transitionTime = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(transitionTime)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt56sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ScenesCluster, removeAllScenes)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; + + chip::app::Clusters::Scenes::Commands::RemoveAllScenes::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeInt56s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt56sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ScenesCluster, removeScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::Scenes::Commands::RemoveScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInt56s(onReport->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeInt64sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ScenesCluster, storeScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64s::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + chip::app::Clusters::Scenes::Commands::StoreScene::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeInt64sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ScenesCluster, viewScene) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject groupId, jobject sceneId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster; + + chip::app::Clusters::Scenes::Commands::ViewScene::Type request; + + request.groupId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(groupId)); + request.sceneId = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(sceneId)); + std::unique_ptr onSuccess( + Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeInt64s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportInt64sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeInt64s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeEnum8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ScenesCluster, subscribeSceneCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum8::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Scenes::Attributes::SceneCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeEnum8Attribute) +JNI_METHOD(void, ScenesCluster, subscribeCurrentSceneAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeEnum8(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Scenes::Attributes::CurrentScene::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -25936,91 +17659,73 @@ JNI_METHOD(void, TestClusterCluster, subscribeEnum8Attribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportEnum8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeEnum8(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeEnum16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ScenesCluster, subscribeCurrentGroupAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum16::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Scenes::Attributes::CurrentGroup::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeEnum16Attribute) +JNI_METHOD(void, ScenesCluster, subscribeSceneValidAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeEnum16(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Scenes::Attributes::SceneValid::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -26028,91 +17733,73 @@ JNI_METHOD(void, TestClusterCluster, subscribeEnum16Attribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportEnum16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeEnum16(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeFloatSingleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, ScenesCluster, subscribeNameSupportAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatSingle::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().FloatToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Scenes::Attributes::NameSupport::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeFloatSingleAttribute) +JNI_METHOD(void, ScenesCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ScenesCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeFloatSingle(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Scenes::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -26120,91 +17807,80 @@ JNI_METHOD(void, TestClusterCluster, subscribeFloatSingleAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportFloatSingleAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, SoftwareDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeFloatSingle(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + SoftwareDiagnosticsCluster * cppCluster = new SoftwareDiagnosticsCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, TestClusterCluster, writeFloatDoubleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, SoftwareDiagnosticsCluster, resetWatermarks)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatDouble::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().DoubleToPrimitive(value)); + chip::app::Clusters::SoftwareDiagnostics::Commands::ResetWatermarks::Type request; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeFloatDoubleAttribute) +JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapFreeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeFloatDouble(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapFree::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -26212,91 +17888,111 @@ JNI_METHOD(void, TestClusterCluster, subscribeFloatDoubleAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportFloatDoubleAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapUsedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeFloatDouble(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapUsed::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeOctetStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) +JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeCurrentHeapHighWatermarkAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::OctetString::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeOctetStringAttribute) +JNI_METHOD(void, SoftwareDiagnosticsCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SoftwareDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOctetString(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -26304,91 +18000,82 @@ JNI_METHOD(void, TestClusterCluster, subscribeOctetStringAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportOctetStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, SwitchCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOctetString(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + SwitchCluster * cppCluster = new SwitchCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, TestClusterCluster, writeLongOctetStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) +JNI_METHOD(void, SwitchCluster, subscribeNumberOfPositionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongOctetString::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Switch::Attributes::NumberOfPositions::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeLongOctetStringAttribute) +JNI_METHOD(void, SwitchCluster, subscribeCurrentPositionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeLongOctetString(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Switch::Attributes::CurrentPosition::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -26396,91 +18083,110 @@ JNI_METHOD(void, TestClusterCluster, subscribeLongOctetStringAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportLongOctetStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, SwitchCluster, subscribeMultiPressMaxAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeLongOctetString(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Switch::Attributes::MultiPressMax::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeCharStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) +JNI_METHOD(void, SwitchCluster, subscribeFeatureMapAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::CharString::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::Switch::Attributes::FeatureMap::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeCharStringAttribute) +JNI_METHOD(void, SwitchCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + SwitchCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCharString(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Switch::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -26488,91 +18194,125 @@ JNI_METHOD(void, TestClusterCluster, subscribeCharStringAttribute) onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, TargetNavigatorCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + TargetNavigatorCluster * cppCluster = new TargetNavigatorCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} -JNI_METHOD(void, TestClusterCluster, reportCharStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TargetNavigatorCluster, navigateTargetRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject target, jstring data) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TargetNavigatorCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::TargetNavigator::Commands::NavigateTargetRequest::Type request; + + request.target = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(target)); + request.data = chip::JniUtfString(env, static_cast(data)).charSpan(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeCharString(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeLongCharStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) +JNI_METHOD(void, TargetNavigatorCluster, subscribeCurrentNavigatorTargetAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongCharString::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TargetNavigatorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TargetNavigator::Attributes::CurrentNavigatorTarget::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeLongCharStringAttribute) +JNI_METHOD(void, TargetNavigatorCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TargetNavigatorCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeLongCharString(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TargetNavigator::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -26580,91 +18320,83 @@ JNI_METHOD(void, TestClusterCluster, subscribeLongCharStringAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportLongCharStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, TemperatureMeasurementCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeLongCharString(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + TemperatureMeasurementCluster * cppCluster = new TemperatureMeasurementCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, TestClusterCluster, writeEpochUsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochUs::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeEpochUsAttribute) +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeEpochUs(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -26672,91 +18404,112 @@ JNI_METHOD(void, TestClusterCluster, subscribeEpochUsAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportEpochUsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeMaxMeasuredValueAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeEpochUs(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeEpochSAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeToleranceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochS::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::Tolerance::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); + VerifyOrReturn(err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeEpochSAttribute) +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeEpochS(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -26764,629 +18517,697 @@ JNI_METHOD(void, TestClusterCluster, subscribeEpochSAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportEpochSAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, TestClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeEpochS(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + TestClusterCluster * cppCluster = new TestClusterCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, TestClusterCluster, writeVendorIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TestClusterCluster, simpleStructEchoRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, + jobject f, jobject g, jobject h) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::VendorId::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.arg1 = chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeVendorIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, test)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::Test::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportVendorIdAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, testAddArguments) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type request; + + request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); + request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeVendorId(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeEnumAttrAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TestClusterCluster, testEnumsRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1, jobject arg2) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EnumAttr::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.arg1 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg1)); + request.arg2 = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(arg2)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeEnumAttrAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testListInt8UArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type request; + + request.arg1 = chip::app::DataModel::List(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeEnumAttr(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportEnumAttrAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, testListInt8UReverseRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type request; + + request.arg1 = chip::app::DataModel::List(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeEnumAttr(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TestClusterCluster, testListNestedStructListArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jobject d, jobject e, + jbyteArray f, jobject g) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8u::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.arg1 = chip::app::DataModel::List(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testListStructArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, + jobject f, jobject g, jobject h) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type request; + + request.arg1 = chip::app::DataModel::List(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeRangeRestrictedInt8u( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportRangeRestrictedInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, testNestedStructArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type request; + + request.arg1 = chip::app::Clusters::TestCluster::Structs::NestedStruct::Type(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRangeRestrictedInt8u(onReport->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TestClusterCluster, testNestedStructListArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jobject d, jobject e, + jbyteArray f, jobject g) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8s::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + request.arg1 = chip::app::Clusters::TestCluster::Structs::NestedStructList::Type(); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testNotHandled)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeRangeRestrictedInt8s( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportRangeRestrictedInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRangeRestrictedInt8s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TestClusterCluster, testNullableOptionalRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16u::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type request; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + chip::JniReferences::GetInstance().GetOptionalValue(arg1, arg1); + uint8_t arg1Value; + if (arg1 != nullptr) + { + arg1Value = chip::JniReferences::GetInstance().IntegerToPrimitive(arg1); + } + request.arg1 = chip::Optional>( + arg1 == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(arg1Value)); + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testSimpleOptionalArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject arg1) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type request; + + chip::JniReferences::GetInstance().GetOptionalValue(arg1, arg1); + request.arg1 = + chip::Optional(static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(arg1))); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRangeRestrictedInt16u( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportRangeRestrictedInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, testSpecific)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::TestCluster::Commands::TestSpecific::Type request; + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeRangeRestrictedInt16u(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TestClusterCluster, testStructArgumentRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject a, jobject b, jobject c, jbyteArray d, jstring e, + jobject f, jobject g, jobject h) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16s::TypeInfo; - TypeInfo::Type cppValue; - - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type request; + request.arg1 = chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type(); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, TestClusterCluster, testUnknownCommand)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + chip::app::Clusters::TestCluster::Commands::TestUnknownCommand::Type request; + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeRangeRestrictedInt16s( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportRangeRestrictedInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRangeRestrictedInt16s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeTimedWriteBooleanAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TestClusterCluster, timedInvokeRequest)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::TimedWriteBoolean::TypeInfo; - TypeInfo::Type cppValue; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; - cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + chip::app::Clusters::TestCluster::Commands::TimedInvokeRequest::Type request; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, 10000); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall, 10000); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, writeUnsupportedAttribute) +JNI_METHOD(void, TestClusterCluster, writeBooleanAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Unsupported::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Boolean::TypeInfo; TypeInfo::Type cppValue; cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); @@ -27419,18 +19240,18 @@ JNI_METHOD(void, TestClusterCluster, writeUnsupportedAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeUnsupportedAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeBooleanAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -27441,8 +19262,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeUnsupportedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeUnsupported(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Boolean::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -27451,42 +19278,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeUnsupportedAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportUnsupportedAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeUnsupported(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableBooleanAttribute) +JNI_METHOD(void, TestClusterCluster, writeBitmap8Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBoolean::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap8::TypeInfo; TypeInfo::Type cppValue; - bool valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().BooleanToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -27516,18 +19315,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableBooleanAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableBooleanAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeBitmap8Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -27538,8 +19337,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableBooleanAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableBoolean(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap8::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -27548,42 +19353,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableBooleanAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableBooleanAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableBoolean(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableBitmap8Attribute) +JNI_METHOD(void, TestClusterCluster, writeBitmap16Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap8::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap16::TypeInfo; TypeInfo::Type cppValue; - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -27613,18 +19390,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableBitmap8Attribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap8Attribute) +JNI_METHOD(void, TestClusterCluster, subscribeBitmap16Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -27635,8 +19412,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap8Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableBitmap8(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap16::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -27645,42 +19428,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap8Attribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableBitmap8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableBitmap8(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableBitmap16Attribute) +JNI_METHOD(void, TestClusterCluster, writeBitmap32Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap16::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap32::TypeInfo; TypeInfo::Type cppValue; - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -27710,47 +19465,21 @@ JNI_METHOD(void, TestClusterCluster, writeNullableBitmap16Attribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap16Attribute) +JNI_METHOD(void, TestClusterCluster, subscribeBitmap32Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->SubscribeAttributeNullableBitmap16(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, reportNullableBitmap16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -27758,27 +19487,30 @@ JNI_METHOD(void, TestClusterCluster, reportNullableBitmap16Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeNullableBitmap16(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap32::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, writeNullableBitmap32Attribute) +JNI_METHOD(void, TestClusterCluster, writeBitmap64Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap32::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap64::TypeInfo; TypeInfo::Type cppValue; - uint32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -27808,18 +19540,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableBitmap32Attribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap32Attribute) +JNI_METHOD(void, TestClusterCluster, subscribeBitmap64Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -27830,8 +19562,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap32Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableBitmap32(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap64::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -27840,43 +19578,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap32Attribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableBitmap32Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableBitmap32(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableBitmap64Attribute) +JNI_METHOD(void, TestClusterCluster, writeInt8uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap64::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8u::TypeInfo; TypeInfo::Type cppValue; - uint64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -27906,18 +19615,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableBitmap64Attribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap64Attribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt8uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -27928,8 +19637,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap64Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableBitmap64(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -27938,43 +19653,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap64Attribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableBitmap64Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableBitmap64(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt8uAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt16uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16u::TypeInfo; TypeInfo::Type cppValue; - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28004,18 +19690,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt8uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt16uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28026,8 +19712,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt8u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28036,42 +19728,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8uAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt8uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt8u(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt16uAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt24uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24u::TypeInfo; TypeInfo::Type cppValue; - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28101,18 +19765,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt16uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt24uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28123,8 +19787,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt16u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28133,42 +19803,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16uAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt16uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt16u(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt24uAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt32uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32u::TypeInfo; TypeInfo::Type cppValue; - uint32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28198,18 +19840,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt24uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt32uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28220,8 +19862,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt24u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28230,42 +19878,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24uAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt24uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt24u(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt32uAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt40uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40u::TypeInfo; TypeInfo::Type cppValue; - uint32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28295,18 +19915,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt32uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt40uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28317,8 +19937,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt32u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28327,42 +19953,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32uAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt32uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt32u(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt40uAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt48uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48u::TypeInfo; TypeInfo::Type cppValue; - uint64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28392,18 +19990,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt40uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt48uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28414,52 +20012,30 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt40u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TestClusterCluster, reportNullableInt40uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt40u(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, writeNullableInt48uAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt56uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56u::TypeInfo; TypeInfo::Type cppValue; - uint64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28489,18 +20065,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt48uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt56uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28511,8 +20087,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt48u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28521,42 +20103,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48uAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt48uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt48u(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt56uAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt64uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64u::TypeInfo; TypeInfo::Type cppValue; - uint64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28586,18 +20140,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt56uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt64uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28608,8 +20162,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt56u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28618,42 +20178,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56uAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt56uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt56u(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt64uAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt8sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8s::TypeInfo; TypeInfo::Type cppValue; - uint64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28683,18 +20215,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt64uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt8sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28705,8 +20237,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt64u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28715,42 +20253,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64uAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt64uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt64u(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt8sAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt16sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8s::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16s::TypeInfo; TypeInfo::Type cppValue; - int8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28780,18 +20290,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt8sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt16sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28802,8 +20312,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt8s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28812,42 +20328,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8sAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt8sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt8s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt16sAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt24sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16s::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24s::TypeInfo; TypeInfo::Type cppValue; - int16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28877,18 +20365,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt16sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt24sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28899,8 +20387,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt16s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int24s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -28909,42 +20403,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16sAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt16sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt16s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt24sAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt32sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24s::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32s::TypeInfo; TypeInfo::Type cppValue; - int32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -28974,18 +20440,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt24sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt32sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -28996,8 +20462,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt24s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29006,42 +20478,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24sAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt24sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt24s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt32sAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt40sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32s::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40s::TypeInfo; TypeInfo::Type cppValue; - int32_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -29071,18 +20515,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt32sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt40sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29093,8 +20537,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt32s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int40s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29103,42 +20553,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32sAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt32sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt32s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt40sAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt48sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40s::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48s::TypeInfo; TypeInfo::Type cppValue; - int64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -29168,18 +20590,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt40sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt48sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29190,8 +20612,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt40s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int48s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29200,42 +20628,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40sAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt40sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt40s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt48sAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt56sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48s::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56s::TypeInfo; TypeInfo::Type cppValue; - int64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -29265,18 +20665,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt48sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt56sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29287,8 +20687,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt48s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int56s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29297,42 +20703,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48sAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt48sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt48s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt56sAttribute) +JNI_METHOD(void, TestClusterCluster, writeInt64sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56s::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64s::TypeInfo; TypeInfo::Type cppValue; - int64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -29362,18 +20740,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt56sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeInt64sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29384,8 +20762,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt56s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29394,42 +20778,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56sAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt56sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt56s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableInt64sAttribute) +JNI_METHOD(void, TestClusterCluster, writeEnum8Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64s::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum8::TypeInfo; TypeInfo::Type cppValue; - int64_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -29459,18 +20815,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt64sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeEnum8Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29481,8 +20837,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableInt64s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum8::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29491,42 +20853,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64sAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableInt64sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableInt64s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableEnum8Attribute) +JNI_METHOD(void, TestClusterCluster, writeEnum16Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum8::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum16::TypeInfo; TypeInfo::Type cppValue; - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -29556,18 +20890,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableEnum8Attribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum8Attribute) +JNI_METHOD(void, TestClusterCluster, subscribeEnum16Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29578,8 +20912,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum8Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableEnum8(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum16::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29588,42 +20928,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum8Attribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableEnum8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableEnum8(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableEnum16Attribute) +JNI_METHOD(void, TestClusterCluster, writeFloatSingleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum16::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatSingle::TypeInfo; TypeInfo::Type cppValue; - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().FloatToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -29653,18 +20965,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableEnum16Attribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum16Attribute) +JNI_METHOD(void, TestClusterCluster, subscribeFloatSingleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29675,8 +20987,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum16Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableEnum16(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatSingle::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPFloatAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29685,42 +21003,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum16Attribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableEnum16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableEnum16(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableFloatSingleAttribute) +JNI_METHOD(void, TestClusterCluster, writeFloatDoubleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatSingle::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatDouble::TypeInfo; TypeInfo::Type cppValue; - float valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().FloatToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().DoubleToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -29750,18 +21040,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableFloatSingleAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatSingleAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeFloatDoubleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29772,8 +21062,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatSingleAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableFloatSingle(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::FloatDouble::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPDoubleAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29782,43 +21078,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatSingleAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableFloatSingleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableFloatSingle(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableFloatDoubleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TestClusterCluster, writeOctetStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatDouble::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::OctetString::TypeInfo; TypeInfo::Type cppValue; - double valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().DoubleToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -29848,18 +21115,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableFloatDoubleAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatDoubleAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeOctetStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29870,8 +21137,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatDoubleAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableFloatDouble(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::OctetString::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29880,44 +21153,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatDoubleAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableFloatDoubleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableFloatDouble(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableOctetStringAttribute) +JNI_METHOD(void, TestClusterCluster, writeLongOctetStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableOctetString::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongOctetString::TypeInfo; TypeInfo::Type cppValue; - chip::ByteSpan valueValue; - if (value != nullptr) - { - valueValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() - : chip::app::DataModel::Nullable(valueValue); + cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -29947,18 +21190,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableOctetStringAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableOctetStringAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeLongOctetStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -29969,8 +21212,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableOctetStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableOctetString(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongOctetString::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -29979,44 +21228,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableOctetStringAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableOctetStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableOctetString(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableCharStringAttribute) +JNI_METHOD(void, TestClusterCluster, writeCharStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableCharString::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::CharString::TypeInfo; TypeInfo::Type cppValue; - chip::CharSpan valueValue; - if (value != nullptr) - { - valueValue = chip::JniUtfString(env, static_cast(value)).charSpan(); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() - : chip::app::DataModel::Nullable(valueValue); + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -30046,18 +21265,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableCharStringAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableCharStringAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeCharStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -30068,8 +21287,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableCharStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableCharString(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::CharString::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -30078,44 +21303,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableCharStringAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableCharStringAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableCharString(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableEnumAttrAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +JNI_METHOD(void, TestClusterCluster, writeLongCharStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnumAttr::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongCharString::TypeInfo; TypeInfo::Type cppValue; - decltype(cppValue)::UnderlyingType valueValue; - if (value != nullptr) - { - valueValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() - : chip::app::DataModel::Nullable(valueValue); + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -30145,18 +21340,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableEnumAttrAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableEnumAttrAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeLongCharStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -30167,8 +21362,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableEnumAttrAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableEnumAttr(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongCharString::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -30177,43 +21378,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableEnumAttrAttribute) onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableEnumAttrAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableEnumAttr(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt8uAttribute) +JNI_METHOD(void, TestClusterCluster, writeEpochUsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochUs::TypeInfo; TypeInfo::Type cppValue; - uint8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -30243,18 +21415,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt8uAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeEpochUsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -30265,8 +21437,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8uAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableRangeRestrictedInt8u( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochUs::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -30275,43 +21453,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8uAttrib onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableRangeRestrictedInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableRangeRestrictedInt8u(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt8sAttribute) +JNI_METHOD(void, TestClusterCluster, writeEpochSAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8s::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochS::TypeInfo; TypeInfo::Type cppValue; - int8_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -30341,18 +21490,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt8sAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeEpochSAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -30363,8 +21512,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8sAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableRangeRestrictedInt8s( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochS::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -30373,43 +21528,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8sAttrib onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableRangeRestrictedInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableRangeRestrictedInt8s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt16uAttribute) +JNI_METHOD(void, TestClusterCluster, writeVendorIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16u::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::VendorId::TypeInfo; TypeInfo::Type cppValue; - uint16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -30439,18 +21565,19 @@ JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt16uAttribute onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16uAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeVendorIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -30461,8 +21588,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16uAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableRangeRestrictedInt16u( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::VendorId::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterVendorIdAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -30471,43 +21604,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16uAttri onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableRangeRestrictedInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNullableRangeRestrictedInt16u(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt16sAttribute) +JNI_METHOD(void, TestClusterCluster, writeEnumAttrAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16s::TypeInfo; - TypeInfo::Type cppValue; - - int16_t valueValue; - if (value != nullptr) - { - valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); - } - cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EnumAttr::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -30537,18 +21641,18 @@ JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt16sAttribute onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16sAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeEnumAttrAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -30559,8 +21663,14 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16sAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNullableRangeRestrictedInt16s( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EnumAttr::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -30569,33 +21679,15 @@ JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16sAttri onFailure.release(); } -JNI_METHOD(void, TestClusterCluster, reportNullableRangeRestrictedInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt8uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8u::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeNullableRangeRestrictedInt16s(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - onReport.release(); -} -JNI_METHOD(void, TestClusterCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -30614,24 +21706,31 @@ JNI_METHOD(void, TestClusterCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, TestClusterCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt8uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -30639,247 +21738,239 @@ JNI_METHOD(void, TestClusterCluster, reportClusterRevisionAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8u::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, ThermostatCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - ThermostatCluster * cppCluster = new ThermostatCluster(); + env, callback, "Error subscribing to attribute", err)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, clearWeeklySchedule)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8s::TypeInfo; + TypeInfo::Type cppValue; - chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::Type request; + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, getRelayStatusLog)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster; - - chip::app::Clusters::Thermostat::Commands::GetRelayStatusLog::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt8s::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, getWeeklySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject daysToReturn, jobject modeToReturn) + +JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16u::TypeInfo; + TypeInfo::Type cppValue; - chip::app::Clusters::Thermostat::Commands::GetWeeklySchedule::Type request; + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - request.daysToReturn = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(daysToReturn)); - request.modeToReturn = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(modeToReturn)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr - onSuccess(Platform::New(callback), - Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, setWeeklySchedule) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject numberOfTransitionsForSequence, - jobject dayOfWeekForSequence, jobject modeForSequence, jobject payload) +JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster; - - chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Type request; - - request.numberOfTransitionsForSequence = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(numberOfTransitionsForSequence)); - request.dayOfWeekForSequence = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(dayOfWeekForSequence)); - request.modeForSequence = - static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(modeForSequence)); - request.payload = chip::app::DataModel::List(); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16u::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, setpointRaiseLower) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject mode, jobject amount) + +JNI_METHOD(void, TestClusterCluster, writeRangeRestrictedInt16sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16s::TypeInfo; + TypeInfo::Type cppValue; - chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type request; + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - request.mode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(mode)); - request.amount = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(amount)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeLocalTemperatureAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeRangeRestrictedInt16sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeLocalTemperature(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::RangeRestrictedInt16s::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -30888,32 +21979,53 @@ JNI_METHOD(void, ThermostatCluster, subscribeLocalTemperatureAttribute) onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, reportLocalTemperatureAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeTimedWriteBooleanAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::TimedWriteBoolean::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeLocalTemperature(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, 10000); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeAbsMinHeatSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, TestClusterCluster, writeUnsupportedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Unsupported::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -30926,49 +22038,74 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMinHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeAbsMinHeatSetpointLimit( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, reportAbsMinHeatSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeUnsupportedAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeAbsMinHeatSetpointLimit(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Unsupported::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxHeatSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, TestClusterCluster, writeNullableBooleanAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBoolean::TypeInfo; + TypeInfo::Type cppValue; + + bool valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().BooleanToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -30981,49 +22118,75 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeAbsMaxHeatSetpointLimit( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, reportAbsMaxHeatSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeNullableBooleanAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeAbsMaxHeatSetpointLimit(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBoolean::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableBooleanAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeAbsMinCoolSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap8Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap8::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -31036,49 +22199,75 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMinCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeAbsMinCoolSetpointLimit( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, reportAbsMinCoolSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap8Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeAbsMinCoolSetpointLimit(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap8::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableBitmap8AttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxCoolSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap16::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -31091,54 +22280,74 @@ JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeAbsMaxCoolSetpointLimit( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, reportAbsMaxCoolSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeAbsMaxCoolSetpointLimit(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap16::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableBitmap16AttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, writeOccupiedCoolingSetpointAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap32Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap32::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -31152,8 +22361,8 @@ JNI_METHOD(void, ThermostatCluster, writeOccupiedCoolingSetpointAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -31168,30 +22377,37 @@ JNI_METHOD(void, ThermostatCluster, writeOccupiedCoolingSetpointAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeOccupiedCoolingSetpointAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap32Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOccupiedCoolingSetpoint( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap32::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableBitmap32AttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -31200,38 +22416,19 @@ JNI_METHOD(void, ThermostatCluster, subscribeOccupiedCoolingSetpointAttribute) onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, reportOccupiedCoolingSetpointAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOccupiedCoolingSetpoint(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ThermostatCluster, writeOccupiedHeatingSetpointAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableBitmap64Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap64::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -31245,8 +22442,8 @@ JNI_METHOD(void, ThermostatCluster, writeOccupiedHeatingSetpointAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -31261,30 +22458,37 @@ JNI_METHOD(void, ThermostatCluster, writeOccupiedHeatingSetpointAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeOccupiedHeatingSetpointAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableBitmap64Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOccupiedHeatingSetpoint( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap64::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableBitmap64AttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -31293,38 +22497,19 @@ JNI_METHOD(void, ThermostatCluster, subscribeOccupiedHeatingSetpointAttribute) onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, reportOccupiedHeatingSetpointAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOccupiedHeatingSetpoint(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ThermostatCluster, writeMinHeatSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableInt8uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8u::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -31338,8 +22523,8 @@ JNI_METHOD(void, ThermostatCluster, writeMinHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -31354,30 +22539,37 @@ JNI_METHOD(void, ThermostatCluster, writeMinHeatSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeMinHeatSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinHeatSetpointLimit( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -31386,38 +22578,19 @@ JNI_METHOD(void, ThermostatCluster, subscribeMinHeatSetpointLimitAttribute) onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, reportMinHeatSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMinHeatSetpointLimit(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ThermostatCluster, writeMaxHeatSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableInt16uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16u::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -31431,8 +22604,8 @@ JNI_METHOD(void, ThermostatCluster, writeMaxHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -31447,30 +22620,37 @@ JNI_METHOD(void, ThermostatCluster, writeMaxHeatSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeMaxHeatSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxHeatSetpointLimit( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -31479,38 +22659,19 @@ JNI_METHOD(void, ThermostatCluster, subscribeMaxHeatSetpointLimitAttribute) onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, reportMaxHeatSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxHeatSetpointLimit(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ThermostatCluster, writeMinCoolSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableInt24uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24u::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -31524,8 +22685,8 @@ JNI_METHOD(void, ThermostatCluster, writeMinCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -31540,30 +22701,37 @@ JNI_METHOD(void, ThermostatCluster, writeMinCoolSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeMinCoolSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinCoolSetpointLimit( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt24uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -31571,39 +22739,101 @@ JNI_METHOD(void, ThermostatCluster, subscribeMinCoolSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, reportMinCoolSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) + +JNI_METHOD(void, TestClusterCluster, writeNullableInt32uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32u::TypeInfo; + TypeInfo::Type cppValue; + + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeMinCoolSetpointLimit(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, writeMaxCoolSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableInt40uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40u::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -31617,8 +22847,8 @@ JNI_METHOD(void, ThermostatCluster, writeMaxCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -31633,30 +22863,37 @@ JNI_METHOD(void, ThermostatCluster, writeMaxCoolSetpointLimitAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeMaxCoolSetpointLimitAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMaxCoolSetpointLimit( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt40uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -31665,38 +22902,19 @@ JNI_METHOD(void, ThermostatCluster, subscribeMaxCoolSetpointLimitAttribute) onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, reportMaxCoolSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMaxCoolSetpointLimit(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableInt48uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48u::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -31710,8 +22928,8 @@ JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -31726,30 +22944,37 @@ JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeMinSetpointDeadBandAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMinSetpointDeadBand(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt48uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -31758,38 +22983,19 @@ JNI_METHOD(void, ThermostatCluster, subscribeMinSetpointDeadBandAttribute) onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, reportMinSetpointDeadBandAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMinSetpointDeadBand(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ThermostatCluster, writeControlSequenceOfOperationAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableInt56uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56u::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -31803,8 +23009,8 @@ JNI_METHOD(void, ThermostatCluster, writeControlSequenceOfOperationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -31819,30 +23025,37 @@ JNI_METHOD(void, ThermostatCluster, writeControlSequenceOfOperationAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeControlSequenceOfOperationAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeControlSequenceOfOperation( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt56uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -31851,38 +23064,19 @@ JNI_METHOD(void, ThermostatCluster, subscribeControlSequenceOfOperationAttribute onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, reportControlSequenceOfOperationAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeControlSequenceOfOperation(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ThermostatCluster, writeSystemModeAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableInt64uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::Thermostat::Attributes::SystemMode::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64u::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -31896,8 +23090,8 @@ JNI_METHOD(void, ThermostatCluster, writeSystemModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -31912,30 +23106,37 @@ JNI_METHOD(void, ThermostatCluster, writeSystemModeAttribute) onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeSystemModeAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSystemMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -31944,32 +23145,20 @@ JNI_METHOD(void, ThermostatCluster, subscribeSystemModeAttribute) onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, reportSystemModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8s::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeSystemMode(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + int8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - onReport.release(); -} -JNI_METHOD(void, ThermostatCluster, subscribeStartOfWeekAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -31982,48 +23171,75 @@ JNI_METHOD(void, ThermostatCluster, subscribeStartOfWeekAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeStartOfWeek(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, reportStartOfWeekAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeStartOfWeek(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeNumberOfWeeklyTransitionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, TestClusterCluster, writeNullableInt16sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16s::TypeInfo; + TypeInfo::Type cppValue; + + int16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -32036,69 +23252,53 @@ JNI_METHOD(void, ThermostatCluster, subscribeNumberOfWeeklyTransitionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNumberOfWeeklyTransitions( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, reportNumberOfWeeklyTransitionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeNumberOfWeeklyTransitions(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ThermostatCluster, subscribeNumberOfDailyTransitionsAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt16sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNumberOfDailyTransitions( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -32107,33 +23307,20 @@ JNI_METHOD(void, ThermostatCluster, subscribeNumberOfDailyTransitionsAttribute) onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, reportNumberOfDailyTransitionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableInt24sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24s::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeNumberOfDailyTransitions(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + int32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - onReport.release(); -} -JNI_METHOD(void, ThermostatCluster, subscribeFeatureMapAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -32146,48 +23333,75 @@ JNI_METHOD(void, ThermostatCluster, subscribeFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, reportFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt24sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeFeatureMap(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt24s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt24sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThermostatCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, TestClusterCluster, writeNullableInt32sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32s::TypeInfo; + TypeInfo::Type cppValue; + + int32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -32200,62 +23414,74 @@ JNI_METHOD(void, ThermostatCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt32sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt32sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, ThermostatUserInterfaceConfigurationCluster, initWithDevice) -(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - ThermostatUserInterfaceConfigurationCluster * cppCluster = new ThermostatUserInterfaceConfigurationCluster(); + env, callback, "Error subscribing to attribute", err)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeTemperatureDisplayModeAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableInt40sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40s::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + int64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -32269,9 +23495,8 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeTemperatureDi chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -32286,31 +23511,37 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeTemperatureDi onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeTemperatureDisplayModeAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt40sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTemperatureDisplayMode( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt40s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt40sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -32319,39 +23550,19 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeTemperatu onFailure.release(); } -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, reportTemperatureDisplayModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTemperatureDisplayMode(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeKeypadLockoutAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableInt48sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48s::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + int64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -32365,9 +23576,8 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeKeypadLockout chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -32382,31 +23592,37 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeKeypadLockout onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeKeypadLockoutAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt48sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeKeypadLockout(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt48s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt48sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -32415,39 +23631,19 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeKeypadLoc onFailure.release(); } -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, reportKeypadLockoutAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeKeypadLockout(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} - -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeScheduleProgrammingVisibilityAttribute) +JNI_METHOD(void, TestClusterCluster, writeNullableInt56sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56s::TypeInfo; TypeInfo::Type cppValue; - cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + int64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); @@ -32461,9 +23657,8 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeScheduleProgr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); @@ -32478,31 +23673,37 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeScheduleProgr onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeScheduleProgrammingVisibilityAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt56sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeScheduleProgrammingVisibility( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt56s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt56sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -32511,34 +23712,20 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeScheduleP onFailure.release(); } -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, reportScheduleProgrammingVisibilityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableInt64sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64s::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeScheduleProgrammingVisibility(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + int64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - onReport.release(); -} -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -32551,115 +23738,134 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeClusterRe chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeNullableInt64sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThermostatUserInterfaceConfigurationCluster * cppCluster = - reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableInt64sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, ThreadNetworkDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - ThreadNetworkDiagnosticsCluster * cppCluster = new ThreadNetworkDiagnosticsCluster(); + env, callback, "Error subscribing to attribute", err)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, resetCounts)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableEnum8Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum8::TypeInfo; + TypeInfo::Type cppValue; - chip::app::Clusters::ThreadNetworkDiagnostics::Commands::ResetCounts::Type request; + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeChannelAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum8Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeChannel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum8::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableEnum8AttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -32668,33 +23874,20 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeChannelAttribute) onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportChannelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableEnum16Attribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum16::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeChannel(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRoutingRoleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -32707,69 +23900,53 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRoutingRoleAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRoutingRole(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRoutingRoleAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRoutingRole(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeNetworkNameAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableEnum16Attribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeNetworkName(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum16::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableEnum16AttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -32778,53 +23955,80 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeNetworkNameAttribute) onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportNetworkNameAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableFloatSingleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatSingle::TypeInfo; + TypeInfo::Type cppValue; + + float valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().FloatToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeNetworkName(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePanIdAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatSingleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePanId(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatSingle::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableFloatSingleAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -32833,33 +24037,20 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePanIdAttribute) onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportPanIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableFloatDoubleAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatDouble::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributePanId(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + double valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().DoubleToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeExtendedPanIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -32872,69 +24063,54 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeExtendedPanIdAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeExtendedPanId(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportExtendedPanIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeExtendedPanId(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeMeshLocalPrefixAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableFloatDoubleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMeshLocalPrefix(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableFloatDouble::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableFloatDoubleAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -32943,33 +24119,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeMeshLocalPrefixAttrib onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportMeshLocalPrefixAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableOctetStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableOctetString::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeMeshLocalPrefix(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + chip::ByteSpan valueValue; + if (value != nullptr) + { + valueValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(valueValue); - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeOverrunCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -32982,69 +24146,54 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeOverrunCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOverrunCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportOverrunCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOverrunCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePartitionIdAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableOctetStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePartitionId(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableOctetString::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33053,33 +24202,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePartitionIdAttribute) onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportPartitionIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableCharStringAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableCharString::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributePartitionId(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + chip::CharSpan valueValue; + if (value != nullptr) + { + valueValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(valueValue); - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeWeightingAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -33092,69 +24229,54 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeWeightingAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeWeighting(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportWeightingAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeWeighting(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeDataVersionAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableCharStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeDataVersion(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableCharString::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33163,53 +24285,80 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeDataVersionAttribute) onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportDataVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableEnumAttrAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnumAttr::TypeInfo; + TypeInfo::Type cppValue; + + decltype(cppValue)::UnderlyingType valueValue; + if (value != nullptr) + { + valueValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(valueValue); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeDataVersion(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeStableDataVersionAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableEnumAttrAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeStableDataVersion(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnumAttr::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPTestClusterNullableEnumAttrAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33218,33 +24367,20 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeStableDataVersionAttr onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportStableDataVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt8uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8u::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeStableDataVersion(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeLeaderRouterIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -33257,69 +24393,56 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeLeaderRouterIdAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeLeaderRouterId(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportLeaderRouterIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeLeaderRouterId(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeDetachedRoleCountAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8uAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeDetachedRoleCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPTestClusterNullableRangeRestrictedInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33328,33 +24451,20 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeDetachedRoleCountAttr onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportDetachedRoleCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt8sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8s::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeDetachedRoleCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + int8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeChildRoleCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -33367,69 +24477,56 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeChildRoleCountAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeChildRoleCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportChildRoleCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeChildRoleCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRouterRoleCountAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt8sAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRouterRoleCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt8s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPTestClusterNullableRangeRestrictedInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33438,33 +24535,20 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRouterRoleCountAttrib onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRouterRoleCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16u::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeRouterRoleCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeLeaderRoleCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -33477,49 +24561,78 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeLeaderRoleCountAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeLeaderRoleCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportLeaderRoleCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16uAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeLeaderRoleCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16u::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPTestClusterNullableRangeRestrictedInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeAttachAttemptCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, TestClusterCluster, writeNullableRangeRestrictedInt16sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16s::TypeInfo; + TypeInfo::Type cppValue; + + int16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -33532,69 +24645,93 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeAttachAttemptCountAtt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeAttachAttemptCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportAttachAttemptCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, TestClusterCluster, subscribeNullableRangeRestrictedInt16sAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeAttachAttemptCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableRangeRestrictedInt16s::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPTestClusterNullableRangeRestrictedInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePartitionIdChangeCountAttribute) +JNI_METHOD(void, TestClusterCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePartitionIdChangeCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33602,164 +24739,246 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePartitionIdChangeCoun onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, ThermostatCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + ThermostatCluster * cppCluster = new ThermostatCluster(); -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportPartitionIdChangeCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, ThermostatCluster, clearWeeklySchedule)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::Thermostat::Commands::ClearWeeklySchedule::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributePartitionIdChangeCount(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeBetterPartitionAttachAttemptCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ThermostatCluster, getRelayStatusLog)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster; + + chip::app::Clusters::Thermostat::Commands::GetRelayStatusLog::Type request; + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeBetterPartitionAttachAttemptCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportBetterPartitionAttachAttemptCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, getWeeklySchedule) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject daysToReturn, jobject modeToReturn) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::Thermostat::Commands::GetWeeklySchedule::Type request; + + request.daysToReturn = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(daysToReturn)); + request.modeToReturn = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(modeToReturn)); + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeBetterPartitionAttachAttemptCount(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeParentChangeCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, ThermostatCluster, setWeeklySchedule) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject numberOfTransitionsForSequence, + jobject dayOfWeekForSequence, jobject modeForSequence, jobject payload) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster; + + chip::app::Clusters::Thermostat::Commands::SetWeeklySchedule::Type request; + + request.numberOfTransitionsForSequence = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(numberOfTransitionsForSequence)); + request.dayOfWeekForSequence = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(dayOfWeekForSequence)); + request.modeForSequence = + static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(modeForSequence)); + request.payload = chip::app::DataModel::List(); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeParentChangeCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportParentChangeCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, setpointRaiseLower) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject mode, jobject amount) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::Thermostat::Commands::SetpointRaiseLower::Type request; + + request.mode = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(mode)); + request.amount = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(amount)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeParentChangeCount(onReport->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxTotalCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeLocalTemperatureAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxTotalCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::LocalTemperature::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33767,54 +24986,73 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxTotalCountAttribute onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxTotalCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, subscribeAbsMinHeatSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxTotalCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMinHeatSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxUnicastCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxHeatSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxUnicastCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMaxHeatSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33822,54 +25060,73 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxUnicastCountAttribu onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxUnicastCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, subscribeAbsMinCoolSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxUnicastCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxBroadcastCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeAbsMaxCoolSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxBroadcastCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33878,53 +25135,73 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxBroadcastCountAttri onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxBroadcastCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, writeOccupiedCoolingSetpointAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxBroadcastCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxAckRequestedCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeOccupiedCoolingSetpointAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxAckRequestedCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33933,53 +25210,73 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxAckRequestedCountAt onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxAckRequestedCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, writeOccupiedHeatingSetpointAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxAckRequestedCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxAckedCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeOccupiedHeatingSetpointAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxAckedCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -33988,53 +25285,73 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxAckedCountAttribute onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxAckedCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, writeMinHeatSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxAckedCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxNoAckRequestedCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeMinHeatSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxNoAckRequestedCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34043,53 +25360,73 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxNoAckRequestedCount onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxNoAckRequestedCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, writeMaxHeatSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxNoAckRequestedCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxDataCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeMaxHeatSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxDataCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34098,53 +25435,73 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxDataCountAttribute) onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxDataCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, writeMinCoolSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxDataCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxDataPollCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeMinCoolSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxDataPollCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34153,33 +25510,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxDataPollCountAttrib onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxDataPollCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, writeMaxCoolSetpointLimitAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeTxDataPollCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxBeaconCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -34192,69 +25531,52 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxBeaconCountAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxBeaconCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxBeaconCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTxBeaconCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxBeaconRequestCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeMaxCoolSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxBeaconRequestCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34263,33 +25585,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxBeaconRequestCountA onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxBeaconRequestCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; + TypeInfo::Type cppValue; - err = cppCluster->ReportAttributeTxBeaconRequestCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxOtherCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -34302,49 +25606,69 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxOtherCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxOtherCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxOtherCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, subscribeMinSetpointDeadBandAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxOtherCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxRetryCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ThermostatCluster, writeControlSequenceOfOperationAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -34357,49 +25681,69 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxRetryCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxRetryCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxRetryCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, subscribeControlSequenceOfOperationAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxRetryCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxDirectMaxRetryExpiryCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ThermostatCluster, writeSystemModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::SystemMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -34412,69 +25756,89 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxDirectMaxRetryExpir chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxDirectMaxRetryExpiryCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxDirectMaxRetryExpiryCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, subscribeSystemModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxDirectMaxRetryExpiryCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::SystemMode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxIndirectMaxRetryExpiryCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeStartOfWeekAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxIndirectMaxRetryExpiryCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::StartOfWeek::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34482,54 +25846,73 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxIndirectMaxRetryExp onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxIndirectMaxRetryExpiryCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, subscribeNumberOfWeeklyTransitionsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxIndirectMaxRetryExpiryCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::NumberOfWeeklyTransitions::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxErrCcaCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeNumberOfDailyTransitionsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxErrCcaCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::NumberOfDailyTransitions::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34537,54 +25920,73 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxErrCcaCountAttribut onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxErrCcaCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatCluster, subscribeFeatureMapAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxErrCcaCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::FeatureMap::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxErrAbortCountAttribute) +JNI_METHOD(void, ThermostatCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxErrAbortCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34592,34 +25994,25 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxErrAbortCountAttrib onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxErrAbortCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, ThermostatUserInterfaceConfigurationCluster, initWithDevice) +(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTxErrAbortCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + ThermostatUserInterfaceConfigurationCluster * cppCluster = new ThermostatUserInterfaceConfigurationCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxErrBusyChannelCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeTemperatureDisplayModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -34632,49 +26025,72 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxErrBusyChannelCount chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatUserInterfaceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTxErrBusyChannelCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportTxErrBusyChannelCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeTemperatureDisplayModeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatUserInterfaceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeTxErrBusyChannelCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; + auto successFn = + chip::Callback::Callback:: + FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxTotalCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeKeypadLockoutAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -34687,49 +26103,72 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxTotalCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatUserInterfaceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxTotalCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxTotalCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeKeypadLockoutAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatUserInterfaceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxTotalCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxUnicastCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) + +JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeScheduleProgrammingVisibilityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -34742,69 +26181,93 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxUnicastCountAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatUserInterfaceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxUnicastCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxUnicastCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeScheduleProgrammingVisibilityAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatUserInterfaceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxUnicastCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; + auto successFn = chip::Callback:: + Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBroadcastCountAttribute) +JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatUserInterfaceConfigurationCluster * cppCluster = + reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxBroadcastCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback< + CHIPThermostatUserInterfaceConfigurationClusterClusterRevisionAttributeCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34812,42 +26275,62 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBroadcastCountAttri onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, ThreadNetworkDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + ThreadNetworkDiagnosticsCluster * cppCluster = new ThreadNetworkDiagnosticsCluster(); -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxBroadcastCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, resetCounts)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::ThreadNetworkDiagnostics::Commands::ResetCounts::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeRxBroadcastCount(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDataCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeChannelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -34858,8 +26341,14 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDataCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxDataCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Channel::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34867,42 +26356,18 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDataCountAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxDataCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeRxDataCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDataPollCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRoutingRoleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -34913,8 +26378,14 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDataPollCountAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxDataPollCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RoutingRole::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34922,16 +26393,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDataPollCountAttrib onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxDataPollCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeNetworkNameAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -34939,25 +26415,33 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxDataPollCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxDataPollCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::NetworkName::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBeaconCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePanIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -34968,8 +26452,14 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBeaconCountAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxBeaconCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PanId::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -34977,16 +26467,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBeaconCountAttribut onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxBeaconCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeExtendedPanIdAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -34994,25 +26489,34 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxBeaconCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxBeaconCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ExtendedPanId::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBeaconRequestCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeMeshLocalPrefixAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35023,8 +26527,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBeaconRequestCountA chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxBeaconRequestCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35032,16 +26543,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBeaconRequestCountA onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxBeaconRequestCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeOverrunCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35049,25 +26565,33 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxBeaconRequestCountAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxBeaconRequestCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxOtherCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePartitionIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35078,8 +26602,14 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxOtherCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxOtherCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionId::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35087,16 +26617,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxOtherCountAttribute onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxOtherCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeWeightingAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35104,25 +26639,33 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxOtherCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxOtherCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Weighting::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxAddressFilteredCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeDataVersionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35133,8 +26676,14 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxAddressFilteredCoun chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxAddressFilteredCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::DataVersion::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35142,16 +26691,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxAddressFilteredCoun onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxAddressFilteredCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeStableDataVersionAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35159,25 +26713,34 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxAddressFilteredCountAt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxAddressFilteredCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::StableDataVersion::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDestAddrFilteredCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeLeaderRouterIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35188,8 +26751,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDestAddrFilteredCou chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxDestAddrFilteredCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRouterId::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35197,16 +26767,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDestAddrFilteredCou onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxDestAddrFilteredCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeDetachedRoleCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35214,25 +26789,34 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxDestAddrFilteredCountA chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxDestAddrFilteredCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDuplicatedCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeChildRoleCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35243,8 +26827,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDuplicatedCountAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxDuplicatedCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ChildRoleCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35252,16 +26843,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDuplicatedCountAttr onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxDuplicatedCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRouterRoleCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35269,25 +26865,34 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxDuplicatedCountAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxDuplicatedCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RouterRoleCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrNoFrameCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeLeaderRoleCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35298,8 +26903,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrNoFrameCountAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxErrNoFrameCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35307,16 +26919,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrNoFrameCountAttr onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrNoFrameCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeAttachAttemptCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35324,25 +26941,34 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrNoFrameCountAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxErrNoFrameCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrUnknownNeighborCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePartitionIdChangeCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35353,8 +26979,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrUnknownNeighborC chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxErrUnknownNeighborCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35362,16 +26995,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrUnknownNeighborC onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrUnknownNeighborCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeBetterPartitionAttachAttemptCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35379,25 +27017,34 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrUnknownNeighborCoun chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxErrUnknownNeighborCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::TypeInfo; + auto successFn = + chip::Callback::Callback:: + FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrInvalidSrcAddrCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeParentChangeCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35408,8 +27055,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrInvalidSrcAddrCo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxErrInvalidSrcAddrCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ParentChangeCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35417,16 +27071,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrInvalidSrcAddrCo onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrInvalidSrcAddrCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxTotalCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35434,25 +27093,33 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrInvalidSrcAddrCount chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxErrInvalidSrcAddrCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxTotalCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrSecCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxUnicastCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35463,8 +27130,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrSecCountAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxErrSecCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxUnicastCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35472,16 +27146,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrSecCountAttribut onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrSecCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxBroadcastCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35489,25 +27168,34 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrSecCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxErrSecCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrFcsCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxAckRequestedCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35518,8 +27206,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrFcsCountAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxErrFcsCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35527,16 +27222,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrFcsCountAttribut onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrFcsCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxAckedCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35544,25 +27244,33 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrFcsCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxErrFcsCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckedCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrOtherCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxNoAckRequestedCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35573,8 +27281,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrOtherCountAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRxErrOtherCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35582,16 +27297,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrOtherCountAttrib onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrOtherCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxDataCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35599,25 +27319,33 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportRxErrOtherCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRxErrOtherCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeActiveTimestampAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxDataPollCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35628,8 +27356,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeActiveTimestampAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeActiveTimestamp(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataPollCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35637,16 +27372,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeActiveTimestampAttrib onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportActiveTimestampAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxBeaconCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35654,25 +27394,34 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportActiveTimestampAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeActiveTimestamp(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePendingTimestampAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxBeaconRequestCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35683,8 +27432,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePendingTimestampAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePendingTimestamp(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35692,16 +27448,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePendingTimestampAttri onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportPendingTimestampAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxOtherCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35709,25 +27470,33 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportPendingTimestampAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePendingTimestamp(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxOtherCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeDelayAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxRetryCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35738,8 +27507,14 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeDelayAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeDelay(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxRetryCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35747,16 +27522,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeDelayAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportDelayAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxDirectMaxRetryExpiryCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35764,25 +27544,33 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportDelayAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeDelay(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::TypeInfo; + auto successFn = chip::Callback::Callback< + CHIPThreadNetworkDiagnosticsClusterTxDirectMaxRetryExpiryCountAttributeCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeChannelMaskAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxIndirectMaxRetryExpiryCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35793,8 +27581,14 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeChannelMaskAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeChannelMask(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo; + auto successFn = chip::Callback::Callback< + CHIPThreadNetworkDiagnosticsClusterTxIndirectMaxRetryExpiryCountAttributeCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35802,16 +27596,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeChannelMaskAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportChannelMaskAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxErrCcaCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35819,25 +27618,34 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportChannelMaskAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeChannelMask(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxErrAbortCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -35848,8 +27656,15 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeClusterRevisionAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35857,16 +27672,21 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeClusterRevisionAttrib onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeTxErrBusyChannelCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -35874,55 +27694,52 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, reportClusterRevisionAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, UserLabelCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - UserLabelCluster * cppCluster = new UserLabelCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(jlong, WakeOnLanCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - WakeOnLanCluster * cppCluster = new WakeOnLanCluster(); + env, callback, "Error subscribing to attribute", err)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, WakeOnLanCluster, subscribeWakeOnLanMacAddressAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxTotalCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WakeOnLanCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeWakeOnLanMacAddress(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxTotalCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35930,54 +27747,75 @@ JNI_METHOD(void, WakeOnLanCluster, subscribeWakeOnLanMacAddressAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WakeOnLanCluster, reportWakeOnLanMacAddressAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxUnicastCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WakeOnLanCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeWakeOnLanMacAddress(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxUnicastCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WakeOnLanCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBroadcastCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WakeOnLanCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -35985,97 +27823,112 @@ JNI_METHOD(void, WakeOnLanCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WakeOnLanCluster, reportClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDataCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WakeOnLanCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, WiFiNetworkDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - WiFiNetworkDiagnosticsCluster * cppCluster = new WiFiNetworkDiagnosticsCluster(); + env, callback, "Error subscribing to attribute", err)); - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); + onSuccess.release(); + onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, resetCounts)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDataPollCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster; - - chip::app::Clusters::WiFiNetworkDiagnostics::Commands::ResetCounts::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataPollCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeBssidAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBeaconCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBssid(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36083,54 +27936,74 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeBssidAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportBssidAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxBeaconRequestCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeBssid(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeSecurityTypeAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxOtherCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSecurityType(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxOtherCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36138,54 +28011,75 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeSecurityTypeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportSecurityTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxAddressFilteredCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeSecurityType(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeWiFiVersionAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDestAddrFilteredCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeWiFiVersion(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36193,54 +28087,75 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeWiFiVersionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportWiFiVersionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxDuplicatedCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeWiFiVersion(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeChannelNumberAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrNoFrameCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeChannelNumber(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36248,54 +28163,75 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeChannelNumberAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportChannelNumberAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrUnknownNeighborCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeChannelNumber(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeRssiAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrInvalidSrcAddrCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeRssi(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36303,53 +28239,75 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeRssiAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportRssiAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrSecCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeRssi(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrSecCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeBeaconLostCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrFcsCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBeaconLostCount(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36357,54 +28315,75 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeBeaconLostCountAttribut onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportBeaconLostCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeRxErrOtherCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeBeaconLostCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeBeaconRxCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeActiveTimestampAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeBeaconRxCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36412,54 +28391,74 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeBeaconRxCountAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportBeaconRxCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribePendingTimestampAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeBeaconRxCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PendingTimestamp::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketMulticastRxCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeDelayAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePacketMulticastRxCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Delay::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36467,54 +28466,74 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketMulticastRxCountA onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportPacketMulticastRxCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeChannelMaskAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributePacketMulticastRxCount(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ChannelMask::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketMulticastTxCountAttribute) +JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + ThreadNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePacketMulticastTxCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36522,54 +28541,54 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketMulticastTxCountA onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportPacketMulticastTxCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(jlong, UserLabelCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + UserLabelCluster * cppCluster = new UserLabelCluster(); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} - err = cppCluster->ReportAttributePacketMulticastTxCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); +JNI_METHOD(jlong, WakeOnLanCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + WakeOnLanCluster * cppCluster = new WakeOnLanCluster(); - onReport.release(); + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketUnicastRxCountAttribute) + +JNI_METHOD(void, WakeOnLanCluster, subscribeWakeOnLanMacAddressAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WakeOnLanCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePacketUnicastRxCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WakeOnLan::Attributes::WakeOnLanMacAddress::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPCharStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36577,54 +28596,36 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketUnicastRxCountAtt onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportPacketUnicastRxCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributePacketUnicastRxCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketUnicastTxCountAttribute) +JNI_METHOD(void, WakeOnLanCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WakeOnLanCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributePacketUnicastTxCount( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WakeOnLan::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36632,42 +28633,62 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketUnicastTxCountAtt onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, WiFiNetworkDiagnosticsCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + WiFiNetworkDiagnosticsCluster * cppCluster = new WiFiNetworkDiagnosticsCluster(); -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportPacketUnicastTxCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, resetCounts)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::WiFiNetworkDiagnostics::Commands::ResetCounts::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributePacketUnicastTxCount(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeCurrentMaxRateAttribute) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeBssidAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { - chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -36678,8 +28699,14 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeCurrentMaxRateAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentMaxRate(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::Bssid::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPOctetStringAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36687,42 +28714,18 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeCurrentMaxRateAttribute onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportCurrentMaxRateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeCurrentMaxRate(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeOverrunCountAttribute) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeSecurityTypeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -36733,8 +28736,14 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeOverrunCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeOverrunCount(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::SecurityType::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36742,42 +28751,18 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeOverrunCountAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportOverrunCountAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeOverrunCount(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeClusterRevisionAttribute) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeWiFiVersionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -36788,8 +28773,14 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeClusterRevisionAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::WiFiVersion::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -36797,16 +28788,21 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeClusterRevisionAttribut onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeChannelNumberAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -36814,309 +28810,240 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, reportClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(jlong, WindowCoveringCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) -{ - chip::DeviceLayer::StackLock lock; - WindowCoveringCluster * cppCluster = new WindowCoveringCluster(); - - cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); - return reinterpret_cast(cppCluster); -} - -JNI_METHOD(void, WindowCoveringCluster, downOrClose)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster; - - chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type request; - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::ChannelNumber::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, goToLiftPercentage) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject liftPercentageValue, jobject liftPercent100thsValue) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeRssiAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster; - - chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type request; - - request.liftPercentageValue = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(liftPercentageValue)); - request.liftPercent100thsValue = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(liftPercent100thsValue)); - - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); - std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - - cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); - - onSuccess.release(); - onFailure.release(); -} -JNI_METHOD(void, WindowCoveringCluster, goToLiftValue) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject liftValue) -{ - chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster; - - chip::app::Clusters::WindowCovering::Commands::GoToLiftValue::Type request; - - request.liftValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(liftValue)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::Rssi::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8sAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, goToTiltPercentage) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject tiltPercentageValue, jobject tiltPercent100thsValue) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeBeaconLostCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster; - - chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type request; - - request.tiltPercentageValue = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(tiltPercentageValue)); - request.tiltPercent100thsValue = static_cast( - chip::JniReferences::GetInstance().IntegerToPrimitive(tiltPercent100thsValue)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::BeaconLostCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, goToTiltValue) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject tiltValue) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeBeaconRxCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster; - - chip::app::Clusters::WindowCovering::Commands::GoToTiltValue::Type request; - - request.tiltValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(tiltValue)); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::BeaconRxCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, stopMotion)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketMulticastRxCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster; - - chip::app::Clusters::WindowCovering::Commands::StopMotion::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, upOrOpen)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketMulticastTxCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster; - - chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type request; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, - AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", - CHIP_ERROR_INCORRECT_STATE)); + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error subscribing to attribute", err)); onSuccess.release(); onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeTypeAttribute) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketUnicastRxCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeType(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37124,53 +29051,74 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeTypeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribePacketUnicastTxCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeType(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftAttribute) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeCurrentMaxRateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentPositionLift(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37178,54 +29126,74 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportCurrentPositionLiftAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeOverrunCountAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeCurrentPositionLift(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt64uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltAttribute) +JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + CHIP_ERROR err = CHIP_NO_ERROR; + WiFiNetworkDiagnosticsCluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentPositionTilt(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37233,261 +29201,290 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltAttribute) onSuccess.release(); onFailure.release(); } +JNI_METHOD(jlong, WindowCoveringCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + WindowCoveringCluster * cppCluster = new WindowCoveringCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} -JNI_METHOD(void, WindowCoveringCluster, reportCurrentPositionTiltAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, downOrClose)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + WindowCoveringCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::WindowCovering::Commands::DownOrClose::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReportAttributeCurrentPositionTilt(onReport->Cancel()); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeConfigStatusAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +JNI_METHOD(void, WindowCoveringCluster, goToLiftPercentage) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject liftPercentageValue, jobject liftPercent100thsValue) { chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + WindowCoveringCluster * cppCluster; + + chip::app::Clusters::WindowCovering::Commands::GoToLiftPercentage::Type request; + + request.liftPercentageValue = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(liftPercentageValue)); + request.liftPercent100thsValue = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(liftPercent100thsValue)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn(err == CHIP_NO_ERROR, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); + + onSuccess.release(); + onFailure.release(); +} +JNI_METHOD(void, WindowCoveringCluster, goToLiftValue) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject liftValue) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + WindowCoveringCluster * cppCluster; + + chip::app::Clusters::WindowCovering::Commands::GoToLiftValue::Type request; + + request.liftValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(liftValue)); + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeConfigStatus(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportConfigStatusAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, goToTiltPercentage) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject tiltPercentageValue, jobject tiltPercent100thsValue) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + WindowCoveringCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type request; - err = cppCluster->ReportAttributeConfigStatus(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.tiltPercentageValue = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(tiltPercentageValue)); + request.tiltPercent100thsValue = static_cast( + chip::JniReferences::GetInstance().IntegerToPrimitive(tiltPercent100thsValue)); - onReport.release(); -} -JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercentageAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeCurrentPositionLiftPercentage( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportCurrentPositionLiftPercentageAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, goToTiltValue) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject tiltValue) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + WindowCoveringCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + chip::app::Clusters::WindowCovering::Commands::GoToTiltValue::Type request; - err = cppCluster->ReportAttributeCurrentPositionLiftPercentage(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + request.tiltValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(tiltValue)); - onReport.release(); -} -JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltPercentageAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentPositionTiltPercentage( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportCurrentPositionTiltPercentageAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, stopMotion)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + CHIP_ERROR err = CHIP_NO_ERROR; + WindowCoveringCluster * cppCluster; - err = cppCluster->ReportAttributeCurrentPositionTiltPercentage(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + chip::app::Clusters::WindowCovering::Commands::StopMotion::Type request; - onReport.release(); -} -JNI_METHOD(void, WindowCoveringCluster, subscribeOperationalStatusAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) -{ - chip::DeviceLayer::StackLock lock; std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - std::unique_ptr onFailure( Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->SubscribeAttributeOperationalStatus(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error subscribing to attribute", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportOperationalStatusAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, upOrOpen)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + CHIP_ERROR err = CHIP_NO_ERROR; + WindowCoveringCluster * cppCluster; - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::app::Clusters::WindowCovering::Commands::UpOrOpen::Type request; + + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + VerifyOrReturn(onFailure.get() != nullptr, + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); + + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeOperationalStatus(onReport->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->InvokeCommand(request, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error invoking command", + CHIP_ERROR_INCORRECT_STATE)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionLiftPercent100thsAttribute) +JNI_METHOD(void, WindowCoveringCluster, subscribeTypeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -37498,8 +29495,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionLiftPercent100ths chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTargetPositionLiftPercent100ths( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::Type::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37507,42 +29510,20 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionLiftPercent100ths onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportTargetPositionLiftPercent100thsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTargetPositionLiftPercent100ths(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionTiltPercent100thsAttribute) +JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -37553,8 +29534,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionTiltPercent100ths chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeTargetPositionTiltPercent100ths( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLift::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPWindowCoveringCurrentPositionLiftAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37562,42 +29549,20 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionTiltPercent100ths onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportTargetPositionTiltPercent100thsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeTargetPositionTiltPercent100ths(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} -JNI_METHOD(void, WindowCoveringCluster, subscribeEndProductTypeAttribute) +JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -37608,8 +29573,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeEndProductTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeEndProductType(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTilt::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), CHIPWindowCoveringCurrentPositionTiltAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37617,16 +29588,21 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeEndProductTypeAttribute) onSuccess.release(); onFailure.release(); } +JNI_METHOD(void, WindowCoveringCluster, subscribeConfigStatusAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); -JNI_METHOD(void, WindowCoveringCluster, reportEndProductTypeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -37634,25 +29610,35 @@ JNI_METHOD(void, WindowCoveringCluster, reportEndProductTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeEndProductType(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::ConfigStatus::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercent100thsAttribute) +JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercentageAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -37663,8 +29649,16 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercent100th chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentPositionLiftPercent100ths( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37672,16 +29666,23 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercent100th onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportCurrentPositionLiftPercent100thsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltPercentageAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -37689,25 +29690,35 @@ JNI_METHOD(void, WindowCoveringCluster, reportCurrentPositionLiftPercent100thsAt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeCurrentPositionLiftPercent100ths(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltPercent100thsAttribute) +JNI_METHOD(void, WindowCoveringCluster, subscribeOperationalStatusAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -37718,8 +29729,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltPercent100th chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeCurrentPositionTiltPercent100ths( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::OperationalStatus::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37727,16 +29744,23 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltPercent100th onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportCurrentPositionTiltPercent100thsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionLiftPercent100thsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -37744,25 +29768,37 @@ JNI_METHOD(void, WindowCoveringCluster, reportCurrentPositionTiltPercent100thsAt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeCurrentPositionTiltPercent100ths(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledOpenLimitLiftAttribute) +JNI_METHOD(void, WindowCoveringCluster, subscribeTargetPositionTiltPercent100thsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -37773,8 +29809,16 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledOpenLimitLiftAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInstalledOpenLimitLift( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37782,16 +29826,21 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledOpenLimitLiftAttribute onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportInstalledOpenLimitLiftAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, subscribeEndProductTypeAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -37799,25 +29848,35 @@ JNI_METHOD(void, WindowCoveringCluster, reportInstalledOpenLimitLiftAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInstalledOpenLimitLift(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::EndProductType::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledClosedLimitLiftAttribute) +JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionLiftPercent100thsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -37828,8 +29887,16 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledClosedLimitLiftAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInstalledClosedLimitLift( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37837,16 +29904,23 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledClosedLimitLiftAttribu onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportInstalledClosedLimitLiftAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, subscribeCurrentPositionTiltPercent100thsAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr + onSuccess(Platform::New(callback, true), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -37854,25 +29928,35 @@ JNI_METHOD(void, WindowCoveringCluster, reportInstalledClosedLimitLiftAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInstalledClosedLimitLift(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute( + onSuccess->mContext, successFn->mCall, failureFn->mCall, static_cast(minInterval), + static_cast(maxInterval), + CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledOpenLimitTiltAttribute) +JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledOpenLimitLiftAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -37883,8 +29967,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledOpenLimitTiltAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInstalledOpenLimitTilt( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::InstalledOpenLimitLift::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37892,16 +29982,21 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledOpenLimitTiltAttribute onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportInstalledOpenLimitTiltAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledClosedLimitLiftAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -37909,25 +30004,34 @@ JNI_METHOD(void, WindowCoveringCluster, reportInstalledOpenLimitTiltAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInstalledOpenLimitTilt(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::InstalledClosedLimitLift::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } -JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledClosedLimitTiltAttribute) +JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledOpenLimitTiltAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -37938,8 +30042,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledClosedLimitTiltAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeInstalledClosedLimitTilt( - onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::InstalledOpenLimitTilt::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -37947,16 +30057,21 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledClosedLimitTiltAttribu onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportInstalledClosedLimitTiltAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, WindowCoveringCluster, subscribeInstalledClosedLimitTiltAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); @@ -37964,12 +30079,21 @@ JNI_METHOD(void, WindowCoveringCluster, reportInstalledClosedLimitTiltAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReportAttributeInstalledClosedLimitTilt(onReport->Cancel()); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::InstalledClosedLimitTilt::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); + env, callback, "Error subscribing to attribute", err)); - onReport.release(); + onSuccess.release(); + onFailure.release(); } JNI_METHOD(void, WindowCoveringCluster, writeModeAttribute) @@ -38013,14 +30137,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -38031,8 +30155,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::Mode::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt8uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -38040,41 +30170,18 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeModeAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeMode(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, WindowCoveringCluster, subscribeSafetyStatusAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -38085,8 +30192,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeSafetyStatusAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeSafetyStatus(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::SafetyStatus::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -38094,41 +30207,18 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeSafetyStatusAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportSafetyStatusAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeSafetyStatus(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, WindowCoveringCluster, subscribeFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -38139,8 +30229,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), - static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::FeatureMap::TypeInfo; + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt32uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -38148,41 +30244,18 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeFeatureMapAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeFeatureMap(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} JNI_METHOD(void, WindowCoveringCluster, subscribeClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - Platform::New(callback), Platform::Delete); + std::unique_ptr onSuccess( + Platform::New(callback, true), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure( - Platform::New(callback), Platform::Delete); + Platform::New(callback), chip::Platform::Delete); VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); @@ -38193,8 +30266,14 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->SubscribeAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(minInterval), static_cast(maxInterval)); + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::ClusterRevision::TypeInfo; + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + err = cppCluster->SubscribeAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall, + static_cast(minInterval), static_cast(maxInterval), + CHIPInt16uAttributeCallback::OnSubscriptionEstablished); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error subscribing to attribute", err)); @@ -38202,27 +30281,3 @@ JNI_METHOD(void, WindowCoveringCluster, subscribeClusterRevisionAttribute) onSuccess.release(); onFailure.release(); } - -JNI_METHOD(void, WindowCoveringCluster, reportClusterRevisionAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - std::unique_ptr onReport( - Platform::New(callback, true), Platform::Delete); - VerifyOrReturn(onReport.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - err = cppCluster->ReportAttributeClusterRevision(onReport->Cancel()); - VerifyOrReturn(err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error registering for attribute reporting", err)); - - onReport.release(); -} diff --git a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp index 3827a67f7dccdf..61a2d6a5479c33 100644 --- a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp @@ -643,6 +643,44 @@ JNI_METHOD(void, ApplicationBasicCluster, readApplicationVersionAttribute) onFailure.release(); } +JNI_METHOD(void, ApplicationBasicCluster, readAllowedVendorListAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::AllowedVendorList::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::ApplicationBasicCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, ApplicationBasicCluster, readAttributeListAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -2497,6 +2535,110 @@ JNI_METHOD(void, BridgedDeviceBasicCluster, readClusterRevisionAttribute) onFailure.release(); } +JNI_METHOD(void, ChannelCluster, readChannelListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Channel::Attributes::ChannelList::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::ChannelCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ChannelCluster, readAttributeListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Channel::Attributes::AttributeList::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::ChannelCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ChannelCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Channel::Attributes::ClusterRevision::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::ChannelCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, ColorControlCluster, readCurrentHueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; @@ -4362,15 +4504,15 @@ JNI_METHOD(void, ColorControlCluster, readClusterRevisionAttribute)(JNIEnv * env onFailure.release(); } -JNI_METHOD(void, ContentLauncherCluster, readAcceptsHeaderListAttribute) +JNI_METHOD(void, ContentLauncherCluster, readAcceptHeaderListAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::AcceptsHeaderList::TypeInfo; - std::unique_ptr - onSuccess(chip::Platform::New(callback, false), - chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::AcceptHeaderList::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4388,7 +4530,7 @@ JNI_METHOD(void, ContentLauncherCluster, readAcceptsHeaderListAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - auto successFn = chip::Callback::Callback::FromCancelable( + auto successFn = chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -7201,13 +7343,52 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readClusterRevisionAttribute) onFailure.release(); } -JNI_METHOD(void, GroupKeyManagementCluster, readGroupsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, GroupKeyManagementCluster, readGroupKeyMapAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::Groups::TypeInfo; - std::unique_ptr - onSuccess(chip::Platform::New(callback, false), - chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::GroupKeyManagementCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, GroupKeyManagementCluster, readGroupTableAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::GroupTable::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7226,7 +7407,43 @@ JNI_METHOD(void, GroupKeyManagementCluster, readGroupsAttribute)(JNIEnv * env, j env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, GroupKeyManagementCluster, readMaxGroupsPerFabricAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::GroupKeyManagementCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( @@ -7237,13 +7454,13 @@ JNI_METHOD(void, GroupKeyManagementCluster, readGroupsAttribute)(JNIEnv * env, j onFailure.release(); } -JNI_METHOD(void, GroupKeyManagementCluster, readGroupKeysAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +JNI_METHOD(void, GroupKeyManagementCluster, readMaxGroupKeysPerFabricAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeys::TypeInfo; - std::unique_ptr - onSuccess(chip::Platform::New(callback, false), - chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7262,7 +7479,8 @@ JNI_METHOD(void, GroupKeyManagementCluster, readGroupKeysAttribute)(JNIEnv * env env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( @@ -9639,14 +9857,15 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, readClusterRevisionAttribute) onFailure.release(); } -JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readDefaultOtaProviderAttribute) +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readDefaultOtaProvidersAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProviders::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9665,7 +9884,7 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readDefaultOtaProviderAttrib env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = - chip::Callback::Callback::FromCancelable( + chip::Callback::Callback::FromCancelable( onSuccess->Cancel()); auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); @@ -9714,6 +9933,82 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readUpdatePossibleAttribute) onFailure.release(); } +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readUpdateStateAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateState::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::OtaSoftwareUpdateRequestorCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readUpdateStateProgressAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::OtaSoftwareUpdateRequestorCluster * cppCluster = + reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readAttributeListAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -13292,110 +13587,6 @@ JNI_METHOD(void, SwitchCluster, readClusterRevisionAttribute)(JNIEnv * env, jobj onFailure.release(); } -JNI_METHOD(void, TvChannelCluster, readChannelListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TvChannel::Attributes::ChannelList::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::TvChannelCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TvChannelCluster, readAttributeListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TvChannel::Attributes::AttributeList::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::TvChannelCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - -JNI_METHOD(void, TvChannelCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) -{ - chip::DeviceLayer::StackLock lock; - using TypeInfo = chip::app::Clusters::TvChannel::Attributes::ClusterRevision::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); - VerifyOrReturn(onSuccess.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); - - std::unique_ptr onFailure( - chip::Platform::New(callback), chip::Platform::Delete); - VerifyOrReturn(onFailure.get() != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); - - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::TvChannelCluster * cppCluster = reinterpret_cast(clusterPtr); - VerifyOrReturn(cppCluster != nullptr, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( - env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - - auto successFn = - chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); - auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); - err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); - VerifyOrReturn( - err == CHIP_NO_ERROR, - chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); - - onSuccess.release(); - onFailure.release(); -} - JNI_METHOD(void, TargetNavigatorCluster, readTargetNavigatorListAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -20602,8 +20793,10 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftAttribute) { chip::DeviceLayer::StackLock lock; using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLift::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20637,8 +20830,10 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltAttribute) { chip::DeviceLayer::StackLock lock; using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTilt::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20706,8 +20901,10 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftPercentageAttribu { chip::DeviceLayer::StackLock lock; using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20742,8 +20939,10 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltPercentageAttribu { chip::DeviceLayer::StackLock lock; using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20813,8 +21012,10 @@ JNI_METHOD(void, WindowCoveringCluster, readTargetPositionLiftPercent100thsAttri { chip::DeviceLayer::StackLock lock; using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20849,8 +21050,10 @@ JNI_METHOD(void, WindowCoveringCluster, readTargetPositionTiltPercent100thsAttri { chip::DeviceLayer::StackLock lock; using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20919,8 +21122,10 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftPercent100thsAttr { chip::DeviceLayer::StackLock lock; using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -20955,8 +21160,10 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltPercent100thsAttr { chip::DeviceLayer::StackLock lock; using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), chip::Platform::Delete); + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index e652ffe7a7a645..20f677bc24e216 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -88,8 +88,9 @@ void CHIPAccountLoginClusterGetSetupPINResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, setupPIN); } -CHIPApplicationLauncherClusterHideAppResponseCallback::CHIPApplicationLauncherClusterHideAppResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPApplicationLauncherClusterLauncherResponseCallback::CHIPApplicationLauncherClusterLauncherResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -105,7 +106,7 @@ CHIPApplicationLauncherClusterHideAppResponseCallback::CHIPApplicationLauncherCl } } -CHIPApplicationLauncherClusterHideAppResponseCallback::~CHIPApplicationLauncherClusterHideAppResponseCallback() +CHIPApplicationLauncherClusterLauncherResponseCallback::~CHIPApplicationLauncherClusterLauncherResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -116,8 +117,8 @@ CHIPApplicationLauncherClusterHideAppResponseCallback::~CHIPApplicationLauncherC env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPApplicationLauncherClusterHideAppResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::HideAppResponse::DecodableType & dataResponse) +void CHIPApplicationLauncherClusterLauncherResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -127,10 +128,10 @@ void CHIPApplicationLauncherClusterHideAppResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -145,7 +146,7 @@ void CHIPApplicationLauncherClusterHideAppResponseCallback::CallbackFn( std::string statusClassName = "java/lang/Integer"; std::string statusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( + chip::JniReferences::GetInstance().CreateBoxedObject( statusClassName.c_str(), statusCtorSignature.c_str(), dataResponse.status, status); jobject data; @@ -154,9 +155,8 @@ void CHIPApplicationLauncherClusterHideAppResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, status, data); } -CHIPApplicationLauncherClusterLaunchAppResponseCallback::CHIPApplicationLauncherClusterLaunchAppResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPChannelClusterChangeChannelResponseCallback::CHIPChannelClusterChangeChannelResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -172,7 +172,7 @@ CHIPApplicationLauncherClusterLaunchAppResponseCallback::CHIPApplicationLauncher } } -CHIPApplicationLauncherClusterLaunchAppResponseCallback::~CHIPApplicationLauncherClusterLaunchAppResponseCallback() +CHIPChannelClusterChangeChannelResponseCallback::~CHIPChannelClusterChangeChannelResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -183,8 +183,8 @@ CHIPApplicationLauncherClusterLaunchAppResponseCallback::~CHIPApplicationLaunche env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPApplicationLauncherClusterLaunchAppResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType & dataResponse) +void CHIPChannelClusterChangeChannelResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -194,35 +194,32 @@ void CHIPApplicationLauncherClusterLaunchAppResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", - &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject status; + jobject channelMatch; - std::string statusClassName = "java/lang/Integer"; - std::string statusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - statusClassName.c_str(), statusCtorSignature.c_str(), dataResponse.status, status); - jobject data; + channelMatch = nullptr; /* Struct - conversion from this type to Java is not properly implemented yet */ + jobject errorType; - chip::UtfString dataUtfString(env, dataResponse.data); - data = dataUtfString.jniValue(); + std::string errorTypeClassName = "java/lang/Integer"; + std::string errorTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + errorTypeClassName.c_str(), errorTypeCtorSignature.c_str(), dataResponse.errorType, errorType); - env->CallVoidMethod(javaCallbackRef, javaMethod, status, data); + env->CallVoidMethod(javaCallbackRef, javaMethod, channelMatch, errorType); } -CHIPApplicationLauncherClusterStopAppResponseCallback::CHIPApplicationLauncherClusterStopAppResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPContentLauncherClusterLaunchResponseCallback::CHIPContentLauncherClusterLaunchResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -238,7 +235,7 @@ CHIPApplicationLauncherClusterStopAppResponseCallback::CHIPApplicationLauncherCl } } -CHIPApplicationLauncherClusterStopAppResponseCallback::~CHIPApplicationLauncherClusterStopAppResponseCallback() +CHIPContentLauncherClusterLaunchResponseCallback::~CHIPContentLauncherClusterLaunchResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -249,8 +246,8 @@ CHIPApplicationLauncherClusterStopAppResponseCallback::~CHIPApplicationLauncherC env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPApplicationLauncherClusterStopAppResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::StopAppResponse::DecodableType & dataResponse) +void CHIPContentLauncherClusterLaunchResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -260,10 +257,9 @@ void CHIPApplicationLauncherClusterStopAppResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -278,7 +274,7 @@ void CHIPApplicationLauncherClusterStopAppResponseCallback::CallbackFn( std::string statusClassName = "java/lang/Integer"; std::string statusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( + chip::JniReferences::GetInstance().CreateBoxedObject( statusClassName.c_str(), statusCtorSignature.c_str(), dataResponse.status, status); jobject data; @@ -287,141 +283,6 @@ void CHIPApplicationLauncherClusterStopAppResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, status, data); } -CHIPContentLauncherClusterLaunchContentResponseCallback::CHIPContentLauncherClusterLaunchContentResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPContentLauncherClusterLaunchContentResponseCallback::~CHIPContentLauncherClusterLaunchContentResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPContentLauncherClusterLaunchContentResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", - &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject contentLaunchStatus; - - std::string contentLaunchStatusClassName = "java/lang/Integer"; - std::string contentLaunchStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - contentLaunchStatusClassName.c_str(), contentLaunchStatusCtorSignature.c_str(), dataResponse.contentLaunchStatus, - contentLaunchStatus); - jobject data; - - chip::UtfString dataUtfString(env, dataResponse.data); - data = dataUtfString.jniValue(); - - env->CallVoidMethod(javaCallbackRef, javaMethod, contentLaunchStatus, data); -} -CHIPContentLauncherClusterLaunchURLResponseCallback::CHIPContentLauncherClusterLaunchURLResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPContentLauncherClusterLaunchURLResponseCallback::~CHIPContentLauncherClusterLaunchURLResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPContentLauncherClusterLaunchURLResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", - &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject contentLaunchStatus; - - std::string contentLaunchStatusClassName = "java/lang/Integer"; - std::string contentLaunchStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - contentLaunchStatusClassName.c_str(), contentLaunchStatusCtorSignature.c_str(), dataResponse.contentLaunchStatus, - contentLaunchStatus); - jobject data; - - chip::UtfString dataUtfString(env, dataResponse.data); - data = dataUtfString.jniValue(); - - env->CallVoidMethod(javaCallbackRef, javaMethod, contentLaunchStatus, data); -} CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback::CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback(jobject javaCallback) : Callback::Callback(CallbackFn, this) { @@ -825,544 +686,17 @@ void CHIPGeneralCommissioningClusterArmFailSafeResponseCallback::CallbackFn( std::string errorCodeClassName = "java/lang/Integer"; std::string errorCodeCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject( - errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), dataResponse.errorCode, errorCode); - jobject debugText; - - chip::UtfString debugTextUtfString(env, dataResponse.debugText); - debugText = debugTextUtfString.jniValue(); - - env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); -} -CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: - CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: - ~CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback::CallbackFn( - void * context, - const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", - &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject errorCode; - - std::string errorCodeClassName = "java/lang/Integer"; - std::string errorCodeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), dataResponse.errorCode, errorCode); - jobject debugText; - - chip::UtfString debugTextUtfString(env, dataResponse.debugText); - debugText = debugTextUtfString.jniValue(); - - env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); -} -CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: - CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: - ~CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback::CallbackFn( - void * context, - const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", - &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject errorCode; - - std::string errorCodeClassName = "java/lang/Integer"; - std::string errorCodeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), dataResponse.errorCode, errorCode); - jobject debugText; - - chip::UtfString debugTextUtfString(env, dataResponse.debugText); - debugText = debugTextUtfString.jniValue(); - - env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); -} -CHIPGroupsClusterAddGroupResponseCallback::CHIPGroupsClusterAddGroupResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPGroupsClusterAddGroupResponseCallback::~CHIPGroupsClusterAddGroupResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPGroupsClusterAddGroupResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject status; - - std::string statusClassName = "java/lang/Integer"; - std::string statusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), - dataResponse.status, status); - jobject groupId; - - std::string groupIdClassName = "java/lang/Integer"; - std::string groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), - dataResponse.groupId, groupId); - - env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId); -} -CHIPGroupsClusterGetGroupMembershipResponseCallback::CHIPGroupsClusterGetGroupMembershipResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPGroupsClusterGetGroupMembershipResponseCallback::~CHIPGroupsClusterGetGroupMembershipResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPGroupsClusterGetGroupMembershipResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject capacity; - - std::string capacityClassName = "java/lang/Integer"; - std::string capacityCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(capacityClassName.c_str(), capacityCtorSignature.c_str(), - dataResponse.capacity, capacity); - jobject groupList; - - groupList = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ - - env->CallVoidMethod(javaCallbackRef, javaMethod, capacity, groupList); -} -CHIPGroupsClusterRemoveGroupResponseCallback::CHIPGroupsClusterRemoveGroupResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPGroupsClusterRemoveGroupResponseCallback::~CHIPGroupsClusterRemoveGroupResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPGroupsClusterRemoveGroupResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject status; - - std::string statusClassName = "java/lang/Integer"; - std::string statusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), - dataResponse.status, status); - jobject groupId; - - std::string groupIdClassName = "java/lang/Integer"; - std::string groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), - dataResponse.groupId, groupId); - - env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId); -} -CHIPGroupsClusterViewGroupResponseCallback::CHIPGroupsClusterViewGroupResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPGroupsClusterViewGroupResponseCallback::~CHIPGroupsClusterViewGroupResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPGroupsClusterViewGroupResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject status; - - std::string statusClassName = "java/lang/Integer"; - std::string statusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), - dataResponse.status, status); - jobject groupId; - - std::string groupIdClassName = "java/lang/Integer"; - std::string groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), - dataResponse.groupId, groupId); - jobject groupName; - - chip::UtfString groupNameUtfString(env, dataResponse.groupName); - groupName = groupNameUtfString.jniValue(); - - env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId, groupName); -} -CHIPIdentifyClusterIdentifyQueryResponseCallback::CHIPIdentifyClusterIdentifyQueryResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPIdentifyClusterIdentifyQueryResponseCallback::~CHIPIdentifyClusterIdentifyQueryResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPIdentifyClusterIdentifyQueryResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::Identify::Commands::IdentifyQueryResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject timeout; - - std::string timeoutClassName = "java/lang/Integer"; - std::string timeoutCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(timeoutClassName.c_str(), timeoutCtorSignature.c_str(), - dataResponse.timeout, timeout); - - env->CallVoidMethod(javaCallbackRef, javaMethod, timeout); -} -CHIPKeypadInputClusterSendKeyResponseCallback::CHIPKeypadInputClusterSendKeyResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPKeypadInputClusterSendKeyResponseCallback::~CHIPKeypadInputClusterSendKeyResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPKeypadInputClusterSendKeyResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject status; + errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), dataResponse.errorCode, errorCode); + jobject debugText; - std::string statusClassName = "java/lang/Integer"; - std::string statusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - statusClassName.c_str(), statusCtorSignature.c_str(), dataResponse.status, status); + chip::UtfString debugTextUtfString(env, dataResponse.debugText); + debugText = debugTextUtfString.jniValue(); - env->CallVoidMethod(javaCallbackRef, javaMethod, status); + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); } -CHIPMediaPlaybackClusterMediaFastForwardResponseCallback::CHIPMediaPlaybackClusterMediaFastForwardResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: + CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1378,7 +712,8 @@ CHIPMediaPlaybackClusterMediaFastForwardResponseCallback::CHIPMediaPlaybackClust } } -CHIPMediaPlaybackClusterMediaFastForwardResponseCallback::~CHIPMediaPlaybackClusterMediaFastForwardResponseCallback() +CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback:: + ~CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1389,8 +724,9 @@ CHIPMediaPlaybackClusterMediaFastForwardResponseCallback::~CHIPMediaPlaybackClus env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaFastForwardResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType & dataResponse) +void CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1400,31 +736,36 @@ void CHIPMediaPlaybackClusterMediaFastForwardResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), dataResponse.errorCode, errorCode); + jobject debugText; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + chip::UtfString debugTextUtfString(env, dataResponse.debugText); + debugText = debugTextUtfString.jniValue(); - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); } -CHIPMediaPlaybackClusterMediaNextResponseCallback::CHIPMediaPlaybackClusterMediaNextResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: + CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1440,7 +781,8 @@ CHIPMediaPlaybackClusterMediaNextResponseCallback::CHIPMediaPlaybackClusterMedia } } -CHIPMediaPlaybackClusterMediaNextResponseCallback::~CHIPMediaPlaybackClusterMediaNextResponseCallback() +CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback:: + ~CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1451,8 +793,9 @@ CHIPMediaPlaybackClusterMediaNextResponseCallback::~CHIPMediaPlaybackClusterMedi env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaNextResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType & dataResponse) +void CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1462,31 +805,36 @@ void CHIPMediaPlaybackClusterMediaNextResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/String;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject errorCode; + + std::string errorCodeClassName = "java/lang/Integer"; + std::string errorCodeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + errorCodeClassName.c_str(), errorCodeCtorSignature.c_str(), dataResponse.errorCode, errorCode); + jobject debugText; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + chip::UtfString debugTextUtfString(env, dataResponse.debugText); + debugText = debugTextUtfString.jniValue(); - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, errorCode, debugText); } -CHIPMediaPlaybackClusterMediaPauseResponseCallback::CHIPMediaPlaybackClusterMediaPauseResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback:: + CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1502,7 +850,8 @@ CHIPMediaPlaybackClusterMediaPauseResponseCallback::CHIPMediaPlaybackClusterMedi } } -CHIPMediaPlaybackClusterMediaPauseResponseCallback::~CHIPMediaPlaybackClusterMediaPauseResponseCallback() +CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback:: + ~CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1513,8 +862,9 @@ CHIPMediaPlaybackClusterMediaPauseResponseCallback::~CHIPMediaPlaybackClusterMed env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaPauseResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType & dataResponse) +void CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback::CallbackFn( + void * context, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1524,31 +874,28 @@ void CHIPMediaPlaybackClusterMediaPauseResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "()V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject groupKeySetIDs; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + groupKeySetIDs = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, groupKeySetIDs); } -CHIPMediaPlaybackClusterMediaPlayResponseCallback::CHIPMediaPlaybackClusterMediaPlayResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPGroupKeyManagementClusterKeySetReadResponseCallback::CHIPGroupKeyManagementClusterKeySetReadResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1564,7 +911,7 @@ CHIPMediaPlaybackClusterMediaPlayResponseCallback::CHIPMediaPlaybackClusterMedia } } -CHIPMediaPlaybackClusterMediaPlayResponseCallback::~CHIPMediaPlaybackClusterMediaPlayResponseCallback() +CHIPGroupKeyManagementClusterKeySetReadResponseCallback::~CHIPGroupKeyManagementClusterKeySetReadResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1575,8 +922,8 @@ CHIPMediaPlaybackClusterMediaPlayResponseCallback::~CHIPMediaPlaybackClusterMedi env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaPlayResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType & dataResponse) +void CHIPGroupKeyManagementClusterKeySetReadResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1586,31 +933,27 @@ void CHIPMediaPlaybackClusterMediaPlayResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "()V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject groupKeySet; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + groupKeySet = nullptr; /* Struct - conversion from this type to Java is not properly implemented yet */ - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, groupKeySet); } -CHIPMediaPlaybackClusterMediaPreviousResponseCallback::CHIPMediaPlaybackClusterMediaPreviousResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPGroupsClusterAddGroupResponseCallback::CHIPGroupsClusterAddGroupResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1626,7 +969,7 @@ CHIPMediaPlaybackClusterMediaPreviousResponseCallback::CHIPMediaPlaybackClusterM } } -CHIPMediaPlaybackClusterMediaPreviousResponseCallback::~CHIPMediaPlaybackClusterMediaPreviousResponseCallback() +CHIPGroupsClusterAddGroupResponseCallback::~CHIPGroupsClusterAddGroupResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1637,8 +980,8 @@ CHIPMediaPlaybackClusterMediaPreviousResponseCallback::~CHIPMediaPlaybackCluster env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaPreviousResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType & dataResponse) +void CHIPGroupsClusterAddGroupResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1648,31 +991,36 @@ void CHIPMediaPlaybackClusterMediaPreviousResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId); } -CHIPMediaPlaybackClusterMediaRewindResponseCallback::CHIPMediaPlaybackClusterMediaRewindResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPGroupsClusterGetGroupMembershipResponseCallback::CHIPGroupsClusterGetGroupMembershipResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1688,7 +1036,7 @@ CHIPMediaPlaybackClusterMediaRewindResponseCallback::CHIPMediaPlaybackClusterMed } } -CHIPMediaPlaybackClusterMediaRewindResponseCallback::~CHIPMediaPlaybackClusterMediaRewindResponseCallback() +CHIPGroupsClusterGetGroupMembershipResponseCallback::~CHIPGroupsClusterGetGroupMembershipResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1699,8 +1047,8 @@ CHIPMediaPlaybackClusterMediaRewindResponseCallback::~CHIPMediaPlaybackClusterMe env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaRewindResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType & dataResponse) +void CHIPGroupsClusterGetGroupMembershipResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1710,10 +1058,10 @@ void CHIPMediaPlaybackClusterMediaRewindResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -1723,18 +1071,20 @@ void CHIPMediaPlaybackClusterMediaRewindResponseCallback::CallbackFn( err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject capacity; + + std::string capacityClassName = "java/lang/Integer"; + std::string capacityCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(capacityClassName.c_str(), capacityCtorSignature.c_str(), + dataResponse.capacity, capacity); + jobject groupList; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + groupList = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, capacity, groupList); } -CHIPMediaPlaybackClusterMediaSeekResponseCallback::CHIPMediaPlaybackClusterMediaSeekResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPGroupsClusterRemoveGroupResponseCallback::CHIPGroupsClusterRemoveGroupResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1750,7 +1100,7 @@ CHIPMediaPlaybackClusterMediaSeekResponseCallback::CHIPMediaPlaybackClusterMedia } } -CHIPMediaPlaybackClusterMediaSeekResponseCallback::~CHIPMediaPlaybackClusterMediaSeekResponseCallback() +CHIPGroupsClusterRemoveGroupResponseCallback::~CHIPGroupsClusterRemoveGroupResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1761,8 +1111,8 @@ CHIPMediaPlaybackClusterMediaSeekResponseCallback::~CHIPMediaPlaybackClusterMedi env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaSeekResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType & dataResponse) +void CHIPGroupsClusterRemoveGroupResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1772,32 +1122,36 @@ void CHIPMediaPlaybackClusterMediaSeekResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId); } -CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback::CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPGroupsClusterViewGroupResponseCallback::CHIPGroupsClusterViewGroupResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1813,7 +1167,7 @@ CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback::CHIPMediaPlaybackClus } } -CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback::~CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback() +CHIPGroupsClusterViewGroupResponseCallback::~CHIPGroupsClusterViewGroupResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1824,8 +1178,8 @@ CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback::~CHIPMediaPlaybackClu env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType & dataResponse) +void CHIPGroupsClusterViewGroupResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1835,32 +1189,40 @@ void CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr cppCallback( + reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject status; + + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(statusClassName.c_str(), statusCtorSignature.c_str(), + dataResponse.status, status); + jobject groupId; + + std::string groupIdClassName = "java/lang/Integer"; + std::string groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(groupIdClassName.c_str(), groupIdCtorSignature.c_str(), + dataResponse.groupId, groupId); + jobject groupName; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + chip::UtfString groupNameUtfString(env, dataResponse.groupName); + groupName = groupNameUtfString.jniValue(); - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId, groupName); } -CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback::CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPIdentifyClusterIdentifyQueryResponseCallback::CHIPIdentifyClusterIdentifyQueryResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1876,7 +1238,7 @@ CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback::CHIPMediaPlaybackClust } } -CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback::~CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback() +CHIPIdentifyClusterIdentifyQueryResponseCallback::~CHIPIdentifyClusterIdentifyQueryResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1887,8 +1249,8 @@ CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback::~CHIPMediaPlaybackClus env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType & dataResponse) +void CHIPIdentifyClusterIdentifyQueryResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::Identify::Commands::IdentifyQueryResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1898,10 +1260,9 @@ void CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -1911,19 +1272,17 @@ void CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback::CallbackFn( err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject timeout; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + std::string timeoutClassName = "java/lang/Integer"; + std::string timeoutCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(timeoutClassName.c_str(), timeoutCtorSignature.c_str(), + dataResponse.timeout, timeout); - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, timeout); } -CHIPMediaPlaybackClusterMediaStartOverResponseCallback::CHIPMediaPlaybackClusterMediaStartOverResponseCallback( - jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPKeypadInputClusterSendKeyResponseCallback::CHIPKeypadInputClusterSendKeyResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1939,7 +1298,7 @@ CHIPMediaPlaybackClusterMediaStartOverResponseCallback::CHIPMediaPlaybackCluster } } -CHIPMediaPlaybackClusterMediaStartOverResponseCallback::~CHIPMediaPlaybackClusterMediaStartOverResponseCallback() +CHIPKeypadInputClusterSendKeyResponseCallback::~CHIPKeypadInputClusterSendKeyResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1950,8 +1309,8 @@ CHIPMediaPlaybackClusterMediaStartOverResponseCallback::~CHIPMediaPlaybackCluste env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaStartOverResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType & dataResponse) +void CHIPKeypadInputClusterSendKeyResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1961,10 +1320,9 @@ void CHIPMediaPlaybackClusterMediaStartOverResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -1974,18 +1332,17 @@ void CHIPMediaPlaybackClusterMediaStartOverResponseCallback::CallbackFn( err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject status; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + statusClassName.c_str(), statusCtorSignature.c_str(), dataResponse.status, status); - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, status); } -CHIPMediaPlaybackClusterMediaStopResponseCallback::CHIPMediaPlaybackClusterMediaStopResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) +CHIPMediaPlaybackClusterPlaybackResponseCallback::CHIPMediaPlaybackClusterPlaybackResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2001,7 +1358,7 @@ CHIPMediaPlaybackClusterMediaStopResponseCallback::CHIPMediaPlaybackClusterMedia } } -CHIPMediaPlaybackClusterMediaStopResponseCallback::~CHIPMediaPlaybackClusterMediaStopResponseCallback() +CHIPMediaPlaybackClusterPlaybackResponseCallback::~CHIPMediaPlaybackClusterPlaybackResponseCallback() { JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2012,8 +1369,8 @@ CHIPMediaPlaybackClusterMediaStopResponseCallback::~CHIPMediaPlaybackClusterMedi env->DeleteGlobalRef(javaCallbackRef); }; -void CHIPMediaPlaybackClusterMediaStopResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType & dataResponse) +void CHIPMediaPlaybackClusterPlaybackResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & dataResponse) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -2023,10 +1380,9 @@ void CHIPMediaPlaybackClusterMediaStopResponseCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); javaCallbackRef = cppCallback->javaCallbackRef; @@ -2036,15 +1392,14 @@ void CHIPMediaPlaybackClusterMediaStopResponseCallback::CallbackFn( err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - jobject mediaPlaybackStatus; + jobject status; - std::string mediaPlaybackStatusClassName = "java/lang/Integer"; - std::string mediaPlaybackStatusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - mediaPlaybackStatusClassName.c_str(), mediaPlaybackStatusCtorSignature.c_str(), dataResponse.mediaPlaybackStatus, - mediaPlaybackStatus); + std::string statusClassName = "java/lang/Integer"; + std::string statusCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + statusClassName.c_str(), statusCtorSignature.c_str(), dataResponse.status, status); - env->CallVoidMethod(javaCallbackRef, javaMethod, mediaPlaybackStatus); + env->CallVoidMethod(javaCallbackRef, javaMethod, status); } CHIPNetworkCommissioningClusterConnectNetworkResponseCallback::CHIPNetworkCommissioningClusterConnectNetworkResponseCallback( jobject javaCallback) : @@ -2251,11 +1606,27 @@ void CHIPNetworkCommissioningClusterScanNetworksResponseCallback::CallbackFn( chip::UtfString DebugTextUtfString(env, dataResponse.debugText); DebugText = DebugTextUtfString.jniValue(); jobject WiFiScanResults; + if (!dataResponse.wiFiScanResults.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, WiFiScanResults); + } + else + { - WiFiScanResults = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + WiFiScanResults = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + chip::JniReferences::GetInstance().CreateOptional(WiFiScanResults, WiFiScanResults); + } jobject ThreadScanResults; + if (!dataResponse.threadScanResults.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, ThreadScanResults); + } + else + { - ThreadScanResults = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + ThreadScanResults = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ + chip::JniReferences::GetInstance().CreateOptional(ThreadScanResults, ThreadScanResults); + } env->CallVoidMethod(javaCallbackRef, javaMethod, NetworkingStatus, DebugText, WiFiScanResults, ThreadScanResults); } @@ -3210,70 +2581,6 @@ void CHIPScenesClusterViewSceneResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, status, groupId, sceneId, transitionTime, sceneName, extensionFieldSets); } -CHIPTvChannelClusterChangeChannelResponseCallback::CHIPTvChannelClusterChangeChannelResponseCallback(jobject javaCallback) : - Callback::Callback(CallbackFn, this) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPTvChannelClusterChangeChannelResponseCallback::~CHIPTvChannelClusterChangeChannelResponseCallback() -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -}; - -void CHIPTvChannelClusterChangeChannelResponseCallback::CallbackFn( - void * context, const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType & dataResponse) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - jmethodID javaMethod; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); - - std::unique_ptr - cppCallback(reinterpret_cast(context), - chip::Platform::Delete); - VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); - - javaCallbackRef = cppCallback->javaCallbackRef; - // Java callback is allowed to be null, exit early if this is the case. - VerifyOrReturn(javaCallbackRef != nullptr); - - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); - - jobject channelMatch; - - channelMatch = nullptr; /* Struct - conversion from this type to Java is not properly implemented yet */ - jobject errorType; - - std::string errorTypeClassName = "java/lang/Integer"; - std::string errorTypeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - errorTypeClassName.c_str(), errorTypeCtorSignature.c_str(), dataResponse.errorType, errorType); - - env->CallVoidMethod(javaCallbackRef, javaMethod, channelMatch, errorType); -} CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CHIPTargetNavigatorClusterNavigateTargetResponseCallback( jobject javaCallback) : Callback::Callback(CallbackFn, this) @@ -3332,7 +2639,7 @@ void CHIPTargetNavigatorClusterNavigateTargetResponseCallback::CallbackFn( std::string statusClassName = "java/lang/Integer"; std::string statusCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( + chip::JniReferences::GetInstance().CreateBoxedObject( statusClassName.c_str(), statusCtorSignature.c_str(), dataResponse.status, status); jobject data; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 7050765b040a4e..79fade03a2f5f6 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -39,76 +39,46 @@ class CHIPAccountLoginClusterGetSetupPINResponseCallback jobject javaCallbackRef; }; -class CHIPApplicationLauncherClusterHideAppResponseCallback - : public Callback::Callback +class CHIPApplicationLauncherClusterLauncherResponseCallback + : public Callback::Callback { public: - CHIPApplicationLauncherClusterHideAppResponseCallback(jobject javaCallback); + CHIPApplicationLauncherClusterLauncherResponseCallback(jobject javaCallback); - ~CHIPApplicationLauncherClusterHideAppResponseCallback(); + ~CHIPApplicationLauncherClusterLauncherResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::ApplicationLauncher::Commands::HideAppResponse::DecodableType & data); + const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & data); private: jobject javaCallbackRef; }; -class CHIPApplicationLauncherClusterLaunchAppResponseCallback - : public Callback::Callback +class CHIPChannelClusterChangeChannelResponseCallback + : public Callback::Callback { public: - CHIPApplicationLauncherClusterLaunchAppResponseCallback(jobject javaCallback); + CHIPChannelClusterChangeChannelResponseCallback(jobject javaCallback); - ~CHIPApplicationLauncherClusterLaunchAppResponseCallback(); + ~CHIPChannelClusterChangeChannelResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType & data); + const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & data); private: jobject javaCallbackRef; }; -class CHIPApplicationLauncherClusterStopAppResponseCallback - : public Callback::Callback +class CHIPContentLauncherClusterLaunchResponseCallback + : public Callback::Callback { public: - CHIPApplicationLauncherClusterStopAppResponseCallback(jobject javaCallback); + CHIPContentLauncherClusterLaunchResponseCallback(jobject javaCallback); - ~CHIPApplicationLauncherClusterStopAppResponseCallback(); + ~CHIPContentLauncherClusterLaunchResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::ApplicationLauncher::Commands::StopAppResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPContentLauncherClusterLaunchContentResponseCallback - : public Callback::Callback -{ -public: - CHIPContentLauncherClusterLaunchContentResponseCallback(jobject javaCallback); - - ~CHIPContentLauncherClusterLaunchContentResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPContentLauncherClusterLaunchURLResponseCallback - : public Callback::Callback -{ -public: - CHIPContentLauncherClusterLaunchURLResponseCallback(jobject javaCallback); - - ~CHIPContentLauncherClusterLaunchURLResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType & data); + const chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::DecodableType & data); private: jobject javaCallbackRef; @@ -219,6 +189,37 @@ class CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallback jobject javaCallbackRef; }; +class CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback + : public Callback::Callback +{ +public: + CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(jobject javaCallback); + + ~CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(); + + static void + CallbackFn(void * context, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + +class CHIPGroupKeyManagementClusterKeySetReadResponseCallback + : public Callback::Callback +{ +public: + CHIPGroupKeyManagementClusterKeySetReadResponseCallback(jobject javaCallback); + + ~CHIPGroupKeyManagementClusterKeySetReadResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPGroupsClusterAddGroupResponseCallback : public Callback::Callback { public: @@ -301,166 +302,16 @@ class CHIPKeypadInputClusterSendKeyResponseCallback : public Callback::Callback< jobject javaCallbackRef; }; -class CHIPMediaPlaybackClusterMediaFastForwardResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaFastForwardResponseCallback(jobject javaCallback); - - ~CHIPMediaPlaybackClusterMediaFastForwardResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaNextResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaNextResponseCallback(jobject javaCallback); - - ~CHIPMediaPlaybackClusterMediaNextResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaPauseResponseCallback - : public Callback::Callback +class CHIPMediaPlaybackClusterPlaybackResponseCallback + : public Callback::Callback { public: - CHIPMediaPlaybackClusterMediaPauseResponseCallback(jobject javaCallback); + CHIPMediaPlaybackClusterPlaybackResponseCallback(jobject javaCallback); - ~CHIPMediaPlaybackClusterMediaPauseResponseCallback(); + ~CHIPMediaPlaybackClusterPlaybackResponseCallback(); static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaPlayResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaPlayResponseCallback(jobject javaCallback); - - ~CHIPMediaPlaybackClusterMediaPlayResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaPreviousResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaPreviousResponseCallback(jobject javaCallback); - - ~CHIPMediaPlaybackClusterMediaPreviousResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaRewindResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaRewindResponseCallback(jobject javaCallback); - - ~CHIPMediaPlaybackClusterMediaRewindResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaSeekResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaSeekResponseCallback(jobject javaCallback); - - ~CHIPMediaPlaybackClusterMediaSeekResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback(jobject javaCallback); - - ~CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback(jobject javaCallback); - - ~CHIPMediaPlaybackClusterMediaSkipForwardResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaStartOverResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaStartOverResponseCallback(jobject javaCallback); - - ~CHIPMediaPlaybackClusterMediaStartOverResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - -class CHIPMediaPlaybackClusterMediaStopResponseCallback - : public Callback::Callback -{ -public: - CHIPMediaPlaybackClusterMediaStopResponseCallback(jobject javaCallback); - - ~CHIPMediaPlaybackClusterMediaStopResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType & data); + const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & data); private: jobject javaCallbackRef; @@ -686,21 +537,6 @@ class CHIPScenesClusterViewSceneResponseCallback : public Callback::Callback -{ -public: - CHIPTvChannelClusterChangeChannelResponseCallback(jobject javaCallback); - - ~CHIPTvChannelClusterChangeChannelResponseCallback(); - - static void CallbackFn(void * context, - const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType & data); - -private: - jobject javaCallbackRef; -}; - class CHIPTargetNavigatorClusterNavigateTargetResponseCallback : public Callback::Callback { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 13e1d628bb187d..829956173e9dc6 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -1253,6 +1253,96 @@ void CHIPAdministratorCommissioningAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPApplicationBasicAllowedVendorListAttributeCallback::CHIPApplicationBasicAllowedVendorListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPApplicationBasicAllowedVendorListAttributeCallback::~CHIPApplicationBasicAllowedVendorListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPApplicationBasicAllowedVendorListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jclass arrayListClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); + chip::JniClass arrayListJniClass(arrayListClass); + jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); + jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, + ChipLogError(Zcl, "Error finding Java ArrayList methods")); + jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); + VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + auto iter = list.begin(); + while (iter.Next()) + { + auto & entry = iter.GetValue(); + bool entryNull = false; + chip::VendorId entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(I)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); + } + VerifyOrReturn( + iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding AllowedVendorListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPApplicationBasicAttributeListAttributeCallback::CHIPApplicationBasicAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), @@ -1555,7 +1645,7 @@ CHIPAudioOutputAudioOutputListAttributeCallback::~CHIPAudioOutputAudioOutputList void CHIPAudioOutputAudioOutputListAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -1621,7 +1711,7 @@ void CHIPAudioOutputAudioOutputListAttributeCallback::CallbackFn( bool outputTypeNull = false; bool outputTypeHasValue = true; - chip::app::Clusters::AudioOutput::AudioOutputType outputTypeValue = entry.outputType; + chip::app::Clusters::AudioOutput::OutputTypeEnum outputTypeValue = entry.outputType; jobject outputType = nullptr; if (!outputTypeNull && outputTypeHasValue) @@ -2686,10 +2776,8 @@ void CHIPBridgedDeviceBasicAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPColorControlAttributeListAttributeCallback::CHIPColorControlAttributeListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPChannelChannelListAttributeCallback::CHIPChannelChannelListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2705,7 +2793,7 @@ CHIPColorControlAttributeListAttributeCallback::CHIPColorControlAttributeListAtt } } -CHIPColorControlAttributeListAttributeCallback::~CHIPColorControlAttributeListAttributeCallback() +CHIPChannelChannelListAttributeCallback::~CHIPChannelChannelListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2716,8 +2804,9 @@ CHIPColorControlAttributeListAttributeCallback::~CHIPColorControlAttributeListAt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPColorControlAttributeListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPChannelChannelListAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -2726,8 +2815,8 @@ void CHIPColorControlAttributeListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -2749,37 +2838,104 @@ void CHIPColorControlAttributeListAttributeCallback::CallbackFn(void * context, err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + jclass attributeClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipClusters$ChannelCluster$ChannelListAttribute", attributeClass); + VerifyOrReturn( + err == CHIP_NO_ERROR, + ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$ChannelCluster$ChannelListAttribute")); + chip::JniClass attributeJniClass(attributeClass); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find ChannelListAttribute constructor")); + auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - bool entryNull = false; - chip::AttributeId entryValue = entry; + auto & entry = iter.GetValue(); + (void) entry; + bool majorNumberNull = false; + bool majorNumberHasValue = true; - jobject entryObject = nullptr; - if (!entryNull) + uint16_t majorNumberValue = entry.majorNumber; + + jobject majorNumber = nullptr; + if (!majorNumberNull && majorNumberHasValue) { - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", entryTypeCls); - chip::JniClass jniClass(entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(J)V"); - entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + jclass majorNumberEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", majorNumberEntryCls); + chip::JniClass majorNumberJniClass(majorNumberEntryCls); + jmethodID majorNumberEntryTypeCtor = env->GetMethodID(majorNumberEntryCls, "", "(I)V"); + majorNumber = env->NewObject(majorNumberEntryCls, majorNumberEntryTypeCtor, majorNumberValue); } - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); + bool minorNumberNull = false; + bool minorNumberHasValue = true; + + uint16_t minorNumberValue = entry.minorNumber; + + jobject minorNumber = nullptr; + if (!minorNumberNull && minorNumberHasValue) + { + jclass minorNumberEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", minorNumberEntryCls); + chip::JniClass minorNumberJniClass(minorNumberEntryCls); + jmethodID minorNumberEntryTypeCtor = env->GetMethodID(minorNumberEntryCls, "", "(I)V"); + minorNumber = env->NewObject(minorNumberEntryCls, minorNumberEntryTypeCtor, minorNumberValue); + } + + bool nameNull = false; + bool nameHasValue = true; + + chip::CharSpan nameValue = entry.name; + + jstring name = nullptr; + chip::UtfString nameStr(env, nameValue); + if (!nameNull && nameHasValue) + { + name = jstring(nameStr.jniValue()); + } + + bool callSignNull = false; + bool callSignHasValue = true; + + chip::CharSpan callSignValue = entry.callSign; + + jstring callSign = nullptr; + chip::UtfString callSignStr(env, callSignValue); + if (!callSignNull && callSignHasValue) + { + callSign = jstring(callSignStr.jniValue()); + } + + bool affiliateCallSignNull = false; + bool affiliateCallSignHasValue = true; + + chip::CharSpan affiliateCallSignValue = entry.affiliateCallSign; + + jstring affiliateCallSign = nullptr; + chip::UtfString affiliateCallSignStr(env, affiliateCallSignValue); + if (!affiliateCallSignNull && affiliateCallSignHasValue) + { + affiliateCallSign = jstring(affiliateCallSignStr.jniValue()); + } + + jobject attributeObj = + env->NewObject(attributeClass, attributeCtor, majorNumber, minorNumber, name, callSign, affiliateCallSign); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create ChannelListAttribute object")); + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); } - VerifyOrReturn( - iter.GetStatus() == CHIP_NO_ERROR, - ChipLogError(Zcl, "Error decoding AttributeListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding ChannelListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPContentLauncherAcceptsHeaderListAttributeCallback::CHIPContentLauncherAcceptsHeaderListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPChannelAttributeListAttributeCallback::CHIPChannelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2795,7 +2951,7 @@ CHIPContentLauncherAcceptsHeaderListAttributeCallback::CHIPContentLauncherAccept } } -CHIPContentLauncherAcceptsHeaderListAttributeCallback::~CHIPContentLauncherAcceptsHeaderListAttributeCallback() +CHIPChannelAttributeListAttributeCallback::~CHIPChannelAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2806,8 +2962,8 @@ CHIPContentLauncherAcceptsHeaderListAttributeCallback::~CHIPContentLauncherAccep env->DeleteGlobalRef(javaCallbackRef); } -void CHIPContentLauncherAcceptsHeaderListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPChannelAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -2816,8 +2972,8 @@ void CHIPContentLauncherAcceptsHeaderListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -2842,30 +2998,33 @@ void CHIPContentLauncherAcceptsHeaderListAttributeCallback::CallbackFn( auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - bool entryNull = false; - chip::ByteSpan entryValue = entry; + auto & entry = iter.GetValue(); + bool entryNull = false; + chip::AttributeId entryValue = entry; - jbyteArray entryObject = nullptr; + jobject entryObject = nullptr; if (!entryNull) { - entryObject = env->NewByteArray(entryValue.size()); - env->SetByteArrayRegion(entryObject, 0, entryValue.size(), reinterpret_cast(entryValue.data())); + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(J)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); } env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); } VerifyOrReturn( iter.GetStatus() == CHIP_NO_ERROR, - ChipLogError(Zcl, "Error decoding AcceptsHeaderListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + ChipLogError(Zcl, "Error decoding AttributeListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPContentLauncherAttributeListAttributeCallback::CHIPContentLauncherAttributeListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPColorControlAttributeListAttributeCallback::CHIPColorControlAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -2882,7 +3041,7 @@ CHIPContentLauncherAttributeListAttributeCallback::CHIPContentLauncherAttributeL } } -CHIPContentLauncherAttributeListAttributeCallback::~CHIPContentLauncherAttributeListAttributeCallback() +CHIPColorControlAttributeListAttributeCallback::~CHIPColorControlAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2893,8 +3052,8 @@ CHIPContentLauncherAttributeListAttributeCallback::~CHIPContentLauncherAttribute env->DeleteGlobalRef(javaCallbackRef); } -void CHIPContentLauncherAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPColorControlAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -2903,8 +3062,8 @@ void CHIPContentLauncherAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -2953,8 +3112,10 @@ void CHIPContentLauncherAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDescriptorDeviceListAttributeCallback::CHIPDescriptorDeviceListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPContentLauncherAcceptHeaderListAttributeCallback::CHIPContentLauncherAcceptHeaderListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2970,7 +3131,7 @@ CHIPDescriptorDeviceListAttributeCallback::CHIPDescriptorDeviceListAttributeCall } } -CHIPDescriptorDeviceListAttributeCallback::~CHIPDescriptorDeviceListAttributeCallback() +CHIPContentLauncherAcceptHeaderListAttributeCallback::~CHIPContentLauncherAcceptHeaderListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2981,9 +3142,8 @@ CHIPDescriptorDeviceListAttributeCallback::~CHIPDescriptorDeviceListAttributeCal env->DeleteGlobalRef(javaCallbackRef); } -void CHIPDescriptorDeviceListAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPContentLauncherAcceptHeaderListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -2992,8 +3152,8 @@ void CHIPDescriptorDeviceListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -3015,32 +3175,208 @@ void CHIPDescriptorDeviceListAttributeCallback::CallbackFn( err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - jclass attributeClass; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipClusters$DescriptorCluster$DeviceListAttribute", attributeClass); - VerifyOrReturn( - err == CHIP_NO_ERROR, - ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$DescriptorCluster$DeviceListAttribute")); - chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;)V"); - VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find DeviceListAttribute constructor")); - auto iter = list.begin(); while (iter.Next()) { - auto & entry = iter.GetValue(); - (void) entry; - bool typeNull = false; - bool typeHasValue = true; - - chip::DeviceTypeId typeValue = entry.type; + auto & entry = iter.GetValue(); + bool entryNull = false; + chip::CharSpan entryValue = entry; - jobject type = nullptr; - if (!typeNull && typeHasValue) + jstring entryObject = nullptr; + chip::UtfString entryStr(env, entryValue); + if (!entryNull) { - jclass typeEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", typeEntryCls); - chip::JniClass typeJniClass(typeEntryCls); + entryObject = jstring(entryStr.jniValue()); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); + } + VerifyOrReturn( + iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding AcceptHeaderListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPContentLauncherAttributeListAttributeCallback::CHIPContentLauncherAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPContentLauncherAttributeListAttributeCallback::~CHIPContentLauncherAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPContentLauncherAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jclass arrayListClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); + chip::JniClass arrayListJniClass(arrayListClass); + jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); + jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, + ChipLogError(Zcl, "Error finding Java ArrayList methods")); + jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); + VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + auto iter = list.begin(); + while (iter.Next()) + { + auto & entry = iter.GetValue(); + bool entryNull = false; + chip::AttributeId entryValue = entry; + + jobject entryObject = nullptr; + if (!entryNull) + { + jclass entryTypeCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", entryTypeCls); + chip::JniClass jniClass(entryTypeCls); + jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(J)V"); + entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); + } + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); + } + VerifyOrReturn( + iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding AttributeListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPDescriptorDeviceListAttributeCallback::CHIPDescriptorDeviceListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPDescriptorDeviceListAttributeCallback::~CHIPDescriptorDeviceListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPDescriptorDeviceListAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jclass arrayListClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); + chip::JniClass arrayListJniClass(arrayListClass); + jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); + jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, + ChipLogError(Zcl, "Error finding Java ArrayList methods")); + jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); + VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jclass attributeClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipClusters$DescriptorCluster$DeviceListAttribute", attributeClass); + VerifyOrReturn( + err == CHIP_NO_ERROR, + ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$DescriptorCluster$DeviceListAttribute")); + chip::JniClass attributeJniClass(attributeClass); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Long;Ljava/lang/Integer;)V"); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find DeviceListAttribute constructor")); + + auto iter = list.begin(); + while (iter.Next()) + { + auto & entry = iter.GetValue(); + (void) entry; + bool typeNull = false; + bool typeHasValue = true; + + chip::DeviceTypeId typeValue = entry.type; + + jobject type = nullptr; + if (!typeNull && typeHasValue) + { + jclass typeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", typeEntryCls); + chip::JniClass typeJniClass(typeEntryCls); jmethodID typeEntryTypeCtor = env->GetMethodID(typeEntryCls, "", "(J)V"); type = env->NewObject(typeEntryCls, typeEntryTypeCtor, typeValue); } @@ -4938,8 +5274,10 @@ void CHIPGeneralDiagnosticsAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGroupsAttributeCallback::CHIPGroupKeyManagementGroupsAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CHIPGroupKeyManagementGroupKeyMapAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4955,7 +5293,7 @@ CHIPGroupKeyManagementGroupsAttributeCallback::CHIPGroupKeyManagementGroupsAttri } } -CHIPGroupKeyManagementGroupsAttributeCallback::~CHIPGroupKeyManagementGroupsAttributeCallback() +CHIPGroupKeyManagementGroupKeyMapAttributeCallback::~CHIPGroupKeyManagementGroupKeyMapAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4966,9 +5304,9 @@ CHIPGroupKeyManagementGroupsAttributeCallback::~CHIPGroupKeyManagementGroupsAttr env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( +void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -4977,8 +5315,8 @@ void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -5002,80 +5340,81 @@ void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( jclass attributeClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupsAttribute", attributeClass); + env, "chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeyMapAttribute", attributeClass); VerifyOrReturn( err == CHIP_NO_ERROR, - ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupsAttribute")); + ChipLogError(Zcl, + "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeyMapAttribute")); chip::JniClass attributeJniClass(attributeClass); jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupsAttribute constructor")); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupKeyMapAttribute constructor")); auto iter = list.begin(); while (iter.Next()) { auto & entry = iter.GetValue(); (void) entry; - bool vendorIdNull = false; - bool vendorIdHasValue = true; + bool fabricIndexNull = false; + bool fabricIndexHasValue = true; - uint16_t vendorIdValue = entry.vendorId; + uint16_t fabricIndexValue = entry.fabricIndex; - jobject vendorId = nullptr; - if (!vendorIdNull && vendorIdHasValue) + jobject fabricIndex = nullptr; + if (!fabricIndexNull && fabricIndexHasValue) { - jclass vendorIdEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", vendorIdEntryCls); - chip::JniClass vendorIdJniClass(vendorIdEntryCls); - jmethodID vendorIdEntryTypeCtor = env->GetMethodID(vendorIdEntryCls, "", "(I)V"); - vendorId = env->NewObject(vendorIdEntryCls, vendorIdEntryTypeCtor, vendorIdValue); + jclass fabricIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); + chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); + jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); + fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); } - bool vendorGroupIdNull = false; - bool vendorGroupIdHasValue = true; + bool groupIdNull = false; + bool groupIdHasValue = true; - uint16_t vendorGroupIdValue = entry.vendorGroupId; + uint16_t groupIdValue = entry.groupId; - jobject vendorGroupId = nullptr; - if (!vendorGroupIdNull && vendorGroupIdHasValue) + jobject groupId = nullptr; + if (!groupIdNull && groupIdHasValue) { - jclass vendorGroupIdEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", vendorGroupIdEntryCls); - chip::JniClass vendorGroupIdJniClass(vendorGroupIdEntryCls); - jmethodID vendorGroupIdEntryTypeCtor = env->GetMethodID(vendorGroupIdEntryCls, "", "(I)V"); - vendorGroupId = env->NewObject(vendorGroupIdEntryCls, vendorGroupIdEntryTypeCtor, vendorGroupIdValue); + jclass groupIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupIdEntryCls); + chip::JniClass groupIdJniClass(groupIdEntryCls); + jmethodID groupIdEntryTypeCtor = env->GetMethodID(groupIdEntryCls, "", "(I)V"); + groupId = env->NewObject(groupIdEntryCls, groupIdEntryTypeCtor, groupIdValue); } - bool groupKeySetIndexNull = false; - bool groupKeySetIndexHasValue = true; + bool groupKeySetIDNull = false; + bool groupKeySetIDHasValue = true; - uint16_t groupKeySetIndexValue = entry.groupKeySetIndex; + uint16_t groupKeySetIDValue = entry.groupKeySetID; - jobject groupKeySetIndex = nullptr; - if (!groupKeySetIndexNull && groupKeySetIndexHasValue) + jobject groupKeySetID = nullptr; + if (!groupKeySetIDNull && groupKeySetIDHasValue) { - jclass groupKeySetIndexEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeySetIndexEntryCls); - chip::JniClass groupKeySetIndexJniClass(groupKeySetIndexEntryCls); - jmethodID groupKeySetIndexEntryTypeCtor = env->GetMethodID(groupKeySetIndexEntryCls, "", "(I)V"); - groupKeySetIndex = env->NewObject(groupKeySetIndexEntryCls, groupKeySetIndexEntryTypeCtor, groupKeySetIndexValue); + jclass groupKeySetIDEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeySetIDEntryCls); + chip::JniClass groupKeySetIDJniClass(groupKeySetIDEntryCls); + jmethodID groupKeySetIDEntryTypeCtor = env->GetMethodID(groupKeySetIDEntryCls, "", "(I)V"); + groupKeySetID = env->NewObject(groupKeySetIDEntryCls, groupKeySetIDEntryTypeCtor, groupKeySetIDValue); } - jobject attributeObj = env->NewObject(attributeClass, attributeCtor, vendorId, vendorGroupId, groupKeySetIndex); - VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupsAttribute object")); + jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, groupId, groupKeySetID); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupKeyMapAttribute object")); env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); } VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, - ChipLogError(Zcl, "Error decoding GroupsAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + ChipLogError(Zcl, "Error decoding GroupKeyMapAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGroupKeysAttributeCallback::CHIPGroupKeyManagementGroupKeysAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPGroupKeyManagementGroupTableAttributeCallback::CHIPGroupKeyManagementGroupTableAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -5092,7 +5431,7 @@ CHIPGroupKeyManagementGroupKeysAttributeCallback::CHIPGroupKeyManagementGroupKey } } -CHIPGroupKeyManagementGroupKeysAttributeCallback::~CHIPGroupKeyManagementGroupKeysAttributeCallback() +CHIPGroupKeyManagementGroupTableAttributeCallback::~CHIPGroupKeyManagementGroupTableAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5103,9 +5442,9 @@ CHIPGroupKeyManagementGroupKeysAttributeCallback::~CHIPGroupKeyManagementGroupKe env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( +void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -5114,8 +5453,8 @@ void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -5139,103 +5478,69 @@ void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( jclass attributeClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeysAttribute", attributeClass); + env, "chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupTableAttribute", attributeClass); VerifyOrReturn( err == CHIP_NO_ERROR, - ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupKeysAttribute")); + ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$GroupKeyManagementCluster$GroupTableAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;[BLjava/lang/Long;Ljava/lang/Integer;)V"); - VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupKeysAttribute constructor")); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V"); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find GroupTableAttribute constructor")); auto iter = list.begin(); while (iter.Next()) { auto & entry = iter.GetValue(); (void) entry; - bool vendorIdNull = false; - bool vendorIdHasValue = true; - - uint16_t vendorIdValue = entry.vendorId; - - jobject vendorId = nullptr; - if (!vendorIdNull && vendorIdHasValue) - { - jclass vendorIdEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", vendorIdEntryCls); - chip::JniClass vendorIdJniClass(vendorIdEntryCls); - jmethodID vendorIdEntryTypeCtor = env->GetMethodID(vendorIdEntryCls, "", "(I)V"); - vendorId = env->NewObject(vendorIdEntryCls, vendorIdEntryTypeCtor, vendorIdValue); - } - - bool groupKeyIndexNull = false; - bool groupKeyIndexHasValue = true; - - uint16_t groupKeyIndexValue = entry.groupKeyIndex; - - jobject groupKeyIndex = nullptr; - if (!groupKeyIndexNull && groupKeyIndexHasValue) - { - jclass groupKeyIndexEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeyIndexEntryCls); - chip::JniClass groupKeyIndexJniClass(groupKeyIndexEntryCls); - jmethodID groupKeyIndexEntryTypeCtor = env->GetMethodID(groupKeyIndexEntryCls, "", "(I)V"); - groupKeyIndex = env->NewObject(groupKeyIndexEntryCls, groupKeyIndexEntryTypeCtor, groupKeyIndexValue); - } - - bool groupKeyRootNull = false; - bool groupKeyRootHasValue = true; + bool fabricIndexNull = false; + bool fabricIndexHasValue = true; - chip::ByteSpan groupKeyRootValue = entry.groupKeyRoot; + uint16_t fabricIndexValue = entry.fabricIndex; - jbyteArray groupKeyRoot = nullptr; - if (!groupKeyRootNull && groupKeyRootHasValue) + jobject fabricIndex = nullptr; + if (!fabricIndexNull && fabricIndexHasValue) { - groupKeyRoot = env->NewByteArray(groupKeyRootValue.size()); - env->SetByteArrayRegion(groupKeyRoot, 0, groupKeyRootValue.size(), - reinterpret_cast(groupKeyRootValue.data())); + jclass fabricIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); + chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); + jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); + fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); } - bool groupKeyEpochStartTimeNull = false; - bool groupKeyEpochStartTimeHasValue = true; + bool groupIdNull = false; + bool groupIdHasValue = true; - uint64_t groupKeyEpochStartTimeValue = entry.groupKeyEpochStartTime; + uint16_t groupIdValue = entry.groupId; - jobject groupKeyEpochStartTime = nullptr; - if (!groupKeyEpochStartTimeNull && groupKeyEpochStartTimeHasValue) + jobject groupId = nullptr; + if (!groupIdNull && groupIdHasValue) { - jclass groupKeyEpochStartTimeEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", groupKeyEpochStartTimeEntryCls); - chip::JniClass groupKeyEpochStartTimeJniClass(groupKeyEpochStartTimeEntryCls); - jmethodID groupKeyEpochStartTimeEntryTypeCtor = env->GetMethodID(groupKeyEpochStartTimeEntryCls, "", "(J)V"); - groupKeyEpochStartTime = - env->NewObject(groupKeyEpochStartTimeEntryCls, groupKeyEpochStartTimeEntryTypeCtor, groupKeyEpochStartTimeValue); + jclass groupIdEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupIdEntryCls); + chip::JniClass groupIdJniClass(groupIdEntryCls); + jmethodID groupIdEntryTypeCtor = env->GetMethodID(groupIdEntryCls, "", "(I)V"); + groupId = env->NewObject(groupIdEntryCls, groupIdEntryTypeCtor, groupIdValue); } - bool groupKeySecurityPolicyNull = false; - bool groupKeySecurityPolicyHasValue = true; + bool groupNameNull = false; + bool groupNameHasValue = true; - chip::app::Clusters::GroupKeyManagement::GroupKeySecurityPolicy groupKeySecurityPolicyValue = entry.groupKeySecurityPolicy; + chip::CharSpan groupNameValue = entry.groupName; - jobject groupKeySecurityPolicy = nullptr; - if (!groupKeySecurityPolicyNull && groupKeySecurityPolicyHasValue) + jstring groupName = nullptr; + chip::UtfString groupNameStr(env, groupNameValue); + if (!groupNameNull && groupNameHasValue) { - jclass groupKeySecurityPolicyEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", groupKeySecurityPolicyEntryCls); - chip::JniClass groupKeySecurityPolicyJniClass(groupKeySecurityPolicyEntryCls); - jmethodID groupKeySecurityPolicyEntryTypeCtor = env->GetMethodID(groupKeySecurityPolicyEntryCls, "", "(I)V"); - groupKeySecurityPolicy = - env->NewObject(groupKeySecurityPolicyEntryCls, groupKeySecurityPolicyEntryTypeCtor, groupKeySecurityPolicyValue); + groupName = jstring(groupNameStr.jniValue()); } - jobject attributeObj = env->NewObject(attributeClass, attributeCtor, vendorId, groupKeyIndex, groupKeyRoot, - groupKeyEpochStartTime, groupKeySecurityPolicy); - VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupKeysAttribute object")); + jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, groupId, groupName); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create GroupTableAttribute object")); env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); } VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, - ChipLogError(Zcl, "Error decoding GroupKeysAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + ChipLogError(Zcl, "Error decoding GroupTableAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); @@ -6378,7 +6683,7 @@ CHIPMediaInputMediaInputListAttributeCallback::~CHIPMediaInputMediaInputListAttr void CHIPMediaInputMediaInputListAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -6444,7 +6749,7 @@ void CHIPMediaInputMediaInputListAttributeCallback::CallbackFn( bool inputTypeNull = false; bool inputTypeHasValue = true; - chip::app::Clusters::MediaInput::MediaInputType inputTypeValue = entry.inputType; + chip::app::Clusters::MediaInput::InputTypeEnum inputTypeValue = entry.inputType; jobject inputType = nullptr; if (!inputTypeNull && inputTypeHasValue) @@ -7101,9 +7406,9 @@ void CHIPOtaSoftwareUpdateProviderAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback::CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback:: + CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -7120,7 +7425,8 @@ CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback::CHIPOtaSoftwareUpd } } -CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback::~CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback() +CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback:: + ~CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -7131,8 +7437,10 @@ CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback::~CHIPOtaSoftwareUp env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -7141,8 +7449,209 @@ void CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jclass arrayListClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); + chip::JniClass arrayListJniClass(arrayListClass); + jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); + jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, + ChipLogError(Zcl, "Error finding Java ArrayList methods")); + jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); + VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jclass attributeClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipClusters$OtaSoftwareUpdateRequestorCluster$DefaultOtaProvidersAttribute", attributeClass); + VerifyOrReturn( + err == CHIP_NO_ERROR, + ChipLogError(Zcl, + "Could not find class " + "chip/devicecontroller/ChipClusters$OtaSoftwareUpdateRequestorCluster$DefaultOtaProvidersAttribute")); + chip::JniClass attributeJniClass(attributeClass); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V"); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find DefaultOtaProvidersAttribute constructor")); + + auto iter = list.begin(); + while (iter.Next()) + { + auto & entry = iter.GetValue(); + (void) entry; + bool fabricIndexNull = false; + bool fabricIndexHasValue = true; + + chip::FabricIndex fabricIndexValue = entry.fabricIndex; + + jobject fabricIndex = nullptr; + if (!fabricIndexNull && fabricIndexHasValue) + { + jclass fabricIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); + chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); + jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); + fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); + } + + bool providerNodeIDNull = false; + bool providerNodeIDHasValue = true; + + chip::NodeId providerNodeIDValue = entry.providerNodeID; + + jobject providerNodeID = nullptr; + if (!providerNodeIDNull && providerNodeIDHasValue) + { + jclass providerNodeIDEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", providerNodeIDEntryCls); + chip::JniClass providerNodeIDJniClass(providerNodeIDEntryCls); + jmethodID providerNodeIDEntryTypeCtor = env->GetMethodID(providerNodeIDEntryCls, "", "(J)V"); + providerNodeID = env->NewObject(providerNodeIDEntryCls, providerNodeIDEntryTypeCtor, providerNodeIDValue); + } + + bool endpointNull = false; + bool endpointHasValue = true; + + chip::EndpointId endpointValue = entry.endpoint; + + jobject endpoint = nullptr; + if (!endpointNull && endpointHasValue) + { + jclass endpointEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", endpointEntryCls); + chip::JniClass endpointJniClass(endpointEntryCls); + jmethodID endpointEntryTypeCtor = env->GetMethodID(endpointEntryCls, "", "(I)V"); + endpoint = env->NewObject(endpointEntryCls, endpointEntryTypeCtor, endpointValue); + } + + jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, providerNodeID, endpoint); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create DefaultOtaProvidersAttribute object")); + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); + } + VerifyOrReturn( + iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding DefaultOtaProvidersAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback:: + CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback:: + ~CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback::CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback::~CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -9062,8 +9571,10 @@ void CHIPSwitchAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTvChannelChannelListAttributeCallback::CHIPTvChannelChannelListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CHIPTargetNavigatorTargetNavigatorListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -9079,7 +9590,7 @@ CHIPTvChannelChannelListAttributeCallback::CHIPTvChannelChannelListAttributeCall } } -CHIPTvChannelChannelListAttributeCallback::~CHIPTvChannelChannelListAttributeCallback() +CHIPTargetNavigatorTargetNavigatorListAttributeCallback::~CHIPTargetNavigatorTargetNavigatorListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -9090,9 +9601,9 @@ CHIPTvChannelChannelListAttributeCallback::~CHIPTvChannelChannelListAttributeCal env->DeleteGlobalRef(javaCallbackRef); } -void CHIPTvChannelChannelListAttributeCallback::CallbackFn( +void CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list) + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -9101,8 +9612,8 @@ void CHIPTvChannelChannelListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -9126,49 +9637,33 @@ void CHIPTvChannelChannelListAttributeCallback::CallbackFn( jclass attributeClass; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipClusters$TvChannelCluster$ChannelListAttribute", attributeClass); + env, "chip/devicecontroller/ChipClusters$TargetNavigatorCluster$TargetNavigatorListAttribute", attributeClass); VerifyOrReturn( err == CHIP_NO_ERROR, - ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$TvChannelCluster$ChannelListAttribute")); + ChipLogError( + Zcl, "Could not find class chip/devicecontroller/ChipClusters$TargetNavigatorCluster$TargetNavigatorListAttribute")); chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = - env->GetMethodID(attributeClass, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); - VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find ChannelListAttribute constructor")); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find TargetNavigatorListAttribute constructor")); auto iter = list.begin(); while (iter.Next()) { auto & entry = iter.GetValue(); (void) entry; - bool majorNumberNull = false; - bool majorNumberHasValue = true; - - uint16_t majorNumberValue = entry.majorNumber; - - jobject majorNumber = nullptr; - if (!majorNumberNull && majorNumberHasValue) - { - jclass majorNumberEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", majorNumberEntryCls); - chip::JniClass majorNumberJniClass(majorNumberEntryCls); - jmethodID majorNumberEntryTypeCtor = env->GetMethodID(majorNumberEntryCls, "", "(I)V"); - majorNumber = env->NewObject(majorNumberEntryCls, majorNumberEntryTypeCtor, majorNumberValue); - } - - bool minorNumberNull = false; - bool minorNumberHasValue = true; + bool identifierNull = false; + bool identifierHasValue = true; - uint16_t minorNumberValue = entry.minorNumber; + uint8_t identifierValue = entry.identifier; - jobject minorNumber = nullptr; - if (!minorNumberNull && minorNumberHasValue) + jobject identifier = nullptr; + if (!identifierNull && identifierHasValue) { - jclass minorNumberEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", minorNumberEntryCls); - chip::JniClass minorNumberJniClass(minorNumberEntryCls); - jmethodID minorNumberEntryTypeCtor = env->GetMethodID(minorNumberEntryCls, "", "(I)V"); - minorNumber = env->NewObject(minorNumberEntryCls, minorNumberEntryTypeCtor, minorNumberValue); + jclass identifierEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", identifierEntryCls); + chip::JniClass identifierJniClass(identifierEntryCls); + jmethodID identifierEntryTypeCtor = env->GetMethodID(identifierEntryCls, "", "(I)V"); + identifier = env->NewObject(identifierEntryCls, identifierEntryTypeCtor, identifierValue); } bool nameNull = false; @@ -9183,45 +9678,23 @@ void CHIPTvChannelChannelListAttributeCallback::CallbackFn( name = jstring(nameStr.jniValue()); } - bool callSignNull = false; - bool callSignHasValue = true; - - chip::CharSpan callSignValue = entry.callSign; - - jstring callSign = nullptr; - chip::UtfString callSignStr(env, callSignValue); - if (!callSignNull && callSignHasValue) - { - callSign = jstring(callSignStr.jniValue()); - } - - bool affiliateCallSignNull = false; - bool affiliateCallSignHasValue = true; - - chip::CharSpan affiliateCallSignValue = entry.affiliateCallSign; - - jstring affiliateCallSign = nullptr; - chip::UtfString affiliateCallSignStr(env, affiliateCallSignValue); - if (!affiliateCallSignNull && affiliateCallSignHasValue) - { - affiliateCallSign = jstring(affiliateCallSignStr.jniValue()); - } - - jobject attributeObj = - env->NewObject(attributeClass, attributeCtor, majorNumber, minorNumber, name, callSign, affiliateCallSign); - VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create ChannelListAttribute object")); + jobject attributeObj = env->NewObject(attributeClass, attributeCtor, identifier, name); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create TargetNavigatorListAttribute object")); env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); } - VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, - ChipLogError(Zcl, "Error decoding ChannelListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + VerifyOrReturn( + iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding TargetNavigatorListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTvChannelAttributeListAttributeCallback::CHIPTvChannelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPTargetNavigatorAttributeListAttributeCallback::CHIPTargetNavigatorAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -9237,218 +9710,7 @@ CHIPTvChannelAttributeListAttributeCallback::CHIPTvChannelAttributeListAttribute } } -CHIPTvChannelAttributeListAttributeCallback::~CHIPTvChannelAttributeListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPTvChannelAttributeListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jclass arrayListClass; - err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); - chip::JniClass arrayListJniClass(arrayListClass); - jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); - jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); - VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, - ChipLogError(Zcl, "Error finding Java ArrayList methods")); - jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); - VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - auto iter = list.begin(); - while (iter.Next()) - { - auto & entry = iter.GetValue(); - bool entryNull = false; - chip::AttributeId entryValue = entry; - - jobject entryObject = nullptr; - if (!entryNull) - { - jclass entryTypeCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Long", entryTypeCls); - chip::JniClass jniClass(entryTypeCls); - jmethodID entryTypeCtor = env->GetMethodID(entryTypeCls, "", "(J)V"); - entryObject = env->NewObject(entryTypeCls, entryTypeCtor, entryValue); - } - - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, entryObject); - } - VerifyOrReturn( - iter.GetStatus() == CHIP_NO_ERROR, - ChipLogError(Zcl, "Error decoding AttributeListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CHIPTargetNavigatorTargetNavigatorListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPTargetNavigatorTargetNavigatorListAttributeCallback::~CHIPTargetNavigatorTargetNavigatorListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jclass arrayListClass; - err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); - chip::JniClass arrayListJniClass(arrayListClass); - jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); - jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); - VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, - ChipLogError(Zcl, "Error finding Java ArrayList methods")); - jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); - VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jclass attributeClass; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipClusters$TargetNavigatorCluster$TargetNavigatorListAttribute", attributeClass); - VerifyOrReturn( - err == CHIP_NO_ERROR, - ChipLogError( - Zcl, "Could not find class chip/devicecontroller/ChipClusters$TargetNavigatorCluster$TargetNavigatorListAttribute")); - chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); - VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find TargetNavigatorListAttribute constructor")); - - auto iter = list.begin(); - while (iter.Next()) - { - auto & entry = iter.GetValue(); - (void) entry; - bool identifierNull = false; - bool identifierHasValue = true; - - uint8_t identifierValue = entry.identifier; - - jobject identifier = nullptr; - if (!identifierNull && identifierHasValue) - { - jclass identifierEntryCls; - chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", identifierEntryCls); - chip::JniClass identifierJniClass(identifierEntryCls); - jmethodID identifierEntryTypeCtor = env->GetMethodID(identifierEntryCls, "", "(I)V"); - identifier = env->NewObject(identifierEntryCls, identifierEntryTypeCtor, identifierValue); - } - - bool nameNull = false; - bool nameHasValue = true; - - chip::CharSpan nameValue = entry.name; - - jstring name = nullptr; - chip::UtfString nameStr(env, nameValue); - if (!nameNull && nameHasValue) - { - name = jstring(nameStr.jniValue()); - } - - jobject attributeObj = env->NewObject(attributeClass, attributeCtor, identifier, name); - VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create TargetNavigatorListAttribute object")); - - env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); - } - VerifyOrReturn( - iter.GetStatus() == CHIP_NO_ERROR, - ChipLogError(Zcl, "Error decoding TargetNavigatorListAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPTargetNavigatorAttributeListAttributeCallback::CHIPTargetNavigatorAttributeListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPTargetNavigatorAttributeListAttributeCallback::~CHIPTargetNavigatorAttributeListAttributeCallback() +CHIPTargetNavigatorAttributeListAttributeCallback::~CHIPTargetNavigatorAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -13934,6 +14196,500 @@ void CHIPWiFiNetworkDiagnosticsAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPWindowCoveringCurrentPositionLiftAttributeCallback::CHIPWindowCoveringCurrentPositionLiftAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPWindowCoveringCurrentPositionLiftAttributeCallback::~CHIPWindowCoveringCurrentPositionLiftAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPWindowCoveringCurrentPositionLiftAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPWindowCoveringCurrentPositionTiltAttributeCallback::CHIPWindowCoveringCurrentPositionTiltAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPWindowCoveringCurrentPositionTiltAttributeCallback::~CHIPWindowCoveringCurrentPositionTiltAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPWindowCoveringCurrentPositionTiltAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback::CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback:: + ~CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback::CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback:: + ~CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback:: + CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback:: + ~CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + javaValueClassName.c_str(), javaValueCtorSignature.c_str(), value.Value(), javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback:: + CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback:: + ~CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + javaValueClassName.c_str(), javaValueCtorSignature.c_str(), value.Value(), javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback:: + CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback:: + ~CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + javaValueClassName.c_str(), javaValueCtorSignature.c_str(), value.Value(), javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback:: + CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback:: + ~CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + javaValueClassName.c_str(), javaValueCtorSignature.c_str(), value.Value(), javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + CHIPWindowCoveringAttributeListAttributeCallback::CHIPWindowCoveringAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 1a9afa8d7523cd..87312f1e70e1e4 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -18,7 +18,10 @@ // THIS FILE IS GENERATED BY ZAP #include "CHIPCallbackTypes.h" +#include #include +#include +#include #include class CHIPBooleanAttributeCallback : public chip::Callback::Callback @@ -38,6 +41,12 @@ class CHIPBooleanAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -60,6 +69,12 @@ class CHIPCharStringAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -82,6 +97,12 @@ class CHIPDoubleAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -104,6 +125,12 @@ class CHIPFloatAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -126,6 +153,12 @@ class CHIPInt8sAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -148,6 +181,12 @@ class CHIPInt8uAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -170,6 +209,12 @@ class CHIPInt16sAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -192,6 +237,12 @@ class CHIPInt16uAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -214,6 +265,12 @@ class CHIPInt32sAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -236,6 +293,12 @@ class CHIPInt32uAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -258,6 +321,12 @@ class CHIPInt64sAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -280,6 +349,12 @@ class CHIPInt64uAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -302,6 +377,12 @@ class CHIPOctetStringAttributeCallback : public chip::Callback::Callback(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -328,6 +409,12 @@ class CHIPAccessControlAclAttributeCallback : public chip::Callback::Callback & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -355,6 +442,12 @@ class CHIPAccessControlExtensionAttributeCallback void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -379,6 +472,12 @@ class CHIPAccessControlAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -403,6 +502,12 @@ class CHIPAccountLoginAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -427,6 +532,12 @@ class CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback } static void CallbackFn(void * context, chip::FabricIndex value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -451,6 +562,42 @@ class CHIPAdministratorCommissioningAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPApplicationBasicAllowedVendorListAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPApplicationBasicAllowedVendorListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPApplicationBasicAllowedVendorListAttributeCallback(); + + static void maybeDestroy(CHIPApplicationBasicAllowedVendorListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -475,6 +622,12 @@ class CHIPApplicationBasicAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -499,6 +652,12 @@ class CHIPApplicationLauncherApplicationLauncherListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -523,6 +682,12 @@ class CHIPApplicationLauncherAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -548,8 +713,13 @@ class CHIPAudioOutputAudioOutputListAttributeCallback static void CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list); + const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -574,6 +744,12 @@ class CHIPAudioOutputAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -598,6 +774,12 @@ class CHIPBarrierControlAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -621,6 +803,12 @@ class CHIPBasicAttributeListAttributeCallback : public chip::Callback::Callback< } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -645,6 +833,12 @@ class CHIPBinaryInputBasicAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -669,6 +863,12 @@ class CHIPBindingAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -693,6 +893,12 @@ class CHIPBooleanStateAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -720,6 +926,12 @@ class CHIPBridgedActionsActionListAttributeCallback void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -747,6 +959,12 @@ class CHIPBridgedActionsEndpointListAttributeCallback void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -771,6 +989,12 @@ class CHIPBridgedActionsAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -795,6 +1019,73 @@ class CHIPBridgedDeviceBasicAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPChannelChannelListAttributeCallback : public chip::Callback::Callback +{ +public: + CHIPChannelChannelListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPChannelChannelListAttributeCallback(); + + static void maybeDestroy(CHIPChannelChannelListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void + CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPChannelAttributeListAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPChannelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPChannelAttributeListAttributeCallback(); + + static void maybeDestroy(CHIPChannelAttributeListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -819,30 +1110,42 @@ class CHIPColorControlAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; bool keepAlive; }; -class CHIPContentLauncherAcceptsHeaderListAttributeCallback - : public chip::Callback::Callback +class CHIPContentLauncherAcceptHeaderListAttributeCallback + : public chip::Callback::Callback { public: - CHIPContentLauncherAcceptsHeaderListAttributeCallback(jobject javaCallback, bool keepAlive = false); + CHIPContentLauncherAcceptHeaderListAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPContentLauncherAcceptsHeaderListAttributeCallback(); + ~CHIPContentLauncherAcceptHeaderListAttributeCallback(); - static void maybeDestroy(CHIPContentLauncherAcceptsHeaderListAttributeCallback * callback) + static void maybeDestroy(CHIPContentLauncherAcceptHeaderListAttributeCallback * callback) { if (!callback->keepAlive) { callback->Cancel(); - chip::Platform::Delete(callback); + chip::Platform::Delete(callback); } } - static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -867,6 +1170,12 @@ class CHIPContentLauncherAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -893,6 +1202,12 @@ class CHIPDescriptorDeviceListAttributeCallback static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -917,6 +1232,12 @@ class CHIPDescriptorServerListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -941,6 +1262,12 @@ class CHIPDescriptorClientListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -965,6 +1292,12 @@ class CHIPDescriptorPartsListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -989,6 +1322,12 @@ class CHIPDescriptorAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1013,6 +1352,12 @@ class CHIPDiagnosticLogsAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1037,6 +1382,12 @@ class CHIPDoorLockLockStateAttributeCallback : public chip::Callback::Callback & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1061,6 +1412,12 @@ class CHIPDoorLockDoorStateAttributeCallback : public chip::Callback::Callback & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1085,6 +1442,12 @@ class CHIPDoorLockAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1109,6 +1472,12 @@ class CHIPElectricalMeasurementAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1133,6 +1502,12 @@ class CHIPEthernetNetworkDiagnosticsAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1159,6 +1534,12 @@ class CHIPFixedLabelLabelListAttributeCallback static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1183,6 +1564,12 @@ class CHIPFixedLabelAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1207,6 +1594,12 @@ class CHIPFlowMeasurementAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1234,6 +1627,12 @@ class CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType> & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1258,6 +1657,12 @@ class CHIPGeneralCommissioningAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1284,6 +1689,12 @@ class CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1308,6 +1719,12 @@ class CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1332,6 +1749,12 @@ class CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1356,6 +1779,12 @@ class CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1380,60 +1809,78 @@ class CHIPGeneralDiagnosticsAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; bool keepAlive; }; -class CHIPGroupKeyManagementGroupsAttributeCallback - : public chip::Callback::Callback +class CHIPGroupKeyManagementGroupKeyMapAttributeCallback + : public chip::Callback::Callback { public: - CHIPGroupKeyManagementGroupsAttributeCallback(jobject javaCallback, bool keepAlive = false); + CHIPGroupKeyManagementGroupKeyMapAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPGroupKeyManagementGroupsAttributeCallback(); + ~CHIPGroupKeyManagementGroupKeyMapAttributeCallback(); - static void maybeDestroy(CHIPGroupKeyManagementGroupsAttributeCallback * callback) + static void maybeDestroy(CHIPGroupKeyManagementGroupKeyMapAttributeCallback * callback) { if (!callback->keepAlive) { callback->Cancel(); - chip::Platform::Delete(callback); + chip::Platform::Delete(callback); } } static void CallbackFn( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; bool keepAlive; }; -class CHIPGroupKeyManagementGroupKeysAttributeCallback - : public chip::Callback::Callback +class CHIPGroupKeyManagementGroupTableAttributeCallback + : public chip::Callback::Callback { public: - CHIPGroupKeyManagementGroupKeysAttributeCallback(jobject javaCallback, bool keepAlive = false); + CHIPGroupKeyManagementGroupTableAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPGroupKeyManagementGroupKeysAttributeCallback(); + ~CHIPGroupKeyManagementGroupTableAttributeCallback(); - static void maybeDestroy(CHIPGroupKeyManagementGroupKeysAttributeCallback * callback) + static void maybeDestroy(CHIPGroupKeyManagementGroupTableAttributeCallback * callback) { if (!callback->keepAlive) { callback->Cancel(); - chip::Platform::Delete(callback); + chip::Platform::Delete(callback); } } static void CallbackFn( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1458,6 +1905,12 @@ class CHIPGroupKeyManagementAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1482,6 +1935,12 @@ class CHIPGroupsAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1506,6 +1965,12 @@ class CHIPIdentifyAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1530,6 +1995,12 @@ class CHIPIlluminanceMeasurementMeasuredValueAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1554,6 +2025,12 @@ class CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1578,6 +2055,12 @@ class CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1602,6 +2085,12 @@ class CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1626,6 +2115,12 @@ class CHIPIlluminanceMeasurementAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1650,6 +2145,12 @@ class CHIPKeypadInputAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1674,6 +2175,12 @@ class CHIPLevelControlOnLevelAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1698,6 +2205,12 @@ class CHIPLevelControlOnTransitionTimeAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1722,6 +2235,12 @@ class CHIPLevelControlOffTransitionTimeAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1746,6 +2265,12 @@ class CHIPLevelControlDefaultMoveRateAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1770,6 +2295,12 @@ class CHIPLevelControlAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1794,6 +2325,12 @@ class CHIPLowPowerAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1819,7 +2356,13 @@ class CHIPMediaInputMediaInputListAttributeCallback static void CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list); + const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1844,6 +2387,12 @@ class CHIPMediaInputAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1868,6 +2417,12 @@ class CHIPMediaPlaybackAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1895,6 +2450,12 @@ class CHIPModeSelectSupportedModesAttributeCallback void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1919,6 +2480,12 @@ class CHIPModeSelectAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1946,6 +2513,12 @@ class CHIPNetworkCommissioningNetworksAttributeCallback void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1970,6 +2543,74 @@ class CHIPOtaSoftwareUpdateProviderAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback(); + + static void maybeDestroy(CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback(); + + static void maybeDestroy(CHIPOtaSoftwareUpdateRequestorUpdateStateProgressAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -1994,6 +2635,12 @@ class CHIPOtaSoftwareUpdateRequestorAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2018,6 +2665,12 @@ class CHIPOccupancySensingAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2041,6 +2694,12 @@ class CHIPOnOffAttributeListAttributeCallback : public chip::Callback::Callback< } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2065,6 +2724,12 @@ class CHIPOnOffSwitchConfigurationAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2091,6 +2756,12 @@ class CHIPOperationalCredentialsFabricsListAttributeCallback static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2115,6 +2786,12 @@ class CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2139,6 +2816,12 @@ class CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback } static void CallbackFn(void * context, chip::FabricIndex value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2163,6 +2846,12 @@ class CHIPOperationalCredentialsAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2187,6 +2876,12 @@ class CHIPPowerSourceActiveBatteryFaultsAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2211,6 +2906,12 @@ class CHIPPowerSourceAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2235,6 +2936,12 @@ class CHIPPowerSourceConfigurationSourcesAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2259,6 +2966,12 @@ class CHIPPowerSourceConfigurationAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2283,6 +2996,12 @@ class CHIPPressureMeasurementAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2307,6 +3026,12 @@ class CHIPPumpConfigurationAndControlLifetimeRunningHoursAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2331,6 +3056,12 @@ class CHIPPumpConfigurationAndControlLifetimeEnergyConsumedAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2355,6 +3086,12 @@ class CHIPPumpConfigurationAndControlAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2379,6 +3116,12 @@ class CHIPRelativeHumidityMeasurementAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2403,6 +3146,12 @@ class CHIPScenesAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2430,6 +3179,12 @@ class CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2454,6 +3209,12 @@ class CHIPSoftwareDiagnosticsAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2478,56 +3239,12 @@ class CHIPSwitchAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); - -private: - jobject javaCallbackRef; - bool keepAlive; -}; - -class CHIPTvChannelChannelListAttributeCallback - : public chip::Callback::Callback -{ -public: - CHIPTvChannelChannelListAttributeCallback(jobject javaCallback, bool keepAlive = false); - - ~CHIPTvChannelChannelListAttributeCallback(); - - static void maybeDestroy(CHIPTvChannelChannelListAttributeCallback * callback) + static void OnSubscriptionEstablished(void * context) { - if (!callback->keepAlive) - { - callback->Cancel(); - chip::Platform::Delete(callback); - } - } - - static void CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & list); - -private: - jobject javaCallbackRef; - bool keepAlive; -}; - -class CHIPTvChannelAttributeListAttributeCallback - : public chip::Callback::Callback -{ -public: - CHIPTvChannelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive = false); - - ~CHIPTvChannelAttributeListAttributeCallback(); - - static void maybeDestroy(CHIPTvChannelAttributeListAttributeCallback * callback) - { - if (!callback->keepAlive) - { - callback->Cancel(); - chip::Platform::Delete(callback); - } - } - - static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2551,9 +3268,15 @@ class CHIPTargetNavigatorTargetNavigatorListAttributeCallback } } - static void CallbackFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & list); + static void CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2578,6 +3301,12 @@ class CHIPTargetNavigatorAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2602,6 +3331,12 @@ class CHIPTemperatureMeasurementAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2626,6 +3361,12 @@ class CHIPTestClusterListInt8uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2650,6 +3391,12 @@ class CHIPTestClusterListOctetStringAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2677,6 +3424,12 @@ class CHIPTestClusterListStructOctetStringAttributeCallback void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2701,6 +3454,12 @@ class CHIPTestClusterVendorIdAttributeCallback } static void CallbackFn(void * context, chip::VendorId value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2727,6 +3486,12 @@ class CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2751,6 +3516,12 @@ class CHIPTestClusterListLongOctetStringAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2775,6 +3546,12 @@ class CHIPTestClusterNullableBooleanAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2799,6 +3576,12 @@ class CHIPTestClusterNullableBitmap8AttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2823,6 +3606,12 @@ class CHIPTestClusterNullableBitmap16AttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2847,6 +3636,12 @@ class CHIPTestClusterNullableBitmap32AttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2871,6 +3666,12 @@ class CHIPTestClusterNullableBitmap64AttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2895,6 +3696,12 @@ class CHIPTestClusterNullableInt8uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2919,6 +3726,12 @@ class CHIPTestClusterNullableInt16uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2943,6 +3756,12 @@ class CHIPTestClusterNullableInt24uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2967,6 +3786,12 @@ class CHIPTestClusterNullableInt32uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -2991,6 +3816,12 @@ class CHIPTestClusterNullableInt40uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3015,6 +3846,12 @@ class CHIPTestClusterNullableInt48uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3039,6 +3876,12 @@ class CHIPTestClusterNullableInt56uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3063,6 +3906,12 @@ class CHIPTestClusterNullableInt64uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3087,6 +3936,12 @@ class CHIPTestClusterNullableInt8sAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3111,6 +3966,12 @@ class CHIPTestClusterNullableInt16sAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3135,6 +3996,12 @@ class CHIPTestClusterNullableInt24sAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3159,6 +4026,12 @@ class CHIPTestClusterNullableInt32sAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3183,6 +4056,12 @@ class CHIPTestClusterNullableInt40sAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3207,6 +4086,12 @@ class CHIPTestClusterNullableInt48sAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3231,6 +4116,12 @@ class CHIPTestClusterNullableInt56sAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3255,6 +4146,12 @@ class CHIPTestClusterNullableInt64sAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3279,6 +4176,12 @@ class CHIPTestClusterNullableEnum8AttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3303,6 +4206,12 @@ class CHIPTestClusterNullableEnum16AttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3327,6 +4236,12 @@ class CHIPTestClusterNullableFloatSingleAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3351,6 +4266,12 @@ class CHIPTestClusterNullableFloatDoubleAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3375,6 +4296,12 @@ class CHIPTestClusterNullableOctetStringAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3399,6 +4326,12 @@ class CHIPTestClusterNullableCharStringAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3424,6 +4357,12 @@ class CHIPTestClusterNullableEnumAttrAttributeCallback static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3448,6 +4387,12 @@ class CHIPTestClusterNullableRangeRestrictedInt8uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3472,6 +4417,12 @@ class CHIPTestClusterNullableRangeRestrictedInt8sAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3496,6 +4447,12 @@ class CHIPTestClusterNullableRangeRestrictedInt16uAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3520,6 +4477,12 @@ class CHIPTestClusterNullableRangeRestrictedInt16sAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3544,6 +4507,12 @@ class CHIPTestClusterAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3568,6 +4537,12 @@ class CHIPThermostatAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3592,6 +4567,12 @@ class CHIPThermostatUserInterfaceConfigurationAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3618,6 +4599,12 @@ class CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::ThreadNetworkDiagnostics::Structs::NeighborTable::DecodableType> & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3644,6 +4631,12 @@ class CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::ThreadNetworkDiagnostics::Structs::RouteTable::DecodableType> & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3670,6 +4663,12 @@ class CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::ThreadNetworkDiagnostics::Structs::SecurityPolicy::DecodableType> & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3697,6 +4696,13 @@ class CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType> & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context) + ->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3723,6 +4729,12 @@ class CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3747,6 +4759,12 @@ class CHIPThreadNetworkDiagnosticsAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3772,6 +4790,12 @@ class CHIPUserLabelLabelListAttributeCallback : public chip::Callback::Callback< static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3796,6 +4820,12 @@ class CHIPWakeOnLanAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3820,6 +4850,252 @@ class CHIPWiFiNetworkDiagnosticsAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPWindowCoveringCurrentPositionLiftAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPWindowCoveringCurrentPositionLiftAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPWindowCoveringCurrentPositionLiftAttributeCallback(); + + static void maybeDestroy(CHIPWindowCoveringCurrentPositionLiftAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPWindowCoveringCurrentPositionTiltAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPWindowCoveringCurrentPositionTiltAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPWindowCoveringCurrentPositionTiltAttributeCallback(); + + static void maybeDestroy(CHIPWindowCoveringCurrentPositionTiltAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback(); + + static void maybeDestroy(CHIPWindowCoveringCurrentPositionLiftPercentageAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback(); + + static void maybeDestroy(CHIPWindowCoveringCurrentPositionTiltPercentageAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback(); + + static void maybeDestroy(CHIPWindowCoveringTargetPositionLiftPercent100thsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback(); + + static void maybeDestroy(CHIPWindowCoveringTargetPositionTiltPercent100thsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback(); + + static void maybeDestroy(CHIPWindowCoveringCurrentPositionLiftPercent100thsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback(); + + static void maybeDestroy(CHIPWindowCoveringCurrentPositionTiltPercent100thsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; @@ -3844,6 +5120,12 @@ class CHIPWindowCoveringAttributeListAttributeCallback } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void OnSubscriptionEstablished(void * context) + { + CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( + reinterpret_cast(context)->javaCallbackRef); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error calling onSubscriptionEstablished: %s", ErrorStr(err))); + }; private: jobject javaCallbackRef; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 9f5e18649f2a5d..e125f787d2a5d9 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -37,6 +37,8 @@ public interface CharStringAttributeCallback { void onSuccess(String value); void onError(Exception error); + + default void onSubscriptionEstablished() {} } public interface OctetStringAttributeCallback { @@ -44,36 +46,48 @@ public interface OctetStringAttributeCallback { void onSuccess(byte[] value); void onError(Exception error); + + default void onSubscriptionEstablished() {} } public interface IntegerAttributeCallback { void onSuccess(int value); void onError(Exception error); + + default void onSubscriptionEstablished() {} } public interface LongAttributeCallback { void onSuccess(long value); void onError(Exception error); + + default void onSubscriptionEstablished() {} } public interface BooleanAttributeCallback { void onSuccess(boolean value); void onError(Exception error); + + default void onSubscriptionEstablished() {} } public interface FloatAttributeCallback { void onSuccess(float value); void onError(Exception error); + + default void onSubscriptionEstablished() {} } public interface DoubleAttributeCallback { void onSuccess(double value); void onError(Exception error); + + default void onSubscriptionEstablished() {} } public abstract static class BaseChipCluster { @@ -144,6 +158,8 @@ public interface AclAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public static class ExtensionAttribute { @@ -174,12 +190,16 @@ public interface ExtensionAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readAclAttribute(AclAttributeCallback callback) { @@ -222,29 +242,30 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void getSetupPIN(GetSetupPINResponseCallback callback, String tempAccountIdentifier) { - getSetupPIN(chipClusterPtr, callback, tempAccountIdentifier); + public void getSetupPINRequest( + GetSetupPINResponseCallback callback, String tempAccountIdentifier) { + getSetupPINRequest(chipClusterPtr, callback, tempAccountIdentifier); } - public void login( + public void loginRequest( DefaultClusterCallback callback, String tempAccountIdentifier, String setupPIN) { - login(chipClusterPtr, callback, tempAccountIdentifier, setupPIN); + loginRequest(chipClusterPtr, callback, tempAccountIdentifier, setupPIN); } - public void logout(DefaultClusterCallback callback) { - logout(chipClusterPtr, callback); + public void logoutRequest(DefaultClusterCallback callback) { + logoutRequest(chipClusterPtr, callback); } - private native void getSetupPIN( + private native void getSetupPINRequest( long chipClusterPtr, GetSetupPINResponseCallback Callback, String tempAccountIdentifier); - private native void login( + private native void loginRequest( long chipClusterPtr, DefaultClusterCallback Callback, String tempAccountIdentifier, String setupPIN); - private native void logout(long chipClusterPtr, DefaultClusterCallback Callback); + private native void logoutRequest(long chipClusterPtr, DefaultClusterCallback Callback); public interface GetSetupPINResponseCallback { void onSuccess(String setupPIN); @@ -256,6 +277,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -267,14 +290,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -282,10 +301,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class AdministratorCommissioningCluster extends BaseChipCluster { @@ -347,12 +363,16 @@ public interface AdminFabricIndexAttributeCallback { void onSuccess(Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readWindowStatusAttribute(IntegerAttributeCallback callback) { @@ -376,14 +396,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readWindowStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -400,10 +416,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class ApplicationBasicCluster extends BaseChipCluster { @@ -418,17 +431,20 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void changeStatus(DefaultClusterCallback callback, Integer status) { - changeStatus(chipClusterPtr, callback, status); - } + public interface AllowedVendorListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); - private native void changeStatus( - long chipClusterPtr, DefaultClusterCallback Callback, Integer status); + default void onSubscriptionEstablished() {} + } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readVendorNameAttribute(CharStringAttributeCallback callback) { @@ -436,77 +452,57 @@ public void readVendorNameAttribute(CharStringAttributeCallback callback) { } public void subscribeVendorNameAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeVendorNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportVendorNameAttribute(CharStringAttributeCallback callback) { - reportVendorNameAttribute(chipClusterPtr, callback); - } - public void readVendorIdAttribute(IntegerAttributeCallback callback) { readVendorIdAttribute(chipClusterPtr, callback); } public void subscribeVendorIdAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeVendorIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportVendorIdAttribute(IntegerAttributeCallback callback) { - reportVendorIdAttribute(chipClusterPtr, callback); - } - public void readApplicationNameAttribute(CharStringAttributeCallback callback) { readApplicationNameAttribute(chipClusterPtr, callback); } public void subscribeApplicationNameAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeApplicationNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportApplicationNameAttribute(CharStringAttributeCallback callback) { - reportApplicationNameAttribute(chipClusterPtr, callback); - } - public void readProductIdAttribute(IntegerAttributeCallback callback) { readProductIdAttribute(chipClusterPtr, callback); } public void subscribeProductIdAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeProductIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportProductIdAttribute(IntegerAttributeCallback callback) { - reportProductIdAttribute(chipClusterPtr, callback); - } - public void readApplicationStatusAttribute(IntegerAttributeCallback callback) { readApplicationStatusAttribute(chipClusterPtr, callback); } public void subscribeApplicationStatusAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeApplicationStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportApplicationStatusAttribute(IntegerAttributeCallback callback) { - reportApplicationStatusAttribute(chipClusterPtr, callback); - } - public void readApplicationVersionAttribute(CharStringAttributeCallback callback) { readApplicationVersionAttribute(chipClusterPtr, callback); } public void subscribeApplicationVersionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeApplicationVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportApplicationVersionAttribute(CharStringAttributeCallback callback) { - reportApplicationVersionAttribute(chipClusterPtr, callback); + public void readAllowedVendorListAttribute(AllowedVendorListAttributeCallback callback) { + readAllowedVendorListAttribute(chipClusterPtr, callback); } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -518,67 +514,57 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readVendorNameAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeVendorNameAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportVendorNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readVendorIdAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeVendorIdAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportVendorIdAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readApplicationNameAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeApplicationNameAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportApplicationNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readProductIdAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeProductIdAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportProductIdAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readApplicationStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeApplicationStatusAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportApplicationStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readApplicationVersionAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeApplicationVersionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); - private native void reportApplicationVersionAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readAllowedVendorListAttribute( + long chipClusterPtr, AllowedVendorListAttributeCallback callback); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -587,10 +573,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class ApplicationLauncherCluster extends BaseChipCluster { @@ -605,56 +588,44 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void hideApp( - HideAppResponseCallback callback, Integer catalogVendorId, String applicationId) { - hideApp(chipClusterPtr, callback, catalogVendorId, applicationId); + public void hideAppRequest( + LauncherResponseCallback callback, Integer catalogVendorId, String applicationId) { + hideAppRequest(chipClusterPtr, callback, catalogVendorId, applicationId); } - public void launchApp( - LaunchAppResponseCallback callback, + public void launchAppRequest( + LauncherResponseCallback callback, String data, Integer catalogVendorId, String applicationId) { - launchApp(chipClusterPtr, callback, data, catalogVendorId, applicationId); + launchAppRequest(chipClusterPtr, callback, data, catalogVendorId, applicationId); } - public void stopApp( - StopAppResponseCallback callback, Integer catalogVendorId, String applicationId) { - stopApp(chipClusterPtr, callback, catalogVendorId, applicationId); + public void stopAppRequest( + LauncherResponseCallback callback, Integer catalogVendorId, String applicationId) { + stopAppRequest(chipClusterPtr, callback, catalogVendorId, applicationId); } - private native void hideApp( + private native void hideAppRequest( long chipClusterPtr, - HideAppResponseCallback Callback, + LauncherResponseCallback Callback, Integer catalogVendorId, String applicationId); - private native void launchApp( + private native void launchAppRequest( long chipClusterPtr, - LaunchAppResponseCallback Callback, + LauncherResponseCallback Callback, String data, Integer catalogVendorId, String applicationId); - private native void stopApp( + private native void stopAppRequest( long chipClusterPtr, - StopAppResponseCallback Callback, + LauncherResponseCallback Callback, Integer catalogVendorId, String applicationId); - public interface HideAppResponseCallback { - void onSuccess(Integer status, String data); - - void onError(Exception error); - } - - public interface LaunchAppResponseCallback { - void onSuccess(Integer status, String data); - - void onError(Exception error); - } - - public interface StopAppResponseCallback { + public interface LauncherResponseCallback { void onSuccess(Integer status, String data); void onError(Exception error); @@ -664,12 +635,16 @@ public interface ApplicationLauncherListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readApplicationLauncherListAttribute( @@ -686,14 +661,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readApplicationLauncherListAttribute( long chipClusterPtr, ApplicationLauncherListAttributeCallback callback); @@ -704,10 +675,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class AudioOutputCluster extends BaseChipCluster { @@ -722,18 +690,18 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void renameOutput(DefaultClusterCallback callback, Integer index, String name) { - renameOutput(chipClusterPtr, callback, index, name); + public void renameOutputRequest(DefaultClusterCallback callback, Integer index, String name) { + renameOutputRequest(chipClusterPtr, callback, index, name); } - public void selectOutput(DefaultClusterCallback callback, Integer index) { - selectOutput(chipClusterPtr, callback, index); + public void selectOutputRequest(DefaultClusterCallback callback, Integer index) { + selectOutputRequest(chipClusterPtr, callback, index); } - private native void renameOutput( + private native void renameOutputRequest( long chipClusterPtr, DefaultClusterCallback Callback, Integer index, String name); - private native void selectOutput( + private native void selectOutputRequest( long chipClusterPtr, DefaultClusterCallback Callback, Integer index); public static class AudioOutputListAttribute { @@ -770,12 +738,16 @@ public interface AudioOutputListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readAudioOutputListAttribute(AudioOutputListAttributeCallback callback) { @@ -787,14 +759,10 @@ public void readCurrentAudioOutputAttribute(IntegerAttributeCallback callback) { } public void subscribeCurrentAudioOutputAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentAudioOutputAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentAudioOutputAttribute(IntegerAttributeCallback callback) { - reportCurrentAudioOutputAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -804,14 +772,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readAudioOutputListAttribute( long chipClusterPtr, AudioOutputListAttributeCallback callback); @@ -819,10 +783,7 @@ private native void readCurrentAudioOutputAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentAudioOutputAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentAudioOutputAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -831,10 +792,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class BarrierControlCluster extends BaseChipCluster { @@ -866,6 +824,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readBarrierMovingStateAttribute(IntegerAttributeCallback callback) { @@ -873,53 +833,37 @@ public void readBarrierMovingStateAttribute(IntegerAttributeCallback callback) { } public void subscribeBarrierMovingStateAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBarrierMovingStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBarrierMovingStateAttribute(IntegerAttributeCallback callback) { - reportBarrierMovingStateAttribute(chipClusterPtr, callback); - } - public void readBarrierSafetyStatusAttribute(IntegerAttributeCallback callback) { readBarrierSafetyStatusAttribute(chipClusterPtr, callback); } public void subscribeBarrierSafetyStatusAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBarrierSafetyStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBarrierSafetyStatusAttribute(IntegerAttributeCallback callback) { - reportBarrierSafetyStatusAttribute(chipClusterPtr, callback); - } - public void readBarrierCapabilitiesAttribute(IntegerAttributeCallback callback) { readBarrierCapabilitiesAttribute(chipClusterPtr, callback); } public void subscribeBarrierCapabilitiesAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBarrierCapabilitiesAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBarrierCapabilitiesAttribute(IntegerAttributeCallback callback) { - reportBarrierCapabilitiesAttribute(chipClusterPtr, callback); - } - public void readBarrierPositionAttribute(IntegerAttributeCallback callback) { readBarrierPositionAttribute(chipClusterPtr, callback); } public void subscribeBarrierPositionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBarrierPositionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBarrierPositionAttribute(IntegerAttributeCallback callback) { - reportBarrierPositionAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -929,49 +873,33 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readBarrierMovingStateAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeBarrierMovingStateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBarrierMovingStateAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readBarrierSafetyStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeBarrierSafetyStatusAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBarrierSafetyStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readBarrierCapabilitiesAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeBarrierCapabilitiesAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBarrierCapabilitiesAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readBarrierPositionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeBarrierPositionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBarrierPositionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -980,10 +908,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class BasicCluster extends BaseChipCluster { @@ -1008,6 +933,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readInteractionModelVersionAttribute(IntegerAttributeCallback callback) { @@ -1015,66 +942,46 @@ public void readInteractionModelVersionAttribute(IntegerAttributeCallback callba } public void subscribeInteractionModelVersionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeInteractionModelVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInteractionModelVersionAttribute(IntegerAttributeCallback callback) { - reportInteractionModelVersionAttribute(chipClusterPtr, callback); - } - public void readVendorNameAttribute(CharStringAttributeCallback callback) { readVendorNameAttribute(chipClusterPtr, callback); } public void subscribeVendorNameAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeVendorNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportVendorNameAttribute(CharStringAttributeCallback callback) { - reportVendorNameAttribute(chipClusterPtr, callback); - } - public void readVendorIDAttribute(IntegerAttributeCallback callback) { readVendorIDAttribute(chipClusterPtr, callback); } public void subscribeVendorIDAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeVendorIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportVendorIDAttribute(IntegerAttributeCallback callback) { - reportVendorIDAttribute(chipClusterPtr, callback); - } - public void readProductNameAttribute(CharStringAttributeCallback callback) { readProductNameAttribute(chipClusterPtr, callback); } public void subscribeProductNameAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeProductNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportProductNameAttribute(CharStringAttributeCallback callback) { - reportProductNameAttribute(chipClusterPtr, callback); - } - public void readProductIDAttribute(IntegerAttributeCallback callback) { readProductIDAttribute(chipClusterPtr, callback); } public void subscribeProductIDAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeProductIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportProductIDAttribute(IntegerAttributeCallback callback) { - reportProductIDAttribute(chipClusterPtr, callback); - } - public void readNodeLabelAttribute(CharStringAttributeCallback callback) { readNodeLabelAttribute(chipClusterPtr, callback); } @@ -1084,14 +991,10 @@ public void writeNodeLabelAttribute(DefaultClusterCallback callback, String valu } public void subscribeNodeLabelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeNodeLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNodeLabelAttribute(CharStringAttributeCallback callback) { - reportNodeLabelAttribute(chipClusterPtr, callback); - } - public void readLocationAttribute(CharStringAttributeCallback callback) { readLocationAttribute(chipClusterPtr, callback); } @@ -1101,131 +1004,91 @@ public void writeLocationAttribute(DefaultClusterCallback callback, String value } public void subscribeLocationAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeLocationAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLocationAttribute(CharStringAttributeCallback callback) { - reportLocationAttribute(chipClusterPtr, callback); - } - public void readHardwareVersionAttribute(IntegerAttributeCallback callback) { readHardwareVersionAttribute(chipClusterPtr, callback); } public void subscribeHardwareVersionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeHardwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportHardwareVersionAttribute(IntegerAttributeCallback callback) { - reportHardwareVersionAttribute(chipClusterPtr, callback); - } - public void readHardwareVersionStringAttribute(CharStringAttributeCallback callback) { readHardwareVersionStringAttribute(chipClusterPtr, callback); } public void subscribeHardwareVersionStringAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeHardwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportHardwareVersionStringAttribute(CharStringAttributeCallback callback) { - reportHardwareVersionStringAttribute(chipClusterPtr, callback); - } - public void readSoftwareVersionAttribute(LongAttributeCallback callback) { readSoftwareVersionAttribute(chipClusterPtr, callback); } public void subscribeSoftwareVersionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeSoftwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSoftwareVersionAttribute(LongAttributeCallback callback) { - reportSoftwareVersionAttribute(chipClusterPtr, callback); - } - public void readSoftwareVersionStringAttribute(CharStringAttributeCallback callback) { readSoftwareVersionStringAttribute(chipClusterPtr, callback); } public void subscribeSoftwareVersionStringAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeSoftwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSoftwareVersionStringAttribute(CharStringAttributeCallback callback) { - reportSoftwareVersionStringAttribute(chipClusterPtr, callback); - } - public void readManufacturingDateAttribute(CharStringAttributeCallback callback) { readManufacturingDateAttribute(chipClusterPtr, callback); } public void subscribeManufacturingDateAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeManufacturingDateAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportManufacturingDateAttribute(CharStringAttributeCallback callback) { - reportManufacturingDateAttribute(chipClusterPtr, callback); - } - public void readPartNumberAttribute(CharStringAttributeCallback callback) { readPartNumberAttribute(chipClusterPtr, callback); } public void subscribePartNumberAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribePartNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPartNumberAttribute(CharStringAttributeCallback callback) { - reportPartNumberAttribute(chipClusterPtr, callback); - } - public void readProductURLAttribute(CharStringAttributeCallback callback) { readProductURLAttribute(chipClusterPtr, callback); } public void subscribeProductURLAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeProductURLAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportProductURLAttribute(CharStringAttributeCallback callback) { - reportProductURLAttribute(chipClusterPtr, callback); - } - public void readProductLabelAttribute(CharStringAttributeCallback callback) { readProductLabelAttribute(chipClusterPtr, callback); } public void subscribeProductLabelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeProductLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportProductLabelAttribute(CharStringAttributeCallback callback) { - reportProductLabelAttribute(chipClusterPtr, callback); - } - public void readSerialNumberAttribute(CharStringAttributeCallback callback) { readSerialNumberAttribute(chipClusterPtr, callback); } public void subscribeSerialNumberAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeSerialNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSerialNumberAttribute(CharStringAttributeCallback callback) { - reportSerialNumberAttribute(chipClusterPtr, callback); - } - public void readLocalConfigDisabledAttribute(BooleanAttributeCallback callback) { readLocalConfigDisabledAttribute(chipClusterPtr, callback); } @@ -1235,27 +1098,19 @@ public void writeLocalConfigDisabledAttribute(DefaultClusterCallback callback, B } public void subscribeLocalConfigDisabledAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeLocalConfigDisabledAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLocalConfigDisabledAttribute(BooleanAttributeCallback callback) { - reportLocalConfigDisabledAttribute(chipClusterPtr, callback); - } - public void readReachableAttribute(BooleanAttributeCallback callback) { readReachableAttribute(chipClusterPtr, callback); } public void subscribeReachableAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeReachableAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportReachableAttribute(BooleanAttributeCallback callback) { - reportReachableAttribute(chipClusterPtr, callback); - } - public void readUniqueIDAttribute(CharStringAttributeCallback callback) { readUniqueIDAttribute(chipClusterPtr, callback); } @@ -1269,58 +1124,45 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readInteractionModelVersionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeInteractionModelVersionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInteractionModelVersionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readVendorNameAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeVendorNameAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportVendorNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readVendorIDAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeVendorIDAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportVendorIDAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readProductNameAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeProductNameAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportProductNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readProductIDAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeProductIDAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportProductIDAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readNodeLabelAttribute( long chipClusterPtr, CharStringAttributeCallback callback); @@ -1329,10 +1171,10 @@ private native void writeNodeLabelAttribute( long chipClusterPtr, DefaultClusterCallback callback, String value); private native void subscribeNodeLabelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNodeLabelAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readLocationAttribute( long chipClusterPtr, CharStringAttributeCallback callback); @@ -1341,91 +1183,85 @@ private native void writeLocationAttribute( long chipClusterPtr, DefaultClusterCallback callback, String value); private native void subscribeLocationAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLocationAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readHardwareVersionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeHardwareVersionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportHardwareVersionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readHardwareVersionStringAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeHardwareVersionStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportHardwareVersionStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readSoftwareVersionAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeSoftwareVersionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSoftwareVersionAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readSoftwareVersionStringAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeSoftwareVersionStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSoftwareVersionStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readManufacturingDateAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeManufacturingDateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportManufacturingDateAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readPartNumberAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribePartNumberAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPartNumberAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readProductURLAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeProductURLAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportProductURLAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readProductLabelAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeProductLabelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportProductLabelAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readSerialNumberAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeSerialNumberAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSerialNumberAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readLocalConfigDisabledAttribute( long chipClusterPtr, BooleanAttributeCallback callback); @@ -1434,19 +1270,13 @@ private native void writeLocalConfigDisabledAttribute( long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribeLocalConfigDisabledAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLocalConfigDisabledAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readReachableAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void subscribeReachableAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportReachableAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readUniqueIDAttribute( long chipClusterPtr, CharStringAttributeCallback callback); @@ -1458,10 +1288,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class BinaryInputBasicCluster extends BaseChipCluster { @@ -1480,6 +1307,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readOutOfServiceAttribute(BooleanAttributeCallback callback) { @@ -1491,14 +1320,10 @@ public void writeOutOfServiceAttribute(DefaultClusterCallback callback, Boolean } public void subscribeOutOfServiceAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeOutOfServiceAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOutOfServiceAttribute(BooleanAttributeCallback callback) { - reportOutOfServiceAttribute(chipClusterPtr, callback); - } - public void readPresentValueAttribute(BooleanAttributeCallback callback) { readPresentValueAttribute(chipClusterPtr, callback); } @@ -1508,27 +1333,19 @@ public void writePresentValueAttribute(DefaultClusterCallback callback, Boolean } public void subscribePresentValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribePresentValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPresentValueAttribute(BooleanAttributeCallback callback) { - reportPresentValueAttribute(chipClusterPtr, callback); - } - public void readStatusFlagsAttribute(IntegerAttributeCallback callback) { readStatusFlagsAttribute(chipClusterPtr, callback); } public void subscribeStatusFlagsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeStatusFlagsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportStatusFlagsAttribute(IntegerAttributeCallback callback) { - reportStatusFlagsAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -1538,14 +1355,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readOutOfServiceAttribute( long chipClusterPtr, BooleanAttributeCallback callback); @@ -1553,10 +1366,7 @@ private native void writeOutOfServiceAttribute( long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribeOutOfServiceAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOutOfServiceAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readPresentValueAttribute( long chipClusterPtr, BooleanAttributeCallback callback); @@ -1565,19 +1375,13 @@ private native void writePresentValueAttribute( long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribePresentValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPresentValueAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readStatusFlagsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeStatusFlagsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportStatusFlagsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -1586,10 +1390,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class BindingCluster extends BaseChipCluster { @@ -1642,6 +1443,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -1653,14 +1456,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -1668,10 +1467,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class BooleanStateCluster extends BaseChipCluster { @@ -1690,6 +1486,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readStateValueAttribute(BooleanAttributeCallback callback) { @@ -1697,14 +1495,10 @@ public void readStateValueAttribute(BooleanAttributeCallback callback) { } public void subscribeStateValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeStateValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportStateValueAttribute(BooleanAttributeCallback callback) { - reportStateValueAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -1714,22 +1508,15 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readStateValueAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void subscribeStateValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportStateValueAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -1738,10 +1525,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class BridgedActionsCluster extends BaseChipCluster { @@ -1954,6 +1738,8 @@ public interface ActionListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public static class EndpointListAttribute { @@ -1990,12 +1776,16 @@ public interface EndpointListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readActionListAttribute(ActionListAttributeCallback callback) { @@ -2011,14 +1801,10 @@ public void readSetupUrlAttribute(CharStringAttributeCallback callback) { } public void subscribeSetupUrlAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeSetupUrlAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSetupUrlAttribute(CharStringAttributeCallback callback) { - reportSetupUrlAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -2028,14 +1814,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readActionListAttribute( long chipClusterPtr, ActionListAttributeCallback callback); @@ -2046,10 +1828,10 @@ private native void readSetupUrlAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeSetupUrlAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSetupUrlAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -2058,10 +1840,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class BridgedDeviceBasicCluster extends BaseChipCluster { @@ -2080,6 +1859,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -2091,14 +1872,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -2106,38 +1883,173 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class ColorControlCluster extends BaseChipCluster { - public ColorControlCluster(long devicePtr, int endpointId) { + public static class ChannelCluster extends BaseChipCluster { + public ChannelCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } public static long clusterId() { - return Long.parseUnsignedLong("768"); + return Long.parseUnsignedLong("1284"); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void colorLoopSet( - DefaultClusterCallback callback, - Integer updateFlags, - Integer action, - Integer direction, - Integer time, - Integer startHue, - Integer optionsMask, - Integer optionsOverride) { - colorLoopSet( - chipClusterPtr, - callback, - updateFlags, - action, + public void changeChannelByNumberRequest( + DefaultClusterCallback callback, Integer majorNumber, Integer minorNumber) { + changeChannelByNumberRequest(chipClusterPtr, callback, majorNumber, minorNumber); + } + + public void changeChannelRequest(ChangeChannelResponseCallback callback, String match) { + changeChannelRequest(chipClusterPtr, callback, match); + } + + public void skipChannelRequest(DefaultClusterCallback callback, Integer count) { + skipChannelRequest(chipClusterPtr, callback, count); + } + + private native void changeChannelByNumberRequest( + long chipClusterPtr, + DefaultClusterCallback Callback, + Integer majorNumber, + Integer minorNumber); + + private native void changeChannelRequest( + long chipClusterPtr, ChangeChannelResponseCallback Callback, String match); + + private native void skipChannelRequest( + long chipClusterPtr, DefaultClusterCallback Callback, Integer count); + + public interface ChangeChannelResponseCallback { + void onSuccess( // channelMatch: Struct ChannelInfo + // Conversion from this type to Java is not properly implemented yet + Integer errorType); + + void onError(Exception error); + } + + public static class ChannelListAttribute { + public Integer majorNumber; + public Integer minorNumber; + public String name; + public String callSign; + public String affiliateCallSign; + + public ChannelListAttribute( + Integer majorNumber, + Integer minorNumber, + String name, + String callSign, + String affiliateCallSign) { + this.majorNumber = majorNumber; + this.minorNumber = minorNumber; + this.name = name; + this.callSign = callSign; + this.affiliateCallSign = affiliateCallSign; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(""); + output.append("int majorNumber: "); + output.append(this.majorNumber); + output.append("\n"); + + output.append("int minorNumber: "); + output.append(this.minorNumber); + output.append("\n"); + + output.append("String name: "); + output.append(this.name); + output.append("\n"); + + output.append("String callSign: "); + output.append(this.callSign); + output.append("\n"); + + output.append("String affiliateCallSign: "); + output.append(this.affiliateCallSign); + output.append("\n"); + + return output.toString(); + } + } + + public interface ChannelListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public void readChannelListAttribute(ChannelListAttributeCallback callback) { + readChannelListAttribute(chipClusterPtr, callback); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readChannelListAttribute( + long chipClusterPtr, ChannelListAttributeCallback callback); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class ColorControlCluster extends BaseChipCluster { + public ColorControlCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + public static long clusterId() { + return Long.parseUnsignedLong("768"); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void colorLoopSet( + DefaultClusterCallback callback, + Integer updateFlags, + Integer action, + Integer direction, + Integer time, + Integer startHue, + Integer optionsMask, + Integer optionsOverride) { + colorLoopSet( + chipClusterPtr, + callback, + updateFlags, + action, direction, time, startHue, @@ -2546,6 +2458,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readCurrentHueAttribute(IntegerAttributeCallback callback) { @@ -2553,118 +2467,82 @@ public void readCurrentHueAttribute(IntegerAttributeCallback callback) { } public void subscribeCurrentHueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentHueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentHueAttribute(IntegerAttributeCallback callback) { - reportCurrentHueAttribute(chipClusterPtr, callback); - } - public void readCurrentSaturationAttribute(IntegerAttributeCallback callback) { readCurrentSaturationAttribute(chipClusterPtr, callback); } public void subscribeCurrentSaturationAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentSaturationAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentSaturationAttribute(IntegerAttributeCallback callback) { - reportCurrentSaturationAttribute(chipClusterPtr, callback); - } - public void readRemainingTimeAttribute(IntegerAttributeCallback callback) { readRemainingTimeAttribute(chipClusterPtr, callback); } public void subscribeRemainingTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRemainingTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRemainingTimeAttribute(IntegerAttributeCallback callback) { - reportRemainingTimeAttribute(chipClusterPtr, callback); - } - public void readCurrentXAttribute(IntegerAttributeCallback callback) { readCurrentXAttribute(chipClusterPtr, callback); } public void subscribeCurrentXAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentXAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentXAttribute(IntegerAttributeCallback callback) { - reportCurrentXAttribute(chipClusterPtr, callback); - } - public void readCurrentYAttribute(IntegerAttributeCallback callback) { readCurrentYAttribute(chipClusterPtr, callback); } public void subscribeCurrentYAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentYAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentYAttribute(IntegerAttributeCallback callback) { - reportCurrentYAttribute(chipClusterPtr, callback); - } - public void readDriftCompensationAttribute(IntegerAttributeCallback callback) { readDriftCompensationAttribute(chipClusterPtr, callback); } public void subscribeDriftCompensationAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeDriftCompensationAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportDriftCompensationAttribute(IntegerAttributeCallback callback) { - reportDriftCompensationAttribute(chipClusterPtr, callback); - } - public void readCompensationTextAttribute(CharStringAttributeCallback callback) { readCompensationTextAttribute(chipClusterPtr, callback); } public void subscribeCompensationTextAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeCompensationTextAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCompensationTextAttribute(CharStringAttributeCallback callback) { - reportCompensationTextAttribute(chipClusterPtr, callback); - } - public void readColorTemperatureAttribute(IntegerAttributeCallback callback) { readColorTemperatureAttribute(chipClusterPtr, callback); } public void subscribeColorTemperatureAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorTemperatureAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorTemperatureAttribute(IntegerAttributeCallback callback) { - reportColorTemperatureAttribute(chipClusterPtr, callback); - } - public void readColorModeAttribute(IntegerAttributeCallback callback) { readColorModeAttribute(chipClusterPtr, callback); } public void subscribeColorModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorModeAttribute(IntegerAttributeCallback callback) { - reportColorModeAttribute(chipClusterPtr, callback); - } - public void readColorControlOptionsAttribute(IntegerAttributeCallback callback) { readColorControlOptionsAttribute(chipClusterPtr, callback); } @@ -2674,261 +2552,181 @@ public void writeColorControlOptionsAttribute(DefaultClusterCallback callback, I } public void subscribeColorControlOptionsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorControlOptionsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorControlOptionsAttribute(IntegerAttributeCallback callback) { - reportColorControlOptionsAttribute(chipClusterPtr, callback); - } - public void readNumberOfPrimariesAttribute(IntegerAttributeCallback callback) { readNumberOfPrimariesAttribute(chipClusterPtr, callback); } public void subscribeNumberOfPrimariesAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeNumberOfPrimariesAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNumberOfPrimariesAttribute(IntegerAttributeCallback callback) { - reportNumberOfPrimariesAttribute(chipClusterPtr, callback); - } - public void readPrimary1XAttribute(IntegerAttributeCallback callback) { readPrimary1XAttribute(chipClusterPtr, callback); } public void subscribePrimary1XAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary1XAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary1XAttribute(IntegerAttributeCallback callback) { - reportPrimary1XAttribute(chipClusterPtr, callback); - } - public void readPrimary1YAttribute(IntegerAttributeCallback callback) { readPrimary1YAttribute(chipClusterPtr, callback); } public void subscribePrimary1YAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary1YAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary1YAttribute(IntegerAttributeCallback callback) { - reportPrimary1YAttribute(chipClusterPtr, callback); - } - public void readPrimary1IntensityAttribute(IntegerAttributeCallback callback) { readPrimary1IntensityAttribute(chipClusterPtr, callback); } public void subscribePrimary1IntensityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary1IntensityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary1IntensityAttribute(IntegerAttributeCallback callback) { - reportPrimary1IntensityAttribute(chipClusterPtr, callback); - } - public void readPrimary2XAttribute(IntegerAttributeCallback callback) { readPrimary2XAttribute(chipClusterPtr, callback); } public void subscribePrimary2XAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary2XAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary2XAttribute(IntegerAttributeCallback callback) { - reportPrimary2XAttribute(chipClusterPtr, callback); - } - public void readPrimary2YAttribute(IntegerAttributeCallback callback) { readPrimary2YAttribute(chipClusterPtr, callback); } public void subscribePrimary2YAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary2YAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary2YAttribute(IntegerAttributeCallback callback) { - reportPrimary2YAttribute(chipClusterPtr, callback); - } - public void readPrimary2IntensityAttribute(IntegerAttributeCallback callback) { readPrimary2IntensityAttribute(chipClusterPtr, callback); } public void subscribePrimary2IntensityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary2IntensityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary2IntensityAttribute(IntegerAttributeCallback callback) { - reportPrimary2IntensityAttribute(chipClusterPtr, callback); - } - public void readPrimary3XAttribute(IntegerAttributeCallback callback) { readPrimary3XAttribute(chipClusterPtr, callback); } public void subscribePrimary3XAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary3XAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary3XAttribute(IntegerAttributeCallback callback) { - reportPrimary3XAttribute(chipClusterPtr, callback); - } - public void readPrimary3YAttribute(IntegerAttributeCallback callback) { readPrimary3YAttribute(chipClusterPtr, callback); } public void subscribePrimary3YAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary3YAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary3YAttribute(IntegerAttributeCallback callback) { - reportPrimary3YAttribute(chipClusterPtr, callback); - } - public void readPrimary3IntensityAttribute(IntegerAttributeCallback callback) { readPrimary3IntensityAttribute(chipClusterPtr, callback); } public void subscribePrimary3IntensityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary3IntensityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary3IntensityAttribute(IntegerAttributeCallback callback) { - reportPrimary3IntensityAttribute(chipClusterPtr, callback); - } - public void readPrimary4XAttribute(IntegerAttributeCallback callback) { readPrimary4XAttribute(chipClusterPtr, callback); } public void subscribePrimary4XAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary4XAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary4XAttribute(IntegerAttributeCallback callback) { - reportPrimary4XAttribute(chipClusterPtr, callback); - } - public void readPrimary4YAttribute(IntegerAttributeCallback callback) { readPrimary4YAttribute(chipClusterPtr, callback); } public void subscribePrimary4YAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary4YAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary4YAttribute(IntegerAttributeCallback callback) { - reportPrimary4YAttribute(chipClusterPtr, callback); - } - public void readPrimary4IntensityAttribute(IntegerAttributeCallback callback) { readPrimary4IntensityAttribute(chipClusterPtr, callback); } public void subscribePrimary4IntensityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary4IntensityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary4IntensityAttribute(IntegerAttributeCallback callback) { - reportPrimary4IntensityAttribute(chipClusterPtr, callback); - } - public void readPrimary5XAttribute(IntegerAttributeCallback callback) { readPrimary5XAttribute(chipClusterPtr, callback); } public void subscribePrimary5XAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary5XAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary5XAttribute(IntegerAttributeCallback callback) { - reportPrimary5XAttribute(chipClusterPtr, callback); - } - public void readPrimary5YAttribute(IntegerAttributeCallback callback) { readPrimary5YAttribute(chipClusterPtr, callback); } public void subscribePrimary5YAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary5YAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary5YAttribute(IntegerAttributeCallback callback) { - reportPrimary5YAttribute(chipClusterPtr, callback); - } - public void readPrimary5IntensityAttribute(IntegerAttributeCallback callback) { readPrimary5IntensityAttribute(chipClusterPtr, callback); } public void subscribePrimary5IntensityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary5IntensityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary5IntensityAttribute(IntegerAttributeCallback callback) { - reportPrimary5IntensityAttribute(chipClusterPtr, callback); - } - public void readPrimary6XAttribute(IntegerAttributeCallback callback) { readPrimary6XAttribute(chipClusterPtr, callback); } public void subscribePrimary6XAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary6XAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary6XAttribute(IntegerAttributeCallback callback) { - reportPrimary6XAttribute(chipClusterPtr, callback); - } - public void readPrimary6YAttribute(IntegerAttributeCallback callback) { readPrimary6YAttribute(chipClusterPtr, callback); } public void subscribePrimary6YAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary6YAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary6YAttribute(IntegerAttributeCallback callback) { - reportPrimary6YAttribute(chipClusterPtr, callback); - } - public void readPrimary6IntensityAttribute(IntegerAttributeCallback callback) { readPrimary6IntensityAttribute(chipClusterPtr, callback); } public void subscribePrimary6IntensityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePrimary6IntensityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPrimary6IntensityAttribute(IntegerAttributeCallback callback) { - reportPrimary6IntensityAttribute(chipClusterPtr, callback); - } - public void readWhitePointXAttribute(IntegerAttributeCallback callback) { readWhitePointXAttribute(chipClusterPtr, callback); } @@ -2938,14 +2736,10 @@ public void writeWhitePointXAttribute(DefaultClusterCallback callback, Integer v } public void subscribeWhitePointXAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeWhitePointXAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportWhitePointXAttribute(IntegerAttributeCallback callback) { - reportWhitePointXAttribute(chipClusterPtr, callback); - } - public void readWhitePointYAttribute(IntegerAttributeCallback callback) { readWhitePointYAttribute(chipClusterPtr, callback); } @@ -2955,14 +2749,10 @@ public void writeWhitePointYAttribute(DefaultClusterCallback callback, Integer v } public void subscribeWhitePointYAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeWhitePointYAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportWhitePointYAttribute(IntegerAttributeCallback callback) { - reportWhitePointYAttribute(chipClusterPtr, callback); - } - public void readColorPointRXAttribute(IntegerAttributeCallback callback) { readColorPointRXAttribute(chipClusterPtr, callback); } @@ -2972,14 +2762,10 @@ public void writeColorPointRXAttribute(DefaultClusterCallback callback, Integer } public void subscribeColorPointRXAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorPointRXAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorPointRXAttribute(IntegerAttributeCallback callback) { - reportColorPointRXAttribute(chipClusterPtr, callback); - } - public void readColorPointRYAttribute(IntegerAttributeCallback callback) { readColorPointRYAttribute(chipClusterPtr, callback); } @@ -2989,14 +2775,10 @@ public void writeColorPointRYAttribute(DefaultClusterCallback callback, Integer } public void subscribeColorPointRYAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorPointRYAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorPointRYAttribute(IntegerAttributeCallback callback) { - reportColorPointRYAttribute(chipClusterPtr, callback); - } - public void readColorPointRIntensityAttribute(IntegerAttributeCallback callback) { readColorPointRIntensityAttribute(chipClusterPtr, callback); } @@ -3006,14 +2788,10 @@ public void writeColorPointRIntensityAttribute(DefaultClusterCallback callback, } public void subscribeColorPointRIntensityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorPointRIntensityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorPointRIntensityAttribute(IntegerAttributeCallback callback) { - reportColorPointRIntensityAttribute(chipClusterPtr, callback); - } - public void readColorPointGXAttribute(IntegerAttributeCallback callback) { readColorPointGXAttribute(chipClusterPtr, callback); } @@ -3023,14 +2801,10 @@ public void writeColorPointGXAttribute(DefaultClusterCallback callback, Integer } public void subscribeColorPointGXAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorPointGXAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorPointGXAttribute(IntegerAttributeCallback callback) { - reportColorPointGXAttribute(chipClusterPtr, callback); - } - public void readColorPointGYAttribute(IntegerAttributeCallback callback) { readColorPointGYAttribute(chipClusterPtr, callback); } @@ -3040,14 +2814,10 @@ public void writeColorPointGYAttribute(DefaultClusterCallback callback, Integer } public void subscribeColorPointGYAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorPointGYAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorPointGYAttribute(IntegerAttributeCallback callback) { - reportColorPointGYAttribute(chipClusterPtr, callback); - } - public void readColorPointGIntensityAttribute(IntegerAttributeCallback callback) { readColorPointGIntensityAttribute(chipClusterPtr, callback); } @@ -3057,14 +2827,10 @@ public void writeColorPointGIntensityAttribute(DefaultClusterCallback callback, } public void subscribeColorPointGIntensityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorPointGIntensityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorPointGIntensityAttribute(IntegerAttributeCallback callback) { - reportColorPointGIntensityAttribute(chipClusterPtr, callback); - } - public void readColorPointBXAttribute(IntegerAttributeCallback callback) { readColorPointBXAttribute(chipClusterPtr, callback); } @@ -3074,14 +2840,10 @@ public void writeColorPointBXAttribute(DefaultClusterCallback callback, Integer } public void subscribeColorPointBXAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorPointBXAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorPointBXAttribute(IntegerAttributeCallback callback) { - reportColorPointBXAttribute(chipClusterPtr, callback); - } - public void readColorPointBYAttribute(IntegerAttributeCallback callback) { readColorPointBYAttribute(chipClusterPtr, callback); } @@ -3091,14 +2853,10 @@ public void writeColorPointBYAttribute(DefaultClusterCallback callback, Integer } public void subscribeColorPointBYAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorPointBYAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorPointBYAttribute(IntegerAttributeCallback callback) { - reportColorPointBYAttribute(chipClusterPtr, callback); - } - public void readColorPointBIntensityAttribute(IntegerAttributeCallback callback) { readColorPointBIntensityAttribute(chipClusterPtr, callback); } @@ -3108,160 +2866,112 @@ public void writeColorPointBIntensityAttribute(DefaultClusterCallback callback, } public void subscribeColorPointBIntensityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorPointBIntensityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorPointBIntensityAttribute(IntegerAttributeCallback callback) { - reportColorPointBIntensityAttribute(chipClusterPtr, callback); - } - public void readEnhancedCurrentHueAttribute(IntegerAttributeCallback callback) { readEnhancedCurrentHueAttribute(chipClusterPtr, callback); } public void subscribeEnhancedCurrentHueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeEnhancedCurrentHueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEnhancedCurrentHueAttribute(IntegerAttributeCallback callback) { - reportEnhancedCurrentHueAttribute(chipClusterPtr, callback); - } - public void readEnhancedColorModeAttribute(IntegerAttributeCallback callback) { readEnhancedColorModeAttribute(chipClusterPtr, callback); } public void subscribeEnhancedColorModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeEnhancedColorModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEnhancedColorModeAttribute(IntegerAttributeCallback callback) { - reportEnhancedColorModeAttribute(chipClusterPtr, callback); - } - public void readColorLoopActiveAttribute(IntegerAttributeCallback callback) { readColorLoopActiveAttribute(chipClusterPtr, callback); } public void subscribeColorLoopActiveAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorLoopActiveAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorLoopActiveAttribute(IntegerAttributeCallback callback) { - reportColorLoopActiveAttribute(chipClusterPtr, callback); - } - public void readColorLoopDirectionAttribute(IntegerAttributeCallback callback) { readColorLoopDirectionAttribute(chipClusterPtr, callback); } public void subscribeColorLoopDirectionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorLoopDirectionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorLoopDirectionAttribute(IntegerAttributeCallback callback) { - reportColorLoopDirectionAttribute(chipClusterPtr, callback); - } - public void readColorLoopTimeAttribute(IntegerAttributeCallback callback) { readColorLoopTimeAttribute(chipClusterPtr, callback); } public void subscribeColorLoopTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorLoopTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorLoopTimeAttribute(IntegerAttributeCallback callback) { - reportColorLoopTimeAttribute(chipClusterPtr, callback); - } - public void readColorLoopStartEnhancedHueAttribute(IntegerAttributeCallback callback) { readColorLoopStartEnhancedHueAttribute(chipClusterPtr, callback); } public void subscribeColorLoopStartEnhancedHueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorLoopStartEnhancedHueAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorLoopStartEnhancedHueAttribute(IntegerAttributeCallback callback) { - reportColorLoopStartEnhancedHueAttribute(chipClusterPtr, callback); - } - public void readColorLoopStoredEnhancedHueAttribute(IntegerAttributeCallback callback) { readColorLoopStoredEnhancedHueAttribute(chipClusterPtr, callback); } public void subscribeColorLoopStoredEnhancedHueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorLoopStoredEnhancedHueAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorLoopStoredEnhancedHueAttribute(IntegerAttributeCallback callback) { - reportColorLoopStoredEnhancedHueAttribute(chipClusterPtr, callback); - } - public void readColorCapabilitiesAttribute(IntegerAttributeCallback callback) { readColorCapabilitiesAttribute(chipClusterPtr, callback); } public void subscribeColorCapabilitiesAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorCapabilitiesAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorCapabilitiesAttribute(IntegerAttributeCallback callback) { - reportColorCapabilitiesAttribute(chipClusterPtr, callback); - } - public void readColorTempPhysicalMinAttribute(IntegerAttributeCallback callback) { readColorTempPhysicalMinAttribute(chipClusterPtr, callback); } public void subscribeColorTempPhysicalMinAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorTempPhysicalMinAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorTempPhysicalMinAttribute(IntegerAttributeCallback callback) { - reportColorTempPhysicalMinAttribute(chipClusterPtr, callback); - } - public void readColorTempPhysicalMaxAttribute(IntegerAttributeCallback callback) { readColorTempPhysicalMaxAttribute(chipClusterPtr, callback); } public void subscribeColorTempPhysicalMaxAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeColorTempPhysicalMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportColorTempPhysicalMaxAttribute(IntegerAttributeCallback callback) { - reportColorTempPhysicalMaxAttribute(chipClusterPtr, callback); - } - public void readCoupleColorTempToLevelMinMiredsAttribute(IntegerAttributeCallback callback) { readCoupleColorTempToLevelMinMiredsAttribute(chipClusterPtr, callback); } public void subscribeCoupleColorTempToLevelMinMiredsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCoupleColorTempToLevelMinMiredsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCoupleColorTempToLevelMinMiredsAttribute(IntegerAttributeCallback callback) { - reportCoupleColorTempToLevelMinMiredsAttribute(chipClusterPtr, callback); - } - public void readStartUpColorTemperatureMiredsAttribute(IntegerAttributeCallback callback) { readStartUpColorTemperatureMiredsAttribute(chipClusterPtr, callback); } @@ -3272,15 +2982,11 @@ public void writeStartUpColorTemperatureMiredsAttribute( } public void subscribeStartUpColorTemperatureMiredsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeStartUpColorTemperatureMiredsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportStartUpColorTemperatureMiredsAttribute(IntegerAttributeCallback callback) { - reportStartUpColorTemperatureMiredsAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -3290,94 +2996,66 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readCurrentHueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentHueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentHueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentSaturationAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentSaturationAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentSaturationAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRemainingTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRemainingTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRemainingTimeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentXAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentXAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentXAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentYAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentYAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentYAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readDriftCompensationAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeDriftCompensationAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportDriftCompensationAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCompensationTextAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeCompensationTextAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCompensationTextAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readColorTemperatureAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeColorTemperatureAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorTemperatureAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeColorModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorControlOptionsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3386,181 +3064,121 @@ private native void writeColorControlOptionsAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorControlOptionsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorControlOptionsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readNumberOfPrimariesAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeNumberOfPrimariesAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNumberOfPrimariesAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary1XAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary1XAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary1XAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary1YAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary1YAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary1YAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary1IntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary1IntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary1IntensityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary2XAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary2XAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary2XAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary2YAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary2YAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary2YAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary2IntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary2IntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary2IntensityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary3XAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary3XAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary3XAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary3YAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary3YAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary3YAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary3IntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary3IntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary3IntensityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary4XAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary4XAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary4XAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary4YAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary4YAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary4YAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary4IntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary4IntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary4IntensityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary5XAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary5XAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary5XAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary5YAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary5YAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary5YAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary5IntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary5IntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary5IntensityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary6XAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary6XAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary6XAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary6YAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary6YAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary6YAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPrimary6IntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePrimary6IntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPrimary6IntensityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readWhitePointXAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3569,10 +3187,7 @@ private native void writeWhitePointXAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeWhitePointXAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportWhitePointXAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readWhitePointYAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3581,10 +3196,7 @@ private native void writeWhitePointYAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeWhitePointYAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportWhitePointYAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorPointRXAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3593,10 +3205,7 @@ private native void writeColorPointRXAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointRXAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorPointRXAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorPointRYAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3605,10 +3214,7 @@ private native void writeColorPointRYAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointRYAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorPointRYAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorPointRIntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3617,10 +3223,7 @@ private native void writeColorPointRIntensityAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointRIntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorPointRIntensityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorPointGXAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3629,10 +3232,7 @@ private native void writeColorPointGXAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointGXAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorPointGXAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorPointGYAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3641,10 +3241,7 @@ private native void writeColorPointGYAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointGYAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorPointGYAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorPointGIntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3653,10 +3250,7 @@ private native void writeColorPointGIntensityAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointGIntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorPointGIntensityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorPointBXAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3665,10 +3259,7 @@ private native void writeColorPointBXAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointBXAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorPointBXAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorPointBYAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3677,10 +3268,7 @@ private native void writeColorPointBYAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointBYAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorPointBYAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorPointBIntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3689,109 +3277,73 @@ private native void writeColorPointBIntensityAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointBIntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorPointBIntensityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readEnhancedCurrentHueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeEnhancedCurrentHueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEnhancedCurrentHueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readEnhancedColorModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeEnhancedColorModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEnhancedColorModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorLoopActiveAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeColorLoopActiveAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorLoopActiveAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorLoopDirectionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeColorLoopDirectionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorLoopDirectionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorLoopTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeColorLoopTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorLoopTimeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorLoopStartEnhancedHueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeColorLoopStartEnhancedHueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorLoopStartEnhancedHueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorLoopStoredEnhancedHueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeColorLoopStoredEnhancedHueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorLoopStoredEnhancedHueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorCapabilitiesAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeColorCapabilitiesAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorCapabilitiesAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorTempPhysicalMinAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeColorTempPhysicalMinAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorTempPhysicalMinAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readColorTempPhysicalMaxAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeColorTempPhysicalMaxAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportColorTempPhysicalMaxAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCoupleColorTempToLevelMinMiredsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCoupleColorTempToLevelMinMiredsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCoupleColorTempToLevelMinMiredsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readStartUpColorTemperatureMiredsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -3800,10 +3352,7 @@ private native void writeStartUpColorTemperatureMiredsAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeStartUpColorTemperatureMiredsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportStartUpColorTemperatureMiredsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -3812,10 +3361,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class ContentLauncherCluster extends BaseChipCluster { @@ -3830,64 +3376,53 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void launchContent( - LaunchContentResponseCallback callback, - Boolean autoPlay, - String data, - Integer type, - String value) { - launchContent(chipClusterPtr, callback, autoPlay, data, type, value); + public void launchContentRequest( + LaunchResponseCallback callback, Boolean autoPlay, String data) { + launchContentRequest(chipClusterPtr, callback, autoPlay, data); } - public void launchURL( - LaunchURLResponseCallback callback, + public void launchURLRequest( + LaunchResponseCallback callback, String contentURL, String displayString, String providerName) { - launchURL(chipClusterPtr, callback, contentURL, displayString, providerName); + launchURLRequest(chipClusterPtr, callback, contentURL, displayString, providerName); } - private native void launchContent( - long chipClusterPtr, - LaunchContentResponseCallback Callback, - Boolean autoPlay, - String data, - Integer type, - String value); + private native void launchContentRequest( + long chipClusterPtr, LaunchResponseCallback Callback, Boolean autoPlay, String data); - private native void launchURL( + private native void launchURLRequest( long chipClusterPtr, - LaunchURLResponseCallback Callback, + LaunchResponseCallback Callback, String contentURL, String displayString, String providerName); - public interface LaunchContentResponseCallback { - void onSuccess(Integer contentLaunchStatus, String data); - - void onError(Exception error); - } - - public interface LaunchURLResponseCallback { - void onSuccess(Integer contentLaunchStatus, String data); + public interface LaunchResponseCallback { + void onSuccess(Integer status, String data); void onError(Exception error); } - public interface AcceptsHeaderListAttributeCallback { + public interface AcceptHeaderListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } - public void readAcceptsHeaderListAttribute(AcceptsHeaderListAttributeCallback callback) { - readAcceptsHeaderListAttribute(chipClusterPtr, callback); + public void readAcceptHeaderListAttribute(AcceptHeaderListAttributeCallback callback) { + readAcceptHeaderListAttribute(chipClusterPtr, callback); } public void readSupportedStreamingProtocolsAttribute(LongAttributeCallback callback) { @@ -3900,15 +3435,11 @@ public void writeSupportedStreamingProtocolsAttribute( } public void subscribeSupportedStreamingProtocolsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeSupportedStreamingProtocolsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSupportedStreamingProtocolsAttribute(LongAttributeCallback callback) { - reportSupportedStreamingProtocolsAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -3918,16 +3449,12 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - - private native void readAcceptsHeaderListAttribute( - long chipClusterPtr, AcceptsHeaderListAttributeCallback callback); + private native void readAcceptHeaderListAttribute( + long chipClusterPtr, AcceptHeaderListAttributeCallback callback); private native void readSupportedStreamingProtocolsAttribute( long chipClusterPtr, LongAttributeCallback callback); @@ -3936,10 +3463,7 @@ private native void writeSupportedStreamingProtocolsAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeSupportedStreamingProtocolsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSupportedStreamingProtocolsAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -3948,10 +3472,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class DescriptorCluster extends BaseChipCluster { @@ -3994,30 +3515,40 @@ public interface DeviceListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface ServerListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface ClientListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface PartsListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readDeviceListAttribute(DeviceListAttributeCallback callback) { @@ -4045,14 +3576,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readDeviceListAttribute( long chipClusterPtr, DeviceListAttributeCallback callback); @@ -4072,10 +3599,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class DiagnosticLogsCluster extends BaseChipCluster { @@ -4116,6 +3640,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -4288,18 +3814,24 @@ public interface LockStateAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface DoorStateAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readLockStateAttribute(LockStateAttributeCallback callback) { @@ -4307,53 +3839,37 @@ public void readLockStateAttribute(LockStateAttributeCallback callback) { } public void subscribeLockStateAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LockStateAttributeCallback callback, int minInterval, int maxInterval) { subscribeLockStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLockStateAttribute(IntegerAttributeCallback callback) { - reportLockStateAttribute(chipClusterPtr, callback); - } - public void readLockTypeAttribute(IntegerAttributeCallback callback) { readLockTypeAttribute(chipClusterPtr, callback); } public void subscribeLockTypeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeLockTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLockTypeAttribute(IntegerAttributeCallback callback) { - reportLockTypeAttribute(chipClusterPtr, callback); - } - public void readActuatorEnabledAttribute(BooleanAttributeCallback callback) { readActuatorEnabledAttribute(chipClusterPtr, callback); } public void subscribeActuatorEnabledAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeActuatorEnabledAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportActuatorEnabledAttribute(BooleanAttributeCallback callback) { - reportActuatorEnabledAttribute(chipClusterPtr, callback); - } - public void readDoorStateAttribute(DoorStateAttributeCallback callback) { readDoorStateAttribute(chipClusterPtr, callback); } public void subscribeDoorStateAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + DoorStateAttributeCallback callback, int minInterval, int maxInterval) { subscribeDoorStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportDoorStateAttribute(IntegerAttributeCallback callback) { - reportDoorStateAttribute(chipClusterPtr, callback); - } - public void readNumberOfTotalUsersSupportedAttribute(IntegerAttributeCallback callback) { readNumberOfTotalUsersSupportedAttribute(chipClusterPtr, callback); } @@ -4379,14 +3895,10 @@ public void writeLanguageAttribute(DefaultClusterCallback callback, String value } public void subscribeLanguageAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeLanguageAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLanguageAttribute(CharStringAttributeCallback callback) { - reportLanguageAttribute(chipClusterPtr, callback); - } - public void readAutoRelockTimeAttribute(LongAttributeCallback callback) { readAutoRelockTimeAttribute(chipClusterPtr, callback); } @@ -4396,14 +3908,10 @@ public void writeAutoRelockTimeAttribute(DefaultClusterCallback callback, Long v } public void subscribeAutoRelockTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeAutoRelockTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportAutoRelockTimeAttribute(LongAttributeCallback callback) { - reportAutoRelockTimeAttribute(chipClusterPtr, callback); - } - public void readSoundVolumeAttribute(IntegerAttributeCallback callback) { readSoundVolumeAttribute(chipClusterPtr, callback); } @@ -4413,14 +3921,10 @@ public void writeSoundVolumeAttribute(DefaultClusterCallback callback, Integer v } public void subscribeSoundVolumeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeSoundVolumeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSoundVolumeAttribute(IntegerAttributeCallback callback) { - reportSoundVolumeAttribute(chipClusterPtr, callback); - } - public void readOperatingModeAttribute(IntegerAttributeCallback callback) { readOperatingModeAttribute(chipClusterPtr, callback); } @@ -4430,14 +3934,10 @@ public void writeOperatingModeAttribute(DefaultClusterCallback callback, Integer } public void subscribeOperatingModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOperatingModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOperatingModeAttribute(IntegerAttributeCallback callback) { - reportOperatingModeAttribute(chipClusterPtr, callback); - } - public void readSupportedOperatingModesAttribute(IntegerAttributeCallback callback) { readSupportedOperatingModesAttribute(chipClusterPtr, callback); } @@ -4452,14 +3952,10 @@ public void writeEnableOneTouchLockingAttribute( } public void subscribeEnableOneTouchLockingAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeEnableOneTouchLockingAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEnableOneTouchLockingAttribute(BooleanAttributeCallback callback) { - reportEnableOneTouchLockingAttribute(chipClusterPtr, callback); - } - public void readEnablePrivacyModeButtonAttribute(BooleanAttributeCallback callback) { readEnablePrivacyModeButtonAttribute(chipClusterPtr, callback); } @@ -4470,14 +3966,10 @@ public void writeEnablePrivacyModeButtonAttribute( } public void subscribeEnablePrivacyModeButtonAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeEnablePrivacyModeButtonAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEnablePrivacyModeButtonAttribute(BooleanAttributeCallback callback) { - reportEnablePrivacyModeButtonAttribute(chipClusterPtr, callback); - } - public void readWrongCodeEntryLimitAttribute(IntegerAttributeCallback callback) { readWrongCodeEntryLimitAttribute(chipClusterPtr, callback); } @@ -4487,14 +3979,10 @@ public void writeWrongCodeEntryLimitAttribute(DefaultClusterCallback callback, I } public void subscribeWrongCodeEntryLimitAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeWrongCodeEntryLimitAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportWrongCodeEntryLimitAttribute(IntegerAttributeCallback callback) { - reportWrongCodeEntryLimitAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -4504,49 +3992,33 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readLockStateAttribute( long chipClusterPtr, LockStateAttributeCallback callback); private native void subscribeLockStateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLockStateAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, LockStateAttributeCallback callback, int minInterval, int maxInterval); private native void readLockTypeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeLockTypeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLockTypeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readActuatorEnabledAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void subscribeActuatorEnabledAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportActuatorEnabledAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readDoorStateAttribute( long chipClusterPtr, DoorStateAttributeCallback callback); private native void subscribeDoorStateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportDoorStateAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, DoorStateAttributeCallback callback, int minInterval, int maxInterval); private native void readNumberOfTotalUsersSupportedAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -4567,10 +4039,10 @@ private native void writeLanguageAttribute( long chipClusterPtr, DefaultClusterCallback callback, String value); private native void subscribeLanguageAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLanguageAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readAutoRelockTimeAttribute( long chipClusterPtr, LongAttributeCallback callback); @@ -4579,10 +4051,7 @@ private native void writeAutoRelockTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeAutoRelockTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportAutoRelockTimeAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readSoundVolumeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -4591,10 +4060,7 @@ private native void writeSoundVolumeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeSoundVolumeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSoundVolumeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readOperatingModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -4603,10 +4069,7 @@ private native void writeOperatingModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOperatingModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOperatingModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readSupportedOperatingModesAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -4618,10 +4081,7 @@ private native void writeEnableOneTouchLockingAttribute( long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribeEnableOneTouchLockingAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEnableOneTouchLockingAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readEnablePrivacyModeButtonAttribute( long chipClusterPtr, BooleanAttributeCallback callback); @@ -4630,10 +4090,7 @@ private native void writeEnablePrivacyModeButtonAttribute( long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribeEnablePrivacyModeButtonAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEnablePrivacyModeButtonAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readWrongCodeEntryLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -4642,10 +4099,7 @@ private native void writeWrongCodeEntryLimitAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeWrongCodeEntryLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportWrongCodeEntryLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -4654,10 +4108,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class ElectricalMeasurementCluster extends BaseChipCluster { @@ -4676,6 +4127,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readMeasurementTypeAttribute(LongAttributeCallback callback) { @@ -4683,144 +4136,100 @@ public void readMeasurementTypeAttribute(LongAttributeCallback callback) { } public void subscribeMeasurementTypeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeMeasurementTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMeasurementTypeAttribute(LongAttributeCallback callback) { - reportMeasurementTypeAttribute(chipClusterPtr, callback); - } - public void readTotalActivePowerAttribute(LongAttributeCallback callback) { readTotalActivePowerAttribute(chipClusterPtr, callback); } public void subscribeTotalActivePowerAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTotalActivePowerAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTotalActivePowerAttribute(LongAttributeCallback callback) { - reportTotalActivePowerAttribute(chipClusterPtr, callback); - } - public void readRmsVoltageAttribute(IntegerAttributeCallback callback) { readRmsVoltageAttribute(chipClusterPtr, callback); } public void subscribeRmsVoltageAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRmsVoltageAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRmsVoltageAttribute(IntegerAttributeCallback callback) { - reportRmsVoltageAttribute(chipClusterPtr, callback); - } - public void readRmsVoltageMinAttribute(IntegerAttributeCallback callback) { readRmsVoltageMinAttribute(chipClusterPtr, callback); } public void subscribeRmsVoltageMinAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRmsVoltageMinAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRmsVoltageMinAttribute(IntegerAttributeCallback callback) { - reportRmsVoltageMinAttribute(chipClusterPtr, callback); - } - public void readRmsVoltageMaxAttribute(IntegerAttributeCallback callback) { readRmsVoltageMaxAttribute(chipClusterPtr, callback); } public void subscribeRmsVoltageMaxAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRmsVoltageMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRmsVoltageMaxAttribute(IntegerAttributeCallback callback) { - reportRmsVoltageMaxAttribute(chipClusterPtr, callback); - } - public void readRmsCurrentAttribute(IntegerAttributeCallback callback) { readRmsCurrentAttribute(chipClusterPtr, callback); } public void subscribeRmsCurrentAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRmsCurrentAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRmsCurrentAttribute(IntegerAttributeCallback callback) { - reportRmsCurrentAttribute(chipClusterPtr, callback); - } - public void readRmsCurrentMinAttribute(IntegerAttributeCallback callback) { readRmsCurrentMinAttribute(chipClusterPtr, callback); } public void subscribeRmsCurrentMinAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRmsCurrentMinAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRmsCurrentMinAttribute(IntegerAttributeCallback callback) { - reportRmsCurrentMinAttribute(chipClusterPtr, callback); - } - public void readRmsCurrentMaxAttribute(IntegerAttributeCallback callback) { readRmsCurrentMaxAttribute(chipClusterPtr, callback); } public void subscribeRmsCurrentMaxAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRmsCurrentMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRmsCurrentMaxAttribute(IntegerAttributeCallback callback) { - reportRmsCurrentMaxAttribute(chipClusterPtr, callback); - } - public void readActivePowerAttribute(IntegerAttributeCallback callback) { readActivePowerAttribute(chipClusterPtr, callback); } public void subscribeActivePowerAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeActivePowerAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportActivePowerAttribute(IntegerAttributeCallback callback) { - reportActivePowerAttribute(chipClusterPtr, callback); - } - public void readActivePowerMinAttribute(IntegerAttributeCallback callback) { readActivePowerMinAttribute(chipClusterPtr, callback); } public void subscribeActivePowerMinAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeActivePowerMinAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportActivePowerMinAttribute(IntegerAttributeCallback callback) { - reportActivePowerMinAttribute(chipClusterPtr, callback); - } - public void readActivePowerMaxAttribute(IntegerAttributeCallback callback) { readActivePowerMaxAttribute(chipClusterPtr, callback); } public void subscribeActivePowerMaxAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeActivePowerMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportActivePowerMaxAttribute(IntegerAttributeCallback callback) { - reportActivePowerMaxAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -4830,112 +4239,75 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readMeasurementTypeAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeMeasurementTypeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMeasurementTypeAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTotalActivePowerAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTotalActivePowerAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTotalActivePowerAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRmsVoltageAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRmsVoltageAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRmsVoltageAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRmsVoltageMinAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRmsVoltageMinAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRmsVoltageMinAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRmsVoltageMaxAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRmsVoltageMaxAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRmsVoltageMaxAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRmsCurrentAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRmsCurrentAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRmsCurrentAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRmsCurrentMinAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRmsCurrentMinAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRmsCurrentMinAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRmsCurrentMaxAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRmsCurrentMaxAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRmsCurrentMaxAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readActivePowerAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeActivePowerAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportActivePowerAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readActivePowerMinAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeActivePowerMinAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportActivePowerMinAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readActivePowerMaxAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeActivePowerMaxAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportActivePowerMaxAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -4944,10 +4316,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class EthernetNetworkDiagnosticsCluster extends BaseChipCluster { @@ -4972,6 +4341,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readPHYRateAttribute(IntegerAttributeCallback callback) { @@ -4979,118 +4350,82 @@ public void readPHYRateAttribute(IntegerAttributeCallback callback) { } public void subscribePHYRateAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePHYRateAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPHYRateAttribute(IntegerAttributeCallback callback) { - reportPHYRateAttribute(chipClusterPtr, callback); - } - public void readFullDuplexAttribute(BooleanAttributeCallback callback) { readFullDuplexAttribute(chipClusterPtr, callback); } public void subscribeFullDuplexAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeFullDuplexAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportFullDuplexAttribute(BooleanAttributeCallback callback) { - reportFullDuplexAttribute(chipClusterPtr, callback); - } - public void readPacketRxCountAttribute(LongAttributeCallback callback) { readPacketRxCountAttribute(chipClusterPtr, callback); } public void subscribePacketRxCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribePacketRxCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPacketRxCountAttribute(LongAttributeCallback callback) { - reportPacketRxCountAttribute(chipClusterPtr, callback); - } - public void readPacketTxCountAttribute(LongAttributeCallback callback) { readPacketTxCountAttribute(chipClusterPtr, callback); } public void subscribePacketTxCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribePacketTxCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPacketTxCountAttribute(LongAttributeCallback callback) { - reportPacketTxCountAttribute(chipClusterPtr, callback); - } - public void readTxErrCountAttribute(LongAttributeCallback callback) { readTxErrCountAttribute(chipClusterPtr, callback); } public void subscribeTxErrCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxErrCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxErrCountAttribute(LongAttributeCallback callback) { - reportTxErrCountAttribute(chipClusterPtr, callback); - } - public void readCollisionCountAttribute(LongAttributeCallback callback) { readCollisionCountAttribute(chipClusterPtr, callback); } public void subscribeCollisionCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeCollisionCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCollisionCountAttribute(LongAttributeCallback callback) { - reportCollisionCountAttribute(chipClusterPtr, callback); - } - public void readOverrunCountAttribute(LongAttributeCallback callback) { readOverrunCountAttribute(chipClusterPtr, callback); } public void subscribeOverrunCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeOverrunCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOverrunCountAttribute(LongAttributeCallback callback) { - reportOverrunCountAttribute(chipClusterPtr, callback); - } - public void readCarrierDetectAttribute(BooleanAttributeCallback callback) { readCarrierDetectAttribute(chipClusterPtr, callback); } public void subscribeCarrierDetectAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeCarrierDetectAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCarrierDetectAttribute(BooleanAttributeCallback callback) { - reportCarrierDetectAttribute(chipClusterPtr, callback); - } - public void readTimeSinceResetAttribute(LongAttributeCallback callback) { readTimeSinceResetAttribute(chipClusterPtr, callback); } public void subscribeTimeSinceResetAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTimeSinceResetAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTimeSinceResetAttribute(LongAttributeCallback callback) { - reportTimeSinceResetAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -5104,94 +4439,63 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readPHYRateAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePHYRateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPHYRateAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readFullDuplexAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void subscribeFullDuplexAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportFullDuplexAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readPacketRxCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribePacketRxCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPacketRxCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readPacketTxCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribePacketTxCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPacketTxCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxErrCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxErrCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxErrCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readCollisionCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeCollisionCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCollisionCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readOverrunCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeOverrunCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOverrunCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readCarrierDetectAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void subscribeCarrierDetectAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCarrierDetectAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readTimeSinceResetAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTimeSinceResetAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTimeSinceResetAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -5203,10 +4507,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class FixedLabelCluster extends BaseChipCluster { @@ -5249,12 +4550,16 @@ public interface LabelListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readLabelListAttribute(LabelListAttributeCallback callback) { @@ -5270,14 +4575,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readLabelListAttribute( long chipClusterPtr, LabelListAttributeCallback callback); @@ -5288,10 +4589,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class FlowMeasurementCluster extends BaseChipCluster { @@ -5310,6 +4608,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readMeasuredValueAttribute(IntegerAttributeCallback callback) { @@ -5317,53 +4617,37 @@ public void readMeasuredValueAttribute(IntegerAttributeCallback callback) { } public void subscribeMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readMinMeasuredValueAttribute(IntegerAttributeCallback callback) { readMinMeasuredValueAttribute(chipClusterPtr, callback); } public void subscribeMinMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMinMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { readMaxMeasuredValueAttribute(chipClusterPtr, callback); } public void subscribeMaxMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMaxMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readToleranceAttribute(IntegerAttributeCallback callback) { readToleranceAttribute(chipClusterPtr, callback); } public void subscribeToleranceAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeToleranceAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportToleranceAttribute(IntegerAttributeCallback callback) { - reportToleranceAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -5373,49 +4657,33 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readToleranceAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeToleranceAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportToleranceAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -5424,10 +4692,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class GeneralCommissioningCluster extends BaseChipCluster { @@ -5521,12 +4786,16 @@ public interface BasicCommissioningInfoListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readBreadcrumbAttribute(LongAttributeCallback callback) { @@ -5538,14 +4807,10 @@ public void writeBreadcrumbAttribute(DefaultClusterCallback callback, Long value } public void subscribeBreadcrumbAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeBreadcrumbAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBreadcrumbAttribute(LongAttributeCallback callback) { - reportBreadcrumbAttribute(chipClusterPtr, callback); - } - public void readBasicCommissioningInfoListAttribute( BasicCommissioningInfoListAttributeCallback callback) { readBasicCommissioningInfoListAttribute(chipClusterPtr, callback); @@ -5568,14 +4833,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readBreadcrumbAttribute( long chipClusterPtr, LongAttributeCallback callback); @@ -5583,10 +4844,7 @@ private native void writeBreadcrumbAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeBreadcrumbAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBreadcrumbAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readBasicCommissioningInfoListAttribute( long chipClusterPtr, BasicCommissioningInfoListAttributeCallback callback); @@ -5604,10 +4862,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class GeneralDiagnosticsCluster extends BaseChipCluster { @@ -5680,30 +4935,40 @@ public interface NetworkInterfacesAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface ActiveHardwareFaultsAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface ActiveRadioFaultsAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface ActiveNetworkFaultsAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readNetworkInterfacesAttribute(NetworkInterfacesAttributeCallback callback) { @@ -5715,53 +4980,37 @@ public void readRebootCountAttribute(IntegerAttributeCallback callback) { } public void subscribeRebootCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRebootCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRebootCountAttribute(IntegerAttributeCallback callback) { - reportRebootCountAttribute(chipClusterPtr, callback); - } - public void readUpTimeAttribute(LongAttributeCallback callback) { readUpTimeAttribute(chipClusterPtr, callback); } public void subscribeUpTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeUpTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportUpTimeAttribute(LongAttributeCallback callback) { - reportUpTimeAttribute(chipClusterPtr, callback); - } - public void readTotalOperationalHoursAttribute(LongAttributeCallback callback) { readTotalOperationalHoursAttribute(chipClusterPtr, callback); } public void subscribeTotalOperationalHoursAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTotalOperationalHoursAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTotalOperationalHoursAttribute(LongAttributeCallback callback) { - reportTotalOperationalHoursAttribute(chipClusterPtr, callback); - } - public void readBootReasonsAttribute(IntegerAttributeCallback callback) { readBootReasonsAttribute(chipClusterPtr, callback); } public void subscribeBootReasonsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBootReasonsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBootReasonsAttribute(IntegerAttributeCallback callback) { - reportBootReasonsAttribute(chipClusterPtr, callback); - } - public void readActiveHardwareFaultsAttribute(ActiveHardwareFaultsAttributeCallback callback) { readActiveHardwareFaultsAttribute(chipClusterPtr, callback); } @@ -5783,14 +5032,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readNetworkInterfacesAttribute( long chipClusterPtr, NetworkInterfacesAttributeCallback callback); @@ -5798,35 +5043,24 @@ private native void readRebootCountAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRebootCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRebootCountAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readUpTimeAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void subscribeUpTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportUpTimeAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTotalOperationalHoursAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTotalOperationalHoursAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTotalOperationalHoursAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readBootReasonsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeBootReasonsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBootReasonsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readActiveHardwareFaultsAttribute( long chipClusterPtr, ActiveHardwareFaultsAttributeCallback callback); @@ -5844,10 +5078,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class GroupKeyManagementCluster extends BaseChipCluster { @@ -5862,107 +5093,177 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public static class GroupsAttribute { - public Integer vendorId; - public Integer vendorGroupId; - public Integer groupKeySetIndex; + public void keySetRead(KeySetReadResponseCallback callback, Integer groupKeySetID) { + keySetRead(chipClusterPtr, callback, groupKeySetID); + } - public GroupsAttribute(Integer vendorId, Integer vendorGroupId, Integer groupKeySetIndex) { - this.vendorId = vendorId; - this.vendorGroupId = vendorGroupId; - this.groupKeySetIndex = groupKeySetIndex; + public void keySetReadAllIndices( + KeySetReadAllIndicesResponseCallback callback, Integer groupKeySetIDs) { + keySetReadAllIndices(chipClusterPtr, callback, groupKeySetIDs); + } + + public void keySetRemove(DefaultClusterCallback callback, Integer groupKeySetID) { + keySetRemove(chipClusterPtr, callback, groupKeySetID); + } + + public void keySetWrite( + DefaultClusterCallback callback, + Integer groupKeySetID, + Integer securityPolicy, + byte[] epochKey0, + Long epochStartTime0, + byte[] epochKey1, + Long epochStartTime1, + byte[] epochKey2, + Long epochStartTime2) { + keySetWrite( + chipClusterPtr, + callback, + groupKeySetID, + securityPolicy, + epochKey0, + epochStartTime0, + epochKey1, + epochStartTime1, + epochKey2, + epochStartTime2); + } + + private native void keySetRead( + long chipClusterPtr, KeySetReadResponseCallback Callback, Integer groupKeySetID); + + private native void keySetReadAllIndices( + long chipClusterPtr, KeySetReadAllIndicesResponseCallback Callback, Integer groupKeySetIDs); + + private native void keySetRemove( + long chipClusterPtr, DefaultClusterCallback Callback, Integer groupKeySetID); + + private native void keySetWrite( + long chipClusterPtr, + DefaultClusterCallback Callback, + Integer groupKeySetID, + Integer securityPolicy, + byte[] epochKey0, + Long epochStartTime0, + byte[] epochKey1, + Long epochStartTime1, + byte[] epochKey2, + Long epochStartTime2); + + public interface KeySetReadAllIndicesResponseCallback { + void onSuccess( // groupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * + // Conversion from this type to Java is not properly implemented yet + ); + + void onError(Exception error); + } + + public interface KeySetReadResponseCallback { + void onSuccess( // groupKeySet: Struct GroupKeySet + // Conversion from this type to Java is not properly implemented yet + ); + + void onError(Exception error); + } + + public static class GroupKeyMapAttribute { + public Integer fabricIndex; + public Integer groupId; + public Integer groupKeySetID; + + public GroupKeyMapAttribute(Integer fabricIndex, Integer groupId, Integer groupKeySetID) { + this.fabricIndex = fabricIndex; + this.groupId = groupId; + this.groupKeySetID = groupKeySetID; } @Override public String toString() { StringBuilder output = new StringBuilder(""); - output.append("int vendorId: "); - output.append(this.vendorId); + output.append("int fabricIndex: "); + output.append(this.fabricIndex); output.append("\n"); - output.append("int vendorGroupId: "); - output.append(this.vendorGroupId); + output.append("int groupId: "); + output.append(this.groupId); output.append("\n"); - output.append("int groupKeySetIndex: "); - output.append(this.groupKeySetIndex); + output.append("int groupKeySetID: "); + output.append(this.groupKeySetID); output.append("\n"); return output.toString(); } } - public interface GroupsAttributeCallback { - void onSuccess(List valueList); + public interface GroupKeyMapAttributeCallback { + void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } - public static class GroupKeysAttribute { - public Integer vendorId; - public Integer groupKeyIndex; - public byte[] groupKeyRoot; - public Long groupKeyEpochStartTime; - public Integer groupKeySecurityPolicy; + public static class GroupTableAttribute { + public Integer fabricIndex; + public Integer groupId; + public String groupName; - public GroupKeysAttribute( - Integer vendorId, - Integer groupKeyIndex, - byte[] groupKeyRoot, - Long groupKeyEpochStartTime, - Integer groupKeySecurityPolicy) { - this.vendorId = vendorId; - this.groupKeyIndex = groupKeyIndex; - this.groupKeyRoot = groupKeyRoot; - this.groupKeyEpochStartTime = groupKeyEpochStartTime; - this.groupKeySecurityPolicy = groupKeySecurityPolicy; + public GroupTableAttribute(Integer fabricIndex, Integer groupId, String groupName) { + this.fabricIndex = fabricIndex; + this.groupId = groupId; + this.groupName = groupName; } @Override public String toString() { StringBuilder output = new StringBuilder(""); - output.append("int vendorId: "); - output.append(this.vendorId); - output.append("\n"); - - output.append("int groupKeyIndex: "); - output.append(this.groupKeyIndex); - output.append("\n"); - - output.append("byte[] "); - output.append(Arrays.toString(groupKeyRoot)); + output.append("int fabricIndex: "); + output.append(this.fabricIndex); output.append("\n"); - output.append("long groupKeyEpochStartTime: "); - output.append(this.groupKeyEpochStartTime); + output.append("int groupId: "); + output.append(this.groupId); output.append("\n"); - output.append("int groupKeySecurityPolicy: "); - output.append(this.groupKeySecurityPolicy); + output.append("String groupName: "); + output.append(this.groupName); output.append("\n"); return output.toString(); } } - public interface GroupKeysAttributeCallback { - void onSuccess(List valueList); + public interface GroupTableAttributeCallback { + void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public void readGroupKeyMapAttribute(GroupKeyMapAttributeCallback callback) { + readGroupKeyMapAttribute(chipClusterPtr, callback); + } + + public void readGroupTableAttribute(GroupTableAttributeCallback callback) { + readGroupTableAttribute(chipClusterPtr, callback); } - public void readGroupsAttribute(GroupsAttributeCallback callback) { - readGroupsAttribute(chipClusterPtr, callback); + public void readMaxGroupsPerFabricAttribute(IntegerAttributeCallback callback) { + readMaxGroupsPerFabricAttribute(chipClusterPtr, callback); } - public void readGroupKeysAttribute(GroupKeysAttributeCallback callback) { - readGroupKeysAttribute(chipClusterPtr, callback); + public void readMaxGroupKeysPerFabricAttribute(IntegerAttributeCallback callback) { + readMaxGroupKeysPerFabricAttribute(chipClusterPtr, callback); } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -5974,18 +5275,21 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } + private native void readGroupKeyMapAttribute( + long chipClusterPtr, GroupKeyMapAttributeCallback callback); + + private native void readGroupTableAttribute( + long chipClusterPtr, GroupTableAttributeCallback callback); - private native void readGroupsAttribute(long chipClusterPtr, GroupsAttributeCallback callback); + private native void readMaxGroupsPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); - private native void readGroupKeysAttribute( - long chipClusterPtr, GroupKeysAttributeCallback callback); + private native void readMaxGroupKeysPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -5994,10 +5298,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class GroupsCluster extends BaseChipCluster { @@ -6085,6 +5386,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readNameSupportAttribute(IntegerAttributeCallback callback) { @@ -6092,14 +5395,10 @@ public void readNameSupportAttribute(IntegerAttributeCallback callback) { } public void subscribeNameSupportAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeNameSupportAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNameSupportAttribute(IntegerAttributeCallback callback) { - reportNameSupportAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -6109,22 +5408,15 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readNameSupportAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeNameSupportAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNameSupportAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -6133,10 +5425,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class IdentifyCluster extends BaseChipCluster { @@ -6185,6 +5474,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readIdentifyTimeAttribute(IntegerAttributeCallback callback) { @@ -6196,27 +5487,19 @@ public void writeIdentifyTimeAttribute(DefaultClusterCallback callback, Integer } public void subscribeIdentifyTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeIdentifyTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportIdentifyTimeAttribute(IntegerAttributeCallback callback) { - reportIdentifyTimeAttribute(chipClusterPtr, callback); - } - public void readIdentifyTypeAttribute(IntegerAttributeCallback callback) { readIdentifyTypeAttribute(chipClusterPtr, callback); } public void subscribeIdentifyTypeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeIdentifyTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportIdentifyTypeAttribute(IntegerAttributeCallback callback) { - reportIdentifyTypeAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -6226,14 +5509,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readIdentifyTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -6241,19 +5520,13 @@ private native void writeIdentifyTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeIdentifyTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportIdentifyTimeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readIdentifyTypeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeIdentifyTypeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportIdentifyTypeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -6262,10 +5535,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class IlluminanceMeasurementCluster extends BaseChipCluster { @@ -6284,30 +5554,40 @@ public interface MeasuredValueAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface MinMeasuredValueAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface MaxMeasuredValueAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface LightSensorTypeAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readMeasuredValueAttribute(MeasuredValueAttributeCallback callback) { @@ -6315,66 +5595,46 @@ public void readMeasuredValueAttribute(MeasuredValueAttributeCallback callback) } public void subscribeMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + MeasuredValueAttributeCallback callback, int minInterval, int maxInterval) { subscribeMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readMinMeasuredValueAttribute(MinMeasuredValueAttributeCallback callback) { readMinMeasuredValueAttribute(chipClusterPtr, callback); } public void subscribeMinMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + MinMeasuredValueAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMinMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readMaxMeasuredValueAttribute(MaxMeasuredValueAttributeCallback callback) { readMaxMeasuredValueAttribute(chipClusterPtr, callback); } public void subscribeMaxMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + MaxMeasuredValueAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMaxMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readToleranceAttribute(IntegerAttributeCallback callback) { readToleranceAttribute(chipClusterPtr, callback); } public void subscribeToleranceAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeToleranceAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportToleranceAttribute(IntegerAttributeCallback callback) { - reportToleranceAttribute(chipClusterPtr, callback); - } - public void readLightSensorTypeAttribute(LightSensorTypeAttributeCallback callback) { readLightSensorTypeAttribute(chipClusterPtr, callback); } public void subscribeLightSensorTypeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LightSensorTypeAttributeCallback callback, int minInterval, int maxInterval) { subscribeLightSensorTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLightSensorTypeAttribute(IntegerAttributeCallback callback) { - reportLightSensorTypeAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -6384,58 +5644,51 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readMeasuredValueAttribute( long chipClusterPtr, MeasuredValueAttributeCallback callback); private native void subscribeMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + MeasuredValueAttributeCallback callback, + int minInterval, + int maxInterval); private native void readMinMeasuredValueAttribute( long chipClusterPtr, MinMeasuredValueAttributeCallback callback); private native void subscribeMinMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + MinMeasuredValueAttributeCallback callback, + int minInterval, + int maxInterval); private native void readMaxMeasuredValueAttribute( long chipClusterPtr, MaxMeasuredValueAttributeCallback callback); private native void subscribeMaxMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + MaxMeasuredValueAttributeCallback callback, + int minInterval, + int maxInterval); private native void readToleranceAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeToleranceAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportToleranceAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readLightSensorTypeAttribute( long chipClusterPtr, LightSensorTypeAttributeCallback callback); private native void subscribeLightSensorTypeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLightSensorTypeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + LightSensorTypeAttributeCallback callback, + int minInterval, + int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -6444,10 +5697,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class KeypadInputCluster extends BaseChipCluster { @@ -6462,11 +5712,11 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void sendKey(SendKeyResponseCallback callback, Integer keyCode) { - sendKey(chipClusterPtr, callback, keyCode); + public void sendKeyRequest(SendKeyResponseCallback callback, Integer keyCode) { + sendKeyRequest(chipClusterPtr, callback, keyCode); } - private native void sendKey( + private native void sendKeyRequest( long chipClusterPtr, SendKeyResponseCallback Callback, Integer keyCode); public interface SendKeyResponseCallback { @@ -6479,6 +5729,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -6490,14 +5742,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -6505,10 +5753,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class LevelControlCluster extends BaseChipCluster { @@ -6630,30 +5875,40 @@ public interface OnLevelAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface OnTransitionTimeAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface OffTransitionTimeAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface DefaultMoveRateAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readCurrentLevelAttribute(IntegerAttributeCallback callback) { @@ -6661,92 +5916,64 @@ public void readCurrentLevelAttribute(IntegerAttributeCallback callback) { } public void subscribeCurrentLevelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentLevelAttribute(IntegerAttributeCallback callback) { - reportCurrentLevelAttribute(chipClusterPtr, callback); - } - public void readRemainingTimeAttribute(IntegerAttributeCallback callback) { readRemainingTimeAttribute(chipClusterPtr, callback); } public void subscribeRemainingTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRemainingTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRemainingTimeAttribute(IntegerAttributeCallback callback) { - reportRemainingTimeAttribute(chipClusterPtr, callback); - } - public void readMinLevelAttribute(IntegerAttributeCallback callback) { readMinLevelAttribute(chipClusterPtr, callback); } public void subscribeMinLevelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinLevelAttribute(IntegerAttributeCallback callback) { - reportMinLevelAttribute(chipClusterPtr, callback); - } - public void readMaxLevelAttribute(IntegerAttributeCallback callback) { readMaxLevelAttribute(chipClusterPtr, callback); } public void subscribeMaxLevelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxLevelAttribute(IntegerAttributeCallback callback) { - reportMaxLevelAttribute(chipClusterPtr, callback); - } - public void readCurrentFrequencyAttribute(IntegerAttributeCallback callback) { readCurrentFrequencyAttribute(chipClusterPtr, callback); } public void subscribeCurrentFrequencyAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentFrequencyAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentFrequencyAttribute(IntegerAttributeCallback callback) { - reportCurrentFrequencyAttribute(chipClusterPtr, callback); - } - public void readMinFrequencyAttribute(IntegerAttributeCallback callback) { readMinFrequencyAttribute(chipClusterPtr, callback); } public void subscribeMinFrequencyAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinFrequencyAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinFrequencyAttribute(IntegerAttributeCallback callback) { - reportMinFrequencyAttribute(chipClusterPtr, callback); - } - public void readMaxFrequencyAttribute(IntegerAttributeCallback callback) { readMaxFrequencyAttribute(chipClusterPtr, callback); } public void subscribeMaxFrequencyAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxFrequencyAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxFrequencyAttribute(IntegerAttributeCallback callback) { - reportMaxFrequencyAttribute(chipClusterPtr, callback); - } - public void readOptionsAttribute(IntegerAttributeCallback callback) { readOptionsAttribute(chipClusterPtr, callback); } @@ -6756,14 +5983,10 @@ public void writeOptionsAttribute(DefaultClusterCallback callback, Integer value } public void subscribeOptionsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOptionsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOptionsAttribute(IntegerAttributeCallback callback) { - reportOptionsAttribute(chipClusterPtr, callback); - } - public void readOnOffTransitionTimeAttribute(IntegerAttributeCallback callback) { readOnOffTransitionTimeAttribute(chipClusterPtr, callback); } @@ -6773,14 +5996,10 @@ public void writeOnOffTransitionTimeAttribute(DefaultClusterCallback callback, I } public void subscribeOnOffTransitionTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOnOffTransitionTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOnOffTransitionTimeAttribute(IntegerAttributeCallback callback) { - reportOnOffTransitionTimeAttribute(chipClusterPtr, callback); - } - public void readOnLevelAttribute(OnLevelAttributeCallback callback) { readOnLevelAttribute(chipClusterPtr, callback); } @@ -6790,14 +6009,10 @@ public void writeOnLevelAttribute(DefaultClusterCallback callback, @Nullable Int } public void subscribeOnLevelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + OnLevelAttributeCallback callback, int minInterval, int maxInterval) { subscribeOnLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOnLevelAttribute(IntegerAttributeCallback callback) { - reportOnLevelAttribute(chipClusterPtr, callback); - } - public void readOnTransitionTimeAttribute(OnTransitionTimeAttributeCallback callback) { readOnTransitionTimeAttribute(chipClusterPtr, callback); } @@ -6808,14 +6023,10 @@ public void writeOnTransitionTimeAttribute( } public void subscribeOnTransitionTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + OnTransitionTimeAttributeCallback callback, int minInterval, int maxInterval) { subscribeOnTransitionTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOnTransitionTimeAttribute(IntegerAttributeCallback callback) { - reportOnTransitionTimeAttribute(chipClusterPtr, callback); - } - public void readOffTransitionTimeAttribute(OffTransitionTimeAttributeCallback callback) { readOffTransitionTimeAttribute(chipClusterPtr, callback); } @@ -6826,14 +6037,10 @@ public void writeOffTransitionTimeAttribute( } public void subscribeOffTransitionTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + OffTransitionTimeAttributeCallback callback, int minInterval, int maxInterval) { subscribeOffTransitionTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOffTransitionTimeAttribute(IntegerAttributeCallback callback) { - reportOffTransitionTimeAttribute(chipClusterPtr, callback); - } - public void readDefaultMoveRateAttribute(DefaultMoveRateAttributeCallback callback) { readDefaultMoveRateAttribute(chipClusterPtr, callback); } @@ -6844,14 +6051,10 @@ public void writeDefaultMoveRateAttribute( } public void subscribeDefaultMoveRateAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + DefaultMoveRateAttributeCallback callback, int minInterval, int maxInterval) { subscribeDefaultMoveRateAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportDefaultMoveRateAttribute(IntegerAttributeCallback callback) { - reportDefaultMoveRateAttribute(chipClusterPtr, callback); - } - public void readStartUpCurrentLevelAttribute(IntegerAttributeCallback callback) { readStartUpCurrentLevelAttribute(chipClusterPtr, callback); } @@ -6861,14 +6064,10 @@ public void writeStartUpCurrentLevelAttribute(DefaultClusterCallback callback, I } public void subscribeStartUpCurrentLevelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeStartUpCurrentLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportStartUpCurrentLevelAttribute(IntegerAttributeCallback callback) { - reportStartUpCurrentLevelAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -6878,76 +6077,51 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readCurrentLevelAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentLevelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentLevelAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRemainingTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRemainingTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRemainingTimeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinLevelAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinLevelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinLevelAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxLevelAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxLevelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxLevelAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentFrequencyAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentFrequencyAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentFrequencyAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinFrequencyAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinFrequencyAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinFrequencyAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxFrequencyAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxFrequencyAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxFrequencyAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readOptionsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -6956,10 +6130,7 @@ private native void writeOptionsAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOptionsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOptionsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readOnOffTransitionTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -6968,10 +6139,7 @@ private native void writeOnOffTransitionTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOnOffTransitionTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOnOffTransitionTimeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readOnLevelAttribute( long chipClusterPtr, OnLevelAttributeCallback callback); @@ -6980,10 +6148,7 @@ private native void writeOnLevelAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeOnLevelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOnLevelAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, OnLevelAttributeCallback callback, int minInterval, int maxInterval); private native void readOnTransitionTimeAttribute( long chipClusterPtr, OnTransitionTimeAttributeCallback callback); @@ -6992,10 +6157,10 @@ private native void writeOnTransitionTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeOnTransitionTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOnTransitionTimeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + OnTransitionTimeAttributeCallback callback, + int minInterval, + int maxInterval); private native void readOffTransitionTimeAttribute( long chipClusterPtr, OffTransitionTimeAttributeCallback callback); @@ -7004,10 +6169,10 @@ private native void writeOffTransitionTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeOffTransitionTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOffTransitionTimeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + OffTransitionTimeAttributeCallback callback, + int minInterval, + int maxInterval); private native void readDefaultMoveRateAttribute( long chipClusterPtr, DefaultMoveRateAttributeCallback callback); @@ -7016,10 +6181,10 @@ private native void writeDefaultMoveRateAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeDefaultMoveRateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportDefaultMoveRateAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + DefaultMoveRateAttributeCallback callback, + int minInterval, + int maxInterval); private native void readStartUpCurrentLevelAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -7028,10 +6193,7 @@ private native void writeStartUpCurrentLevelAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeStartUpCurrentLevelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportStartUpCurrentLevelAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -7040,10 +6202,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class LowPowerCluster extends BaseChipCluster { @@ -7068,6 +6227,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -7079,14 +6240,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -7094,10 +6251,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class MediaInputCluster extends BaseChipCluster { @@ -7112,31 +6266,33 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void hideInputStatus(DefaultClusterCallback callback) { - hideInputStatus(chipClusterPtr, callback); + public void hideInputStatusRequest(DefaultClusterCallback callback) { + hideInputStatusRequest(chipClusterPtr, callback); } - public void renameInput(DefaultClusterCallback callback, Integer index, String name) { - renameInput(chipClusterPtr, callback, index, name); + public void renameInputRequest(DefaultClusterCallback callback, Integer index, String name) { + renameInputRequest(chipClusterPtr, callback, index, name); } - public void selectInput(DefaultClusterCallback callback, Integer index) { - selectInput(chipClusterPtr, callback, index); + public void selectInputRequest(DefaultClusterCallback callback, Integer index) { + selectInputRequest(chipClusterPtr, callback, index); } - public void showInputStatus(DefaultClusterCallback callback) { - showInputStatus(chipClusterPtr, callback); + public void showInputStatusRequest(DefaultClusterCallback callback) { + showInputStatusRequest(chipClusterPtr, callback); } - private native void hideInputStatus(long chipClusterPtr, DefaultClusterCallback Callback); + private native void hideInputStatusRequest( + long chipClusterPtr, DefaultClusterCallback Callback); - private native void renameInput( + private native void renameInputRequest( long chipClusterPtr, DefaultClusterCallback Callback, Integer index, String name); - private native void selectInput( + private native void selectInputRequest( long chipClusterPtr, DefaultClusterCallback Callback, Integer index); - private native void showInputStatus(long chipClusterPtr, DefaultClusterCallback Callback); + private native void showInputStatusRequest( + long chipClusterPtr, DefaultClusterCallback Callback); public static class MediaInputListAttribute { public Integer index; @@ -7179,12 +6335,16 @@ public interface MediaInputListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readMediaInputListAttribute(MediaInputListAttributeCallback callback) { @@ -7196,14 +6356,10 @@ public void readCurrentMediaInputAttribute(IntegerAttributeCallback callback) { } public void subscribeCurrentMediaInputAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentMediaInputAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentMediaInputAttribute(IntegerAttributeCallback callback) { - reportCurrentMediaInputAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -7213,14 +6369,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readMediaInputListAttribute( long chipClusterPtr, MediaInputListAttributeCallback callback); @@ -7228,10 +6380,7 @@ private native void readCurrentMediaInputAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentMediaInputAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentMediaInputAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -7240,10 +6389,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class MediaPlaybackCluster extends BaseChipCluster { @@ -7258,145 +6404,79 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void mediaFastForward(MediaFastForwardResponseCallback callback) { - mediaFastForward(chipClusterPtr, callback); - } - - public void mediaNext(MediaNextResponseCallback callback) { - mediaNext(chipClusterPtr, callback); - } - - public void mediaPause(MediaPauseResponseCallback callback) { - mediaPause(chipClusterPtr, callback); - } - - public void mediaPlay(MediaPlayResponseCallback callback) { - mediaPlay(chipClusterPtr, callback); - } - - public void mediaPrevious(MediaPreviousResponseCallback callback) { - mediaPrevious(chipClusterPtr, callback); + public void fastForwardRequest(PlaybackResponseCallback callback) { + fastForwardRequest(chipClusterPtr, callback); } - public void mediaRewind(MediaRewindResponseCallback callback) { - mediaRewind(chipClusterPtr, callback); + public void nextRequest(PlaybackResponseCallback callback) { + nextRequest(chipClusterPtr, callback); } - public void mediaSeek(MediaSeekResponseCallback callback, Long position) { - mediaSeek(chipClusterPtr, callback, position); + public void pauseRequest(PlaybackResponseCallback callback) { + pauseRequest(chipClusterPtr, callback); } - public void mediaSkipBackward( - MediaSkipBackwardResponseCallback callback, Long deltaPositionMilliseconds) { - mediaSkipBackward(chipClusterPtr, callback, deltaPositionMilliseconds); + public void playRequest(PlaybackResponseCallback callback) { + playRequest(chipClusterPtr, callback); } - public void mediaSkipForward( - MediaSkipForwardResponseCallback callback, Long deltaPositionMilliseconds) { - mediaSkipForward(chipClusterPtr, callback, deltaPositionMilliseconds); + public void previousRequest(PlaybackResponseCallback callback) { + previousRequest(chipClusterPtr, callback); } - public void mediaStartOver(MediaStartOverResponseCallback callback) { - mediaStartOver(chipClusterPtr, callback); + public void rewindRequest(PlaybackResponseCallback callback) { + rewindRequest(chipClusterPtr, callback); } - public void mediaStop(MediaStopResponseCallback callback) { - mediaStop(chipClusterPtr, callback); + public void seekRequest(PlaybackResponseCallback callback, Long position) { + seekRequest(chipClusterPtr, callback, position); } - private native void mediaFastForward( - long chipClusterPtr, MediaFastForwardResponseCallback Callback); - - private native void mediaNext(long chipClusterPtr, MediaNextResponseCallback Callback); - - private native void mediaPause(long chipClusterPtr, MediaPauseResponseCallback Callback); - - private native void mediaPlay(long chipClusterPtr, MediaPlayResponseCallback Callback); - - private native void mediaPrevious(long chipClusterPtr, MediaPreviousResponseCallback Callback); - - private native void mediaRewind(long chipClusterPtr, MediaRewindResponseCallback Callback); - - private native void mediaSeek( - long chipClusterPtr, MediaSeekResponseCallback Callback, Long position); - - private native void mediaSkipBackward( - long chipClusterPtr, - MediaSkipBackwardResponseCallback Callback, - Long deltaPositionMilliseconds); - - private native void mediaSkipForward( - long chipClusterPtr, - MediaSkipForwardResponseCallback Callback, - Long deltaPositionMilliseconds); - - private native void mediaStartOver( - long chipClusterPtr, MediaStartOverResponseCallback Callback); - - private native void mediaStop(long chipClusterPtr, MediaStopResponseCallback Callback); - - public interface MediaFastForwardResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); - - void onError(Exception error); + public void skipBackwardRequest( + PlaybackResponseCallback callback, Long deltaPositionMilliseconds) { + skipBackwardRequest(chipClusterPtr, callback, deltaPositionMilliseconds); } - public interface MediaNextResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); - - void onError(Exception error); + public void skipForwardRequest( + PlaybackResponseCallback callback, Long deltaPositionMilliseconds) { + skipForwardRequest(chipClusterPtr, callback, deltaPositionMilliseconds); } - public interface MediaPauseResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); - - void onError(Exception error); + public void startOverRequest(PlaybackResponseCallback callback) { + startOverRequest(chipClusterPtr, callback); } - public interface MediaPlayResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); - - void onError(Exception error); + public void stopRequest(PlaybackResponseCallback callback) { + stopRequest(chipClusterPtr, callback); } - public interface MediaPreviousResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); + private native void fastForwardRequest(long chipClusterPtr, PlaybackResponseCallback Callback); - void onError(Exception error); - } + private native void nextRequest(long chipClusterPtr, PlaybackResponseCallback Callback); - public interface MediaRewindResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); - - void onError(Exception error); - } + private native void pauseRequest(long chipClusterPtr, PlaybackResponseCallback Callback); - public interface MediaSeekResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); + private native void playRequest(long chipClusterPtr, PlaybackResponseCallback Callback); - void onError(Exception error); - } + private native void previousRequest(long chipClusterPtr, PlaybackResponseCallback Callback); - public interface MediaSkipBackwardResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); + private native void rewindRequest(long chipClusterPtr, PlaybackResponseCallback Callback); - void onError(Exception error); - } + private native void seekRequest( + long chipClusterPtr, PlaybackResponseCallback Callback, Long position); - public interface MediaSkipForwardResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); + private native void skipBackwardRequest( + long chipClusterPtr, PlaybackResponseCallback Callback, Long deltaPositionMilliseconds); - void onError(Exception error); - } + private native void skipForwardRequest( + long chipClusterPtr, PlaybackResponseCallback Callback, Long deltaPositionMilliseconds); - public interface MediaStartOverResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); + private native void startOverRequest(long chipClusterPtr, PlaybackResponseCallback Callback); - void onError(Exception error); - } + private native void stopRequest(long chipClusterPtr, PlaybackResponseCallback Callback); - public interface MediaStopResponseCallback { - void onSuccess(Integer mediaPlaybackStatus); + public interface PlaybackResponseCallback { + void onSuccess(Integer status); void onError(Exception error); } @@ -7405,6 +6485,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readPlaybackStateAttribute(IntegerAttributeCallback callback) { @@ -7412,40 +6494,28 @@ public void readPlaybackStateAttribute(IntegerAttributeCallback callback) { } public void subscribePlaybackStateAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePlaybackStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPlaybackStateAttribute(IntegerAttributeCallback callback) { - reportPlaybackStateAttribute(chipClusterPtr, callback); - } - public void readStartTimeAttribute(LongAttributeCallback callback) { readStartTimeAttribute(chipClusterPtr, callback); } public void subscribeStartTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeStartTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportStartTimeAttribute(LongAttributeCallback callback) { - reportStartTimeAttribute(chipClusterPtr, callback); - } - public void readDurationAttribute(LongAttributeCallback callback) { readDurationAttribute(chipClusterPtr, callback); } public void subscribeDurationAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeDurationAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportDurationAttribute(LongAttributeCallback callback) { - reportDurationAttribute(chipClusterPtr, callback); - } - public void readPlaybackSpeedAttribute(FloatAttributeCallback callback) { readPlaybackSpeedAttribute(chipClusterPtr, callback); } @@ -7455,27 +6525,19 @@ public void readSeekRangeEndAttribute(LongAttributeCallback callback) { } public void subscribeSeekRangeEndAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeSeekRangeEndAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSeekRangeEndAttribute(LongAttributeCallback callback) { - reportSeekRangeEndAttribute(chipClusterPtr, callback); - } - public void readSeekRangeStartAttribute(LongAttributeCallback callback) { readSeekRangeStartAttribute(chipClusterPtr, callback); } public void subscribeSeekRangeStartAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeSeekRangeStartAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSeekRangeStartAttribute(LongAttributeCallback callback) { - reportSeekRangeStartAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -7485,38 +6547,25 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readPlaybackStateAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePlaybackStateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPlaybackStateAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readStartTimeAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void subscribeStartTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportStartTimeAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readDurationAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void subscribeDurationAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportDurationAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readPlaybackSpeedAttribute( long chipClusterPtr, FloatAttributeCallback callback); @@ -7525,19 +6574,13 @@ private native void readSeekRangeEndAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeSeekRangeEndAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSeekRangeEndAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readSeekRangeStartAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeSeekRangeStartAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSeekRangeStartAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -7546,10 +6589,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class ModeSelectCluster extends BaseChipCluster { @@ -7605,12 +6645,16 @@ public interface SupportedModesAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readCurrentModeAttribute(IntegerAttributeCallback callback) { @@ -7618,14 +6662,10 @@ public void readCurrentModeAttribute(IntegerAttributeCallback callback) { } public void subscribeCurrentModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentModeAttribute(IntegerAttributeCallback callback) { - reportCurrentModeAttribute(chipClusterPtr, callback); - } - public void readSupportedModesAttribute(SupportedModesAttributeCallback callback) { readSupportedModesAttribute(chipClusterPtr, callback); } @@ -7639,40 +6679,28 @@ public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value) } public void subscribeOnModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOnModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOnModeAttribute(IntegerAttributeCallback callback) { - reportOnModeAttribute(chipClusterPtr, callback); - } - public void readStartUpModeAttribute(IntegerAttributeCallback callback) { readStartUpModeAttribute(chipClusterPtr, callback); } public void subscribeStartUpModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeStartUpModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportStartUpModeAttribute(IntegerAttributeCallback callback) { - reportStartUpModeAttribute(chipClusterPtr, callback); - } - public void readDescriptionAttribute(CharStringAttributeCallback callback) { readDescriptionAttribute(chipClusterPtr, callback); } public void subscribeDescriptionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportDescriptionAttribute(CharStringAttributeCallback callback) { - reportDescriptionAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -7682,22 +6710,15 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readCurrentModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readSupportedModesAttribute( long chipClusterPtr, SupportedModesAttributeCallback callback); @@ -7708,28 +6729,22 @@ private native void writeOnModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOnModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOnModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readStartUpModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeStartUpModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportStartUpModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readDescriptionAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeDescriptionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportDescriptionAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -7738,10 +6753,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class NetworkCommissioningCluster extends BaseChipCluster { @@ -7874,6 +6886,8 @@ public interface NetworksAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readMaxNetworksAttribute(IntegerAttributeCallback callback) { @@ -7917,27 +6931,19 @@ public void readFeatureMapAttribute(LongAttributeCallback callback) { } public void subscribeFeatureMapAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportFeatureMapAttribute(LongAttributeCallback callback) { - reportFeatureMapAttribute(chipClusterPtr, callback); - } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readMaxNetworksAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -7969,19 +6975,13 @@ private native void readFeatureMapAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeFeatureMapAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportFeatureMapAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class OtaSoftwareUpdateProviderCluster extends BaseChipCluster { @@ -8077,6 +7077,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -8088,14 +7090,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -8103,10 +7101,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class OtaSoftwareUpdateRequestorCluster extends BaseChipCluster { @@ -8123,48 +7118,87 @@ public static long clusterId() { public void announceOtaProvider( DefaultClusterCallback callback, - Long providerLocation, + Long providerNodeId, Integer vendorId, Integer announcementReason, - Optional metadataForNode) { + Optional metadataForNode, + Integer endpoint) { announceOtaProvider( chipClusterPtr, callback, - providerLocation, + providerNodeId, vendorId, announcementReason, - metadataForNode); + metadataForNode, + endpoint); } private native void announceOtaProvider( long chipClusterPtr, DefaultClusterCallback Callback, - Long providerLocation, + Long providerNodeId, Integer vendorId, Integer announcementReason, - Optional metadataForNode); + Optional metadataForNode, + Integer endpoint); - public interface AttributeListAttributeCallback { - void onSuccess(List valueList); + public static class DefaultOtaProvidersAttribute { + public Integer fabricIndex; + public Long providerNodeID; + public Integer endpoint; - void onError(Exception ex); + public DefaultOtaProvidersAttribute( + Integer fabricIndex, Long providerNodeID, Integer endpoint) { + this.fabricIndex = fabricIndex; + this.providerNodeID = providerNodeID; + this.endpoint = endpoint; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(""); + output.append("int fabricIndex: "); + output.append(this.fabricIndex); + output.append("\n"); + + output.append("long providerNodeID: "); + output.append(this.providerNodeID); + output.append("\n"); + + output.append("int endpoint: "); + output.append(this.endpoint); + output.append("\n"); + + return output.toString(); + } } - public void readDefaultOtaProviderAttribute(OctetStringAttributeCallback callback) { - readDefaultOtaProviderAttribute(chipClusterPtr, callback); + public interface DefaultOtaProvidersAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} } - public void writeDefaultOtaProviderAttribute(DefaultClusterCallback callback, byte[] value) { - writeDefaultOtaProviderAttribute(chipClusterPtr, callback, value); + public interface UpdateStateProgressAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} } - public void subscribeDefaultOtaProviderAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeDefaultOtaProviderAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} } - public void reportDefaultOtaProviderAttribute(OctetStringAttributeCallback callback) { - reportDefaultOtaProviderAttribute(chipClusterPtr, callback); + public void readDefaultOtaProvidersAttribute(DefaultOtaProvidersAttributeCallback callback) { + readDefaultOtaProvidersAttribute(chipClusterPtr, callback); } public void readUpdatePossibleAttribute(BooleanAttributeCallback callback) { @@ -8172,12 +7206,26 @@ public void readUpdatePossibleAttribute(BooleanAttributeCallback callback) { } public void subscribeUpdatePossibleAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeUpdatePossibleAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportUpdatePossibleAttribute(BooleanAttributeCallback callback) { - reportUpdatePossibleAttribute(chipClusterPtr, callback); + public void readUpdateStateAttribute(IntegerAttributeCallback callback) { + readUpdateStateAttribute(chipClusterPtr, callback); + } + + public void subscribeUpdateStateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUpdateStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readUpdateStateProgressAttribute(UpdateStateProgressAttributeCallback callback) { + readUpdateStateProgressAttribute(chipClusterPtr, callback); + } + + public void subscribeUpdateStateProgressAttribute( + UpdateStateProgressAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUpdateStateProgressAttribute(chipClusterPtr, callback, minInterval, maxInterval); } public void readAttributeListAttribute(AttributeListAttributeCallback callback) { @@ -8189,34 +7237,33 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - - private native void readDefaultOtaProviderAttribute( - long chipClusterPtr, OctetStringAttributeCallback callback); - - private native void writeDefaultOtaProviderAttribute( - long chipClusterPtr, DefaultClusterCallback callback, byte[] value); - - private native void subscribeDefaultOtaProviderAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportDefaultOtaProviderAttribute( - long chipClusterPtr, OctetStringAttributeCallback callback); + private native void readDefaultOtaProvidersAttribute( + long chipClusterPtr, DefaultOtaProvidersAttributeCallback callback); private native void readUpdatePossibleAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void subscribeUpdatePossibleAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); - private native void reportUpdatePossibleAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + private native void readUpdateStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeUpdateStateAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readUpdateStateProgressAttribute( + long chipClusterPtr, UpdateStateProgressAttributeCallback callback); + + private native void subscribeUpdateStateProgressAttribute( + long chipClusterPtr, + UpdateStateProgressAttributeCallback callback, + int minInterval, + int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -8225,10 +7272,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class OccupancySensingCluster extends BaseChipCluster { @@ -8247,6 +7291,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readOccupancyAttribute(IntegerAttributeCallback callback) { @@ -8254,41 +7300,29 @@ public void readOccupancyAttribute(IntegerAttributeCallback callback) { } public void subscribeOccupancyAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOccupancyAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOccupancyAttribute(IntegerAttributeCallback callback) { - reportOccupancyAttribute(chipClusterPtr, callback); - } - public void readOccupancySensorTypeAttribute(IntegerAttributeCallback callback) { readOccupancySensorTypeAttribute(chipClusterPtr, callback); } public void subscribeOccupancySensorTypeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOccupancySensorTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOccupancySensorTypeAttribute(IntegerAttributeCallback callback) { - reportOccupancySensorTypeAttribute(chipClusterPtr, callback); - } - public void readOccupancySensorTypeBitmapAttribute(IntegerAttributeCallback callback) { readOccupancySensorTypeBitmapAttribute(chipClusterPtr, callback); } public void subscribeOccupancySensorTypeBitmapAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOccupancySensorTypeBitmapAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOccupancySensorTypeBitmapAttribute(IntegerAttributeCallback callback) { - reportOccupancySensorTypeBitmapAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -8298,40 +7332,27 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readOccupancyAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeOccupancyAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOccupancyAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readOccupancySensorTypeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeOccupancySensorTypeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOccupancySensorTypeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readOccupancySensorTypeBitmapAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeOccupancySensorTypeBitmapAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOccupancySensorTypeBitmapAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -8340,10 +7361,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class OnOffCluster extends BaseChipCluster { @@ -8413,6 +7431,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readOnOffAttribute(BooleanAttributeCallback callback) { @@ -8420,27 +7440,19 @@ public void readOnOffAttribute(BooleanAttributeCallback callback) { } public void subscribeOnOffAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeOnOffAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOnOffAttribute(BooleanAttributeCallback callback) { - reportOnOffAttribute(chipClusterPtr, callback); - } - public void readGlobalSceneControlAttribute(BooleanAttributeCallback callback) { readGlobalSceneControlAttribute(chipClusterPtr, callback); } public void subscribeGlobalSceneControlAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeGlobalSceneControlAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportGlobalSceneControlAttribute(BooleanAttributeCallback callback) { - reportGlobalSceneControlAttribute(chipClusterPtr, callback); - } - public void readOnTimeAttribute(IntegerAttributeCallback callback) { readOnTimeAttribute(chipClusterPtr, callback); } @@ -8450,14 +7462,10 @@ public void writeOnTimeAttribute(DefaultClusterCallback callback, Integer value) } public void subscribeOnTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOnTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOnTimeAttribute(IntegerAttributeCallback callback) { - reportOnTimeAttribute(chipClusterPtr, callback); - } - public void readOffWaitTimeAttribute(IntegerAttributeCallback callback) { readOffWaitTimeAttribute(chipClusterPtr, callback); } @@ -8467,14 +7475,10 @@ public void writeOffWaitTimeAttribute(DefaultClusterCallback callback, Integer v } public void subscribeOffWaitTimeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOffWaitTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOffWaitTimeAttribute(IntegerAttributeCallback callback) { - reportOffWaitTimeAttribute(chipClusterPtr, callback); - } - public void readStartUpOnOffAttribute(IntegerAttributeCallback callback) { readStartUpOnOffAttribute(chipClusterPtr, callback); } @@ -8484,14 +7488,10 @@ public void writeStartUpOnOffAttribute(DefaultClusterCallback callback, Integer } public void subscribeStartUpOnOffAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeStartUpOnOffAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportStartUpOnOffAttribute(IntegerAttributeCallback callback) { - reportStartUpOnOffAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -8501,43 +7501,29 @@ public void readFeatureMapAttribute(LongAttributeCallback callback) { } public void subscribeFeatureMapAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportFeatureMapAttribute(LongAttributeCallback callback) { - reportFeatureMapAttribute(chipClusterPtr, callback); - } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readOnOffAttribute(long chipClusterPtr, BooleanAttributeCallback callback); private native void subscribeOnOffAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOnOffAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readGlobalSceneControlAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void subscribeGlobalSceneControlAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportGlobalSceneControlAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readOnTimeAttribute(long chipClusterPtr, IntegerAttributeCallback callback); @@ -8545,10 +7531,7 @@ private native void writeOnTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOnTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOnTimeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readOffWaitTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -8557,10 +7540,7 @@ private native void writeOffWaitTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOffWaitTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOffWaitTimeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readStartUpOnOffAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -8569,10 +7549,7 @@ private native void writeStartUpOnOffAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeStartUpOnOffAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportStartUpOnOffAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -8581,19 +7558,13 @@ private native void readFeatureMapAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeFeatureMapAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportFeatureMapAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class OnOffSwitchConfigurationCluster extends BaseChipCluster { @@ -8612,6 +7583,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readSwitchTypeAttribute(IntegerAttributeCallback callback) { @@ -8619,14 +7592,10 @@ public void readSwitchTypeAttribute(IntegerAttributeCallback callback) { } public void subscribeSwitchTypeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeSwitchTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSwitchTypeAttribute(IntegerAttributeCallback callback) { - reportSwitchTypeAttribute(chipClusterPtr, callback); - } - public void readSwitchActionsAttribute(IntegerAttributeCallback callback) { readSwitchActionsAttribute(chipClusterPtr, callback); } @@ -8636,14 +7605,10 @@ public void writeSwitchActionsAttribute(DefaultClusterCallback callback, Integer } public void subscribeSwitchActionsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeSwitchActionsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSwitchActionsAttribute(IntegerAttributeCallback callback) { - reportSwitchActionsAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -8653,22 +7618,15 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readSwitchTypeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeSwitchTypeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSwitchTypeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readSwitchActionsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -8677,10 +7635,7 @@ private native void writeSwitchActionsAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeSwitchActionsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSwitchActionsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -8689,10 +7644,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class OperationalCredentialsCluster extends BaseChipCluster { @@ -8870,24 +7822,32 @@ public interface FabricsListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface TrustedRootCertificatesAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface CurrentFabricIndexAttributeCallback { void onSuccess(Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readFabricsListAttribute(FabricsListAttributeCallback callback) { @@ -8899,27 +7859,19 @@ public void readSupportedFabricsAttribute(IntegerAttributeCallback callback) { } public void subscribeSupportedFabricsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeSupportedFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSupportedFabricsAttribute(IntegerAttributeCallback callback) { - reportSupportedFabricsAttribute(chipClusterPtr, callback); - } - public void readCommissionedFabricsAttribute(IntegerAttributeCallback callback) { readCommissionedFabricsAttribute(chipClusterPtr, callback); } public void subscribeCommissionedFabricsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCommissionedFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCommissionedFabricsAttribute(IntegerAttributeCallback callback) { - reportCommissionedFabricsAttribute(chipClusterPtr, callback); - } - public void readTrustedRootCertificatesAttribute( TrustedRootCertificatesAttributeCallback callback) { readTrustedRootCertificatesAttribute(chipClusterPtr, callback); @@ -8930,14 +7882,10 @@ public void readCurrentFabricIndexAttribute(CurrentFabricIndexAttributeCallback } public void subscribeCurrentFabricIndexAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CurrentFabricIndexAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentFabricIndexAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentFabricIndexAttribute(IntegerAttributeCallback callback) { - reportCurrentFabricIndexAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -8947,14 +7895,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readFabricsListAttribute( long chipClusterPtr, FabricsListAttributeCallback callback); @@ -8962,19 +7906,13 @@ private native void readSupportedFabricsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeSupportedFabricsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSupportedFabricsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCommissionedFabricsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCommissionedFabricsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCommissionedFabricsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readTrustedRootCertificatesAttribute( long chipClusterPtr, TrustedRootCertificatesAttributeCallback callback); @@ -8983,10 +7921,10 @@ private native void readCurrentFabricIndexAttribute( long chipClusterPtr, CurrentFabricIndexAttributeCallback callback); private native void subscribeCurrentFabricIndexAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentFabricIndexAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + CurrentFabricIndexAttributeCallback callback, + int minInterval, + int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -8995,10 +7933,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class PowerSourceCluster extends BaseChipCluster { @@ -9017,12 +7952,16 @@ public interface ActiveBatteryFaultsAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readStatusAttribute(IntegerAttributeCallback callback) { @@ -9030,92 +7969,64 @@ public void readStatusAttribute(IntegerAttributeCallback callback) { } public void subscribeStatusAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportStatusAttribute(IntegerAttributeCallback callback) { - reportStatusAttribute(chipClusterPtr, callback); - } - public void readOrderAttribute(IntegerAttributeCallback callback) { readOrderAttribute(chipClusterPtr, callback); } public void subscribeOrderAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOrderAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOrderAttribute(IntegerAttributeCallback callback) { - reportOrderAttribute(chipClusterPtr, callback); - } - public void readDescriptionAttribute(CharStringAttributeCallback callback) { readDescriptionAttribute(chipClusterPtr, callback); } public void subscribeDescriptionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeDescriptionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportDescriptionAttribute(CharStringAttributeCallback callback) { - reportDescriptionAttribute(chipClusterPtr, callback); - } - public void readBatteryVoltageAttribute(LongAttributeCallback callback) { readBatteryVoltageAttribute(chipClusterPtr, callback); } public void subscribeBatteryVoltageAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeBatteryVoltageAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBatteryVoltageAttribute(LongAttributeCallback callback) { - reportBatteryVoltageAttribute(chipClusterPtr, callback); - } - public void readBatteryPercentRemainingAttribute(IntegerAttributeCallback callback) { readBatteryPercentRemainingAttribute(chipClusterPtr, callback); } public void subscribeBatteryPercentRemainingAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBatteryPercentRemainingAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBatteryPercentRemainingAttribute(IntegerAttributeCallback callback) { - reportBatteryPercentRemainingAttribute(chipClusterPtr, callback); - } - public void readBatteryTimeRemainingAttribute(LongAttributeCallback callback) { readBatteryTimeRemainingAttribute(chipClusterPtr, callback); } public void subscribeBatteryTimeRemainingAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeBatteryTimeRemainingAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBatteryTimeRemainingAttribute(LongAttributeCallback callback) { - reportBatteryTimeRemainingAttribute(chipClusterPtr, callback); - } - public void readBatteryChargeLevelAttribute(IntegerAttributeCallback callback) { readBatteryChargeLevelAttribute(chipClusterPtr, callback); } public void subscribeBatteryChargeLevelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBatteryChargeLevelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBatteryChargeLevelAttribute(IntegerAttributeCallback callback) { - reportBatteryChargeLevelAttribute(chipClusterPtr, callback); - } - public void readActiveBatteryFaultsAttribute(ActiveBatteryFaultsAttributeCallback callback) { readActiveBatteryFaultsAttribute(chipClusterPtr, callback); } @@ -9125,14 +8036,10 @@ public void readBatteryChargeStateAttribute(IntegerAttributeCallback callback) { } public void subscribeBatteryChargeStateAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBatteryChargeStateAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBatteryChargeStateAttribute(IntegerAttributeCallback callback) { - reportBatteryChargeStateAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -9142,87 +8049,61 @@ public void readFeatureMapAttribute(LongAttributeCallback callback) { } public void subscribeFeatureMapAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportFeatureMapAttribute(LongAttributeCallback callback) { - reportFeatureMapAttribute(chipClusterPtr, callback); - } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readStatusAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeStatusAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readOrderAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeOrderAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOrderAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readDescriptionAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeDescriptionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportDescriptionAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readBatteryVoltageAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeBatteryVoltageAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBatteryVoltageAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readBatteryPercentRemainingAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeBatteryPercentRemainingAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBatteryPercentRemainingAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readBatteryTimeRemainingAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeBatteryTimeRemainingAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBatteryTimeRemainingAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readBatteryChargeLevelAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeBatteryChargeLevelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBatteryChargeLevelAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readActiveBatteryFaultsAttribute( long chipClusterPtr, ActiveBatteryFaultsAttributeCallback callback); @@ -9231,10 +8112,7 @@ private native void readBatteryChargeStateAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeBatteryChargeStateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBatteryChargeStateAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -9243,19 +8121,13 @@ private native void readFeatureMapAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeFeatureMapAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportFeatureMapAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class PowerSourceConfigurationCluster extends BaseChipCluster { @@ -9274,12 +8146,16 @@ public interface SourcesAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readSourcesAttribute(SourcesAttributeCallback callback) { @@ -9320,6 +8196,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readMeasuredValueAttribute(IntegerAttributeCallback callback) { @@ -9327,40 +8205,28 @@ public void readMeasuredValueAttribute(IntegerAttributeCallback callback) { } public void subscribeMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readMinMeasuredValueAttribute(IntegerAttributeCallback callback) { readMinMeasuredValueAttribute(chipClusterPtr, callback); } public void subscribeMinMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMinMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { readMaxMeasuredValueAttribute(chipClusterPtr, callback); } public void subscribeMaxMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMaxMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -9370,40 +8236,27 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -9412,10 +8265,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class PumpConfigurationAndControlCluster extends BaseChipCluster { @@ -9434,18 +8284,24 @@ public interface LifetimeRunningHoursAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface LifetimeEnergyConsumedAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readMaxPressureAttribute(IntegerAttributeCallback callback) { @@ -9453,235 +8309,163 @@ public void readMaxPressureAttribute(IntegerAttributeCallback callback) { } public void subscribeMaxPressureAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxPressureAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxPressureAttribute(IntegerAttributeCallback callback) { - reportMaxPressureAttribute(chipClusterPtr, callback); - } - public void readMaxSpeedAttribute(IntegerAttributeCallback callback) { readMaxSpeedAttribute(chipClusterPtr, callback); } public void subscribeMaxSpeedAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxSpeedAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxSpeedAttribute(IntegerAttributeCallback callback) { - reportMaxSpeedAttribute(chipClusterPtr, callback); - } - public void readMaxFlowAttribute(IntegerAttributeCallback callback) { readMaxFlowAttribute(chipClusterPtr, callback); } public void subscribeMaxFlowAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxFlowAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxFlowAttribute(IntegerAttributeCallback callback) { - reportMaxFlowAttribute(chipClusterPtr, callback); - } - public void readMinConstPressureAttribute(IntegerAttributeCallback callback) { readMinConstPressureAttribute(chipClusterPtr, callback); } public void subscribeMinConstPressureAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinConstPressureAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinConstPressureAttribute(IntegerAttributeCallback callback) { - reportMinConstPressureAttribute(chipClusterPtr, callback); - } - public void readMaxConstPressureAttribute(IntegerAttributeCallback callback) { readMaxConstPressureAttribute(chipClusterPtr, callback); } public void subscribeMaxConstPressureAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxConstPressureAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxConstPressureAttribute(IntegerAttributeCallback callback) { - reportMaxConstPressureAttribute(chipClusterPtr, callback); - } - public void readMinCompPressureAttribute(IntegerAttributeCallback callback) { readMinCompPressureAttribute(chipClusterPtr, callback); } public void subscribeMinCompPressureAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinCompPressureAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinCompPressureAttribute(IntegerAttributeCallback callback) { - reportMinCompPressureAttribute(chipClusterPtr, callback); - } - public void readMaxCompPressureAttribute(IntegerAttributeCallback callback) { readMaxCompPressureAttribute(chipClusterPtr, callback); } public void subscribeMaxCompPressureAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxCompPressureAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxCompPressureAttribute(IntegerAttributeCallback callback) { - reportMaxCompPressureAttribute(chipClusterPtr, callback); - } - public void readMinConstSpeedAttribute(IntegerAttributeCallback callback) { readMinConstSpeedAttribute(chipClusterPtr, callback); } public void subscribeMinConstSpeedAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinConstSpeedAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinConstSpeedAttribute(IntegerAttributeCallback callback) { - reportMinConstSpeedAttribute(chipClusterPtr, callback); - } - public void readMaxConstSpeedAttribute(IntegerAttributeCallback callback) { readMaxConstSpeedAttribute(chipClusterPtr, callback); } public void subscribeMaxConstSpeedAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxConstSpeedAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxConstSpeedAttribute(IntegerAttributeCallback callback) { - reportMaxConstSpeedAttribute(chipClusterPtr, callback); - } - public void readMinConstFlowAttribute(IntegerAttributeCallback callback) { readMinConstFlowAttribute(chipClusterPtr, callback); } public void subscribeMinConstFlowAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinConstFlowAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinConstFlowAttribute(IntegerAttributeCallback callback) { - reportMinConstFlowAttribute(chipClusterPtr, callback); - } - public void readMaxConstFlowAttribute(IntegerAttributeCallback callback) { readMaxConstFlowAttribute(chipClusterPtr, callback); } public void subscribeMaxConstFlowAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxConstFlowAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxConstFlowAttribute(IntegerAttributeCallback callback) { - reportMaxConstFlowAttribute(chipClusterPtr, callback); - } - public void readMinConstTempAttribute(IntegerAttributeCallback callback) { readMinConstTempAttribute(chipClusterPtr, callback); } public void subscribeMinConstTempAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinConstTempAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinConstTempAttribute(IntegerAttributeCallback callback) { - reportMinConstTempAttribute(chipClusterPtr, callback); - } - public void readMaxConstTempAttribute(IntegerAttributeCallback callback) { readMaxConstTempAttribute(chipClusterPtr, callback); } public void subscribeMaxConstTempAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxConstTempAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxConstTempAttribute(IntegerAttributeCallback callback) { - reportMaxConstTempAttribute(chipClusterPtr, callback); - } - public void readPumpStatusAttribute(IntegerAttributeCallback callback) { readPumpStatusAttribute(chipClusterPtr, callback); } public void subscribePumpStatusAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePumpStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPumpStatusAttribute(IntegerAttributeCallback callback) { - reportPumpStatusAttribute(chipClusterPtr, callback); - } - public void readEffectiveOperationModeAttribute(IntegerAttributeCallback callback) { readEffectiveOperationModeAttribute(chipClusterPtr, callback); } public void subscribeEffectiveOperationModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeEffectiveOperationModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEffectiveOperationModeAttribute(IntegerAttributeCallback callback) { - reportEffectiveOperationModeAttribute(chipClusterPtr, callback); - } - public void readEffectiveControlModeAttribute(IntegerAttributeCallback callback) { readEffectiveControlModeAttribute(chipClusterPtr, callback); } public void subscribeEffectiveControlModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeEffectiveControlModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEffectiveControlModeAttribute(IntegerAttributeCallback callback) { - reportEffectiveControlModeAttribute(chipClusterPtr, callback); - } - public void readCapacityAttribute(IntegerAttributeCallback callback) { readCapacityAttribute(chipClusterPtr, callback); } public void subscribeCapacityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCapacityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCapacityAttribute(IntegerAttributeCallback callback) { - reportCapacityAttribute(chipClusterPtr, callback); - } - public void readSpeedAttribute(IntegerAttributeCallback callback) { readSpeedAttribute(chipClusterPtr, callback); } public void subscribeSpeedAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeSpeedAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSpeedAttribute(IntegerAttributeCallback callback) { - reportSpeedAttribute(chipClusterPtr, callback); - } - public void readLifetimeRunningHoursAttribute(LifetimeRunningHoursAttributeCallback callback) { readLifetimeRunningHoursAttribute(chipClusterPtr, callback); } @@ -9692,27 +8476,19 @@ public void writeLifetimeRunningHoursAttribute( } public void subscribeLifetimeRunningHoursAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LifetimeRunningHoursAttributeCallback callback, int minInterval, int maxInterval) { subscribeLifetimeRunningHoursAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLifetimeRunningHoursAttribute(LongAttributeCallback callback) { - reportLifetimeRunningHoursAttribute(chipClusterPtr, callback); - } - public void readPowerAttribute(LongAttributeCallback callback) { readPowerAttribute(chipClusterPtr, callback); } public void subscribePowerAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribePowerAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPowerAttribute(LongAttributeCallback callback) { - reportPowerAttribute(chipClusterPtr, callback); - } - public void readLifetimeEnergyConsumedAttribute( LifetimeEnergyConsumedAttributeCallback callback) { readLifetimeEnergyConsumedAttribute(chipClusterPtr, callback); @@ -9724,14 +8500,10 @@ public void writeLifetimeEnergyConsumedAttribute( } public void subscribeLifetimeEnergyConsumedAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LifetimeEnergyConsumedAttributeCallback callback, int minInterval, int maxInterval) { subscribeLifetimeEnergyConsumedAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLifetimeEnergyConsumedAttribute(LongAttributeCallback callback) { - reportLifetimeEnergyConsumedAttribute(chipClusterPtr, callback); - } - public void readOperationModeAttribute(IntegerAttributeCallback callback) { readOperationModeAttribute(chipClusterPtr, callback); } @@ -9741,14 +8513,10 @@ public void writeOperationModeAttribute(DefaultClusterCallback callback, Integer } public void subscribeOperationModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOperationModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOperationModeAttribute(IntegerAttributeCallback callback) { - reportOperationModeAttribute(chipClusterPtr, callback); - } - public void readControlModeAttribute(IntegerAttributeCallback callback) { readControlModeAttribute(chipClusterPtr, callback); } @@ -9758,27 +8526,19 @@ public void writeControlModeAttribute(DefaultClusterCallback callback, Integer v } public void subscribeControlModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeControlModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportControlModeAttribute(IntegerAttributeCallback callback) { - reportControlModeAttribute(chipClusterPtr, callback); - } - public void readAlarmMaskAttribute(IntegerAttributeCallback callback) { readAlarmMaskAttribute(chipClusterPtr, callback); } public void subscribeAlarmMaskAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeAlarmMaskAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportAlarmMaskAttribute(IntegerAttributeCallback callback) { - reportAlarmMaskAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -9788,187 +8548,125 @@ public void readFeatureMapAttribute(LongAttributeCallback callback) { } public void subscribeFeatureMapAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportFeatureMapAttribute(LongAttributeCallback callback) { - reportFeatureMapAttribute(chipClusterPtr, callback); - } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readMaxPressureAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxPressureAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxPressureAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxSpeedAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxSpeedAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxSpeedAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxFlowAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxFlowAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxFlowAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinConstPressureAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinConstPressureAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinConstPressureAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxConstPressureAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxConstPressureAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxConstPressureAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinCompPressureAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinCompPressureAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinCompPressureAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxCompPressureAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxCompPressureAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxCompPressureAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinConstSpeedAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinConstSpeedAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinConstSpeedAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxConstSpeedAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxConstSpeedAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxConstSpeedAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinConstFlowAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinConstFlowAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinConstFlowAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxConstFlowAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxConstFlowAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxConstFlowAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinConstTempAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinConstTempAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinConstTempAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxConstTempAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxConstTempAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxConstTempAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPumpStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePumpStatusAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPumpStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readEffectiveOperationModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeEffectiveOperationModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEffectiveOperationModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readEffectiveControlModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeEffectiveControlModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEffectiveControlModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCapacityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCapacityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCapacityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readSpeedAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeSpeedAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSpeedAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readLifetimeRunningHoursAttribute( long chipClusterPtr, LifetimeRunningHoursAttributeCallback callback); @@ -9977,17 +8675,15 @@ private native void writeLifetimeRunningHoursAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeLifetimeRunningHoursAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLifetimeRunningHoursAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + LifetimeRunningHoursAttributeCallback callback, + int minInterval, + int maxInterval); private native void readPowerAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void subscribePowerAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPowerAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readLifetimeEnergyConsumedAttribute( long chipClusterPtr, LifetimeEnergyConsumedAttributeCallback callback); @@ -9996,10 +8692,10 @@ private native void writeLifetimeEnergyConsumedAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeLifetimeEnergyConsumedAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLifetimeEnergyConsumedAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + LifetimeEnergyConsumedAttributeCallback callback, + int minInterval, + int maxInterval); private native void readOperationModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -10008,10 +8704,7 @@ private native void writeOperationModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOperationModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOperationModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readControlModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -10020,19 +8713,13 @@ private native void writeControlModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeControlModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportControlModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAlarmMaskAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeAlarmMaskAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportAlarmMaskAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -10041,19 +8728,13 @@ private native void readFeatureMapAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeFeatureMapAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportFeatureMapAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class RelativeHumidityMeasurementCluster extends BaseChipCluster { @@ -10072,6 +8753,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readMeasuredValueAttribute(IntegerAttributeCallback callback) { @@ -10079,53 +8762,37 @@ public void readMeasuredValueAttribute(IntegerAttributeCallback callback) { } public void subscribeMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readMinMeasuredValueAttribute(IntegerAttributeCallback callback) { readMinMeasuredValueAttribute(chipClusterPtr, callback); } public void subscribeMinMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMinMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { readMaxMeasuredValueAttribute(chipClusterPtr, callback); } public void subscribeMaxMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMaxMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readToleranceAttribute(IntegerAttributeCallback callback) { readToleranceAttribute(chipClusterPtr, callback); } public void subscribeToleranceAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeToleranceAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportToleranceAttribute(IntegerAttributeCallback callback) { - reportToleranceAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -10135,49 +8802,33 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readToleranceAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeToleranceAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportToleranceAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -10186,10 +8837,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class ScenesCluster extends BaseChipCluster { @@ -10334,6 +8982,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readSceneCountAttribute(IntegerAttributeCallback callback) { @@ -10341,66 +8991,46 @@ public void readSceneCountAttribute(IntegerAttributeCallback callback) { } public void subscribeSceneCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeSceneCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSceneCountAttribute(IntegerAttributeCallback callback) { - reportSceneCountAttribute(chipClusterPtr, callback); - } - public void readCurrentSceneAttribute(IntegerAttributeCallback callback) { readCurrentSceneAttribute(chipClusterPtr, callback); } public void subscribeCurrentSceneAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentSceneAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentSceneAttribute(IntegerAttributeCallback callback) { - reportCurrentSceneAttribute(chipClusterPtr, callback); - } - public void readCurrentGroupAttribute(IntegerAttributeCallback callback) { readCurrentGroupAttribute(chipClusterPtr, callback); } public void subscribeCurrentGroupAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentGroupAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentGroupAttribute(IntegerAttributeCallback callback) { - reportCurrentGroupAttribute(chipClusterPtr, callback); - } - public void readSceneValidAttribute(BooleanAttributeCallback callback) { readSceneValidAttribute(chipClusterPtr, callback); } public void subscribeSceneValidAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeSceneValidAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSceneValidAttribute(BooleanAttributeCallback callback) { - reportSceneValidAttribute(chipClusterPtr, callback); - } - public void readNameSupportAttribute(IntegerAttributeCallback callback) { readNameSupportAttribute(chipClusterPtr, callback); } public void subscribeNameSupportAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeNameSupportAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNameSupportAttribute(IntegerAttributeCallback callback) { - reportNameSupportAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -10410,58 +9040,39 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readSceneCountAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeSceneCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSceneCountAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentSceneAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentSceneAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentSceneAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentGroupAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentGroupAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentGroupAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readSceneValidAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void subscribeSceneValidAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSceneValidAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readNameSupportAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeNameSupportAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNameSupportAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -10470,10 +9081,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class SoftwareDiagnosticsCluster extends BaseChipCluster { @@ -10541,12 +9149,16 @@ public interface ThreadMetricsAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readThreadMetricsAttribute(ThreadMetricsAttributeCallback callback) { @@ -10558,41 +9170,29 @@ public void readCurrentHeapFreeAttribute(LongAttributeCallback callback) { } public void subscribeCurrentHeapFreeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentHeapFreeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentHeapFreeAttribute(LongAttributeCallback callback) { - reportCurrentHeapFreeAttribute(chipClusterPtr, callback); - } - public void readCurrentHeapUsedAttribute(LongAttributeCallback callback) { readCurrentHeapUsedAttribute(chipClusterPtr, callback); } public void subscribeCurrentHeapUsedAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentHeapUsedAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentHeapUsedAttribute(LongAttributeCallback callback) { - reportCurrentHeapUsedAttribute(chipClusterPtr, callback); - } - public void readCurrentHeapHighWatermarkAttribute(LongAttributeCallback callback) { readCurrentHeapHighWatermarkAttribute(chipClusterPtr, callback); } public void subscribeCurrentHeapHighWatermarkAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentHeapHighWatermarkAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentHeapHighWatermarkAttribute(LongAttributeCallback callback) { - reportCurrentHeapHighWatermarkAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -10606,14 +9206,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readThreadMetricsAttribute( long chipClusterPtr, ThreadMetricsAttributeCallback callback); @@ -10621,28 +9217,19 @@ private native void readCurrentHeapFreeAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeCurrentHeapFreeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentHeapFreeAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentHeapUsedAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeCurrentHeapUsedAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentHeapUsedAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentHeapHighWatermarkAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeCurrentHeapHighWatermarkAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentHeapHighWatermarkAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -10654,10 +9241,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class SwitchCluster extends BaseChipCluster { @@ -10676,6 +9260,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readNumberOfPositionsAttribute(IntegerAttributeCallback callback) { @@ -10683,40 +9269,28 @@ public void readNumberOfPositionsAttribute(IntegerAttributeCallback callback) { } public void subscribeNumberOfPositionsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeNumberOfPositionsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNumberOfPositionsAttribute(IntegerAttributeCallback callback) { - reportNumberOfPositionsAttribute(chipClusterPtr, callback); - } - public void readCurrentPositionAttribute(IntegerAttributeCallback callback) { readCurrentPositionAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentPositionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentPositionAttribute(IntegerAttributeCallback callback) { - reportCurrentPositionAttribute(chipClusterPtr, callback); - } - public void readMultiPressMaxAttribute(IntegerAttributeCallback callback) { readMultiPressMaxAttribute(chipClusterPtr, callback); } public void subscribeMultiPressMaxAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMultiPressMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMultiPressMaxAttribute(IntegerAttributeCallback callback) { - reportMultiPressMaxAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -10726,53 +9300,36 @@ public void readFeatureMapAttribute(LongAttributeCallback callback) { } public void subscribeFeatureMapAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportFeatureMapAttribute(LongAttributeCallback callback) { - reportFeatureMapAttribute(chipClusterPtr, callback); - } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readNumberOfPositionsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeNumberOfPositionsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNumberOfPositionsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentPositionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeCurrentPositionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentPositionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMultiPressMaxAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMultiPressMaxAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMultiPressMaxAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -10781,160 +9338,13 @@ private native void readFeatureMapAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeFeatureMapAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportFeatureMapAttribute( - long chipClusterPtr, LongAttributeCallback callback); - - private native void readClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - } - - public static class TvChannelCluster extends BaseChipCluster { - public TvChannelCluster(long devicePtr, int endpointId) { - super(devicePtr, endpointId); - } - - public static long clusterId() { - return Long.parseUnsignedLong("1284"); - } - - @Override - public native long initWithDevice(long devicePtr, int endpointId); - - public void changeChannel(ChangeChannelResponseCallback callback, String match) { - changeChannel(chipClusterPtr, callback, match); - } - - public void changeChannelByNumber( - DefaultClusterCallback callback, Integer majorNumber, Integer minorNumber) { - changeChannelByNumber(chipClusterPtr, callback, majorNumber, minorNumber); - } - - public void skipChannel(DefaultClusterCallback callback, Integer count) { - skipChannel(chipClusterPtr, callback, count); - } - - private native void changeChannel( - long chipClusterPtr, ChangeChannelResponseCallback Callback, String match); - - private native void changeChannelByNumber( - long chipClusterPtr, - DefaultClusterCallback Callback, - Integer majorNumber, - Integer minorNumber); - - private native void skipChannel( - long chipClusterPtr, DefaultClusterCallback Callback, Integer count); - - public interface ChangeChannelResponseCallback { - void onSuccess( // channelMatch: Struct TvChannelInfo - // Conversion from this type to Java is not properly implemented yet - Integer errorType); - - void onError(Exception error); - } - - public static class ChannelListAttribute { - public Integer majorNumber; - public Integer minorNumber; - public String name; - public String callSign; - public String affiliateCallSign; - - public ChannelListAttribute( - Integer majorNumber, - Integer minorNumber, - String name, - String callSign, - String affiliateCallSign) { - this.majorNumber = majorNumber; - this.minorNumber = minorNumber; - this.name = name; - this.callSign = callSign; - this.affiliateCallSign = affiliateCallSign; - } - - @Override - public String toString() { - StringBuilder output = new StringBuilder(""); - output.append("int majorNumber: "); - output.append(this.majorNumber); - output.append("\n"); - - output.append("int minorNumber: "); - output.append(this.minorNumber); - output.append("\n"); - - output.append("String name: "); - output.append(this.name); - output.append("\n"); - - output.append("String callSign: "); - output.append(this.callSign); - output.append("\n"); - - output.append("String affiliateCallSign: "); - output.append(this.affiliateCallSign); - output.append("\n"); - - return output.toString(); - } - } - - public interface ChannelListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - } - - public interface AttributeListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - } - - public void readChannelListAttribute(ChannelListAttributeCallback callback) { - readChannelListAttribute(chipClusterPtr, callback); - } - - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { - readAttributeListAttribute(chipClusterPtr, callback); - } - - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { - readClusterRevisionAttribute(chipClusterPtr, callback); - } - - public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { - subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - - private native void readChannelListAttribute( - long chipClusterPtr, ChannelListAttributeCallback callback); - - private native void readAttributeListAttribute( - long chipClusterPtr, AttributeListAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class TargetNavigatorCluster extends BaseChipCluster { @@ -10949,12 +9359,12 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void navigateTarget( + public void navigateTargetRequest( NavigateTargetResponseCallback callback, Integer target, String data) { - navigateTarget(chipClusterPtr, callback, target, data); + navigateTargetRequest(chipClusterPtr, callback, target, data); } - private native void navigateTarget( + private native void navigateTargetRequest( long chipClusterPtr, NavigateTargetResponseCallback Callback, Integer target, String data); public interface NavigateTargetResponseCallback { @@ -10991,12 +9401,16 @@ public interface TargetNavigatorListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readTargetNavigatorListAttribute(TargetNavigatorListAttributeCallback callback) { @@ -11007,6 +9421,11 @@ public void readCurrentNavigatorTargetAttribute(IntegerAttributeCallback callbac readCurrentNavigatorTargetAttribute(chipClusterPtr, callback); } + public void subscribeCurrentNavigatorTargetAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeCurrentNavigatorTargetAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -11016,20 +9435,19 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readTargetNavigatorListAttribute( long chipClusterPtr, TargetNavigatorListAttributeCallback callback); private native void readCurrentNavigatorTargetAttribute( long chipClusterPtr, IntegerAttributeCallback callback); + private native void subscribeCurrentNavigatorTargetAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -11037,10 +9455,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class TemperatureMeasurementCluster extends BaseChipCluster { @@ -11059,6 +9474,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readMeasuredValueAttribute(IntegerAttributeCallback callback) { @@ -11066,53 +9483,37 @@ public void readMeasuredValueAttribute(IntegerAttributeCallback callback) { } public void subscribeMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readMinMeasuredValueAttribute(IntegerAttributeCallback callback) { readMinMeasuredValueAttribute(chipClusterPtr, callback); } public void subscribeMinMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMinMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { readMaxMeasuredValueAttribute(chipClusterPtr, callback); } public void subscribeMaxMeasuredValueAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxMeasuredValueAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { - reportMaxMeasuredValueAttribute(chipClusterPtr, callback); - } - public void readToleranceAttribute(IntegerAttributeCallback callback) { readToleranceAttribute(chipClusterPtr, callback); } public void subscribeToleranceAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeToleranceAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportToleranceAttribute(IntegerAttributeCallback callback) { - reportToleranceAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -11122,49 +9523,33 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMinMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeMaxMeasuredValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readToleranceAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeToleranceAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportToleranceAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -11173,10 +9558,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class TestClusterCluster extends BaseChipCluster { @@ -11432,12 +9814,16 @@ public interface ListInt8uAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface ListOctetStringAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public static class ListStructOctetStringAttribute { @@ -11468,12 +9854,16 @@ public interface ListStructOctetStringAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface VendorIdAttributeCallback { void onSuccess(Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public static class ListNullablesAndOptionalsStructAttribute { @@ -11511,210 +9901,280 @@ public interface ListNullablesAndOptionalsStructAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface ListLongOctetStringAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableBooleanAttributeCallback { void onSuccess(@Nullable Boolean value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableBitmap8AttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableBitmap16AttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableBitmap32AttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableBitmap64AttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt8uAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt16uAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt24uAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt32uAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt40uAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt48uAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt56uAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt64uAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt8sAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt16sAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt24sAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt32sAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt40sAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt48sAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt56sAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableInt64sAttributeCallback { void onSuccess(@Nullable Long value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableEnum8AttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableEnum16AttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableFloatSingleAttributeCallback { void onSuccess(@Nullable Float value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableFloatDoubleAttributeCallback { void onSuccess(@Nullable Double value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableOctetStringAttributeCallback { void onSuccess(@Nullable byte[] value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableCharStringAttributeCallback { void onSuccess(@Nullable String value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableEnumAttrAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableRangeRestrictedInt8uAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableRangeRestrictedInt8sAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableRangeRestrictedInt16uAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface NullableRangeRestrictedInt16sAttributeCallback { void onSuccess(@Nullable Integer value); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readBooleanAttribute(BooleanAttributeCallback callback) { @@ -11726,14 +10186,10 @@ public void writeBooleanAttribute(DefaultClusterCallback callback, Boolean value } public void subscribeBooleanAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeBooleanAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBooleanAttribute(BooleanAttributeCallback callback) { - reportBooleanAttribute(chipClusterPtr, callback); - } - public void readBitmap8Attribute(IntegerAttributeCallback callback) { readBitmap8Attribute(chipClusterPtr, callback); } @@ -11743,14 +10199,10 @@ public void writeBitmap8Attribute(DefaultClusterCallback callback, Integer value } public void subscribeBitmap8Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBitmap8Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBitmap8Attribute(IntegerAttributeCallback callback) { - reportBitmap8Attribute(chipClusterPtr, callback); - } - public void readBitmap16Attribute(IntegerAttributeCallback callback) { readBitmap16Attribute(chipClusterPtr, callback); } @@ -11760,14 +10212,10 @@ public void writeBitmap16Attribute(DefaultClusterCallback callback, Integer valu } public void subscribeBitmap16Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBitmap16Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBitmap16Attribute(IntegerAttributeCallback callback) { - reportBitmap16Attribute(chipClusterPtr, callback); - } - public void readBitmap32Attribute(LongAttributeCallback callback) { readBitmap32Attribute(chipClusterPtr, callback); } @@ -11777,14 +10225,10 @@ public void writeBitmap32Attribute(DefaultClusterCallback callback, Long value) } public void subscribeBitmap32Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeBitmap32Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBitmap32Attribute(LongAttributeCallback callback) { - reportBitmap32Attribute(chipClusterPtr, callback); - } - public void readBitmap64Attribute(LongAttributeCallback callback) { readBitmap64Attribute(chipClusterPtr, callback); } @@ -11794,14 +10238,10 @@ public void writeBitmap64Attribute(DefaultClusterCallback callback, Long value) } public void subscribeBitmap64Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeBitmap64Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBitmap64Attribute(LongAttributeCallback callback) { - reportBitmap64Attribute(chipClusterPtr, callback); - } - public void readInt8uAttribute(IntegerAttributeCallback callback) { readInt8uAttribute(chipClusterPtr, callback); } @@ -11811,14 +10251,10 @@ public void writeInt8uAttribute(DefaultClusterCallback callback, Integer value) } public void subscribeInt8uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt8uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt8uAttribute(IntegerAttributeCallback callback) { - reportInt8uAttribute(chipClusterPtr, callback); - } - public void readInt16uAttribute(IntegerAttributeCallback callback) { readInt16uAttribute(chipClusterPtr, callback); } @@ -11828,14 +10264,10 @@ public void writeInt16uAttribute(DefaultClusterCallback callback, Integer value) } public void subscribeInt16uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt16uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt16uAttribute(IntegerAttributeCallback callback) { - reportInt16uAttribute(chipClusterPtr, callback); - } - public void readInt24uAttribute(LongAttributeCallback callback) { readInt24uAttribute(chipClusterPtr, callback); } @@ -11845,14 +10277,10 @@ public void writeInt24uAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt24uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt24uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt24uAttribute(LongAttributeCallback callback) { - reportInt24uAttribute(chipClusterPtr, callback); - } - public void readInt32uAttribute(LongAttributeCallback callback) { readInt32uAttribute(chipClusterPtr, callback); } @@ -11862,14 +10290,10 @@ public void writeInt32uAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt32uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt32uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt32uAttribute(LongAttributeCallback callback) { - reportInt32uAttribute(chipClusterPtr, callback); - } - public void readInt40uAttribute(LongAttributeCallback callback) { readInt40uAttribute(chipClusterPtr, callback); } @@ -11879,14 +10303,10 @@ public void writeInt40uAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt40uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt40uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt40uAttribute(LongAttributeCallback callback) { - reportInt40uAttribute(chipClusterPtr, callback); - } - public void readInt48uAttribute(LongAttributeCallback callback) { readInt48uAttribute(chipClusterPtr, callback); } @@ -11896,14 +10316,10 @@ public void writeInt48uAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt48uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt48uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt48uAttribute(LongAttributeCallback callback) { - reportInt48uAttribute(chipClusterPtr, callback); - } - public void readInt56uAttribute(LongAttributeCallback callback) { readInt56uAttribute(chipClusterPtr, callback); } @@ -11913,14 +10329,10 @@ public void writeInt56uAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt56uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt56uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt56uAttribute(LongAttributeCallback callback) { - reportInt56uAttribute(chipClusterPtr, callback); - } - public void readInt64uAttribute(LongAttributeCallback callback) { readInt64uAttribute(chipClusterPtr, callback); } @@ -11930,14 +10342,10 @@ public void writeInt64uAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt64uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt64uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt64uAttribute(LongAttributeCallback callback) { - reportInt64uAttribute(chipClusterPtr, callback); - } - public void readInt8sAttribute(IntegerAttributeCallback callback) { readInt8sAttribute(chipClusterPtr, callback); } @@ -11947,14 +10355,10 @@ public void writeInt8sAttribute(DefaultClusterCallback callback, Integer value) } public void subscribeInt8sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt8sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt8sAttribute(IntegerAttributeCallback callback) { - reportInt8sAttribute(chipClusterPtr, callback); - } - public void readInt16sAttribute(IntegerAttributeCallback callback) { readInt16sAttribute(chipClusterPtr, callback); } @@ -11964,14 +10368,10 @@ public void writeInt16sAttribute(DefaultClusterCallback callback, Integer value) } public void subscribeInt16sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt16sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt16sAttribute(IntegerAttributeCallback callback) { - reportInt16sAttribute(chipClusterPtr, callback); - } - public void readInt24sAttribute(LongAttributeCallback callback) { readInt24sAttribute(chipClusterPtr, callback); } @@ -11981,14 +10381,10 @@ public void writeInt24sAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt24sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt24sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt24sAttribute(LongAttributeCallback callback) { - reportInt24sAttribute(chipClusterPtr, callback); - } - public void readInt32sAttribute(LongAttributeCallback callback) { readInt32sAttribute(chipClusterPtr, callback); } @@ -11998,14 +10394,10 @@ public void writeInt32sAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt32sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt32sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt32sAttribute(LongAttributeCallback callback) { - reportInt32sAttribute(chipClusterPtr, callback); - } - public void readInt40sAttribute(LongAttributeCallback callback) { readInt40sAttribute(chipClusterPtr, callback); } @@ -12015,14 +10407,10 @@ public void writeInt40sAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt40sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt40sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt40sAttribute(LongAttributeCallback callback) { - reportInt40sAttribute(chipClusterPtr, callback); - } - public void readInt48sAttribute(LongAttributeCallback callback) { readInt48sAttribute(chipClusterPtr, callback); } @@ -12032,14 +10420,10 @@ public void writeInt48sAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt48sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt48sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt48sAttribute(LongAttributeCallback callback) { - reportInt48sAttribute(chipClusterPtr, callback); - } - public void readInt56sAttribute(LongAttributeCallback callback) { readInt56sAttribute(chipClusterPtr, callback); } @@ -12049,14 +10433,10 @@ public void writeInt56sAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt56sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt56sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt56sAttribute(LongAttributeCallback callback) { - reportInt56sAttribute(chipClusterPtr, callback); - } - public void readInt64sAttribute(LongAttributeCallback callback) { readInt64sAttribute(chipClusterPtr, callback); } @@ -12066,14 +10446,10 @@ public void writeInt64sAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeInt64sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeInt64sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInt64sAttribute(LongAttributeCallback callback) { - reportInt64sAttribute(chipClusterPtr, callback); - } - public void readEnum8Attribute(IntegerAttributeCallback callback) { readEnum8Attribute(chipClusterPtr, callback); } @@ -12083,14 +10459,10 @@ public void writeEnum8Attribute(DefaultClusterCallback callback, Integer value) } public void subscribeEnum8Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeEnum8Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEnum8Attribute(IntegerAttributeCallback callback) { - reportEnum8Attribute(chipClusterPtr, callback); - } - public void readEnum16Attribute(IntegerAttributeCallback callback) { readEnum16Attribute(chipClusterPtr, callback); } @@ -12100,14 +10472,10 @@ public void writeEnum16Attribute(DefaultClusterCallback callback, Integer value) } public void subscribeEnum16Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeEnum16Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEnum16Attribute(IntegerAttributeCallback callback) { - reportEnum16Attribute(chipClusterPtr, callback); - } - public void readFloatSingleAttribute(FloatAttributeCallback callback) { readFloatSingleAttribute(chipClusterPtr, callback); } @@ -12117,14 +10485,10 @@ public void writeFloatSingleAttribute(DefaultClusterCallback callback, Float val } public void subscribeFloatSingleAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + FloatAttributeCallback callback, int minInterval, int maxInterval) { subscribeFloatSingleAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportFloatSingleAttribute(FloatAttributeCallback callback) { - reportFloatSingleAttribute(chipClusterPtr, callback); - } - public void readFloatDoubleAttribute(DoubleAttributeCallback callback) { readFloatDoubleAttribute(chipClusterPtr, callback); } @@ -12134,14 +10498,10 @@ public void writeFloatDoubleAttribute(DefaultClusterCallback callback, Double va } public void subscribeFloatDoubleAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + DoubleAttributeCallback callback, int minInterval, int maxInterval) { subscribeFloatDoubleAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportFloatDoubleAttribute(DoubleAttributeCallback callback) { - reportFloatDoubleAttribute(chipClusterPtr, callback); - } - public void readOctetStringAttribute(OctetStringAttributeCallback callback) { readOctetStringAttribute(chipClusterPtr, callback); } @@ -12151,14 +10511,10 @@ public void writeOctetStringAttribute(DefaultClusterCallback callback, byte[] va } public void subscribeOctetStringAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + OctetStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeOctetStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOctetStringAttribute(OctetStringAttributeCallback callback) { - reportOctetStringAttribute(chipClusterPtr, callback); - } - public void readListInt8uAttribute(ListInt8uAttributeCallback callback) { readListInt8uAttribute(chipClusterPtr, callback); } @@ -12181,14 +10537,10 @@ public void writeLongOctetStringAttribute(DefaultClusterCallback callback, byte[ } public void subscribeLongOctetStringAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + OctetStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeLongOctetStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLongOctetStringAttribute(OctetStringAttributeCallback callback) { - reportLongOctetStringAttribute(chipClusterPtr, callback); - } - public void readCharStringAttribute(CharStringAttributeCallback callback) { readCharStringAttribute(chipClusterPtr, callback); } @@ -12198,14 +10550,10 @@ public void writeCharStringAttribute(DefaultClusterCallback callback, String val } public void subscribeCharStringAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeCharStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCharStringAttribute(CharStringAttributeCallback callback) { - reportCharStringAttribute(chipClusterPtr, callback); - } - public void readLongCharStringAttribute(CharStringAttributeCallback callback) { readLongCharStringAttribute(chipClusterPtr, callback); } @@ -12215,14 +10563,10 @@ public void writeLongCharStringAttribute(DefaultClusterCallback callback, String } public void subscribeLongCharStringAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeLongCharStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLongCharStringAttribute(CharStringAttributeCallback callback) { - reportLongCharStringAttribute(chipClusterPtr, callback); - } - public void readEpochUsAttribute(LongAttributeCallback callback) { readEpochUsAttribute(chipClusterPtr, callback); } @@ -12232,14 +10576,10 @@ public void writeEpochUsAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeEpochUsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeEpochUsAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEpochUsAttribute(LongAttributeCallback callback) { - reportEpochUsAttribute(chipClusterPtr, callback); - } - public void readEpochSAttribute(LongAttributeCallback callback) { readEpochSAttribute(chipClusterPtr, callback); } @@ -12249,14 +10589,10 @@ public void writeEpochSAttribute(DefaultClusterCallback callback, Long value) { } public void subscribeEpochSAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeEpochSAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEpochSAttribute(LongAttributeCallback callback) { - reportEpochSAttribute(chipClusterPtr, callback); - } - public void readVendorIdAttribute(VendorIdAttributeCallback callback) { readVendorIdAttribute(chipClusterPtr, callback); } @@ -12266,14 +10602,10 @@ public void writeVendorIdAttribute(DefaultClusterCallback callback, Integer valu } public void subscribeVendorIdAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + VendorIdAttributeCallback callback, int minInterval, int maxInterval) { subscribeVendorIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportVendorIdAttribute(IntegerAttributeCallback callback) { - reportVendorIdAttribute(chipClusterPtr, callback); - } - public void readListNullablesAndOptionalsStructAttribute( ListNullablesAndOptionalsStructAttributeCallback callback) { readListNullablesAndOptionalsStructAttribute(chipClusterPtr, callback); @@ -12288,14 +10620,10 @@ public void writeEnumAttrAttribute(DefaultClusterCallback callback, Integer valu } public void subscribeEnumAttrAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeEnumAttrAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEnumAttrAttribute(IntegerAttributeCallback callback) { - reportEnumAttrAttribute(chipClusterPtr, callback); - } - public void readRangeRestrictedInt8uAttribute(IntegerAttributeCallback callback) { readRangeRestrictedInt8uAttribute(chipClusterPtr, callback); } @@ -12305,14 +10633,10 @@ public void writeRangeRestrictedInt8uAttribute(DefaultClusterCallback callback, } public void subscribeRangeRestrictedInt8uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRangeRestrictedInt8uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRangeRestrictedInt8uAttribute(IntegerAttributeCallback callback) { - reportRangeRestrictedInt8uAttribute(chipClusterPtr, callback); - } - public void readRangeRestrictedInt8sAttribute(IntegerAttributeCallback callback) { readRangeRestrictedInt8sAttribute(chipClusterPtr, callback); } @@ -12322,14 +10646,10 @@ public void writeRangeRestrictedInt8sAttribute(DefaultClusterCallback callback, } public void subscribeRangeRestrictedInt8sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRangeRestrictedInt8sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRangeRestrictedInt8sAttribute(IntegerAttributeCallback callback) { - reportRangeRestrictedInt8sAttribute(chipClusterPtr, callback); - } - public void readRangeRestrictedInt16uAttribute(IntegerAttributeCallback callback) { readRangeRestrictedInt16uAttribute(chipClusterPtr, callback); } @@ -12340,14 +10660,10 @@ public void writeRangeRestrictedInt16uAttribute( } public void subscribeRangeRestrictedInt16uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRangeRestrictedInt16uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRangeRestrictedInt16uAttribute(IntegerAttributeCallback callback) { - reportRangeRestrictedInt16uAttribute(chipClusterPtr, callback); - } - public void readRangeRestrictedInt16sAttribute(IntegerAttributeCallback callback) { readRangeRestrictedInt16sAttribute(chipClusterPtr, callback); } @@ -12358,14 +10674,10 @@ public void writeRangeRestrictedInt16sAttribute( } public void subscribeRangeRestrictedInt16sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRangeRestrictedInt16sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRangeRestrictedInt16sAttribute(IntegerAttributeCallback callback) { - reportRangeRestrictedInt16sAttribute(chipClusterPtr, callback); - } - public void readListLongOctetStringAttribute(ListLongOctetStringAttributeCallback callback) { readListLongOctetStringAttribute(chipClusterPtr, callback); } @@ -12387,14 +10699,10 @@ public void writeUnsupportedAttribute(DefaultClusterCallback callback, Boolean v } public void subscribeUnsupportedAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + BooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeUnsupportedAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportUnsupportedAttribute(BooleanAttributeCallback callback) { - reportUnsupportedAttribute(chipClusterPtr, callback); - } - public void readNullableBooleanAttribute(NullableBooleanAttributeCallback callback) { readNullableBooleanAttribute(chipClusterPtr, callback); } @@ -12405,14 +10713,10 @@ public void writeNullableBooleanAttribute( } public void subscribeNullableBooleanAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableBooleanAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableBooleanAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableBooleanAttribute(BooleanAttributeCallback callback) { - reportNullableBooleanAttribute(chipClusterPtr, callback); - } - public void readNullableBitmap8Attribute(NullableBitmap8AttributeCallback callback) { readNullableBitmap8Attribute(chipClusterPtr, callback); } @@ -12423,14 +10727,10 @@ public void writeNullableBitmap8Attribute( } public void subscribeNullableBitmap8Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableBitmap8AttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableBitmap8Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableBitmap8Attribute(IntegerAttributeCallback callback) { - reportNullableBitmap8Attribute(chipClusterPtr, callback); - } - public void readNullableBitmap16Attribute(NullableBitmap16AttributeCallback callback) { readNullableBitmap16Attribute(chipClusterPtr, callback); } @@ -12441,14 +10741,10 @@ public void writeNullableBitmap16Attribute( } public void subscribeNullableBitmap16Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableBitmap16AttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableBitmap16Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableBitmap16Attribute(IntegerAttributeCallback callback) { - reportNullableBitmap16Attribute(chipClusterPtr, callback); - } - public void readNullableBitmap32Attribute(NullableBitmap32AttributeCallback callback) { readNullableBitmap32Attribute(chipClusterPtr, callback); } @@ -12459,14 +10755,10 @@ public void writeNullableBitmap32Attribute( } public void subscribeNullableBitmap32Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableBitmap32AttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableBitmap32Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableBitmap32Attribute(LongAttributeCallback callback) { - reportNullableBitmap32Attribute(chipClusterPtr, callback); - } - public void readNullableBitmap64Attribute(NullableBitmap64AttributeCallback callback) { readNullableBitmap64Attribute(chipClusterPtr, callback); } @@ -12477,14 +10769,10 @@ public void writeNullableBitmap64Attribute( } public void subscribeNullableBitmap64Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableBitmap64AttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableBitmap64Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableBitmap64Attribute(LongAttributeCallback callback) { - reportNullableBitmap64Attribute(chipClusterPtr, callback); - } - public void readNullableInt8uAttribute(NullableInt8uAttributeCallback callback) { readNullableInt8uAttribute(chipClusterPtr, callback); } @@ -12495,14 +10783,10 @@ public void writeNullableInt8uAttribute( } public void subscribeNullableInt8uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt8uAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt8uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt8uAttribute(IntegerAttributeCallback callback) { - reportNullableInt8uAttribute(chipClusterPtr, callback); - } - public void readNullableInt16uAttribute(NullableInt16uAttributeCallback callback) { readNullableInt16uAttribute(chipClusterPtr, callback); } @@ -12513,14 +10797,10 @@ public void writeNullableInt16uAttribute( } public void subscribeNullableInt16uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt16uAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt16uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt16uAttribute(IntegerAttributeCallback callback) { - reportNullableInt16uAttribute(chipClusterPtr, callback); - } - public void readNullableInt24uAttribute(NullableInt24uAttributeCallback callback) { readNullableInt24uAttribute(chipClusterPtr, callback); } @@ -12531,14 +10811,10 @@ public void writeNullableInt24uAttribute( } public void subscribeNullableInt24uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt24uAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt24uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt24uAttribute(LongAttributeCallback callback) { - reportNullableInt24uAttribute(chipClusterPtr, callback); - } - public void readNullableInt32uAttribute(NullableInt32uAttributeCallback callback) { readNullableInt32uAttribute(chipClusterPtr, callback); } @@ -12549,14 +10825,10 @@ public void writeNullableInt32uAttribute( } public void subscribeNullableInt32uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt32uAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt32uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt32uAttribute(LongAttributeCallback callback) { - reportNullableInt32uAttribute(chipClusterPtr, callback); - } - public void readNullableInt40uAttribute(NullableInt40uAttributeCallback callback) { readNullableInt40uAttribute(chipClusterPtr, callback); } @@ -12567,14 +10839,10 @@ public void writeNullableInt40uAttribute( } public void subscribeNullableInt40uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt40uAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt40uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt40uAttribute(LongAttributeCallback callback) { - reportNullableInt40uAttribute(chipClusterPtr, callback); - } - public void readNullableInt48uAttribute(NullableInt48uAttributeCallback callback) { readNullableInt48uAttribute(chipClusterPtr, callback); } @@ -12585,14 +10853,10 @@ public void writeNullableInt48uAttribute( } public void subscribeNullableInt48uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt48uAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt48uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt48uAttribute(LongAttributeCallback callback) { - reportNullableInt48uAttribute(chipClusterPtr, callback); - } - public void readNullableInt56uAttribute(NullableInt56uAttributeCallback callback) { readNullableInt56uAttribute(chipClusterPtr, callback); } @@ -12603,14 +10867,10 @@ public void writeNullableInt56uAttribute( } public void subscribeNullableInt56uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt56uAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt56uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt56uAttribute(LongAttributeCallback callback) { - reportNullableInt56uAttribute(chipClusterPtr, callback); - } - public void readNullableInt64uAttribute(NullableInt64uAttributeCallback callback) { readNullableInt64uAttribute(chipClusterPtr, callback); } @@ -12621,14 +10881,10 @@ public void writeNullableInt64uAttribute( } public void subscribeNullableInt64uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt64uAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt64uAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt64uAttribute(LongAttributeCallback callback) { - reportNullableInt64uAttribute(chipClusterPtr, callback); - } - public void readNullableInt8sAttribute(NullableInt8sAttributeCallback callback) { readNullableInt8sAttribute(chipClusterPtr, callback); } @@ -12639,14 +10895,10 @@ public void writeNullableInt8sAttribute( } public void subscribeNullableInt8sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt8sAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt8sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt8sAttribute(IntegerAttributeCallback callback) { - reportNullableInt8sAttribute(chipClusterPtr, callback); - } - public void readNullableInt16sAttribute(NullableInt16sAttributeCallback callback) { readNullableInt16sAttribute(chipClusterPtr, callback); } @@ -12657,14 +10909,10 @@ public void writeNullableInt16sAttribute( } public void subscribeNullableInt16sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt16sAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt16sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt16sAttribute(IntegerAttributeCallback callback) { - reportNullableInt16sAttribute(chipClusterPtr, callback); - } - public void readNullableInt24sAttribute(NullableInt24sAttributeCallback callback) { readNullableInt24sAttribute(chipClusterPtr, callback); } @@ -12675,14 +10923,10 @@ public void writeNullableInt24sAttribute( } public void subscribeNullableInt24sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt24sAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt24sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt24sAttribute(LongAttributeCallback callback) { - reportNullableInt24sAttribute(chipClusterPtr, callback); - } - public void readNullableInt32sAttribute(NullableInt32sAttributeCallback callback) { readNullableInt32sAttribute(chipClusterPtr, callback); } @@ -12693,14 +10937,10 @@ public void writeNullableInt32sAttribute( } public void subscribeNullableInt32sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt32sAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt32sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt32sAttribute(LongAttributeCallback callback) { - reportNullableInt32sAttribute(chipClusterPtr, callback); - } - public void readNullableInt40sAttribute(NullableInt40sAttributeCallback callback) { readNullableInt40sAttribute(chipClusterPtr, callback); } @@ -12711,14 +10951,10 @@ public void writeNullableInt40sAttribute( } public void subscribeNullableInt40sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt40sAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt40sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt40sAttribute(LongAttributeCallback callback) { - reportNullableInt40sAttribute(chipClusterPtr, callback); - } - public void readNullableInt48sAttribute(NullableInt48sAttributeCallback callback) { readNullableInt48sAttribute(chipClusterPtr, callback); } @@ -12729,14 +10965,10 @@ public void writeNullableInt48sAttribute( } public void subscribeNullableInt48sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt48sAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt48sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt48sAttribute(LongAttributeCallback callback) { - reportNullableInt48sAttribute(chipClusterPtr, callback); - } - public void readNullableInt56sAttribute(NullableInt56sAttributeCallback callback) { readNullableInt56sAttribute(chipClusterPtr, callback); } @@ -12747,14 +10979,10 @@ public void writeNullableInt56sAttribute( } public void subscribeNullableInt56sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt56sAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt56sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt56sAttribute(LongAttributeCallback callback) { - reportNullableInt56sAttribute(chipClusterPtr, callback); - } - public void readNullableInt64sAttribute(NullableInt64sAttributeCallback callback) { readNullableInt64sAttribute(chipClusterPtr, callback); } @@ -12765,14 +10993,10 @@ public void writeNullableInt64sAttribute( } public void subscribeNullableInt64sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableInt64sAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableInt64sAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableInt64sAttribute(LongAttributeCallback callback) { - reportNullableInt64sAttribute(chipClusterPtr, callback); - } - public void readNullableEnum8Attribute(NullableEnum8AttributeCallback callback) { readNullableEnum8Attribute(chipClusterPtr, callback); } @@ -12783,14 +11007,10 @@ public void writeNullableEnum8Attribute( } public void subscribeNullableEnum8Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableEnum8AttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableEnum8Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableEnum8Attribute(IntegerAttributeCallback callback) { - reportNullableEnum8Attribute(chipClusterPtr, callback); - } - public void readNullableEnum16Attribute(NullableEnum16AttributeCallback callback) { readNullableEnum16Attribute(chipClusterPtr, callback); } @@ -12801,14 +11021,10 @@ public void writeNullableEnum16Attribute( } public void subscribeNullableEnum16Attribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableEnum16AttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableEnum16Attribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableEnum16Attribute(IntegerAttributeCallback callback) { - reportNullableEnum16Attribute(chipClusterPtr, callback); - } - public void readNullableFloatSingleAttribute(NullableFloatSingleAttributeCallback callback) { readNullableFloatSingleAttribute(chipClusterPtr, callback); } @@ -12819,14 +11035,10 @@ public void writeNullableFloatSingleAttribute( } public void subscribeNullableFloatSingleAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableFloatSingleAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableFloatSingleAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableFloatSingleAttribute(FloatAttributeCallback callback) { - reportNullableFloatSingleAttribute(chipClusterPtr, callback); - } - public void readNullableFloatDoubleAttribute(NullableFloatDoubleAttributeCallback callback) { readNullableFloatDoubleAttribute(chipClusterPtr, callback); } @@ -12837,14 +11049,10 @@ public void writeNullableFloatDoubleAttribute( } public void subscribeNullableFloatDoubleAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableFloatDoubleAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableFloatDoubleAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableFloatDoubleAttribute(DoubleAttributeCallback callback) { - reportNullableFloatDoubleAttribute(chipClusterPtr, callback); - } - public void readNullableOctetStringAttribute(NullableOctetStringAttributeCallback callback) { readNullableOctetStringAttribute(chipClusterPtr, callback); } @@ -12855,14 +11063,10 @@ public void writeNullableOctetStringAttribute( } public void subscribeNullableOctetStringAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableOctetStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableOctetStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableOctetStringAttribute(OctetStringAttributeCallback callback) { - reportNullableOctetStringAttribute(chipClusterPtr, callback); - } - public void readNullableCharStringAttribute(NullableCharStringAttributeCallback callback) { readNullableCharStringAttribute(chipClusterPtr, callback); } @@ -12873,14 +11077,10 @@ public void writeNullableCharStringAttribute( } public void subscribeNullableCharStringAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableCharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableCharStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableCharStringAttribute(CharStringAttributeCallback callback) { - reportNullableCharStringAttribute(chipClusterPtr, callback); - } - public void readNullableEnumAttrAttribute(NullableEnumAttrAttributeCallback callback) { readNullableEnumAttrAttribute(chipClusterPtr, callback); } @@ -12891,14 +11091,10 @@ public void writeNullableEnumAttrAttribute( } public void subscribeNullableEnumAttrAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableEnumAttrAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableEnumAttrAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableEnumAttrAttribute(IntegerAttributeCallback callback) { - reportNullableEnumAttrAttribute(chipClusterPtr, callback); - } - public void readNullableRangeRestrictedInt8uAttribute( NullableRangeRestrictedInt8uAttributeCallback callback) { readNullableRangeRestrictedInt8uAttribute(chipClusterPtr, callback); @@ -12910,15 +11106,11 @@ public void writeNullableRangeRestrictedInt8uAttribute( } public void subscribeNullableRangeRestrictedInt8uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableRangeRestrictedInt8uAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableRangeRestrictedInt8uAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableRangeRestrictedInt8uAttribute(IntegerAttributeCallback callback) { - reportNullableRangeRestrictedInt8uAttribute(chipClusterPtr, callback); - } - public void readNullableRangeRestrictedInt8sAttribute( NullableRangeRestrictedInt8sAttributeCallback callback) { readNullableRangeRestrictedInt8sAttribute(chipClusterPtr, callback); @@ -12930,15 +11122,11 @@ public void writeNullableRangeRestrictedInt8sAttribute( } public void subscribeNullableRangeRestrictedInt8sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableRangeRestrictedInt8sAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableRangeRestrictedInt8sAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableRangeRestrictedInt8sAttribute(IntegerAttributeCallback callback) { - reportNullableRangeRestrictedInt8sAttribute(chipClusterPtr, callback); - } - public void readNullableRangeRestrictedInt16uAttribute( NullableRangeRestrictedInt16uAttributeCallback callback) { readNullableRangeRestrictedInt16uAttribute(chipClusterPtr, callback); @@ -12950,15 +11138,11 @@ public void writeNullableRangeRestrictedInt16uAttribute( } public void subscribeNullableRangeRestrictedInt16uAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableRangeRestrictedInt16uAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableRangeRestrictedInt16uAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableRangeRestrictedInt16uAttribute(IntegerAttributeCallback callback) { - reportNullableRangeRestrictedInt16uAttribute(chipClusterPtr, callback); - } - public void readNullableRangeRestrictedInt16sAttribute( NullableRangeRestrictedInt16sAttributeCallback callback) { readNullableRangeRestrictedInt16sAttribute(chipClusterPtr, callback); @@ -12970,15 +11154,11 @@ public void writeNullableRangeRestrictedInt16sAttribute( } public void subscribeNullableRangeRestrictedInt16sAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + NullableRangeRestrictedInt16sAttributeCallback callback, int minInterval, int maxInterval) { subscribeNullableRangeRestrictedInt16sAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNullableRangeRestrictedInt16sAttribute(IntegerAttributeCallback callback) { - reportNullableRangeRestrictedInt16sAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -12988,14 +11168,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readBooleanAttribute( long chipClusterPtr, BooleanAttributeCallback callback); @@ -13003,10 +11179,7 @@ private native void writeBooleanAttribute( long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribeBooleanAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBooleanAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readBitmap8Attribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -13015,10 +11188,7 @@ private native void writeBitmap8Attribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeBitmap8Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBitmap8Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readBitmap16Attribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -13027,10 +11197,7 @@ private native void writeBitmap16Attribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeBitmap16Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBitmap16Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readBitmap32Attribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13038,10 +11205,7 @@ private native void writeBitmap32Attribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeBitmap32Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBitmap32Attribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readBitmap64Attribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13049,10 +11213,7 @@ private native void writeBitmap64Attribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeBitmap64Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBitmap64Attribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt8uAttribute(long chipClusterPtr, IntegerAttributeCallback callback); @@ -13060,10 +11221,7 @@ private native void writeInt8uAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeInt8uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt8uAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readInt16uAttribute(long chipClusterPtr, IntegerAttributeCallback callback); @@ -13071,10 +11229,7 @@ private native void writeInt16uAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeInt16uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt16uAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readInt24uAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13082,9 +11237,7 @@ private native void writeInt24uAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt24uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt24uAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt32uAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13092,9 +11245,7 @@ private native void writeInt32uAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt32uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt32uAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt40uAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13102,9 +11253,7 @@ private native void writeInt40uAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt40uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt40uAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt48uAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13112,9 +11261,7 @@ private native void writeInt48uAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt48uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt48uAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt56uAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13122,9 +11269,7 @@ private native void writeInt56uAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt56uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt56uAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt64uAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13132,9 +11277,7 @@ private native void writeInt64uAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt64uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt64uAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt8sAttribute(long chipClusterPtr, IntegerAttributeCallback callback); @@ -13142,10 +11285,7 @@ private native void writeInt8sAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeInt8sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt8sAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readInt16sAttribute(long chipClusterPtr, IntegerAttributeCallback callback); @@ -13153,10 +11293,7 @@ private native void writeInt16sAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeInt16sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt16sAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readInt24sAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13164,9 +11301,7 @@ private native void writeInt24sAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt24sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt24sAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt32sAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13174,9 +11309,7 @@ private native void writeInt32sAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt32sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt32sAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt40sAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13184,9 +11317,7 @@ private native void writeInt40sAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt40sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt40sAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt48sAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13194,9 +11325,7 @@ private native void writeInt48sAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt48sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt48sAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt56sAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13204,9 +11333,7 @@ private native void writeInt56sAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt56sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt56sAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readInt64sAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13214,9 +11341,7 @@ private native void writeInt64sAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt64sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInt64sAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readEnum8Attribute(long chipClusterPtr, IntegerAttributeCallback callback); @@ -13224,10 +11349,7 @@ private native void writeEnum8Attribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeEnum8Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEnum8Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readEnum16Attribute(long chipClusterPtr, IntegerAttributeCallback callback); @@ -13235,10 +11357,7 @@ private native void writeEnum16Attribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeEnum16Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEnum16Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readFloatSingleAttribute( long chipClusterPtr, FloatAttributeCallback callback); @@ -13247,10 +11366,7 @@ private native void writeFloatSingleAttribute( long chipClusterPtr, DefaultClusterCallback callback, Float value); private native void subscribeFloatSingleAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportFloatSingleAttribute( - long chipClusterPtr, FloatAttributeCallback callback); + long chipClusterPtr, FloatAttributeCallback callback, int minInterval, int maxInterval); private native void readFloatDoubleAttribute( long chipClusterPtr, DoubleAttributeCallback callback); @@ -13259,10 +11375,7 @@ private native void writeFloatDoubleAttribute( long chipClusterPtr, DefaultClusterCallback callback, Double value); private native void subscribeFloatDoubleAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportFloatDoubleAttribute( - long chipClusterPtr, DoubleAttributeCallback callback); + long chipClusterPtr, DoubleAttributeCallback callback, int minInterval, int maxInterval); private native void readOctetStringAttribute( long chipClusterPtr, OctetStringAttributeCallback callback); @@ -13271,10 +11384,10 @@ private native void writeOctetStringAttribute( long chipClusterPtr, DefaultClusterCallback callback, byte[] value); private native void subscribeOctetStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOctetStringAttribute( - long chipClusterPtr, OctetStringAttributeCallback callback); + long chipClusterPtr, + OctetStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readListInt8uAttribute( long chipClusterPtr, ListInt8uAttributeCallback callback); @@ -13292,10 +11405,10 @@ private native void writeLongOctetStringAttribute( long chipClusterPtr, DefaultClusterCallback callback, byte[] value); private native void subscribeLongOctetStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLongOctetStringAttribute( - long chipClusterPtr, OctetStringAttributeCallback callback); + long chipClusterPtr, + OctetStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readCharStringAttribute( long chipClusterPtr, CharStringAttributeCallback callback); @@ -13304,10 +11417,10 @@ private native void writeCharStringAttribute( long chipClusterPtr, DefaultClusterCallback callback, String value); private native void subscribeCharStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCharStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readLongCharStringAttribute( long chipClusterPtr, CharStringAttributeCallback callback); @@ -13316,10 +11429,10 @@ private native void writeLongCharStringAttribute( long chipClusterPtr, DefaultClusterCallback callback, String value); private native void subscribeLongCharStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLongCharStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readEpochUsAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13327,9 +11440,7 @@ private native void writeEpochUsAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeEpochUsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEpochUsAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readEpochSAttribute(long chipClusterPtr, LongAttributeCallback callback); @@ -13337,9 +11448,7 @@ private native void writeEpochSAttribute( long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeEpochSAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEpochSAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readVendorIdAttribute( long chipClusterPtr, VendorIdAttributeCallback callback); @@ -13348,10 +11457,7 @@ private native void writeVendorIdAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeVendorIdAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportVendorIdAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, VendorIdAttributeCallback callback, int minInterval, int maxInterval); private native void readListNullablesAndOptionalsStructAttribute( long chipClusterPtr, ListNullablesAndOptionalsStructAttributeCallback callback); @@ -13363,10 +11469,7 @@ private native void writeEnumAttrAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeEnumAttrAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEnumAttrAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRangeRestrictedInt8uAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -13375,10 +11478,7 @@ private native void writeRangeRestrictedInt8uAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeRangeRestrictedInt8uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRangeRestrictedInt8uAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRangeRestrictedInt8sAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -13387,10 +11487,7 @@ private native void writeRangeRestrictedInt8sAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeRangeRestrictedInt8sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRangeRestrictedInt8sAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRangeRestrictedInt16uAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -13399,10 +11496,7 @@ private native void writeRangeRestrictedInt16uAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeRangeRestrictedInt16uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRangeRestrictedInt16uAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRangeRestrictedInt16sAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -13411,10 +11505,7 @@ private native void writeRangeRestrictedInt16sAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeRangeRestrictedInt16sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRangeRestrictedInt16sAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readListLongOctetStringAttribute( long chipClusterPtr, ListLongOctetStringAttributeCallback callback); @@ -13432,10 +11523,7 @@ private native void writeUnsupportedAttribute( long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribeUnsupportedAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportUnsupportedAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); private native void readNullableBooleanAttribute( long chipClusterPtr, NullableBooleanAttributeCallback callback); @@ -13444,10 +11532,10 @@ private native void writeNullableBooleanAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Boolean value); private native void subscribeNullableBooleanAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableBooleanAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, + NullableBooleanAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableBitmap8Attribute( long chipClusterPtr, NullableBitmap8AttributeCallback callback); @@ -13456,10 +11544,10 @@ private native void writeNullableBitmap8Attribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableBitmap8Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableBitmap8Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableBitmap8AttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableBitmap16Attribute( long chipClusterPtr, NullableBitmap16AttributeCallback callback); @@ -13468,10 +11556,10 @@ private native void writeNullableBitmap16Attribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableBitmap16Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableBitmap16Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableBitmap16AttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableBitmap32Attribute( long chipClusterPtr, NullableBitmap32AttributeCallback callback); @@ -13480,10 +11568,10 @@ private native void writeNullableBitmap32Attribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableBitmap32Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableBitmap32Attribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableBitmap32AttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableBitmap64Attribute( long chipClusterPtr, NullableBitmap64AttributeCallback callback); @@ -13492,10 +11580,10 @@ private native void writeNullableBitmap64Attribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableBitmap64Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableBitmap64Attribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableBitmap64AttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt8uAttribute( long chipClusterPtr, NullableInt8uAttributeCallback callback); @@ -13504,10 +11592,10 @@ private native void writeNullableInt8uAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableInt8uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt8uAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableInt8uAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt16uAttribute( long chipClusterPtr, NullableInt16uAttributeCallback callback); @@ -13516,10 +11604,10 @@ private native void writeNullableInt16uAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableInt16uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt16uAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableInt16uAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt24uAttribute( long chipClusterPtr, NullableInt24uAttributeCallback callback); @@ -13528,10 +11616,10 @@ private native void writeNullableInt24uAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt24uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt24uAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt24uAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt32uAttribute( long chipClusterPtr, NullableInt32uAttributeCallback callback); @@ -13540,10 +11628,10 @@ private native void writeNullableInt32uAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt32uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt32uAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt32uAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt40uAttribute( long chipClusterPtr, NullableInt40uAttributeCallback callback); @@ -13552,10 +11640,10 @@ private native void writeNullableInt40uAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt40uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt40uAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt40uAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt48uAttribute( long chipClusterPtr, NullableInt48uAttributeCallback callback); @@ -13564,10 +11652,10 @@ private native void writeNullableInt48uAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt48uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt48uAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt48uAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt56uAttribute( long chipClusterPtr, NullableInt56uAttributeCallback callback); @@ -13576,10 +11664,10 @@ private native void writeNullableInt56uAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt56uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt56uAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt56uAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt64uAttribute( long chipClusterPtr, NullableInt64uAttributeCallback callback); @@ -13588,10 +11676,10 @@ private native void writeNullableInt64uAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt64uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt64uAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt64uAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt8sAttribute( long chipClusterPtr, NullableInt8sAttributeCallback callback); @@ -13600,10 +11688,10 @@ private native void writeNullableInt8sAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableInt8sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt8sAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableInt8sAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt16sAttribute( long chipClusterPtr, NullableInt16sAttributeCallback callback); @@ -13612,10 +11700,10 @@ private native void writeNullableInt16sAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableInt16sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt16sAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableInt16sAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt24sAttribute( long chipClusterPtr, NullableInt24sAttributeCallback callback); @@ -13624,10 +11712,10 @@ private native void writeNullableInt24sAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt24sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt24sAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt24sAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt32sAttribute( long chipClusterPtr, NullableInt32sAttributeCallback callback); @@ -13636,10 +11724,10 @@ private native void writeNullableInt32sAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt32sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt32sAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt32sAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt40sAttribute( long chipClusterPtr, NullableInt40sAttributeCallback callback); @@ -13648,10 +11736,10 @@ private native void writeNullableInt40sAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt40sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt40sAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt40sAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt48sAttribute( long chipClusterPtr, NullableInt48sAttributeCallback callback); @@ -13660,10 +11748,10 @@ private native void writeNullableInt48sAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt48sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt48sAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt48sAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt56sAttribute( long chipClusterPtr, NullableInt56sAttributeCallback callback); @@ -13672,10 +11760,10 @@ private native void writeNullableInt56sAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt56sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt56sAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt56sAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableInt64sAttribute( long chipClusterPtr, NullableInt64sAttributeCallback callback); @@ -13684,10 +11772,10 @@ private native void writeNullableInt64sAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt64sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableInt64sAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, + NullableInt64sAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableEnum8Attribute( long chipClusterPtr, NullableEnum8AttributeCallback callback); @@ -13696,10 +11784,10 @@ private native void writeNullableEnum8Attribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableEnum8Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableEnum8Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableEnum8AttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableEnum16Attribute( long chipClusterPtr, NullableEnum16AttributeCallback callback); @@ -13708,10 +11796,10 @@ private native void writeNullableEnum16Attribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableEnum16Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableEnum16Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableEnum16AttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableFloatSingleAttribute( long chipClusterPtr, NullableFloatSingleAttributeCallback callback); @@ -13720,10 +11808,10 @@ private native void writeNullableFloatSingleAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Float value); private native void subscribeNullableFloatSingleAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableFloatSingleAttribute( - long chipClusterPtr, FloatAttributeCallback callback); + long chipClusterPtr, + NullableFloatSingleAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableFloatDoubleAttribute( long chipClusterPtr, NullableFloatDoubleAttributeCallback callback); @@ -13732,10 +11820,10 @@ private native void writeNullableFloatDoubleAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Double value); private native void subscribeNullableFloatDoubleAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableFloatDoubleAttribute( - long chipClusterPtr, DoubleAttributeCallback callback); + long chipClusterPtr, + NullableFloatDoubleAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableOctetStringAttribute( long chipClusterPtr, NullableOctetStringAttributeCallback callback); @@ -13744,10 +11832,10 @@ private native void writeNullableOctetStringAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable byte[] value); private native void subscribeNullableOctetStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableOctetStringAttribute( - long chipClusterPtr, OctetStringAttributeCallback callback); + long chipClusterPtr, + NullableOctetStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableCharStringAttribute( long chipClusterPtr, NullableCharStringAttributeCallback callback); @@ -13756,10 +11844,10 @@ private native void writeNullableCharStringAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable String value); private native void subscribeNullableCharStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableCharStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + NullableCharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableEnumAttrAttribute( long chipClusterPtr, NullableEnumAttrAttributeCallback callback); @@ -13768,10 +11856,10 @@ private native void writeNullableEnumAttrAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableEnumAttrAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableEnumAttrAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableEnumAttrAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableRangeRestrictedInt8uAttribute( long chipClusterPtr, NullableRangeRestrictedInt8uAttributeCallback callback); @@ -13780,10 +11868,10 @@ private native void writeNullableRangeRestrictedInt8uAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableRangeRestrictedInt8uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableRangeRestrictedInt8uAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableRangeRestrictedInt8uAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableRangeRestrictedInt8sAttribute( long chipClusterPtr, NullableRangeRestrictedInt8sAttributeCallback callback); @@ -13792,10 +11880,10 @@ private native void writeNullableRangeRestrictedInt8sAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableRangeRestrictedInt8sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableRangeRestrictedInt8sAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableRangeRestrictedInt8sAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableRangeRestrictedInt16uAttribute( long chipClusterPtr, NullableRangeRestrictedInt16uAttributeCallback callback); @@ -13804,10 +11892,10 @@ private native void writeNullableRangeRestrictedInt16uAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableRangeRestrictedInt16uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableRangeRestrictedInt16uAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableRangeRestrictedInt16uAttributeCallback callback, + int minInterval, + int maxInterval); private native void readNullableRangeRestrictedInt16sAttribute( long chipClusterPtr, NullableRangeRestrictedInt16sAttributeCallback callback); @@ -13816,10 +11904,10 @@ private native void writeNullableRangeRestrictedInt16sAttribute( long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableRangeRestrictedInt16sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNullableRangeRestrictedInt16sAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + NullableRangeRestrictedInt16sAttributeCallback callback, + int minInterval, + int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -13828,10 +11916,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class ThermostatCluster extends BaseChipCluster { @@ -13928,6 +12013,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readLocalTemperatureAttribute(IntegerAttributeCallback callback) { @@ -13935,66 +12022,46 @@ public void readLocalTemperatureAttribute(IntegerAttributeCallback callback) { } public void subscribeLocalTemperatureAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeLocalTemperatureAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLocalTemperatureAttribute(IntegerAttributeCallback callback) { - reportLocalTemperatureAttribute(chipClusterPtr, callback); - } - public void readAbsMinHeatSetpointLimitAttribute(IntegerAttributeCallback callback) { readAbsMinHeatSetpointLimitAttribute(chipClusterPtr, callback); } public void subscribeAbsMinHeatSetpointLimitAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeAbsMinHeatSetpointLimitAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportAbsMinHeatSetpointLimitAttribute(IntegerAttributeCallback callback) { - reportAbsMinHeatSetpointLimitAttribute(chipClusterPtr, callback); - } - public void readAbsMaxHeatSetpointLimitAttribute(IntegerAttributeCallback callback) { readAbsMaxHeatSetpointLimitAttribute(chipClusterPtr, callback); } public void subscribeAbsMaxHeatSetpointLimitAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeAbsMaxHeatSetpointLimitAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportAbsMaxHeatSetpointLimitAttribute(IntegerAttributeCallback callback) { - reportAbsMaxHeatSetpointLimitAttribute(chipClusterPtr, callback); - } - public void readAbsMinCoolSetpointLimitAttribute(IntegerAttributeCallback callback) { readAbsMinCoolSetpointLimitAttribute(chipClusterPtr, callback); } public void subscribeAbsMinCoolSetpointLimitAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeAbsMinCoolSetpointLimitAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportAbsMinCoolSetpointLimitAttribute(IntegerAttributeCallback callback) { - reportAbsMinCoolSetpointLimitAttribute(chipClusterPtr, callback); - } - public void readAbsMaxCoolSetpointLimitAttribute(IntegerAttributeCallback callback) { readAbsMaxCoolSetpointLimitAttribute(chipClusterPtr, callback); } public void subscribeAbsMaxCoolSetpointLimitAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeAbsMaxCoolSetpointLimitAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportAbsMaxCoolSetpointLimitAttribute(IntegerAttributeCallback callback) { - reportAbsMaxCoolSetpointLimitAttribute(chipClusterPtr, callback); - } - public void readOccupiedCoolingSetpointAttribute(IntegerAttributeCallback callback) { readOccupiedCoolingSetpointAttribute(chipClusterPtr, callback); } @@ -14005,14 +12072,10 @@ public void writeOccupiedCoolingSetpointAttribute( } public void subscribeOccupiedCoolingSetpointAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOccupiedCoolingSetpointAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOccupiedCoolingSetpointAttribute(IntegerAttributeCallback callback) { - reportOccupiedCoolingSetpointAttribute(chipClusterPtr, callback); - } - public void readOccupiedHeatingSetpointAttribute(IntegerAttributeCallback callback) { readOccupiedHeatingSetpointAttribute(chipClusterPtr, callback); } @@ -14023,14 +12086,10 @@ public void writeOccupiedHeatingSetpointAttribute( } public void subscribeOccupiedHeatingSetpointAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOccupiedHeatingSetpointAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOccupiedHeatingSetpointAttribute(IntegerAttributeCallback callback) { - reportOccupiedHeatingSetpointAttribute(chipClusterPtr, callback); - } - public void readMinHeatSetpointLimitAttribute(IntegerAttributeCallback callback) { readMinHeatSetpointLimitAttribute(chipClusterPtr, callback); } @@ -14040,14 +12099,10 @@ public void writeMinHeatSetpointLimitAttribute(DefaultClusterCallback callback, } public void subscribeMinHeatSetpointLimitAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinHeatSetpointLimitAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinHeatSetpointLimitAttribute(IntegerAttributeCallback callback) { - reportMinHeatSetpointLimitAttribute(chipClusterPtr, callback); - } - public void readMaxHeatSetpointLimitAttribute(IntegerAttributeCallback callback) { readMaxHeatSetpointLimitAttribute(chipClusterPtr, callback); } @@ -14057,14 +12112,10 @@ public void writeMaxHeatSetpointLimitAttribute(DefaultClusterCallback callback, } public void subscribeMaxHeatSetpointLimitAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxHeatSetpointLimitAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxHeatSetpointLimitAttribute(IntegerAttributeCallback callback) { - reportMaxHeatSetpointLimitAttribute(chipClusterPtr, callback); - } - public void readMinCoolSetpointLimitAttribute(IntegerAttributeCallback callback) { readMinCoolSetpointLimitAttribute(chipClusterPtr, callback); } @@ -14074,14 +12125,10 @@ public void writeMinCoolSetpointLimitAttribute(DefaultClusterCallback callback, } public void subscribeMinCoolSetpointLimitAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinCoolSetpointLimitAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinCoolSetpointLimitAttribute(IntegerAttributeCallback callback) { - reportMinCoolSetpointLimitAttribute(chipClusterPtr, callback); - } - public void readMaxCoolSetpointLimitAttribute(IntegerAttributeCallback callback) { readMaxCoolSetpointLimitAttribute(chipClusterPtr, callback); } @@ -14091,14 +12138,10 @@ public void writeMaxCoolSetpointLimitAttribute(DefaultClusterCallback callback, } public void subscribeMaxCoolSetpointLimitAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMaxCoolSetpointLimitAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMaxCoolSetpointLimitAttribute(IntegerAttributeCallback callback) { - reportMaxCoolSetpointLimitAttribute(chipClusterPtr, callback); - } - public void readMinSetpointDeadBandAttribute(IntegerAttributeCallback callback) { readMinSetpointDeadBandAttribute(chipClusterPtr, callback); } @@ -14108,14 +12151,10 @@ public void writeMinSetpointDeadBandAttribute(DefaultClusterCallback callback, I } public void subscribeMinSetpointDeadBandAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeMinSetpointDeadBandAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMinSetpointDeadBandAttribute(IntegerAttributeCallback callback) { - reportMinSetpointDeadBandAttribute(chipClusterPtr, callback); - } - public void readControlSequenceOfOperationAttribute(IntegerAttributeCallback callback) { readControlSequenceOfOperationAttribute(chipClusterPtr, callback); } @@ -14126,15 +12165,11 @@ public void writeControlSequenceOfOperationAttribute( } public void subscribeControlSequenceOfOperationAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeControlSequenceOfOperationAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportControlSequenceOfOperationAttribute(IntegerAttributeCallback callback) { - reportControlSequenceOfOperationAttribute(chipClusterPtr, callback); - } - public void readSystemModeAttribute(IntegerAttributeCallback callback) { readSystemModeAttribute(chipClusterPtr, callback); } @@ -14144,55 +12179,39 @@ public void writeSystemModeAttribute(DefaultClusterCallback callback, Integer va } public void subscribeSystemModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeSystemModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSystemModeAttribute(IntegerAttributeCallback callback) { - reportSystemModeAttribute(chipClusterPtr, callback); - } - public void readStartOfWeekAttribute(IntegerAttributeCallback callback) { readStartOfWeekAttribute(chipClusterPtr, callback); } public void subscribeStartOfWeekAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeStartOfWeekAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportStartOfWeekAttribute(IntegerAttributeCallback callback) { - reportStartOfWeekAttribute(chipClusterPtr, callback); - } - public void readNumberOfWeeklyTransitionsAttribute(IntegerAttributeCallback callback) { readNumberOfWeeklyTransitionsAttribute(chipClusterPtr, callback); } public void subscribeNumberOfWeeklyTransitionsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeNumberOfWeeklyTransitionsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNumberOfWeeklyTransitionsAttribute(IntegerAttributeCallback callback) { - reportNumberOfWeeklyTransitionsAttribute(chipClusterPtr, callback); - } - public void readNumberOfDailyTransitionsAttribute(IntegerAttributeCallback callback) { readNumberOfDailyTransitionsAttribute(chipClusterPtr, callback); } public void subscribeNumberOfDailyTransitionsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeNumberOfDailyTransitionsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNumberOfDailyTransitionsAttribute(IntegerAttributeCallback callback) { - reportNumberOfDailyTransitionsAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -14202,71 +12221,48 @@ public void readFeatureMapAttribute(LongAttributeCallback callback) { } public void subscribeFeatureMapAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportFeatureMapAttribute(LongAttributeCallback callback) { - reportFeatureMapAttribute(chipClusterPtr, callback); - } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readLocalTemperatureAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeLocalTemperatureAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLocalTemperatureAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAbsMinHeatSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeAbsMinHeatSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportAbsMinHeatSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAbsMaxHeatSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeAbsMaxHeatSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportAbsMaxHeatSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAbsMinCoolSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeAbsMinCoolSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportAbsMinCoolSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAbsMaxCoolSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeAbsMaxCoolSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportAbsMaxCoolSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readOccupiedCoolingSetpointAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14275,10 +12271,7 @@ private native void writeOccupiedCoolingSetpointAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOccupiedCoolingSetpointAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOccupiedCoolingSetpointAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readOccupiedHeatingSetpointAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14287,10 +12280,7 @@ private native void writeOccupiedHeatingSetpointAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOccupiedHeatingSetpointAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOccupiedHeatingSetpointAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinHeatSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14299,10 +12289,7 @@ private native void writeMinHeatSetpointLimitAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeMinHeatSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinHeatSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxHeatSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14311,10 +12298,7 @@ private native void writeMaxHeatSetpointLimitAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeMaxHeatSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxHeatSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinCoolSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14323,10 +12307,7 @@ private native void writeMinCoolSetpointLimitAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeMinCoolSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinCoolSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMaxCoolSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14335,10 +12316,7 @@ private native void writeMaxCoolSetpointLimitAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeMaxCoolSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMaxCoolSetpointLimitAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readMinSetpointDeadBandAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14347,10 +12325,7 @@ private native void writeMinSetpointDeadBandAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeMinSetpointDeadBandAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMinSetpointDeadBandAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readControlSequenceOfOperationAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14359,10 +12334,7 @@ private native void writeControlSequenceOfOperationAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeControlSequenceOfOperationAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportControlSequenceOfOperationAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readSystemModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14371,37 +12343,25 @@ private native void writeSystemModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeSystemModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSystemModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readStartOfWeekAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeStartOfWeekAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportStartOfWeekAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readNumberOfWeeklyTransitionsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeNumberOfWeeklyTransitionsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNumberOfWeeklyTransitionsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readNumberOfDailyTransitionsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeNumberOfDailyTransitionsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNumberOfDailyTransitionsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -14410,19 +12370,13 @@ private native void readFeatureMapAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeFeatureMapAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportFeatureMapAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class ThermostatUserInterfaceConfigurationCluster extends BaseChipCluster { @@ -14441,6 +12395,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readTemperatureDisplayModeAttribute(IntegerAttributeCallback callback) { @@ -14453,14 +12409,10 @@ public void writeTemperatureDisplayModeAttribute( } public void subscribeTemperatureDisplayModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeTemperatureDisplayModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTemperatureDisplayModeAttribute(IntegerAttributeCallback callback) { - reportTemperatureDisplayModeAttribute(chipClusterPtr, callback); - } - public void readKeypadLockoutAttribute(IntegerAttributeCallback callback) { readKeypadLockoutAttribute(chipClusterPtr, callback); } @@ -14470,14 +12422,10 @@ public void writeKeypadLockoutAttribute(DefaultClusterCallback callback, Integer } public void subscribeKeypadLockoutAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeKeypadLockoutAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportKeypadLockoutAttribute(IntegerAttributeCallback callback) { - reportKeypadLockoutAttribute(chipClusterPtr, callback); - } - public void readScheduleProgrammingVisibilityAttribute(IntegerAttributeCallback callback) { readScheduleProgrammingVisibilityAttribute(chipClusterPtr, callback); } @@ -14488,15 +12436,11 @@ public void writeScheduleProgrammingVisibilityAttribute( } public void subscribeScheduleProgrammingVisibilityAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeScheduleProgrammingVisibilityAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportScheduleProgrammingVisibilityAttribute(IntegerAttributeCallback callback) { - reportScheduleProgrammingVisibilityAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -14506,14 +12450,10 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readTemperatureDisplayModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14521,10 +12461,7 @@ private native void writeTemperatureDisplayModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeTemperatureDisplayModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTemperatureDisplayModeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readKeypadLockoutAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14533,10 +12470,7 @@ private native void writeKeypadLockoutAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeKeypadLockoutAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportKeypadLockoutAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readScheduleProgrammingVisibilityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -14545,10 +12479,7 @@ private native void writeScheduleProgrammingVisibilityAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeScheduleProgrammingVisibilityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportScheduleProgrammingVisibilityAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -14557,10 +12488,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class ThreadNetworkDiagnosticsCluster extends BaseChipCluster { @@ -14695,6 +12623,8 @@ public interface NeighborTableListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public static class RouteTableListAttribute { @@ -14783,6 +12713,8 @@ public interface RouteTableListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public static class SecurityPolicyAttribute { @@ -14813,6 +12745,8 @@ public interface SecurityPolicyAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public static class OperationalDatasetComponentsAttribute { @@ -14915,18 +12849,24 @@ public interface OperationalDatasetComponentsAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface ActiveNetworkFaultsListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readChannelAttribute(IntegerAttributeCallback callback) { @@ -14934,92 +12874,64 @@ public void readChannelAttribute(IntegerAttributeCallback callback) { } public void subscribeChannelAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeChannelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportChannelAttribute(IntegerAttributeCallback callback) { - reportChannelAttribute(chipClusterPtr, callback); - } - public void readRoutingRoleAttribute(IntegerAttributeCallback callback) { readRoutingRoleAttribute(chipClusterPtr, callback); } public void subscribeRoutingRoleAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRoutingRoleAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRoutingRoleAttribute(IntegerAttributeCallback callback) { - reportRoutingRoleAttribute(chipClusterPtr, callback); - } - public void readNetworkNameAttribute(OctetStringAttributeCallback callback) { readNetworkNameAttribute(chipClusterPtr, callback); } public void subscribeNetworkNameAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + OctetStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeNetworkNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportNetworkNameAttribute(OctetStringAttributeCallback callback) { - reportNetworkNameAttribute(chipClusterPtr, callback); - } - public void readPanIdAttribute(IntegerAttributeCallback callback) { readPanIdAttribute(chipClusterPtr, callback); } public void subscribePanIdAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePanIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPanIdAttribute(IntegerAttributeCallback callback) { - reportPanIdAttribute(chipClusterPtr, callback); - } - public void readExtendedPanIdAttribute(LongAttributeCallback callback) { readExtendedPanIdAttribute(chipClusterPtr, callback); } public void subscribeExtendedPanIdAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeExtendedPanIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportExtendedPanIdAttribute(LongAttributeCallback callback) { - reportExtendedPanIdAttribute(chipClusterPtr, callback); - } - public void readMeshLocalPrefixAttribute(OctetStringAttributeCallback callback) { readMeshLocalPrefixAttribute(chipClusterPtr, callback); } public void subscribeMeshLocalPrefixAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + OctetStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeMeshLocalPrefixAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportMeshLocalPrefixAttribute(OctetStringAttributeCallback callback) { - reportMeshLocalPrefixAttribute(chipClusterPtr, callback); - } - public void readOverrunCountAttribute(LongAttributeCallback callback) { readOverrunCountAttribute(chipClusterPtr, callback); } public void subscribeOverrunCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeOverrunCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOverrunCountAttribute(LongAttributeCallback callback) { - reportOverrunCountAttribute(chipClusterPtr, callback); - } - public void readNeighborTableListAttribute(NeighborTableListAttributeCallback callback) { readNeighborTableListAttribute(chipClusterPtr, callback); } @@ -15033,657 +12945,456 @@ public void readPartitionIdAttribute(LongAttributeCallback callback) { } public void subscribePartitionIdAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribePartitionIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPartitionIdAttribute(LongAttributeCallback callback) { - reportPartitionIdAttribute(chipClusterPtr, callback); - } - public void readWeightingAttribute(IntegerAttributeCallback callback) { readWeightingAttribute(chipClusterPtr, callback); } public void subscribeWeightingAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeWeightingAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportWeightingAttribute(IntegerAttributeCallback callback) { - reportWeightingAttribute(chipClusterPtr, callback); - } - public void readDataVersionAttribute(IntegerAttributeCallback callback) { readDataVersionAttribute(chipClusterPtr, callback); } public void subscribeDataVersionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeDataVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportDataVersionAttribute(IntegerAttributeCallback callback) { - reportDataVersionAttribute(chipClusterPtr, callback); - } - public void readStableDataVersionAttribute(IntegerAttributeCallback callback) { readStableDataVersionAttribute(chipClusterPtr, callback); } public void subscribeStableDataVersionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeStableDataVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportStableDataVersionAttribute(IntegerAttributeCallback callback) { - reportStableDataVersionAttribute(chipClusterPtr, callback); - } - public void readLeaderRouterIdAttribute(IntegerAttributeCallback callback) { readLeaderRouterIdAttribute(chipClusterPtr, callback); } public void subscribeLeaderRouterIdAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeLeaderRouterIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLeaderRouterIdAttribute(IntegerAttributeCallback callback) { - reportLeaderRouterIdAttribute(chipClusterPtr, callback); - } - public void readDetachedRoleCountAttribute(IntegerAttributeCallback callback) { readDetachedRoleCountAttribute(chipClusterPtr, callback); } public void subscribeDetachedRoleCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeDetachedRoleCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportDetachedRoleCountAttribute(IntegerAttributeCallback callback) { - reportDetachedRoleCountAttribute(chipClusterPtr, callback); - } - public void readChildRoleCountAttribute(IntegerAttributeCallback callback) { readChildRoleCountAttribute(chipClusterPtr, callback); } public void subscribeChildRoleCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeChildRoleCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportChildRoleCountAttribute(IntegerAttributeCallback callback) { - reportChildRoleCountAttribute(chipClusterPtr, callback); - } - public void readRouterRoleCountAttribute(IntegerAttributeCallback callback) { readRouterRoleCountAttribute(chipClusterPtr, callback); } public void subscribeRouterRoleCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRouterRoleCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRouterRoleCountAttribute(IntegerAttributeCallback callback) { - reportRouterRoleCountAttribute(chipClusterPtr, callback); - } - public void readLeaderRoleCountAttribute(IntegerAttributeCallback callback) { readLeaderRoleCountAttribute(chipClusterPtr, callback); } public void subscribeLeaderRoleCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeLeaderRoleCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportLeaderRoleCountAttribute(IntegerAttributeCallback callback) { - reportLeaderRoleCountAttribute(chipClusterPtr, callback); - } - public void readAttachAttemptCountAttribute(IntegerAttributeCallback callback) { readAttachAttemptCountAttribute(chipClusterPtr, callback); } public void subscribeAttachAttemptCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeAttachAttemptCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportAttachAttemptCountAttribute(IntegerAttributeCallback callback) { - reportAttachAttemptCountAttribute(chipClusterPtr, callback); - } - public void readPartitionIdChangeCountAttribute(IntegerAttributeCallback callback) { readPartitionIdChangeCountAttribute(chipClusterPtr, callback); } public void subscribePartitionIdChangeCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribePartitionIdChangeCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPartitionIdChangeCountAttribute(IntegerAttributeCallback callback) { - reportPartitionIdChangeCountAttribute(chipClusterPtr, callback); - } - public void readBetterPartitionAttachAttemptCountAttribute(IntegerAttributeCallback callback) { readBetterPartitionAttachAttemptCountAttribute(chipClusterPtr, callback); } public void subscribeBetterPartitionAttachAttemptCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeBetterPartitionAttachAttemptCountAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBetterPartitionAttachAttemptCountAttribute( - IntegerAttributeCallback callback) { - reportBetterPartitionAttachAttemptCountAttribute(chipClusterPtr, callback); - } - public void readParentChangeCountAttribute(IntegerAttributeCallback callback) { readParentChangeCountAttribute(chipClusterPtr, callback); } public void subscribeParentChangeCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeParentChangeCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportParentChangeCountAttribute(IntegerAttributeCallback callback) { - reportParentChangeCountAttribute(chipClusterPtr, callback); - } - public void readTxTotalCountAttribute(LongAttributeCallback callback) { readTxTotalCountAttribute(chipClusterPtr, callback); } public void subscribeTxTotalCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxTotalCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxTotalCountAttribute(LongAttributeCallback callback) { - reportTxTotalCountAttribute(chipClusterPtr, callback); - } - public void readTxUnicastCountAttribute(LongAttributeCallback callback) { readTxUnicastCountAttribute(chipClusterPtr, callback); } public void subscribeTxUnicastCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxUnicastCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxUnicastCountAttribute(LongAttributeCallback callback) { - reportTxUnicastCountAttribute(chipClusterPtr, callback); - } - public void readTxBroadcastCountAttribute(LongAttributeCallback callback) { readTxBroadcastCountAttribute(chipClusterPtr, callback); } public void subscribeTxBroadcastCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxBroadcastCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxBroadcastCountAttribute(LongAttributeCallback callback) { - reportTxBroadcastCountAttribute(chipClusterPtr, callback); - } - public void readTxAckRequestedCountAttribute(LongAttributeCallback callback) { readTxAckRequestedCountAttribute(chipClusterPtr, callback); } public void subscribeTxAckRequestedCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxAckRequestedCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxAckRequestedCountAttribute(LongAttributeCallback callback) { - reportTxAckRequestedCountAttribute(chipClusterPtr, callback); - } - public void readTxAckedCountAttribute(LongAttributeCallback callback) { readTxAckedCountAttribute(chipClusterPtr, callback); } public void subscribeTxAckedCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxAckedCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxAckedCountAttribute(LongAttributeCallback callback) { - reportTxAckedCountAttribute(chipClusterPtr, callback); - } - public void readTxNoAckRequestedCountAttribute(LongAttributeCallback callback) { readTxNoAckRequestedCountAttribute(chipClusterPtr, callback); } public void subscribeTxNoAckRequestedCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxNoAckRequestedCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxNoAckRequestedCountAttribute(LongAttributeCallback callback) { - reportTxNoAckRequestedCountAttribute(chipClusterPtr, callback); - } - public void readTxDataCountAttribute(LongAttributeCallback callback) { readTxDataCountAttribute(chipClusterPtr, callback); } public void subscribeTxDataCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxDataCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxDataCountAttribute(LongAttributeCallback callback) { - reportTxDataCountAttribute(chipClusterPtr, callback); - } - public void readTxDataPollCountAttribute(LongAttributeCallback callback) { readTxDataPollCountAttribute(chipClusterPtr, callback); } public void subscribeTxDataPollCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxDataPollCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxDataPollCountAttribute(LongAttributeCallback callback) { - reportTxDataPollCountAttribute(chipClusterPtr, callback); - } - public void readTxBeaconCountAttribute(LongAttributeCallback callback) { readTxBeaconCountAttribute(chipClusterPtr, callback); } public void subscribeTxBeaconCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxBeaconCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxBeaconCountAttribute(LongAttributeCallback callback) { - reportTxBeaconCountAttribute(chipClusterPtr, callback); - } - public void readTxBeaconRequestCountAttribute(LongAttributeCallback callback) { readTxBeaconRequestCountAttribute(chipClusterPtr, callback); } public void subscribeTxBeaconRequestCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxBeaconRequestCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxBeaconRequestCountAttribute(LongAttributeCallback callback) { - reportTxBeaconRequestCountAttribute(chipClusterPtr, callback); - } - public void readTxOtherCountAttribute(LongAttributeCallback callback) { readTxOtherCountAttribute(chipClusterPtr, callback); } public void subscribeTxOtherCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxOtherCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxOtherCountAttribute(LongAttributeCallback callback) { - reportTxOtherCountAttribute(chipClusterPtr, callback); - } - public void readTxRetryCountAttribute(LongAttributeCallback callback) { readTxRetryCountAttribute(chipClusterPtr, callback); } public void subscribeTxRetryCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxRetryCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxRetryCountAttribute(LongAttributeCallback callback) { - reportTxRetryCountAttribute(chipClusterPtr, callback); - } - public void readTxDirectMaxRetryExpiryCountAttribute(LongAttributeCallback callback) { readTxDirectMaxRetryExpiryCountAttribute(chipClusterPtr, callback); } public void subscribeTxDirectMaxRetryExpiryCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxDirectMaxRetryExpiryCountAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxDirectMaxRetryExpiryCountAttribute(LongAttributeCallback callback) { - reportTxDirectMaxRetryExpiryCountAttribute(chipClusterPtr, callback); - } - public void readTxIndirectMaxRetryExpiryCountAttribute(LongAttributeCallback callback) { readTxIndirectMaxRetryExpiryCountAttribute(chipClusterPtr, callback); } public void subscribeTxIndirectMaxRetryExpiryCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxIndirectMaxRetryExpiryCountAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxIndirectMaxRetryExpiryCountAttribute(LongAttributeCallback callback) { - reportTxIndirectMaxRetryExpiryCountAttribute(chipClusterPtr, callback); - } - public void readTxErrCcaCountAttribute(LongAttributeCallback callback) { readTxErrCcaCountAttribute(chipClusterPtr, callback); } public void subscribeTxErrCcaCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxErrCcaCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxErrCcaCountAttribute(LongAttributeCallback callback) { - reportTxErrCcaCountAttribute(chipClusterPtr, callback); - } - public void readTxErrAbortCountAttribute(LongAttributeCallback callback) { readTxErrAbortCountAttribute(chipClusterPtr, callback); } public void subscribeTxErrAbortCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxErrAbortCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxErrAbortCountAttribute(LongAttributeCallback callback) { - reportTxErrAbortCountAttribute(chipClusterPtr, callback); - } - public void readTxErrBusyChannelCountAttribute(LongAttributeCallback callback) { readTxErrBusyChannelCountAttribute(chipClusterPtr, callback); } public void subscribeTxErrBusyChannelCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeTxErrBusyChannelCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTxErrBusyChannelCountAttribute(LongAttributeCallback callback) { - reportTxErrBusyChannelCountAttribute(chipClusterPtr, callback); - } - public void readRxTotalCountAttribute(LongAttributeCallback callback) { readRxTotalCountAttribute(chipClusterPtr, callback); } public void subscribeRxTotalCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxTotalCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxTotalCountAttribute(LongAttributeCallback callback) { - reportRxTotalCountAttribute(chipClusterPtr, callback); - } - public void readRxUnicastCountAttribute(LongAttributeCallback callback) { readRxUnicastCountAttribute(chipClusterPtr, callback); } public void subscribeRxUnicastCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxUnicastCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxUnicastCountAttribute(LongAttributeCallback callback) { - reportRxUnicastCountAttribute(chipClusterPtr, callback); - } - public void readRxBroadcastCountAttribute(LongAttributeCallback callback) { readRxBroadcastCountAttribute(chipClusterPtr, callback); } public void subscribeRxBroadcastCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxBroadcastCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxBroadcastCountAttribute(LongAttributeCallback callback) { - reportRxBroadcastCountAttribute(chipClusterPtr, callback); - } - public void readRxDataCountAttribute(LongAttributeCallback callback) { readRxDataCountAttribute(chipClusterPtr, callback); } public void subscribeRxDataCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxDataCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxDataCountAttribute(LongAttributeCallback callback) { - reportRxDataCountAttribute(chipClusterPtr, callback); - } - public void readRxDataPollCountAttribute(LongAttributeCallback callback) { readRxDataPollCountAttribute(chipClusterPtr, callback); } public void subscribeRxDataPollCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxDataPollCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxDataPollCountAttribute(LongAttributeCallback callback) { - reportRxDataPollCountAttribute(chipClusterPtr, callback); - } - public void readRxBeaconCountAttribute(LongAttributeCallback callback) { readRxBeaconCountAttribute(chipClusterPtr, callback); } public void subscribeRxBeaconCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxBeaconCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxBeaconCountAttribute(LongAttributeCallback callback) { - reportRxBeaconCountAttribute(chipClusterPtr, callback); - } - public void readRxBeaconRequestCountAttribute(LongAttributeCallback callback) { readRxBeaconRequestCountAttribute(chipClusterPtr, callback); } public void subscribeRxBeaconRequestCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxBeaconRequestCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxBeaconRequestCountAttribute(LongAttributeCallback callback) { - reportRxBeaconRequestCountAttribute(chipClusterPtr, callback); - } - public void readRxOtherCountAttribute(LongAttributeCallback callback) { readRxOtherCountAttribute(chipClusterPtr, callback); } public void subscribeRxOtherCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxOtherCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxOtherCountAttribute(LongAttributeCallback callback) { - reportRxOtherCountAttribute(chipClusterPtr, callback); - } - public void readRxAddressFilteredCountAttribute(LongAttributeCallback callback) { readRxAddressFilteredCountAttribute(chipClusterPtr, callback); } public void subscribeRxAddressFilteredCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxAddressFilteredCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxAddressFilteredCountAttribute(LongAttributeCallback callback) { - reportRxAddressFilteredCountAttribute(chipClusterPtr, callback); - } - public void readRxDestAddrFilteredCountAttribute(LongAttributeCallback callback) { readRxDestAddrFilteredCountAttribute(chipClusterPtr, callback); } public void subscribeRxDestAddrFilteredCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxDestAddrFilteredCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxDestAddrFilteredCountAttribute(LongAttributeCallback callback) { - reportRxDestAddrFilteredCountAttribute(chipClusterPtr, callback); - } - public void readRxDuplicatedCountAttribute(LongAttributeCallback callback) { readRxDuplicatedCountAttribute(chipClusterPtr, callback); } public void subscribeRxDuplicatedCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxDuplicatedCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxDuplicatedCountAttribute(LongAttributeCallback callback) { - reportRxDuplicatedCountAttribute(chipClusterPtr, callback); - } - public void readRxErrNoFrameCountAttribute(LongAttributeCallback callback) { readRxErrNoFrameCountAttribute(chipClusterPtr, callback); } public void subscribeRxErrNoFrameCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxErrNoFrameCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxErrNoFrameCountAttribute(LongAttributeCallback callback) { - reportRxErrNoFrameCountAttribute(chipClusterPtr, callback); - } - public void readRxErrUnknownNeighborCountAttribute(LongAttributeCallback callback) { readRxErrUnknownNeighborCountAttribute(chipClusterPtr, callback); } public void subscribeRxErrUnknownNeighborCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxErrUnknownNeighborCountAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxErrUnknownNeighborCountAttribute(LongAttributeCallback callback) { - reportRxErrUnknownNeighborCountAttribute(chipClusterPtr, callback); - } - public void readRxErrInvalidSrcAddrCountAttribute(LongAttributeCallback callback) { readRxErrInvalidSrcAddrCountAttribute(chipClusterPtr, callback); } public void subscribeRxErrInvalidSrcAddrCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxErrInvalidSrcAddrCountAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxErrInvalidSrcAddrCountAttribute(LongAttributeCallback callback) { - reportRxErrInvalidSrcAddrCountAttribute(chipClusterPtr, callback); - } - public void readRxErrSecCountAttribute(LongAttributeCallback callback) { readRxErrSecCountAttribute(chipClusterPtr, callback); } public void subscribeRxErrSecCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxErrSecCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxErrSecCountAttribute(LongAttributeCallback callback) { - reportRxErrSecCountAttribute(chipClusterPtr, callback); - } - public void readRxErrFcsCountAttribute(LongAttributeCallback callback) { readRxErrFcsCountAttribute(chipClusterPtr, callback); } public void subscribeRxErrFcsCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxErrFcsCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxErrFcsCountAttribute(LongAttributeCallback callback) { - reportRxErrFcsCountAttribute(chipClusterPtr, callback); - } - public void readRxErrOtherCountAttribute(LongAttributeCallback callback) { readRxErrOtherCountAttribute(chipClusterPtr, callback); } public void subscribeRxErrOtherCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeRxErrOtherCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRxErrOtherCountAttribute(LongAttributeCallback callback) { - reportRxErrOtherCountAttribute(chipClusterPtr, callback); - } - public void readActiveTimestampAttribute(LongAttributeCallback callback) { readActiveTimestampAttribute(chipClusterPtr, callback); } public void subscribeActiveTimestampAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeActiveTimestampAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportActiveTimestampAttribute(LongAttributeCallback callback) { - reportActiveTimestampAttribute(chipClusterPtr, callback); - } - public void readPendingTimestampAttribute(LongAttributeCallback callback) { readPendingTimestampAttribute(chipClusterPtr, callback); } public void subscribePendingTimestampAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribePendingTimestampAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPendingTimestampAttribute(LongAttributeCallback callback) { - reportPendingTimestampAttribute(chipClusterPtr, callback); - } - public void readDelayAttribute(LongAttributeCallback callback) { readDelayAttribute(chipClusterPtr, callback); } public void subscribeDelayAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeDelayAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportDelayAttribute(LongAttributeCallback callback) { - reportDelayAttribute(chipClusterPtr, callback); - } - public void readSecurityPolicyAttribute(SecurityPolicyAttributeCallback callback) { readSecurityPolicyAttribute(chipClusterPtr, callback); } @@ -15693,14 +13404,10 @@ public void readChannelMaskAttribute(OctetStringAttributeCallback callback) { } public void subscribeChannelMaskAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + OctetStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeChannelMaskAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportChannelMaskAttribute(OctetStringAttributeCallback callback) { - reportChannelMaskAttribute(chipClusterPtr, callback); - } - public void readOperationalDatasetComponentsAttribute( OperationalDatasetComponentsAttributeCallback callback) { readOperationalDatasetComponentsAttribute(chipClusterPtr, callback); @@ -15724,75 +13431,56 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readChannelAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeChannelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportChannelAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRoutingRoleAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRoutingRoleAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRoutingRoleAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readNetworkNameAttribute( long chipClusterPtr, OctetStringAttributeCallback callback); private native void subscribeNetworkNameAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportNetworkNameAttribute( - long chipClusterPtr, OctetStringAttributeCallback callback); + long chipClusterPtr, + OctetStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readPanIdAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePanIdAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPanIdAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readExtendedPanIdAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeExtendedPanIdAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportExtendedPanIdAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readMeshLocalPrefixAttribute( long chipClusterPtr, OctetStringAttributeCallback callback); private native void subscribeMeshLocalPrefixAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportMeshLocalPrefixAttribute( - long chipClusterPtr, OctetStringAttributeCallback callback); + long chipClusterPtr, + OctetStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readOverrunCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeOverrunCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOverrunCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readNeighborTableListAttribute( long chipClusterPtr, NeighborTableListAttributeCallback callback); @@ -15804,449 +13492,300 @@ private native void readPartitionIdAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribePartitionIdAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPartitionIdAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readWeightingAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeWeightingAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportWeightingAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readDataVersionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeDataVersionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportDataVersionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readStableDataVersionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeStableDataVersionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportStableDataVersionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readLeaderRouterIdAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeLeaderRouterIdAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLeaderRouterIdAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readDetachedRoleCountAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeDetachedRoleCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportDetachedRoleCountAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readChildRoleCountAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeChildRoleCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportChildRoleCountAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRouterRoleCountAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRouterRoleCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRouterRoleCountAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readLeaderRoleCountAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeLeaderRoleCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportLeaderRoleCountAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttachAttemptCountAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeAttachAttemptCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportAttachAttemptCountAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readPartitionIdChangeCountAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribePartitionIdChangeCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPartitionIdChangeCountAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readBetterPartitionAttachAttemptCountAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeBetterPartitionAttachAttemptCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBetterPartitionAttachAttemptCountAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readParentChangeCountAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeParentChangeCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportParentChangeCountAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readTxTotalCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxTotalCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxTotalCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxUnicastCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxUnicastCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxUnicastCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxBroadcastCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxBroadcastCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxBroadcastCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxAckRequestedCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxAckRequestedCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxAckRequestedCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxAckedCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxAckedCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxAckedCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxNoAckRequestedCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxNoAckRequestedCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxNoAckRequestedCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxDataCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxDataCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxDataCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxDataPollCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxDataPollCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxDataPollCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxBeaconCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxBeaconCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxBeaconCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxBeaconRequestCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxBeaconRequestCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxBeaconRequestCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxOtherCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxOtherCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxOtherCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxRetryCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxRetryCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxRetryCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxDirectMaxRetryExpiryCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxDirectMaxRetryExpiryCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxDirectMaxRetryExpiryCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxIndirectMaxRetryExpiryCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxIndirectMaxRetryExpiryCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxIndirectMaxRetryExpiryCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxErrCcaCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxErrCcaCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxErrCcaCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxErrAbortCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxErrAbortCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxErrAbortCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readTxErrBusyChannelCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeTxErrBusyChannelCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTxErrBusyChannelCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxTotalCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxTotalCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxTotalCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxUnicastCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxUnicastCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxUnicastCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxBroadcastCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxBroadcastCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxBroadcastCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxDataCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxDataCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxDataCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxDataPollCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxDataPollCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxDataPollCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxBeaconCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxBeaconCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxBeaconCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxBeaconRequestCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxBeaconRequestCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxBeaconRequestCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxOtherCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxOtherCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxOtherCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxAddressFilteredCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxAddressFilteredCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxAddressFilteredCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxDestAddrFilteredCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxDestAddrFilteredCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxDestAddrFilteredCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxDuplicatedCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxDuplicatedCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxDuplicatedCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxErrNoFrameCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxErrNoFrameCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxErrNoFrameCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxErrUnknownNeighborCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxErrUnknownNeighborCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxErrUnknownNeighborCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxErrInvalidSrcAddrCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxErrInvalidSrcAddrCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxErrInvalidSrcAddrCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxErrSecCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxErrSecCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxErrSecCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxErrFcsCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxErrFcsCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxErrFcsCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readRxErrOtherCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeRxErrOtherCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRxErrOtherCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readActiveTimestampAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeActiveTimestampAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportActiveTimestampAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readPendingTimestampAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribePendingTimestampAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPendingTimestampAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readDelayAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void subscribeDelayAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportDelayAttribute(long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readSecurityPolicyAttribute( long chipClusterPtr, SecurityPolicyAttributeCallback callback); @@ -16255,10 +13794,10 @@ private native void readChannelMaskAttribute( long chipClusterPtr, OctetStringAttributeCallback callback); private native void subscribeChannelMaskAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportChannelMaskAttribute( - long chipClusterPtr, OctetStringAttributeCallback callback); + long chipClusterPtr, + OctetStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readOperationalDatasetComponentsAttribute( long chipClusterPtr, OperationalDatasetComponentsAttributeCallback callback); @@ -16276,10 +13815,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class UserLabelCluster extends BaseChipCluster { @@ -16322,6 +13858,8 @@ public interface LabelListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readLabelListAttribute(LabelListAttributeCallback callback) { @@ -16355,6 +13893,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readWakeOnLanMacAddressAttribute(CharStringAttributeCallback callback) { @@ -16362,14 +13902,10 @@ public void readWakeOnLanMacAddressAttribute(CharStringAttributeCallback callbac } public void subscribeWakeOnLanMacAddressAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CharStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeWakeOnLanMacAddressAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportWakeOnLanMacAddressAttribute(CharStringAttributeCallback callback) { - reportWakeOnLanMacAddressAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -16379,22 +13915,18 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readWakeOnLanMacAddressAttribute( long chipClusterPtr, CharStringAttributeCallback callback); private native void subscribeWakeOnLanMacAddressAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportWakeOnLanMacAddressAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -16403,10 +13935,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class WiFiNetworkDiagnosticsCluster extends BaseChipCluster { @@ -16431,6 +13960,8 @@ public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readBssidAttribute(OctetStringAttributeCallback callback) { @@ -16438,170 +13969,118 @@ public void readBssidAttribute(OctetStringAttributeCallback callback) { } public void subscribeBssidAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + OctetStringAttributeCallback callback, int minInterval, int maxInterval) { subscribeBssidAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBssidAttribute(OctetStringAttributeCallback callback) { - reportBssidAttribute(chipClusterPtr, callback); - } - public void readSecurityTypeAttribute(IntegerAttributeCallback callback) { readSecurityTypeAttribute(chipClusterPtr, callback); } public void subscribeSecurityTypeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeSecurityTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSecurityTypeAttribute(IntegerAttributeCallback callback) { - reportSecurityTypeAttribute(chipClusterPtr, callback); - } - public void readWiFiVersionAttribute(IntegerAttributeCallback callback) { readWiFiVersionAttribute(chipClusterPtr, callback); } public void subscribeWiFiVersionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeWiFiVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportWiFiVersionAttribute(IntegerAttributeCallback callback) { - reportWiFiVersionAttribute(chipClusterPtr, callback); - } - public void readChannelNumberAttribute(IntegerAttributeCallback callback) { readChannelNumberAttribute(chipClusterPtr, callback); } public void subscribeChannelNumberAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeChannelNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportChannelNumberAttribute(IntegerAttributeCallback callback) { - reportChannelNumberAttribute(chipClusterPtr, callback); - } - public void readRssiAttribute(IntegerAttributeCallback callback) { readRssiAttribute(chipClusterPtr, callback); } public void subscribeRssiAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeRssiAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportRssiAttribute(IntegerAttributeCallback callback) { - reportRssiAttribute(chipClusterPtr, callback); - } - public void readBeaconLostCountAttribute(LongAttributeCallback callback) { readBeaconLostCountAttribute(chipClusterPtr, callback); } public void subscribeBeaconLostCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeBeaconLostCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBeaconLostCountAttribute(LongAttributeCallback callback) { - reportBeaconLostCountAttribute(chipClusterPtr, callback); - } - public void readBeaconRxCountAttribute(LongAttributeCallback callback) { readBeaconRxCountAttribute(chipClusterPtr, callback); } public void subscribeBeaconRxCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeBeaconRxCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportBeaconRxCountAttribute(LongAttributeCallback callback) { - reportBeaconRxCountAttribute(chipClusterPtr, callback); - } - public void readPacketMulticastRxCountAttribute(LongAttributeCallback callback) { readPacketMulticastRxCountAttribute(chipClusterPtr, callback); } public void subscribePacketMulticastRxCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribePacketMulticastRxCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPacketMulticastRxCountAttribute(LongAttributeCallback callback) { - reportPacketMulticastRxCountAttribute(chipClusterPtr, callback); - } - public void readPacketMulticastTxCountAttribute(LongAttributeCallback callback) { readPacketMulticastTxCountAttribute(chipClusterPtr, callback); } public void subscribePacketMulticastTxCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribePacketMulticastTxCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPacketMulticastTxCountAttribute(LongAttributeCallback callback) { - reportPacketMulticastTxCountAttribute(chipClusterPtr, callback); - } - public void readPacketUnicastRxCountAttribute(LongAttributeCallback callback) { readPacketUnicastRxCountAttribute(chipClusterPtr, callback); } public void subscribePacketUnicastRxCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribePacketUnicastRxCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPacketUnicastRxCountAttribute(LongAttributeCallback callback) { - reportPacketUnicastRxCountAttribute(chipClusterPtr, callback); - } - public void readPacketUnicastTxCountAttribute(LongAttributeCallback callback) { readPacketUnicastTxCountAttribute(chipClusterPtr, callback); } public void subscribePacketUnicastTxCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribePacketUnicastTxCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportPacketUnicastTxCountAttribute(LongAttributeCallback callback) { - reportPacketUnicastTxCountAttribute(chipClusterPtr, callback); - } - public void readCurrentMaxRateAttribute(LongAttributeCallback callback) { readCurrentMaxRateAttribute(chipClusterPtr, callback); } public void subscribeCurrentMaxRateAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentMaxRateAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentMaxRateAttribute(LongAttributeCallback callback) { - reportCurrentMaxRateAttribute(chipClusterPtr, callback); - } - public void readOverrunCountAttribute(LongAttributeCallback callback) { readOverrunCountAttribute(chipClusterPtr, callback); } public void subscribeOverrunCountAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeOverrunCountAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOverrunCountAttribute(LongAttributeCallback callback) { - reportOverrunCountAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -16615,128 +14094,89 @@ public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readBssidAttribute( long chipClusterPtr, OctetStringAttributeCallback callback); private native void subscribeBssidAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBssidAttribute( - long chipClusterPtr, OctetStringAttributeCallback callback); + long chipClusterPtr, + OctetStringAttributeCallback callback, + int minInterval, + int maxInterval); private native void readSecurityTypeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeSecurityTypeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSecurityTypeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readWiFiVersionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeWiFiVersionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportWiFiVersionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readChannelNumberAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeChannelNumberAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportChannelNumberAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readRssiAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeRssiAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportRssiAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readBeaconLostCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeBeaconLostCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBeaconLostCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readBeaconRxCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeBeaconRxCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportBeaconRxCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readPacketMulticastRxCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribePacketMulticastRxCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPacketMulticastRxCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readPacketMulticastTxCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribePacketMulticastTxCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPacketMulticastTxCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readPacketUnicastRxCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribePacketUnicastRxCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPacketUnicastRxCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readPacketUnicastTxCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribePacketUnicastTxCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportPacketUnicastTxCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentMaxRateAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeCurrentMaxRateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentMaxRateAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readOverrunCountAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeOverrunCountAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOverrunCountAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -16748,10 +14188,7 @@ private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } public static class WindowCoveringCluster extends BaseChipCluster { @@ -16824,10 +14261,76 @@ private native void goToTiltValue( private native void upOrOpen(long chipClusterPtr, DefaultClusterCallback Callback); + public interface CurrentPositionLiftAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface CurrentPositionTiltAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface CurrentPositionLiftPercentageAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface CurrentPositionTiltPercentageAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface TargetPositionLiftPercent100thsAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface TargetPositionTiltPercent100thsAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface CurrentPositionLiftPercent100thsAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + + public interface CurrentPositionTiltPercent100thsAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished() {} + } + public interface AttributeListAttributeCallback { void onSuccess(List valueList); void onError(Exception ex); + + default void onSubscriptionEstablished() {} } public void readTypeAttribute(IntegerAttributeCallback callback) { @@ -16835,217 +14338,167 @@ public void readTypeAttribute(IntegerAttributeCallback callback) { } public void subscribeTypeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTypeAttribute(IntegerAttributeCallback callback) { - reportTypeAttribute(chipClusterPtr, callback); - } - - public void readCurrentPositionLiftAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionLiftAttribute(CurrentPositionLiftAttributeCallback callback) { readCurrentPositionLiftAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionLiftAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CurrentPositionLiftAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentPositionLiftAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentPositionLiftAttribute(IntegerAttributeCallback callback) { - reportCurrentPositionLiftAttribute(chipClusterPtr, callback); - } - - public void readCurrentPositionTiltAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionTiltAttribute(CurrentPositionTiltAttributeCallback callback) { readCurrentPositionTiltAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionTiltAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CurrentPositionTiltAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentPositionTiltAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentPositionTiltAttribute(IntegerAttributeCallback callback) { - reportCurrentPositionTiltAttribute(chipClusterPtr, callback); - } - public void readConfigStatusAttribute(IntegerAttributeCallback callback) { readConfigStatusAttribute(chipClusterPtr, callback); } public void subscribeConfigStatusAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeConfigStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportConfigStatusAttribute(IntegerAttributeCallback callback) { - reportConfigStatusAttribute(chipClusterPtr, callback); - } - - public void readCurrentPositionLiftPercentageAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionLiftPercentageAttribute( + CurrentPositionLiftPercentageAttributeCallback callback) { readCurrentPositionLiftPercentageAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionLiftPercentageAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CurrentPositionLiftPercentageAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentPositionLiftPercentageAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentPositionLiftPercentageAttribute(IntegerAttributeCallback callback) { - reportCurrentPositionLiftPercentageAttribute(chipClusterPtr, callback); - } - - public void readCurrentPositionTiltPercentageAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionTiltPercentageAttribute( + CurrentPositionTiltPercentageAttributeCallback callback) { readCurrentPositionTiltPercentageAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionTiltPercentageAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CurrentPositionTiltPercentageAttributeCallback callback, int minInterval, int maxInterval) { subscribeCurrentPositionTiltPercentageAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentPositionTiltPercentageAttribute(IntegerAttributeCallback callback) { - reportCurrentPositionTiltPercentageAttribute(chipClusterPtr, callback); - } - public void readOperationalStatusAttribute(IntegerAttributeCallback callback) { readOperationalStatusAttribute(chipClusterPtr, callback); } public void subscribeOperationalStatusAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeOperationalStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportOperationalStatusAttribute(IntegerAttributeCallback callback) { - reportOperationalStatusAttribute(chipClusterPtr, callback); - } - - public void readTargetPositionLiftPercent100thsAttribute(IntegerAttributeCallback callback) { + public void readTargetPositionLiftPercent100thsAttribute( + TargetPositionLiftPercent100thsAttributeCallback callback) { readTargetPositionLiftPercent100thsAttribute(chipClusterPtr, callback); } public void subscribeTargetPositionLiftPercent100thsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + TargetPositionLiftPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval) { subscribeTargetPositionLiftPercent100thsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTargetPositionLiftPercent100thsAttribute(IntegerAttributeCallback callback) { - reportTargetPositionLiftPercent100thsAttribute(chipClusterPtr, callback); - } - - public void readTargetPositionTiltPercent100thsAttribute(IntegerAttributeCallback callback) { + public void readTargetPositionTiltPercent100thsAttribute( + TargetPositionTiltPercent100thsAttributeCallback callback) { readTargetPositionTiltPercent100thsAttribute(chipClusterPtr, callback); } public void subscribeTargetPositionTiltPercent100thsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + TargetPositionTiltPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval) { subscribeTargetPositionTiltPercent100thsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportTargetPositionTiltPercent100thsAttribute(IntegerAttributeCallback callback) { - reportTargetPositionTiltPercent100thsAttribute(chipClusterPtr, callback); - } - public void readEndProductTypeAttribute(IntegerAttributeCallback callback) { readEndProductTypeAttribute(chipClusterPtr, callback); } public void subscribeEndProductTypeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeEndProductTypeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportEndProductTypeAttribute(IntegerAttributeCallback callback) { - reportEndProductTypeAttribute(chipClusterPtr, callback); - } - - public void readCurrentPositionLiftPercent100thsAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionLiftPercent100thsAttribute( + CurrentPositionLiftPercent100thsAttributeCallback callback) { readCurrentPositionLiftPercent100thsAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionLiftPercent100thsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CurrentPositionLiftPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval) { subscribeCurrentPositionLiftPercent100thsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentPositionLiftPercent100thsAttribute(IntegerAttributeCallback callback) { - reportCurrentPositionLiftPercent100thsAttribute(chipClusterPtr, callback); - } - - public void readCurrentPositionTiltPercent100thsAttribute(IntegerAttributeCallback callback) { + public void readCurrentPositionTiltPercent100thsAttribute( + CurrentPositionTiltPercent100thsAttributeCallback callback) { readCurrentPositionTiltPercent100thsAttribute(chipClusterPtr, callback); } public void subscribeCurrentPositionTiltPercent100thsAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + CurrentPositionTiltPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval) { subscribeCurrentPositionTiltPercent100thsAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportCurrentPositionTiltPercent100thsAttribute(IntegerAttributeCallback callback) { - reportCurrentPositionTiltPercent100thsAttribute(chipClusterPtr, callback); - } - public void readInstalledOpenLimitLiftAttribute(IntegerAttributeCallback callback) { readInstalledOpenLimitLiftAttribute(chipClusterPtr, callback); } public void subscribeInstalledOpenLimitLiftAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeInstalledOpenLimitLiftAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInstalledOpenLimitLiftAttribute(IntegerAttributeCallback callback) { - reportInstalledOpenLimitLiftAttribute(chipClusterPtr, callback); - } - public void readInstalledClosedLimitLiftAttribute(IntegerAttributeCallback callback) { readInstalledClosedLimitLiftAttribute(chipClusterPtr, callback); } public void subscribeInstalledClosedLimitLiftAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeInstalledClosedLimitLiftAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInstalledClosedLimitLiftAttribute(IntegerAttributeCallback callback) { - reportInstalledClosedLimitLiftAttribute(chipClusterPtr, callback); - } - public void readInstalledOpenLimitTiltAttribute(IntegerAttributeCallback callback) { readInstalledOpenLimitTiltAttribute(chipClusterPtr, callback); } public void subscribeInstalledOpenLimitTiltAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeInstalledOpenLimitTiltAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInstalledOpenLimitTiltAttribute(IntegerAttributeCallback callback) { - reportInstalledOpenLimitTiltAttribute(chipClusterPtr, callback); - } - public void readInstalledClosedLimitTiltAttribute(IntegerAttributeCallback callback) { readInstalledClosedLimitTiltAttribute(chipClusterPtr, callback); } public void subscribeInstalledClosedLimitTiltAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeInstalledClosedLimitTiltAttribute( chipClusterPtr, callback, minInterval, maxInterval); } - public void reportInstalledClosedLimitTiltAttribute(IntegerAttributeCallback callback) { - reportInstalledClosedLimitTiltAttribute(chipClusterPtr, callback); - } - public void readModeAttribute(IntegerAttributeCallback callback) { readModeAttribute(chipClusterPtr, callback); } @@ -17055,27 +14508,19 @@ public void writeModeAttribute(DefaultClusterCallback callback, Integer value) { } public void subscribeModeAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeModeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportModeAttribute(IntegerAttributeCallback callback) { - reportModeAttribute(chipClusterPtr, callback); - } - public void readSafetyStatusAttribute(IntegerAttributeCallback callback) { readSafetyStatusAttribute(chipClusterPtr, callback); } public void subscribeSafetyStatusAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeSafetyStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportSafetyStatusAttribute(IntegerAttributeCallback callback) { - reportSafetyStatusAttribute(chipClusterPtr, callback); - } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { readAttributeListAttribute(chipClusterPtr, callback); } @@ -17085,168 +14530,137 @@ public void readFeatureMapAttribute(LongAttributeCallback callback) { } public void subscribeFeatureMapAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + LongAttributeCallback callback, int minInterval, int maxInterval) { subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportFeatureMapAttribute(LongAttributeCallback callback) { - reportFeatureMapAttribute(chipClusterPtr, callback); - } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } public void subscribeClusterRevisionAttribute( - DefaultClusterCallback callback, int minInterval, int maxInterval) { + IntegerAttributeCallback callback, int minInterval, int maxInterval) { subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { - reportClusterRevisionAttribute(chipClusterPtr, callback); - } - private native void readTypeAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeTypeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTypeAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentPositionLiftAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionLiftAttributeCallback callback); private native void subscribeCurrentPositionLiftAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentPositionLiftAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + CurrentPositionLiftAttributeCallback callback, + int minInterval, + int maxInterval); private native void readCurrentPositionTiltAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionTiltAttributeCallback callback); private native void subscribeCurrentPositionTiltAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentPositionTiltAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + CurrentPositionTiltAttributeCallback callback, + int minInterval, + int maxInterval); private native void readConfigStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeConfigStatusAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportConfigStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentPositionLiftPercentageAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionLiftPercentageAttributeCallback callback); private native void subscribeCurrentPositionLiftPercentageAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentPositionLiftPercentageAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + CurrentPositionLiftPercentageAttributeCallback callback, + int minInterval, + int maxInterval); private native void readCurrentPositionTiltPercentageAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionTiltPercentageAttributeCallback callback); private native void subscribeCurrentPositionTiltPercentageAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentPositionTiltPercentageAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + CurrentPositionTiltPercentageAttributeCallback callback, + int minInterval, + int maxInterval); private native void readOperationalStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeOperationalStatusAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportOperationalStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readTargetPositionLiftPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, TargetPositionLiftPercent100thsAttributeCallback callback); private native void subscribeTargetPositionLiftPercent100thsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTargetPositionLiftPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + TargetPositionLiftPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval); private native void readTargetPositionTiltPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, TargetPositionTiltPercent100thsAttributeCallback callback); private native void subscribeTargetPositionTiltPercent100thsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportTargetPositionTiltPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + TargetPositionTiltPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval); private native void readEndProductTypeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeEndProductTypeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportEndProductTypeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readCurrentPositionLiftPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionLiftPercent100thsAttributeCallback callback); private native void subscribeCurrentPositionLiftPercent100thsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentPositionLiftPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + CurrentPositionLiftPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval); private native void readCurrentPositionTiltPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentPositionTiltPercent100thsAttributeCallback callback); private native void subscribeCurrentPositionTiltPercent100thsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportCurrentPositionTiltPercent100thsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, + CurrentPositionTiltPercent100thsAttributeCallback callback, + int minInterval, + int maxInterval); private native void readInstalledOpenLimitLiftAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeInstalledOpenLimitLiftAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInstalledOpenLimitLiftAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readInstalledClosedLimitLiftAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeInstalledClosedLimitLiftAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInstalledClosedLimitLiftAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readInstalledOpenLimitTiltAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeInstalledOpenLimitTiltAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInstalledOpenLimitTiltAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readInstalledClosedLimitTiltAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeInstalledClosedLimitTiltAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportInstalledClosedLimitTiltAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readModeAttribute(long chipClusterPtr, IntegerAttributeCallback callback); @@ -17254,18 +14668,13 @@ private native void writeModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportModeAttribute(long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readSafetyStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeSafetyStatusAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportSafetyStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readAttributeListAttribute( long chipClusterPtr, AttributeListAttributeCallback callback); @@ -17274,18 +14683,12 @@ private native void readFeatureMapAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void subscribeFeatureMapAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportFeatureMapAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void subscribeClusterRevisionAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); - - private native void reportClusterRevisionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 90903eccfe26d9..aabc135a13f3e1 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -373,8 +373,8 @@ public void onError(Exception ex) { } } - public static class DelegatedApplicationBasicClusterAttributeListAttributeCallback - implements ChipClusters.ApplicationBasicCluster.AttributeListAttributeCallback, + public static class DelegatedApplicationBasicClusterAllowedVendorListAttributeCallback + implements ChipClusters.ApplicationBasicCluster.AllowedVendorListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -386,7 +386,8 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { @Override public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); @@ -398,8 +399,8 @@ public void onError(Exception ex) { } } - public static class DelegatedHideAppResponseCallback - implements ChipClusters.ApplicationLauncherCluster.HideAppResponseCallback, + public static class DelegatedApplicationBasicClusterAttributeListAttributeCallback + implements ChipClusters.ApplicationBasicCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -409,49 +410,22 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer status, String data) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); - responseValues.put(statusResponseValue, status); - CommandResponseInfo dataResponseValue = new CommandResponseInfo("data", "String"); - responseValues.put(dataResponseValue, data); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - - public static class DelegatedLaunchAppResponseCallback - implements ChipClusters.ApplicationLauncherCluster.LaunchAppResponseCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - @Override - public void onSuccess(Integer status, String data) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); - responseValues.put(statusResponseValue, status); - CommandResponseInfo dataResponseValue = new CommandResponseInfo("data", "String"); - responseValues.put(dataResponseValue, data); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedStopAppResponseCallback - implements ChipClusters.ApplicationLauncherCluster.StopAppResponseCallback, + public static class DelegatedLauncherResponseCallback + implements ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -810,8 +784,63 @@ public void onError(Exception ex) { } } - public static class DelegatedColorControlClusterAttributeListAttributeCallback - implements ChipClusters.ColorControlCluster.AttributeListAttributeCallback, + public static class DelegatedChangeChannelResponseCallback + implements ChipClusters.ChannelCluster.ChangeChannelResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( // channelMatch: Struct ChannelInfo + // Conversion from this type to Java is not properly implemented yet + Integer errorType) { + Map responseValues = new LinkedHashMap<>(); + // channelMatch: Struct ChannelInfo + // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo errorTypeResponseValue = new CommandResponseInfo("errorType", "int"); + responseValues.put(errorTypeResponseValue, errorType); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedChannelClusterChannelListAttributeCallback + implements ChipClusters.ChannelCluster.ChannelListAttributeCallback, + 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 DelegatedChannelClusterAttributeListAttributeCallback + implements ChipClusters.ChannelCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -835,8 +864,8 @@ public void onError(Exception ex) { } } - public static class DelegatedLaunchContentResponseCallback - implements ChipClusters.ContentLauncherCluster.LaunchContentResponseCallback, + public static class DelegatedColorControlClusterAttributeListAttributeCallback + implements ChipClusters.ColorControlCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -846,24 +875,22 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer contentLaunchStatus, String data) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo contentLaunchStatusResponseValue = - new CommandResponseInfo("contentLaunchStatus", "int"); - responseValues.put(contentLaunchStatusResponseValue, contentLaunchStatus); - CommandResponseInfo dataResponseValue = new CommandResponseInfo("data", "String"); - responseValues.put(dataResponseValue, data); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedLaunchURLResponseCallback - implements ChipClusters.ContentLauncherCluster.LaunchURLResponseCallback, + public static class DelegatedLaunchResponseCallback + implements ChipClusters.ContentLauncherCluster.LaunchResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -873,11 +900,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer contentLaunchStatus, String data) { + public void onSuccess(Integer status, String data) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo contentLaunchStatusResponseValue = - new CommandResponseInfo("contentLaunchStatus", "int"); - responseValues.put(contentLaunchStatusResponseValue, contentLaunchStatus); + CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); + responseValues.put(statusResponseValue, status); CommandResponseInfo dataResponseValue = new CommandResponseInfo("data", "String"); responseValues.put(dataResponseValue, data); callback.onSuccess(responseValues); @@ -889,8 +915,8 @@ public void onError(Exception error) { } } - public static class DelegatedContentLauncherClusterAcceptsHeaderListAttributeCallback - implements ChipClusters.ContentLauncherCluster.AcceptsHeaderListAttributeCallback, + public static class DelegatedContentLauncherClusterAcceptHeaderListAttributeCallback + implements ChipClusters.ContentLauncherCluster.AcceptHeaderListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -903,7 +929,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo commandResponseInfo = - new CommandResponseInfo("valueList", "List"); + new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); @@ -1663,8 +1689,34 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterGroupsAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.GroupsAttributeCallback, + public static class DelegatedKeySetReadAllIndicesResponseCallback + implements ChipClusters.GroupKeyManagementCluster.KeySetReadAllIndicesResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( // groupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * + // Conversion from this type to Java is not properly implemented yet + ) { + Map responseValues = new LinkedHashMap<>(); + // groupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedKeySetReadResponseCallback + implements ChipClusters.GroupKeyManagementCluster.KeySetReadResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1674,11 +1726,38 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess( // groupKeySet: Struct GroupKeySet + // Conversion from this type to Java is not properly implemented yet + ) { + Map responseValues = new LinkedHashMap<>(); + // groupKeySet: Struct GroupKeySet + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedGroupKeyManagementClusterGroupKeyMapAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.GroupKeyMapAttributeCallback, + 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"); + "valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); @@ -1690,8 +1769,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterGroupKeysAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.GroupKeysAttributeCallback, + public static class DelegatedGroupKeyManagementClusterGroupTableAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.GroupTableAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -1702,11 +1781,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { @Override public void onSuccess( - List valueList) { + List valueList) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo commandResponseInfo = new CommandResponseInfo( - "valueList", "List"); + "valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); @@ -2021,260 +2100,8 @@ public void onError(Exception ex) { } } - public static class DelegatedLowPowerClusterAttributeListAttributeCallback - implements ChipClusters.LowPowerCluster.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 DelegatedMediaInputClusterMediaInputListAttributeCallback - implements ChipClusters.MediaInputCluster.MediaInputListAttributeCallback, - 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 DelegatedMediaInputClusterAttributeListAttributeCallback - implements ChipClusters.MediaInputCluster.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 DelegatedMediaFastForwardResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaFastForwardResponseCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(Integer mediaPlaybackStatus) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - - public static class DelegatedMediaNextResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaNextResponseCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(Integer mediaPlaybackStatus) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - - public static class DelegatedMediaPauseResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaPauseResponseCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(Integer mediaPlaybackStatus) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - - public static class DelegatedMediaPlayResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaPlayResponseCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(Integer mediaPlaybackStatus) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - - public static class DelegatedMediaPreviousResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaPreviousResponseCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(Integer mediaPlaybackStatus) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - - public static class DelegatedMediaRewindResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaRewindResponseCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(Integer mediaPlaybackStatus) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - - public static class DelegatedMediaSeekResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaSeekResponseCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(Integer mediaPlaybackStatus) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - - public static class DelegatedMediaSkipBackwardResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaSkipBackwardResponseCallback, + public static class DelegatedLowPowerClusterAttributeListAttributeCallback + implements ChipClusters.LowPowerCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2284,22 +2111,22 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer mediaPlaybackStatus) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedMediaSkipForwardResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaSkipForwardResponseCallback, + public static class DelegatedMediaInputClusterMediaInputListAttributeCallback + implements ChipClusters.MediaInputCluster.MediaInputListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2309,22 +2136,24 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer mediaPlaybackStatus) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); + + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedMediaStartOverResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaStartOverResponseCallback, + public static class DelegatedMediaInputClusterAttributeListAttributeCallback + implements ChipClusters.MediaInputCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2334,22 +2163,22 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer mediaPlaybackStatus) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedMediaStopResponseCallback - implements ChipClusters.MediaPlaybackCluster.MediaStopResponseCallback, + public static class DelegatedPlaybackResponseCallback + implements ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -2359,11 +2188,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer mediaPlaybackStatus) { + public void onSuccess(Integer status) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo mediaPlaybackStatusResponseValue = - new CommandResponseInfo("mediaPlaybackStatus", "int"); - responseValues.put(mediaPlaybackStatusResponseValue, mediaPlaybackStatus); + CommandResponseInfo statusResponseValue = new CommandResponseInfo("status", "int"); + responseValues.put(statusResponseValue, status); callback.onSuccess(responseValues); } @@ -2674,6 +2502,37 @@ public void onError(Exception ex) { } } + public static class DelegatedOtaSoftwareUpdateRequestorClusterDefaultOtaProvidersAttributeCallback + implements ChipClusters.OtaSoftwareUpdateRequestorCluster + .DefaultOtaProvidersAttributeCallback, + 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 DelegatedOtaSoftwareUpdateRequestorClusterAttributeListAttributeCallback implements ChipClusters.OtaSoftwareUpdateRequestorCluster.AttributeListAttributeCallback, DelegatedClusterCallback { @@ -3422,86 +3281,6 @@ public void onError(Exception ex) { } } - public static class DelegatedChangeChannelResponseCallback - implements ChipClusters.TvChannelCluster.ChangeChannelResponseCallback, - DelegatedClusterCallback { - private ClusterCommandCallback callback; - - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess( // channelMatch: Struct TvChannelInfo - // Conversion from this type to Java is not properly implemented yet - Integer errorType) { - Map responseValues = new LinkedHashMap<>(); - // channelMatch: Struct TvChannelInfo - // Conversion from this type to Java is not properly implemented yet - CommandResponseInfo errorTypeResponseValue = new CommandResponseInfo("errorType", "int"); - responseValues.put(errorTypeResponseValue, errorType); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception error) { - callback.onFailure(error); - } - } - - public static class DelegatedTvChannelClusterChannelListAttributeCallback - implements ChipClusters.TvChannelCluster.ChannelListAttributeCallback, - 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 DelegatedTvChannelClusterAttributeListAttributeCallback - implements ChipClusters.TvChannelCluster.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 DelegatedNavigateTargetResponseCallback implements ChipClusters.TargetNavigatorCluster.NavigateTargetResponseCallback, DelegatedClusterCallback { @@ -4440,6 +4219,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.BridgedDeviceBasicCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("bridgedDeviceBasic", bridgedDeviceBasicClusterInfo); + ClusterInfo channelClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ChannelCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("channel", channelClusterInfo); ClusterInfo colorControlClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.ColorControlCluster(ptr, endpointId), @@ -4620,11 +4403,6 @@ public Map initializeClusterMap() { new ClusterInfo( (ptr, endpointId) -> new ChipClusters.SwitchCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("switch", switchClusterInfo); - ClusterInfo tvChannelClusterInfo = - new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.TvChannelCluster(ptr, endpointId), - new HashMap<>()); - clusterMap.put("tvChannel", tvChannelClusterInfo); ClusterInfo targetNavigatorClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.TargetNavigatorCluster(ptr, endpointId), @@ -4697,6 +4475,7 @@ public void combineCommand( destination.get("booleanState").combineCommands(source.get("booleanState")); destination.get("bridgedActions").combineCommands(source.get("bridgedActions")); destination.get("bridgedDeviceBasic").combineCommands(source.get("bridgedDeviceBasic")); + destination.get("channel").combineCommands(source.get("channel")); destination.get("colorControl").combineCommands(source.get("colorControl")); destination.get("contentLauncher").combineCommands(source.get("contentLauncher")); destination.get("descriptor").combineCommands(source.get("descriptor")); @@ -4747,7 +4526,6 @@ public void combineCommand( destination.get("scenes").combineCommands(source.get("scenes")); destination.get("softwareDiagnostics").combineCommands(source.get("softwareDiagnostics")); destination.get("switch").combineCommands(source.get("switch")); - destination.get("tvChannel").combineCommands(source.get("tvChannel")); destination.get("targetNavigator").combineCommands(source.get("targetNavigator")); destination.get("temperatureMeasurement").combineCommands(source.get("temperatureMeasurement")); destination.get("testCluster").combineCommands(source.get("testCluster")); @@ -4770,62 +4548,66 @@ public Map> getCommandMap() { Map accessControlClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("accessControl", accessControlClusterInteractionInfoMap); Map accountLoginClusterInteractionInfoMap = new LinkedHashMap<>(); - Map accountLogingetSetupPINCommandParams = + Map accountLogingetSetupPINRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo accountLogingetSetupPINtempAccountIdentifierCommandParameterInfo = + CommandParameterInfo accountLogingetSetupPINRequesttempAccountIdentifierCommandParameterInfo = new CommandParameterInfo("tempAccountIdentifier", String.class); - accountLogingetSetupPINCommandParams.put( - "tempAccountIdentifier", accountLogingetSetupPINtempAccountIdentifierCommandParameterInfo); + accountLogingetSetupPINRequestCommandParams.put( + "tempAccountIdentifier", + accountLogingetSetupPINRequesttempAccountIdentifierCommandParameterInfo); // Populate commands - InteractionInfo accountLogingetSetupPINInteractionInfo = + InteractionInfo accountLogingetSetupPINRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AccountLoginCluster) cluster) - .getSetupPIN( + .getSetupPINRequest( (ChipClusters.AccountLoginCluster.GetSetupPINResponseCallback) callback, (String) commandArguments.get("tempAccountIdentifier")); }, () -> new DelegatedGetSetupPINResponseCallback(), - accountLogingetSetupPINCommandParams); + accountLogingetSetupPINRequestCommandParams); accountLoginClusterInteractionInfoMap.put( - "getSetupPIN", accountLogingetSetupPINInteractionInfo); - Map accountLoginloginCommandParams = + "getSetupPINRequest", accountLogingetSetupPINRequestInteractionInfo); + Map accountLoginloginRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo accountLoginlogintempAccountIdentifierCommandParameterInfo = + CommandParameterInfo accountLoginloginRequesttempAccountIdentifierCommandParameterInfo = new CommandParameterInfo("tempAccountIdentifier", String.class); - accountLoginloginCommandParams.put( - "tempAccountIdentifier", accountLoginlogintempAccountIdentifierCommandParameterInfo); + accountLoginloginRequestCommandParams.put( + "tempAccountIdentifier", accountLoginloginRequesttempAccountIdentifierCommandParameterInfo); - CommandParameterInfo accountLoginloginsetupPINCommandParameterInfo = + CommandParameterInfo accountLoginloginRequestsetupPINCommandParameterInfo = new CommandParameterInfo("setupPIN", String.class); - accountLoginloginCommandParams.put("setupPIN", accountLoginloginsetupPINCommandParameterInfo); + accountLoginloginRequestCommandParams.put( + "setupPIN", accountLoginloginRequestsetupPINCommandParameterInfo); // Populate commands - InteractionInfo accountLoginloginInteractionInfo = + InteractionInfo accountLoginloginRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AccountLoginCluster) cluster) - .login( + .loginRequest( (DefaultClusterCallback) callback, (String) commandArguments.get("tempAccountIdentifier"), (String) commandArguments.get("setupPIN")); }, () -> new DelegatedDefaultClusterCallback(), - accountLoginloginCommandParams); - accountLoginClusterInteractionInfoMap.put("login", accountLoginloginInteractionInfo); - Map accountLoginlogoutCommandParams = + accountLoginloginRequestCommandParams); + accountLoginClusterInteractionInfoMap.put( + "loginRequest", accountLoginloginRequestInteractionInfo); + Map accountLoginlogoutRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo accountLoginlogoutInteractionInfo = + InteractionInfo accountLoginlogoutRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AccountLoginCluster) cluster) - .logout((DefaultClusterCallback) callback); + .logoutRequest((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), - accountLoginlogoutCommandParams); - accountLoginClusterInteractionInfoMap.put("logout", accountLoginlogoutInteractionInfo); + accountLoginlogoutRequestCommandParams); + accountLoginClusterInteractionInfoMap.put( + "logoutRequest", accountLoginlogoutRequestInteractionInfo); commandMap.put("accountLogin", accountLoginClusterInteractionInfoMap); Map administratorCommissioningClusterInteractionInfoMap = new LinkedHashMap<>(); @@ -4931,159 +4713,140 @@ public Map> getCommandMap() { commandMap.put( "administratorCommissioning", administratorCommissioningClusterInteractionInfoMap); Map applicationBasicClusterInteractionInfoMap = new LinkedHashMap<>(); - Map applicationBasicchangeStatusCommandParams = - new LinkedHashMap(); - CommandParameterInfo applicationBasicchangeStatusstatusCommandParameterInfo = - new CommandParameterInfo("status", int.class); - applicationBasicchangeStatusCommandParams.put( - "status", applicationBasicchangeStatusstatusCommandParameterInfo); - - // Populate commands - InteractionInfo applicationBasicchangeStatusInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationBasicCluster) cluster) - .changeStatus( - (DefaultClusterCallback) callback, (Integer) commandArguments.get("status")); - }, - () -> new DelegatedDefaultClusterCallback(), - applicationBasicchangeStatusCommandParams); - applicationBasicClusterInteractionInfoMap.put( - "changeStatus", applicationBasicchangeStatusInteractionInfo); commandMap.put("applicationBasic", applicationBasicClusterInteractionInfoMap); Map applicationLauncherClusterInteractionInfoMap = new LinkedHashMap<>(); - Map applicationLauncherhideAppCommandParams = + Map applicationLauncherhideAppRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo applicationLauncherhideAppcatalogVendorIdCommandParameterInfo = + CommandParameterInfo applicationLauncherhideAppRequestcatalogVendorIdCommandParameterInfo = new CommandParameterInfo("catalogVendorId", int.class); - applicationLauncherhideAppCommandParams.put( - "catalogVendorId", applicationLauncherhideAppcatalogVendorIdCommandParameterInfo); + applicationLauncherhideAppRequestCommandParams.put( + "catalogVendorId", applicationLauncherhideAppRequestcatalogVendorIdCommandParameterInfo); - CommandParameterInfo applicationLauncherhideAppapplicationIdCommandParameterInfo = + CommandParameterInfo applicationLauncherhideAppRequestapplicationIdCommandParameterInfo = new CommandParameterInfo("applicationId", String.class); - applicationLauncherhideAppCommandParams.put( - "applicationId", applicationLauncherhideAppapplicationIdCommandParameterInfo); + applicationLauncherhideAppRequestCommandParams.put( + "applicationId", applicationLauncherhideAppRequestapplicationIdCommandParameterInfo); // Populate commands - InteractionInfo applicationLauncherhideAppInteractionInfo = + InteractionInfo applicationLauncherhideAppRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationLauncherCluster) cluster) - .hideApp( - (ChipClusters.ApplicationLauncherCluster.HideAppResponseCallback) callback, + .hideAppRequest( + (ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback, (Integer) commandArguments.get("catalogVendorId"), (String) commandArguments.get("applicationId")); }, - () -> new DelegatedHideAppResponseCallback(), - applicationLauncherhideAppCommandParams); + () -> new DelegatedLauncherResponseCallback(), + applicationLauncherhideAppRequestCommandParams); applicationLauncherClusterInteractionInfoMap.put( - "hideApp", applicationLauncherhideAppInteractionInfo); - Map applicationLauncherlaunchAppCommandParams = + "hideAppRequest", applicationLauncherhideAppRequestInteractionInfo); + Map applicationLauncherlaunchAppRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo applicationLauncherlaunchAppdataCommandParameterInfo = + CommandParameterInfo applicationLauncherlaunchAppRequestdataCommandParameterInfo = new CommandParameterInfo("data", String.class); - applicationLauncherlaunchAppCommandParams.put( - "data", applicationLauncherlaunchAppdataCommandParameterInfo); + applicationLauncherlaunchAppRequestCommandParams.put( + "data", applicationLauncherlaunchAppRequestdataCommandParameterInfo); - CommandParameterInfo applicationLauncherlaunchAppcatalogVendorIdCommandParameterInfo = + CommandParameterInfo applicationLauncherlaunchAppRequestcatalogVendorIdCommandParameterInfo = new CommandParameterInfo("catalogVendorId", int.class); - applicationLauncherlaunchAppCommandParams.put( - "catalogVendorId", applicationLauncherlaunchAppcatalogVendorIdCommandParameterInfo); + applicationLauncherlaunchAppRequestCommandParams.put( + "catalogVendorId", applicationLauncherlaunchAppRequestcatalogVendorIdCommandParameterInfo); - CommandParameterInfo applicationLauncherlaunchAppapplicationIdCommandParameterInfo = + CommandParameterInfo applicationLauncherlaunchAppRequestapplicationIdCommandParameterInfo = new CommandParameterInfo("applicationId", String.class); - applicationLauncherlaunchAppCommandParams.put( - "applicationId", applicationLauncherlaunchAppapplicationIdCommandParameterInfo); + applicationLauncherlaunchAppRequestCommandParams.put( + "applicationId", applicationLauncherlaunchAppRequestapplicationIdCommandParameterInfo); // Populate commands - InteractionInfo applicationLauncherlaunchAppInteractionInfo = + InteractionInfo applicationLauncherlaunchAppRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationLauncherCluster) cluster) - .launchApp( - (ChipClusters.ApplicationLauncherCluster.LaunchAppResponseCallback) callback, + .launchAppRequest( + (ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback, (String) commandArguments.get("data"), (Integer) commandArguments.get("catalogVendorId"), (String) commandArguments.get("applicationId")); }, - () -> new DelegatedLaunchAppResponseCallback(), - applicationLauncherlaunchAppCommandParams); + () -> new DelegatedLauncherResponseCallback(), + applicationLauncherlaunchAppRequestCommandParams); applicationLauncherClusterInteractionInfoMap.put( - "launchApp", applicationLauncherlaunchAppInteractionInfo); - Map applicationLauncherstopAppCommandParams = + "launchAppRequest", applicationLauncherlaunchAppRequestInteractionInfo); + Map applicationLauncherstopAppRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo applicationLauncherstopAppcatalogVendorIdCommandParameterInfo = + CommandParameterInfo applicationLauncherstopAppRequestcatalogVendorIdCommandParameterInfo = new CommandParameterInfo("catalogVendorId", int.class); - applicationLauncherstopAppCommandParams.put( - "catalogVendorId", applicationLauncherstopAppcatalogVendorIdCommandParameterInfo); + applicationLauncherstopAppRequestCommandParams.put( + "catalogVendorId", applicationLauncherstopAppRequestcatalogVendorIdCommandParameterInfo); - CommandParameterInfo applicationLauncherstopAppapplicationIdCommandParameterInfo = + CommandParameterInfo applicationLauncherstopAppRequestapplicationIdCommandParameterInfo = new CommandParameterInfo("applicationId", String.class); - applicationLauncherstopAppCommandParams.put( - "applicationId", applicationLauncherstopAppapplicationIdCommandParameterInfo); + applicationLauncherstopAppRequestCommandParams.put( + "applicationId", applicationLauncherstopAppRequestapplicationIdCommandParameterInfo); // Populate commands - InteractionInfo applicationLauncherstopAppInteractionInfo = + InteractionInfo applicationLauncherstopAppRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ApplicationLauncherCluster) cluster) - .stopApp( - (ChipClusters.ApplicationLauncherCluster.StopAppResponseCallback) callback, + .stopAppRequest( + (ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback, (Integer) commandArguments.get("catalogVendorId"), (String) commandArguments.get("applicationId")); }, - () -> new DelegatedStopAppResponseCallback(), - applicationLauncherstopAppCommandParams); + () -> new DelegatedLauncherResponseCallback(), + applicationLauncherstopAppRequestCommandParams); applicationLauncherClusterInteractionInfoMap.put( - "stopApp", applicationLauncherstopAppInteractionInfo); + "stopAppRequest", applicationLauncherstopAppRequestInteractionInfo); commandMap.put("applicationLauncher", applicationLauncherClusterInteractionInfoMap); Map audioOutputClusterInteractionInfoMap = new LinkedHashMap<>(); - Map audioOutputrenameOutputCommandParams = + Map audioOutputrenameOutputRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo audioOutputrenameOutputindexCommandParameterInfo = + CommandParameterInfo audioOutputrenameOutputRequestindexCommandParameterInfo = new CommandParameterInfo("index", int.class); - audioOutputrenameOutputCommandParams.put( - "index", audioOutputrenameOutputindexCommandParameterInfo); + audioOutputrenameOutputRequestCommandParams.put( + "index", audioOutputrenameOutputRequestindexCommandParameterInfo); - CommandParameterInfo audioOutputrenameOutputnameCommandParameterInfo = + CommandParameterInfo audioOutputrenameOutputRequestnameCommandParameterInfo = new CommandParameterInfo("name", String.class); - audioOutputrenameOutputCommandParams.put( - "name", audioOutputrenameOutputnameCommandParameterInfo); + audioOutputrenameOutputRequestCommandParams.put( + "name", audioOutputrenameOutputRequestnameCommandParameterInfo); // Populate commands - InteractionInfo audioOutputrenameOutputInteractionInfo = + InteractionInfo audioOutputrenameOutputRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AudioOutputCluster) cluster) - .renameOutput( + .renameOutputRequest( (DefaultClusterCallback) callback, (Integer) commandArguments.get("index"), (String) commandArguments.get("name")); }, () -> new DelegatedDefaultClusterCallback(), - audioOutputrenameOutputCommandParams); + audioOutputrenameOutputRequestCommandParams); audioOutputClusterInteractionInfoMap.put( - "renameOutput", audioOutputrenameOutputInteractionInfo); - Map audioOutputselectOutputCommandParams = + "renameOutputRequest", audioOutputrenameOutputRequestInteractionInfo); + Map audioOutputselectOutputRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo audioOutputselectOutputindexCommandParameterInfo = + CommandParameterInfo audioOutputselectOutputRequestindexCommandParameterInfo = new CommandParameterInfo("index", int.class); - audioOutputselectOutputCommandParams.put( - "index", audioOutputselectOutputindexCommandParameterInfo); + audioOutputselectOutputRequestCommandParams.put( + "index", audioOutputselectOutputRequestindexCommandParameterInfo); // Populate commands - InteractionInfo audioOutputselectOutputInteractionInfo = + InteractionInfo audioOutputselectOutputRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.AudioOutputCluster) cluster) - .selectOutput( + .selectOutputRequest( (DefaultClusterCallback) callback, (Integer) commandArguments.get("index")); }, () -> new DelegatedDefaultClusterCallback(), - audioOutputselectOutputCommandParams); + audioOutputselectOutputRequestCommandParams); audioOutputClusterInteractionInfoMap.put( - "selectOutput", audioOutputselectOutputInteractionInfo); + "selectOutputRequest", audioOutputselectOutputRequestInteractionInfo); commandMap.put("audioOutput", audioOutputClusterInteractionInfoMap); Map barrierControlClusterInteractionInfoMap = new LinkedHashMap<>(); Map barrierControlbarrierControlGoToPercentCommandParams = @@ -5555,6 +5318,73 @@ public Map> getCommandMap() { Map bridgedDeviceBasicClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("bridgedDeviceBasic", bridgedDeviceBasicClusterInteractionInfoMap); + Map channelClusterInteractionInfoMap = new LinkedHashMap<>(); + Map channelchangeChannelByNumberRequestCommandParams = + new LinkedHashMap(); + CommandParameterInfo channelchangeChannelByNumberRequestmajorNumberCommandParameterInfo = + new CommandParameterInfo("majorNumber", int.class); + channelchangeChannelByNumberRequestCommandParams.put( + "majorNumber", channelchangeChannelByNumberRequestmajorNumberCommandParameterInfo); + + CommandParameterInfo channelchangeChannelByNumberRequestminorNumberCommandParameterInfo = + new CommandParameterInfo("minorNumber", int.class); + channelchangeChannelByNumberRequestCommandParams.put( + "minorNumber", channelchangeChannelByNumberRequestminorNumberCommandParameterInfo); + + // Populate commands + InteractionInfo channelchangeChannelByNumberRequestInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .changeChannelByNumberRequest( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("majorNumber"), + (Integer) commandArguments.get("minorNumber")); + }, + () -> new DelegatedDefaultClusterCallback(), + channelchangeChannelByNumberRequestCommandParams); + channelClusterInteractionInfoMap.put( + "changeChannelByNumberRequest", channelchangeChannelByNumberRequestInteractionInfo); + Map channelchangeChannelRequestCommandParams = + new LinkedHashMap(); + CommandParameterInfo channelchangeChannelRequestmatchCommandParameterInfo = + new CommandParameterInfo("match", String.class); + channelchangeChannelRequestCommandParams.put( + "match", channelchangeChannelRequestmatchCommandParameterInfo); + + // Populate commands + InteractionInfo channelchangeChannelRequestInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .changeChannelRequest( + (ChipClusters.ChannelCluster.ChangeChannelResponseCallback) callback, + (String) commandArguments.get("match")); + }, + () -> new DelegatedChangeChannelResponseCallback(), + channelchangeChannelRequestCommandParams); + channelClusterInteractionInfoMap.put( + "changeChannelRequest", channelchangeChannelRequestInteractionInfo); + Map channelskipChannelRequestCommandParams = + new LinkedHashMap(); + CommandParameterInfo channelskipChannelRequestcountCommandParameterInfo = + new CommandParameterInfo("count", int.class); + channelskipChannelRequestCommandParams.put( + "count", channelskipChannelRequestcountCommandParameterInfo); + + // Populate commands + InteractionInfo channelskipChannelRequestInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .skipChannelRequest( + (DefaultClusterCallback) callback, (Integer) commandArguments.get("count")); + }, + () -> new DelegatedDefaultClusterCallback(), + channelskipChannelRequestCommandParams); + channelClusterInteractionInfoMap.put( + "skipChannelRequest", channelskipChannelRequestInteractionInfo); + commandMap.put("channel", channelClusterInteractionInfoMap); Map colorControlClusterInteractionInfoMap = new LinkedHashMap<>(); Map colorControlcolorLoopSetCommandParams = new LinkedHashMap(); @@ -6372,76 +6202,64 @@ public Map> getCommandMap() { "stopMoveStep", colorControlstopMoveStepInteractionInfo); commandMap.put("colorControl", colorControlClusterInteractionInfoMap); Map contentLauncherClusterInteractionInfoMap = new LinkedHashMap<>(); - Map contentLauncherlaunchContentCommandParams = + Map contentLauncherlaunchContentRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo contentLauncherlaunchContentautoPlayCommandParameterInfo = + CommandParameterInfo contentLauncherlaunchContentRequestautoPlayCommandParameterInfo = new CommandParameterInfo("autoPlay", boolean.class); - contentLauncherlaunchContentCommandParams.put( - "autoPlay", contentLauncherlaunchContentautoPlayCommandParameterInfo); + contentLauncherlaunchContentRequestCommandParams.put( + "autoPlay", contentLauncherlaunchContentRequestautoPlayCommandParameterInfo); - CommandParameterInfo contentLauncherlaunchContentdataCommandParameterInfo = + CommandParameterInfo contentLauncherlaunchContentRequestdataCommandParameterInfo = new CommandParameterInfo("data", String.class); - contentLauncherlaunchContentCommandParams.put( - "data", contentLauncherlaunchContentdataCommandParameterInfo); - - CommandParameterInfo contentLauncherlaunchContenttypeCommandParameterInfo = - new CommandParameterInfo("type", int.class); - contentLauncherlaunchContentCommandParams.put( - "type", contentLauncherlaunchContenttypeCommandParameterInfo); - - CommandParameterInfo contentLauncherlaunchContentvalueCommandParameterInfo = - new CommandParameterInfo("value", String.class); - contentLauncherlaunchContentCommandParams.put( - "value", contentLauncherlaunchContentvalueCommandParameterInfo); + contentLauncherlaunchContentRequestCommandParams.put( + "data", contentLauncherlaunchContentRequestdataCommandParameterInfo); // Populate commands - InteractionInfo contentLauncherlaunchContentInteractionInfo = + InteractionInfo contentLauncherlaunchContentRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ContentLauncherCluster) cluster) - .launchContent( - (ChipClusters.ContentLauncherCluster.LaunchContentResponseCallback) callback, + .launchContentRequest( + (ChipClusters.ContentLauncherCluster.LaunchResponseCallback) callback, (Boolean) commandArguments.get("autoPlay"), - (String) commandArguments.get("data"), - (Integer) commandArguments.get("type"), - (String) commandArguments.get("value")); + (String) commandArguments.get("data")); }, - () -> new DelegatedLaunchContentResponseCallback(), - contentLauncherlaunchContentCommandParams); + () -> new DelegatedLaunchResponseCallback(), + contentLauncherlaunchContentRequestCommandParams); contentLauncherClusterInteractionInfoMap.put( - "launchContent", contentLauncherlaunchContentInteractionInfo); - Map contentLauncherlaunchURLCommandParams = + "launchContentRequest", contentLauncherlaunchContentRequestInteractionInfo); + Map contentLauncherlaunchURLRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo contentLauncherlaunchURLcontentURLCommandParameterInfo = + CommandParameterInfo contentLauncherlaunchURLRequestcontentURLCommandParameterInfo = new CommandParameterInfo("contentURL", String.class); - contentLauncherlaunchURLCommandParams.put( - "contentURL", contentLauncherlaunchURLcontentURLCommandParameterInfo); + contentLauncherlaunchURLRequestCommandParams.put( + "contentURL", contentLauncherlaunchURLRequestcontentURLCommandParameterInfo); - CommandParameterInfo contentLauncherlaunchURLdisplayStringCommandParameterInfo = + CommandParameterInfo contentLauncherlaunchURLRequestdisplayStringCommandParameterInfo = new CommandParameterInfo("displayString", String.class); - contentLauncherlaunchURLCommandParams.put( - "displayString", contentLauncherlaunchURLdisplayStringCommandParameterInfo); + contentLauncherlaunchURLRequestCommandParams.put( + "displayString", contentLauncherlaunchURLRequestdisplayStringCommandParameterInfo); - CommandParameterInfo contentLauncherlaunchURLproviderNameCommandParameterInfo = + CommandParameterInfo contentLauncherlaunchURLRequestproviderNameCommandParameterInfo = new CommandParameterInfo("providerName", String.class); - contentLauncherlaunchURLCommandParams.put( - "providerName", contentLauncherlaunchURLproviderNameCommandParameterInfo); + contentLauncherlaunchURLRequestCommandParams.put( + "providerName", contentLauncherlaunchURLRequestproviderNameCommandParameterInfo); // Populate commands - InteractionInfo contentLauncherlaunchURLInteractionInfo = + InteractionInfo contentLauncherlaunchURLRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ContentLauncherCluster) cluster) - .launchURL( - (ChipClusters.ContentLauncherCluster.LaunchURLResponseCallback) callback, + .launchURLRequest( + (ChipClusters.ContentLauncherCluster.LaunchResponseCallback) callback, (String) commandArguments.get("contentURL"), (String) commandArguments.get("displayString"), (String) commandArguments.get("providerName")); }, - () -> new DelegatedLaunchURLResponseCallback(), - contentLauncherlaunchURLCommandParams); + () -> new DelegatedLaunchResponseCallback(), + contentLauncherlaunchURLRequestCommandParams); contentLauncherClusterInteractionInfoMap.put( - "launchURL", contentLauncherlaunchURLInteractionInfo); + "launchURLRequest", contentLauncherlaunchURLRequestInteractionInfo); commandMap.put("contentLauncher", contentLauncherClusterInteractionInfoMap); Map descriptorClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("descriptor", descriptorClusterInteractionInfoMap); @@ -6829,6 +6647,129 @@ public Map> getCommandMap() { commandMap.put("generalDiagnostics", generalDiagnosticsClusterInteractionInfoMap); Map groupKeyManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map groupKeyManagementkeySetReadCommandParams = + new LinkedHashMap(); + CommandParameterInfo groupKeyManagementkeySetReadgroupKeySetIDCommandParameterInfo = + new CommandParameterInfo("groupKeySetID", int.class); + groupKeyManagementkeySetReadCommandParams.put( + "groupKeySetID", groupKeyManagementkeySetReadgroupKeySetIDCommandParameterInfo); + + // Populate commands + InteractionInfo groupKeyManagementkeySetReadInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .keySetRead( + (ChipClusters.GroupKeyManagementCluster.KeySetReadResponseCallback) callback, + (Integer) commandArguments.get("groupKeySetID")); + }, + () -> new DelegatedKeySetReadResponseCallback(), + groupKeyManagementkeySetReadCommandParams); + groupKeyManagementClusterInteractionInfoMap.put( + "keySetRead", groupKeyManagementkeySetReadInteractionInfo); + Map groupKeyManagementkeySetReadAllIndicesCommandParams = + new LinkedHashMap(); + CommandParameterInfo groupKeyManagementkeySetReadAllIndicesgroupKeySetIDsCommandParameterInfo = + new CommandParameterInfo("groupKeySetIDs", int.class); + groupKeyManagementkeySetReadAllIndicesCommandParams.put( + "groupKeySetIDs", groupKeyManagementkeySetReadAllIndicesgroupKeySetIDsCommandParameterInfo); + + // Populate commands + InteractionInfo groupKeyManagementkeySetReadAllIndicesInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .keySetReadAllIndices( + (ChipClusters.GroupKeyManagementCluster.KeySetReadAllIndicesResponseCallback) + callback, + (Integer) commandArguments.get("groupKeySetIDs")); + }, + () -> new DelegatedKeySetReadAllIndicesResponseCallback(), + groupKeyManagementkeySetReadAllIndicesCommandParams); + groupKeyManagementClusterInteractionInfoMap.put( + "keySetReadAllIndices", groupKeyManagementkeySetReadAllIndicesInteractionInfo); + Map groupKeyManagementkeySetRemoveCommandParams = + new LinkedHashMap(); + CommandParameterInfo groupKeyManagementkeySetRemovegroupKeySetIDCommandParameterInfo = + new CommandParameterInfo("groupKeySetID", int.class); + groupKeyManagementkeySetRemoveCommandParams.put( + "groupKeySetID", groupKeyManagementkeySetRemovegroupKeySetIDCommandParameterInfo); + + // Populate commands + InteractionInfo groupKeyManagementkeySetRemoveInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .keySetRemove( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("groupKeySetID")); + }, + () -> new DelegatedDefaultClusterCallback(), + groupKeyManagementkeySetRemoveCommandParams); + groupKeyManagementClusterInteractionInfoMap.put( + "keySetRemove", groupKeyManagementkeySetRemoveInteractionInfo); + Map groupKeyManagementkeySetWriteCommandParams = + new LinkedHashMap(); + CommandParameterInfo groupKeyManagementkeySetWritegroupKeySetIDCommandParameterInfo = + new CommandParameterInfo("groupKeySetID", int.class); + groupKeyManagementkeySetWriteCommandParams.put( + "groupKeySetID", groupKeyManagementkeySetWritegroupKeySetIDCommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWritesecurityPolicyCommandParameterInfo = + new CommandParameterInfo("securityPolicy", int.class); + groupKeyManagementkeySetWriteCommandParams.put( + "securityPolicy", groupKeyManagementkeySetWritesecurityPolicyCommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochKey0CommandParameterInfo = + new CommandParameterInfo("epochKey0", byte[].class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochKey0", groupKeyManagementkeySetWriteepochKey0CommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochStartTime0CommandParameterInfo = + new CommandParameterInfo("epochStartTime0", long.class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochStartTime0", groupKeyManagementkeySetWriteepochStartTime0CommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochKey1CommandParameterInfo = + new CommandParameterInfo("epochKey1", byte[].class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochKey1", groupKeyManagementkeySetWriteepochKey1CommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochStartTime1CommandParameterInfo = + new CommandParameterInfo("epochStartTime1", long.class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochStartTime1", groupKeyManagementkeySetWriteepochStartTime1CommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochKey2CommandParameterInfo = + new CommandParameterInfo("epochKey2", byte[].class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochKey2", groupKeyManagementkeySetWriteepochKey2CommandParameterInfo); + + CommandParameterInfo groupKeyManagementkeySetWriteepochStartTime2CommandParameterInfo = + new CommandParameterInfo("epochStartTime2", long.class); + groupKeyManagementkeySetWriteCommandParams.put( + "epochStartTime2", groupKeyManagementkeySetWriteepochStartTime2CommandParameterInfo); + + // Populate commands + InteractionInfo groupKeyManagementkeySetWriteInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .keySetWrite( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("groupKeySetID"), + (Integer) commandArguments.get("securityPolicy"), + (byte[]) commandArguments.get("epochKey0"), + (Long) commandArguments.get("epochStartTime0"), + (byte[]) commandArguments.get("epochKey1"), + (Long) commandArguments.get("epochStartTime1"), + (byte[]) commandArguments.get("epochKey2"), + (Long) commandArguments.get("epochStartTime2")); + }, + () -> new DelegatedDefaultClusterCallback(), + groupKeyManagementkeySetWriteCommandParams); + groupKeyManagementClusterInteractionInfoMap.put( + "keySetWrite", groupKeyManagementkeySetWriteInteractionInfo); commandMap.put("groupKeyManagement", groupKeyManagementClusterInteractionInfoMap); Map groupsClusterInteractionInfoMap = new LinkedHashMap<>(); Map groupsaddGroupCommandParams = @@ -7012,24 +6953,26 @@ public Map> getCommandMap() { new LinkedHashMap<>(); commandMap.put("illuminanceMeasurement", illuminanceMeasurementClusterInteractionInfoMap); Map keypadInputClusterInteractionInfoMap = new LinkedHashMap<>(); - Map keypadInputsendKeyCommandParams = + Map keypadInputsendKeyRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo keypadInputsendKeykeyCodeCommandParameterInfo = + CommandParameterInfo keypadInputsendKeyRequestkeyCodeCommandParameterInfo = new CommandParameterInfo("keyCode", int.class); - keypadInputsendKeyCommandParams.put("keyCode", keypadInputsendKeykeyCodeCommandParameterInfo); + keypadInputsendKeyRequestCommandParams.put( + "keyCode", keypadInputsendKeyRequestkeyCodeCommandParameterInfo); // Populate commands - InteractionInfo keypadInputsendKeyInteractionInfo = + InteractionInfo keypadInputsendKeyRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.KeypadInputCluster) cluster) - .sendKey( + .sendKeyRequest( (ChipClusters.KeypadInputCluster.SendKeyResponseCallback) callback, (Integer) commandArguments.get("keyCode")); }, () -> new DelegatedSendKeyResponseCallback(), - keypadInputsendKeyCommandParams); - keypadInputClusterInteractionInfoMap.put("sendKey", keypadInputsendKeyInteractionInfo); + keypadInputsendKeyRequestCommandParams); + keypadInputClusterInteractionInfoMap.put( + "sendKeyRequest", keypadInputsendKeyRequestInteractionInfo); commandMap.put("keypadInput", keypadInputClusterInteractionInfoMap); Map levelControlClusterInteractionInfoMap = new LinkedHashMap<>(); Map levelControlmoveCommandParams = @@ -7280,248 +7223,255 @@ public Map> getCommandMap() { lowPowerClusterInteractionInfoMap.put("sleep", lowPowersleepInteractionInfo); commandMap.put("lowPower", lowPowerClusterInteractionInfoMap); Map mediaInputClusterInteractionInfoMap = new LinkedHashMap<>(); - Map mediaInputhideInputStatusCommandParams = + Map mediaInputhideInputStatusRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo mediaInputhideInputStatusInteractionInfo = + InteractionInfo mediaInputhideInputStatusRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) - .hideInputStatus((DefaultClusterCallback) callback); + .hideInputStatusRequest((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), - mediaInputhideInputStatusCommandParams); + mediaInputhideInputStatusRequestCommandParams); mediaInputClusterInteractionInfoMap.put( - "hideInputStatus", mediaInputhideInputStatusInteractionInfo); - Map mediaInputrenameInputCommandParams = + "hideInputStatusRequest", mediaInputhideInputStatusRequestInteractionInfo); + Map mediaInputrenameInputRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo mediaInputrenameInputindexCommandParameterInfo = + CommandParameterInfo mediaInputrenameInputRequestindexCommandParameterInfo = new CommandParameterInfo("index", int.class); - mediaInputrenameInputCommandParams.put("index", mediaInputrenameInputindexCommandParameterInfo); + mediaInputrenameInputRequestCommandParams.put( + "index", mediaInputrenameInputRequestindexCommandParameterInfo); - CommandParameterInfo mediaInputrenameInputnameCommandParameterInfo = + CommandParameterInfo mediaInputrenameInputRequestnameCommandParameterInfo = new CommandParameterInfo("name", String.class); - mediaInputrenameInputCommandParams.put("name", mediaInputrenameInputnameCommandParameterInfo); + mediaInputrenameInputRequestCommandParams.put( + "name", mediaInputrenameInputRequestnameCommandParameterInfo); // Populate commands - InteractionInfo mediaInputrenameInputInteractionInfo = + InteractionInfo mediaInputrenameInputRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) - .renameInput( + .renameInputRequest( (DefaultClusterCallback) callback, (Integer) commandArguments.get("index"), (String) commandArguments.get("name")); }, () -> new DelegatedDefaultClusterCallback(), - mediaInputrenameInputCommandParams); - mediaInputClusterInteractionInfoMap.put("renameInput", mediaInputrenameInputInteractionInfo); - Map mediaInputselectInputCommandParams = + mediaInputrenameInputRequestCommandParams); + mediaInputClusterInteractionInfoMap.put( + "renameInputRequest", mediaInputrenameInputRequestInteractionInfo); + Map mediaInputselectInputRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo mediaInputselectInputindexCommandParameterInfo = + CommandParameterInfo mediaInputselectInputRequestindexCommandParameterInfo = new CommandParameterInfo("index", int.class); - mediaInputselectInputCommandParams.put("index", mediaInputselectInputindexCommandParameterInfo); + mediaInputselectInputRequestCommandParams.put( + "index", mediaInputselectInputRequestindexCommandParameterInfo); // Populate commands - InteractionInfo mediaInputselectInputInteractionInfo = + InteractionInfo mediaInputselectInputRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) - .selectInput( + .selectInputRequest( (DefaultClusterCallback) callback, (Integer) commandArguments.get("index")); }, () -> new DelegatedDefaultClusterCallback(), - mediaInputselectInputCommandParams); - mediaInputClusterInteractionInfoMap.put("selectInput", mediaInputselectInputInteractionInfo); - Map mediaInputshowInputStatusCommandParams = + mediaInputselectInputRequestCommandParams); + mediaInputClusterInteractionInfoMap.put( + "selectInputRequest", mediaInputselectInputRequestInteractionInfo); + Map mediaInputshowInputStatusRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo mediaInputshowInputStatusInteractionInfo = + InteractionInfo mediaInputshowInputStatusRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaInputCluster) cluster) - .showInputStatus((DefaultClusterCallback) callback); + .showInputStatusRequest((DefaultClusterCallback) callback); }, () -> new DelegatedDefaultClusterCallback(), - mediaInputshowInputStatusCommandParams); + mediaInputshowInputStatusRequestCommandParams); mediaInputClusterInteractionInfoMap.put( - "showInputStatus", mediaInputshowInputStatusInteractionInfo); + "showInputStatusRequest", mediaInputshowInputStatusRequestInteractionInfo); commandMap.put("mediaInput", mediaInputClusterInteractionInfoMap); Map mediaPlaybackClusterInteractionInfoMap = new LinkedHashMap<>(); - Map mediaPlaybackmediaFastForwardCommandParams = + Map mediaPlaybackfastForwardRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo mediaPlaybackmediaFastForwardInteractionInfo = + InteractionInfo mediaPlaybackfastForwardRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaFastForward( - (ChipClusters.MediaPlaybackCluster.MediaFastForwardResponseCallback) - callback); + .fastForwardRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback); }, - () -> new DelegatedMediaFastForwardResponseCallback(), - mediaPlaybackmediaFastForwardCommandParams); + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybackfastForwardRequestCommandParams); mediaPlaybackClusterInteractionInfoMap.put( - "mediaFastForward", mediaPlaybackmediaFastForwardInteractionInfo); - Map mediaPlaybackmediaNextCommandParams = + "fastForwardRequest", mediaPlaybackfastForwardRequestInteractionInfo); + Map mediaPlaybacknextRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo mediaPlaybackmediaNextInteractionInfo = + InteractionInfo mediaPlaybacknextRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaNext( - (ChipClusters.MediaPlaybackCluster.MediaNextResponseCallback) callback); + .nextRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback); }, - () -> new DelegatedMediaNextResponseCallback(), - mediaPlaybackmediaNextCommandParams); - mediaPlaybackClusterInteractionInfoMap.put("mediaNext", mediaPlaybackmediaNextInteractionInfo); - Map mediaPlaybackmediaPauseCommandParams = + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybacknextRequestCommandParams); + mediaPlaybackClusterInteractionInfoMap.put( + "nextRequest", mediaPlaybacknextRequestInteractionInfo); + Map mediaPlaybackpauseRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo mediaPlaybackmediaPauseInteractionInfo = + InteractionInfo mediaPlaybackpauseRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaPause( - (ChipClusters.MediaPlaybackCluster.MediaPauseResponseCallback) callback); + .pauseRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback); }, - () -> new DelegatedMediaPauseResponseCallback(), - mediaPlaybackmediaPauseCommandParams); + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybackpauseRequestCommandParams); mediaPlaybackClusterInteractionInfoMap.put( - "mediaPause", mediaPlaybackmediaPauseInteractionInfo); - Map mediaPlaybackmediaPlayCommandParams = + "pauseRequest", mediaPlaybackpauseRequestInteractionInfo); + Map mediaPlaybackplayRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo mediaPlaybackmediaPlayInteractionInfo = + InteractionInfo mediaPlaybackplayRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaPlay( - (ChipClusters.MediaPlaybackCluster.MediaPlayResponseCallback) callback); + .playRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback); }, - () -> new DelegatedMediaPlayResponseCallback(), - mediaPlaybackmediaPlayCommandParams); - mediaPlaybackClusterInteractionInfoMap.put("mediaPlay", mediaPlaybackmediaPlayInteractionInfo); - Map mediaPlaybackmediaPreviousCommandParams = + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybackplayRequestCommandParams); + mediaPlaybackClusterInteractionInfoMap.put( + "playRequest", mediaPlaybackplayRequestInteractionInfo); + Map mediaPlaybackpreviousRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo mediaPlaybackmediaPreviousInteractionInfo = + InteractionInfo mediaPlaybackpreviousRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaPrevious( - (ChipClusters.MediaPlaybackCluster.MediaPreviousResponseCallback) callback); + .previousRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback); }, - () -> new DelegatedMediaPreviousResponseCallback(), - mediaPlaybackmediaPreviousCommandParams); + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybackpreviousRequestCommandParams); mediaPlaybackClusterInteractionInfoMap.put( - "mediaPrevious", mediaPlaybackmediaPreviousInteractionInfo); - Map mediaPlaybackmediaRewindCommandParams = + "previousRequest", mediaPlaybackpreviousRequestInteractionInfo); + Map mediaPlaybackrewindRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo mediaPlaybackmediaRewindInteractionInfo = + InteractionInfo mediaPlaybackrewindRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaRewind( - (ChipClusters.MediaPlaybackCluster.MediaRewindResponseCallback) callback); + .rewindRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback); }, - () -> new DelegatedMediaRewindResponseCallback(), - mediaPlaybackmediaRewindCommandParams); + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybackrewindRequestCommandParams); mediaPlaybackClusterInteractionInfoMap.put( - "mediaRewind", mediaPlaybackmediaRewindInteractionInfo); - Map mediaPlaybackmediaSeekCommandParams = + "rewindRequest", mediaPlaybackrewindRequestInteractionInfo); + Map mediaPlaybackseekRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo mediaPlaybackmediaSeekpositionCommandParameterInfo = + CommandParameterInfo mediaPlaybackseekRequestpositionCommandParameterInfo = new CommandParameterInfo("position", long.class); - mediaPlaybackmediaSeekCommandParams.put( - "position", mediaPlaybackmediaSeekpositionCommandParameterInfo); + mediaPlaybackseekRequestCommandParams.put( + "position", mediaPlaybackseekRequestpositionCommandParameterInfo); // Populate commands - InteractionInfo mediaPlaybackmediaSeekInteractionInfo = + InteractionInfo mediaPlaybackseekRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaSeek( - (ChipClusters.MediaPlaybackCluster.MediaSeekResponseCallback) callback, + .seekRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback, (Long) commandArguments.get("position")); }, - () -> new DelegatedMediaSeekResponseCallback(), - mediaPlaybackmediaSeekCommandParams); - mediaPlaybackClusterInteractionInfoMap.put("mediaSeek", mediaPlaybackmediaSeekInteractionInfo); - Map mediaPlaybackmediaSkipBackwardCommandParams = + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybackseekRequestCommandParams); + mediaPlaybackClusterInteractionInfoMap.put( + "seekRequest", mediaPlaybackseekRequestInteractionInfo); + Map mediaPlaybackskipBackwardRequestCommandParams = new LinkedHashMap(); CommandParameterInfo - mediaPlaybackmediaSkipBackwarddeltaPositionMillisecondsCommandParameterInfo = + mediaPlaybackskipBackwardRequestdeltaPositionMillisecondsCommandParameterInfo = new CommandParameterInfo("deltaPositionMilliseconds", long.class); - mediaPlaybackmediaSkipBackwardCommandParams.put( + mediaPlaybackskipBackwardRequestCommandParams.put( "deltaPositionMilliseconds", - mediaPlaybackmediaSkipBackwarddeltaPositionMillisecondsCommandParameterInfo); + mediaPlaybackskipBackwardRequestdeltaPositionMillisecondsCommandParameterInfo); // Populate commands - InteractionInfo mediaPlaybackmediaSkipBackwardInteractionInfo = + InteractionInfo mediaPlaybackskipBackwardRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaSkipBackward( - (ChipClusters.MediaPlaybackCluster.MediaSkipBackwardResponseCallback) - callback, + .skipBackwardRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback, (Long) commandArguments.get("deltaPositionMilliseconds")); }, - () -> new DelegatedMediaSkipBackwardResponseCallback(), - mediaPlaybackmediaSkipBackwardCommandParams); + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybackskipBackwardRequestCommandParams); mediaPlaybackClusterInteractionInfoMap.put( - "mediaSkipBackward", mediaPlaybackmediaSkipBackwardInteractionInfo); - Map mediaPlaybackmediaSkipForwardCommandParams = + "skipBackwardRequest", mediaPlaybackskipBackwardRequestInteractionInfo); + Map mediaPlaybackskipForwardRequestCommandParams = new LinkedHashMap(); CommandParameterInfo - mediaPlaybackmediaSkipForwarddeltaPositionMillisecondsCommandParameterInfo = + mediaPlaybackskipForwardRequestdeltaPositionMillisecondsCommandParameterInfo = new CommandParameterInfo("deltaPositionMilliseconds", long.class); - mediaPlaybackmediaSkipForwardCommandParams.put( + mediaPlaybackskipForwardRequestCommandParams.put( "deltaPositionMilliseconds", - mediaPlaybackmediaSkipForwarddeltaPositionMillisecondsCommandParameterInfo); + mediaPlaybackskipForwardRequestdeltaPositionMillisecondsCommandParameterInfo); // Populate commands - InteractionInfo mediaPlaybackmediaSkipForwardInteractionInfo = + InteractionInfo mediaPlaybackskipForwardRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaSkipForward( - (ChipClusters.MediaPlaybackCluster.MediaSkipForwardResponseCallback) callback, + .skipForwardRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback, (Long) commandArguments.get("deltaPositionMilliseconds")); }, - () -> new DelegatedMediaSkipForwardResponseCallback(), - mediaPlaybackmediaSkipForwardCommandParams); + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybackskipForwardRequestCommandParams); mediaPlaybackClusterInteractionInfoMap.put( - "mediaSkipForward", mediaPlaybackmediaSkipForwardInteractionInfo); - Map mediaPlaybackmediaStartOverCommandParams = + "skipForwardRequest", mediaPlaybackskipForwardRequestInteractionInfo); + Map mediaPlaybackstartOverRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo mediaPlaybackmediaStartOverInteractionInfo = + InteractionInfo mediaPlaybackstartOverRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaStartOver( - (ChipClusters.MediaPlaybackCluster.MediaStartOverResponseCallback) callback); + .startOverRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback); }, - () -> new DelegatedMediaStartOverResponseCallback(), - mediaPlaybackmediaStartOverCommandParams); + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybackstartOverRequestCommandParams); mediaPlaybackClusterInteractionInfoMap.put( - "mediaStartOver", mediaPlaybackmediaStartOverInteractionInfo); - Map mediaPlaybackmediaStopCommandParams = + "startOverRequest", mediaPlaybackstartOverRequestInteractionInfo); + Map mediaPlaybackstopRequestCommandParams = new LinkedHashMap(); // Populate commands - InteractionInfo mediaPlaybackmediaStopInteractionInfo = + InteractionInfo mediaPlaybackstopRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.MediaPlaybackCluster) cluster) - .mediaStop( - (ChipClusters.MediaPlaybackCluster.MediaStopResponseCallback) callback); + .stopRequest( + (ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback); }, - () -> new DelegatedMediaStopResponseCallback(), - mediaPlaybackmediaStopCommandParams); - mediaPlaybackClusterInteractionInfoMap.put("mediaStop", mediaPlaybackmediaStopInteractionInfo); + () -> new DelegatedPlaybackResponseCallback(), + mediaPlaybackstopRequestCommandParams); + mediaPlaybackClusterInteractionInfoMap.put( + "stopRequest", mediaPlaybackstopRequestInteractionInfo); commandMap.put("mediaPlayback", mediaPlaybackClusterInteractionInfoMap); Map modeSelectClusterInteractionInfoMap = new LinkedHashMap<>(); Map modeSelectchangeToModeCommandParams = @@ -7856,11 +7806,11 @@ public Map> getCommandMap() { Map otaSoftwareUpdateRequestorannounceOtaProviderCommandParams = new LinkedHashMap(); CommandParameterInfo - otaSoftwareUpdateRequestorannounceOtaProviderproviderLocationCommandParameterInfo = - new CommandParameterInfo("providerLocation", long.class); + otaSoftwareUpdateRequestorannounceOtaProviderproviderNodeIdCommandParameterInfo = + new CommandParameterInfo("providerNodeId", long.class); otaSoftwareUpdateRequestorannounceOtaProviderCommandParams.put( - "providerLocation", - otaSoftwareUpdateRequestorannounceOtaProviderproviderLocationCommandParameterInfo); + "providerNodeId", + otaSoftwareUpdateRequestorannounceOtaProviderproviderNodeIdCommandParameterInfo); CommandParameterInfo otaSoftwareUpdateRequestorannounceOtaProvidervendorIdCommandParameterInfo = new CommandParameterInfo("vendorId", int.class); @@ -7881,6 +7831,11 @@ public Map> getCommandMap() { "metadataForNode", otaSoftwareUpdateRequestorannounceOtaProvidermetadataForNodeCommandParameterInfo); + CommandParameterInfo otaSoftwareUpdateRequestorannounceOtaProviderendpointCommandParameterInfo = + new CommandParameterInfo("endpoint", int.class); + otaSoftwareUpdateRequestorannounceOtaProviderCommandParams.put( + "endpoint", otaSoftwareUpdateRequestorannounceOtaProviderendpointCommandParameterInfo); + // Populate commands InteractionInfo otaSoftwareUpdateRequestorannounceOtaProviderInteractionInfo = new InteractionInfo( @@ -7888,10 +7843,11 @@ public Map> getCommandMap() { ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) .announceOtaProvider( (DefaultClusterCallback) callback, - (Long) commandArguments.get("providerLocation"), + (Long) commandArguments.get("providerNodeId"), (Integer) commandArguments.get("vendorId"), (Integer) commandArguments.get("announcementReason"), - (Optional) commandArguments.get("metadataForNode")); + (Optional) commandArguments.get("metadataForNode"), + (Integer) commandArguments.get("endpoint")); }, () -> new DelegatedDefaultClusterCallback(), otaSoftwareUpdateRequestorannounceOtaProviderCommandParams); @@ -8454,97 +8410,33 @@ public Map> getCommandMap() { commandMap.put("softwareDiagnostics", softwareDiagnosticsClusterInteractionInfoMap); Map switchClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("switch", switchClusterInteractionInfoMap); - Map tvChannelClusterInteractionInfoMap = new LinkedHashMap<>(); - Map tvChannelchangeChannelCommandParams = - new LinkedHashMap(); - CommandParameterInfo tvChannelchangeChannelmatchCommandParameterInfo = - new CommandParameterInfo("match", String.class); - tvChannelchangeChannelCommandParams.put( - "match", tvChannelchangeChannelmatchCommandParameterInfo); - - // Populate commands - InteractionInfo tvChannelchangeChannelInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TvChannelCluster) cluster) - .changeChannel( - (ChipClusters.TvChannelCluster.ChangeChannelResponseCallback) callback, - (String) commandArguments.get("match")); - }, - () -> new DelegatedChangeChannelResponseCallback(), - tvChannelchangeChannelCommandParams); - tvChannelClusterInteractionInfoMap.put("changeChannel", tvChannelchangeChannelInteractionInfo); - Map tvChannelchangeChannelByNumberCommandParams = - new LinkedHashMap(); - CommandParameterInfo tvChannelchangeChannelByNumbermajorNumberCommandParameterInfo = - new CommandParameterInfo("majorNumber", int.class); - tvChannelchangeChannelByNumberCommandParams.put( - "majorNumber", tvChannelchangeChannelByNumbermajorNumberCommandParameterInfo); - - CommandParameterInfo tvChannelchangeChannelByNumberminorNumberCommandParameterInfo = - new CommandParameterInfo("minorNumber", int.class); - tvChannelchangeChannelByNumberCommandParams.put( - "minorNumber", tvChannelchangeChannelByNumberminorNumberCommandParameterInfo); - - // Populate commands - InteractionInfo tvChannelchangeChannelByNumberInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TvChannelCluster) cluster) - .changeChannelByNumber( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("majorNumber"), - (Integer) commandArguments.get("minorNumber")); - }, - () -> new DelegatedDefaultClusterCallback(), - tvChannelchangeChannelByNumberCommandParams); - tvChannelClusterInteractionInfoMap.put( - "changeChannelByNumber", tvChannelchangeChannelByNumberInteractionInfo); - Map tvChannelskipChannelCommandParams = - new LinkedHashMap(); - CommandParameterInfo tvChannelskipChannelcountCommandParameterInfo = - new CommandParameterInfo("count", int.class); - tvChannelskipChannelCommandParams.put("count", tvChannelskipChannelcountCommandParameterInfo); - - // Populate commands - InteractionInfo tvChannelskipChannelInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TvChannelCluster) cluster) - .skipChannel( - (DefaultClusterCallback) callback, (Integer) commandArguments.get("count")); - }, - () -> new DelegatedDefaultClusterCallback(), - tvChannelskipChannelCommandParams); - tvChannelClusterInteractionInfoMap.put("skipChannel", tvChannelskipChannelInteractionInfo); - commandMap.put("tvChannel", tvChannelClusterInteractionInfoMap); Map targetNavigatorClusterInteractionInfoMap = new LinkedHashMap<>(); - Map targetNavigatornavigateTargetCommandParams = + Map targetNavigatornavigateTargetRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo targetNavigatornavigateTargettargetCommandParameterInfo = + CommandParameterInfo targetNavigatornavigateTargetRequesttargetCommandParameterInfo = new CommandParameterInfo("target", int.class); - targetNavigatornavigateTargetCommandParams.put( - "target", targetNavigatornavigateTargettargetCommandParameterInfo); + targetNavigatornavigateTargetRequestCommandParams.put( + "target", targetNavigatornavigateTargetRequesttargetCommandParameterInfo); - CommandParameterInfo targetNavigatornavigateTargetdataCommandParameterInfo = + CommandParameterInfo targetNavigatornavigateTargetRequestdataCommandParameterInfo = new CommandParameterInfo("data", String.class); - targetNavigatornavigateTargetCommandParams.put( - "data", targetNavigatornavigateTargetdataCommandParameterInfo); + targetNavigatornavigateTargetRequestCommandParams.put( + "data", targetNavigatornavigateTargetRequestdataCommandParameterInfo); // Populate commands - InteractionInfo targetNavigatornavigateTargetInteractionInfo = + InteractionInfo targetNavigatornavigateTargetRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TargetNavigatorCluster) cluster) - .navigateTarget( + .navigateTargetRequest( (ChipClusters.TargetNavigatorCluster.NavigateTargetResponseCallback) callback, (Integer) commandArguments.get("target"), (String) commandArguments.get("data")); }, () -> new DelegatedNavigateTargetResponseCallback(), - targetNavigatornavigateTargetCommandParams); + targetNavigatornavigateTargetRequestCommandParams); targetNavigatorClusterInteractionInfoMap.put( - "navigateTarget", targetNavigatornavigateTargetInteractionInfo); + "navigateTargetRequest", targetNavigatornavigateTargetRequestInteractionInfo); commandMap.put("targetNavigator", targetNavigatorClusterInteractionInfoMap); Map temperatureMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 3583754cfbe90c..640d5d83065bc3 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -267,6 +267,23 @@ public Map> getReadAttributeMap() { readApplicationBasicInteractionInfo.put( "readApplicationVersionAttribute", readApplicationBasicApplicationVersionAttributeInteractionInfo); + Map readApplicationBasicAllowedVendorListCommandParams = + new LinkedHashMap(); + InteractionInfo readApplicationBasicAllowedVendorListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ApplicationBasicCluster) cluster) + .readAllowedVendorListAttribute( + (ChipClusters.ApplicationBasicCluster.AllowedVendorListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedApplicationBasicClusterAllowedVendorListAttributeCallback(), + readApplicationBasicAllowedVendorListCommandParams); + readApplicationBasicInteractionInfo.put( + "readAllowedVendorListAttribute", + readApplicationBasicAllowedVendorListAttributeInteractionInfo); Map readApplicationBasicAttributeListCommandParams = new LinkedHashMap(); InteractionInfo readApplicationBasicAttributeListAttributeInteractionInfo = @@ -984,6 +1001,46 @@ public Map> getReadAttributeMap() { "readClusterRevisionAttribute", readBridgedDeviceBasicClusterRevisionAttributeInteractionInfo); readAttributeMap.put("bridgedDeviceBasic", readBridgedDeviceBasicInteractionInfo); + Map readChannelInteractionInfo = new LinkedHashMap<>(); + Map readChannelChannelListCommandParams = + new LinkedHashMap(); + InteractionInfo readChannelChannelListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .readChannelListAttribute( + (ChipClusters.ChannelCluster.ChannelListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedChannelClusterChannelListAttributeCallback(), + readChannelChannelListCommandParams); + readChannelInteractionInfo.put( + "readChannelListAttribute", readChannelChannelListAttributeInteractionInfo); + Map readChannelAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readChannelAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.ChannelCluster.AttributeListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedChannelClusterAttributeListAttributeCallback(), + readChannelAttributeListCommandParams); + readChannelInteractionInfo.put( + "readAttributeListAttribute", readChannelAttributeListAttributeInteractionInfo); + Map readChannelClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readChannelClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readChannelClusterRevisionCommandParams); + readChannelInteractionInfo.put( + "readClusterRevisionAttribute", readChannelClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("channel", readChannelInteractionInfo); Map readColorControlInteractionInfo = new LinkedHashMap<>(); Map readColorControlCurrentHueCommandParams = new LinkedHashMap(); @@ -1673,23 +1730,23 @@ public Map> getReadAttributeMap() { "readClusterRevisionAttribute", readColorControlClusterRevisionAttributeInteractionInfo); readAttributeMap.put("colorControl", readColorControlInteractionInfo); Map readContentLauncherInteractionInfo = new LinkedHashMap<>(); - Map readContentLauncherAcceptsHeaderListCommandParams = + Map readContentLauncherAcceptHeaderListCommandParams = new LinkedHashMap(); - InteractionInfo readContentLauncherAcceptsHeaderListAttributeInteractionInfo = + InteractionInfo readContentLauncherAcceptHeaderListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ContentLauncherCluster) cluster) - .readAcceptsHeaderListAttribute( - (ChipClusters.ContentLauncherCluster.AcceptsHeaderListAttributeCallback) + .readAcceptHeaderListAttribute( + (ChipClusters.ContentLauncherCluster.AcceptHeaderListAttributeCallback) callback); }, () -> new ClusterInfoMapping - .DelegatedContentLauncherClusterAcceptsHeaderListAttributeCallback(), - readContentLauncherAcceptsHeaderListCommandParams); + .DelegatedContentLauncherClusterAcceptHeaderListAttributeCallback(), + readContentLauncherAcceptHeaderListCommandParams); readContentLauncherInteractionInfo.put( - "readAcceptsHeaderListAttribute", - readContentLauncherAcceptsHeaderListAttributeInteractionInfo); + "readAcceptHeaderListAttribute", + readContentLauncherAcceptHeaderListAttributeInteractionInfo); Map readContentLauncherSupportedStreamingProtocolsCommandParams = new LinkedHashMap(); InteractionInfo readContentLauncherSupportedStreamingProtocolsAttributeInteractionInfo = @@ -2758,35 +2815,66 @@ public Map> getReadAttributeMap() { readGeneralDiagnosticsClusterRevisionAttributeInteractionInfo); readAttributeMap.put("generalDiagnostics", readGeneralDiagnosticsInteractionInfo); Map readGroupKeyManagementInteractionInfo = new LinkedHashMap<>(); - Map readGroupKeyManagementGroupsCommandParams = + Map readGroupKeyManagementGroupKeyMapCommandParams = new LinkedHashMap(); - InteractionInfo readGroupKeyManagementGroupsAttributeInteractionInfo = + InteractionInfo readGroupKeyManagementGroupKeyMapAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupKeyManagementCluster) cluster) - .readGroupsAttribute( - (ChipClusters.GroupKeyManagementCluster.GroupsAttributeCallback) callback); + .readGroupKeyMapAttribute( + (ChipClusters.GroupKeyManagementCluster.GroupKeyMapAttributeCallback) + callback); }, () -> - new ClusterInfoMapping.DelegatedGroupKeyManagementClusterGroupsAttributeCallback(), - readGroupKeyManagementGroupsCommandParams); + new ClusterInfoMapping + .DelegatedGroupKeyManagementClusterGroupKeyMapAttributeCallback(), + readGroupKeyManagementGroupKeyMapCommandParams); readGroupKeyManagementInteractionInfo.put( - "readGroupsAttribute", readGroupKeyManagementGroupsAttributeInteractionInfo); - Map readGroupKeyManagementGroupKeysCommandParams = + "readGroupKeyMapAttribute", readGroupKeyManagementGroupKeyMapAttributeInteractionInfo); + Map readGroupKeyManagementGroupTableCommandParams = new LinkedHashMap(); - InteractionInfo readGroupKeyManagementGroupKeysAttributeInteractionInfo = + InteractionInfo readGroupKeyManagementGroupTableAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.GroupKeyManagementCluster) cluster) - .readGroupKeysAttribute( - (ChipClusters.GroupKeyManagementCluster.GroupKeysAttributeCallback) callback); + .readGroupTableAttribute( + (ChipClusters.GroupKeyManagementCluster.GroupTableAttributeCallback) + callback); }, () -> new ClusterInfoMapping - .DelegatedGroupKeyManagementClusterGroupKeysAttributeCallback(), - readGroupKeyManagementGroupKeysCommandParams); + .DelegatedGroupKeyManagementClusterGroupTableAttributeCallback(), + readGroupKeyManagementGroupTableCommandParams); readGroupKeyManagementInteractionInfo.put( - "readGroupKeysAttribute", readGroupKeyManagementGroupKeysAttributeInteractionInfo); + "readGroupTableAttribute", readGroupKeyManagementGroupTableAttributeInteractionInfo); + Map readGroupKeyManagementMaxGroupsPerFabricCommandParams = + new LinkedHashMap(); + InteractionInfo readGroupKeyManagementMaxGroupsPerFabricAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .readMaxGroupsPerFabricAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGroupKeyManagementMaxGroupsPerFabricCommandParams); + readGroupKeyManagementInteractionInfo.put( + "readMaxGroupsPerFabricAttribute", + readGroupKeyManagementMaxGroupsPerFabricAttributeInteractionInfo); + Map readGroupKeyManagementMaxGroupKeysPerFabricCommandParams = + new LinkedHashMap(); + InteractionInfo readGroupKeyManagementMaxGroupKeysPerFabricAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GroupKeyManagementCluster) cluster) + .readMaxGroupKeysPerFabricAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readGroupKeyManagementMaxGroupKeysPerFabricCommandParams); + readGroupKeyManagementInteractionInfo.put( + "readMaxGroupKeysPerFabricAttribute", + readGroupKeyManagementMaxGroupKeysPerFabricAttributeInteractionInfo); Map readGroupKeyManagementAttributeListCommandParams = new LinkedHashMap(); InteractionInfo readGroupKeyManagementAttributeListAttributeInteractionInfo = @@ -3689,20 +3777,24 @@ public Map> getReadAttributeMap() { Map readOtaSoftwareUpdateRequestorInteractionInfo = new LinkedHashMap<>(); Map - readOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams = + readOtaSoftwareUpdateRequestorDefaultOtaProvidersCommandParams = new LinkedHashMap(); - InteractionInfo readOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo = + InteractionInfo readOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) - .readDefaultOtaProviderAttribute( - (ChipClusters.OctetStringAttributeCallback) callback); + .readDefaultOtaProvidersAttribute( + (ChipClusters.OtaSoftwareUpdateRequestorCluster + .DefaultOtaProvidersAttributeCallback) + callback); }, - () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), - readOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams); + () -> + new ClusterInfoMapping + .DelegatedOtaSoftwareUpdateRequestorClusterDefaultOtaProvidersAttributeCallback(), + readOtaSoftwareUpdateRequestorDefaultOtaProvidersCommandParams); readOtaSoftwareUpdateRequestorInteractionInfo.put( - "readDefaultOtaProviderAttribute", - readOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo); + "readDefaultOtaProvidersAttribute", + readOtaSoftwareUpdateRequestorDefaultOtaProvidersAttributeInteractionInfo); Map readOtaSoftwareUpdateRequestorUpdatePossibleCommandParams = new LinkedHashMap(); InteractionInfo readOtaSoftwareUpdateRequestorUpdatePossibleAttributeInteractionInfo = @@ -3716,6 +3808,36 @@ public Map> getReadAttributeMap() { readOtaSoftwareUpdateRequestorInteractionInfo.put( "readUpdatePossibleAttribute", readOtaSoftwareUpdateRequestorUpdatePossibleAttributeInteractionInfo); + Map readOtaSoftwareUpdateRequestorUpdateStateCommandParams = + new LinkedHashMap(); + InteractionInfo readOtaSoftwareUpdateRequestorUpdateStateAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) + .readUpdateStateAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOtaSoftwareUpdateRequestorUpdateStateCommandParams); + readOtaSoftwareUpdateRequestorInteractionInfo.put( + "readUpdateStateAttribute", + readOtaSoftwareUpdateRequestorUpdateStateAttributeInteractionInfo); + Map + readOtaSoftwareUpdateRequestorUpdateStateProgressCommandParams = + new LinkedHashMap(); + InteractionInfo readOtaSoftwareUpdateRequestorUpdateStateProgressAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) + .readUpdateStateProgressAttribute( + (ChipClusters.OtaSoftwareUpdateRequestorCluster + .UpdateStateProgressAttributeCallback) + callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readOtaSoftwareUpdateRequestorUpdateStateProgressCommandParams); + readOtaSoftwareUpdateRequestorInteractionInfo.put( + "readUpdateStateProgressAttribute", + readOtaSoftwareUpdateRequestorUpdateStateProgressAttributeInteractionInfo); Map readOtaSoftwareUpdateRequestorAttributeListCommandParams = new LinkedHashMap(); InteractionInfo readOtaSoftwareUpdateRequestorAttributeListAttributeInteractionInfo = @@ -5077,46 +5199,6 @@ public Map> getReadAttributeMap() { readSwitchInteractionInfo.put( "readClusterRevisionAttribute", readSwitchClusterRevisionAttributeInteractionInfo); readAttributeMap.put("switch", readSwitchInteractionInfo); - Map readTvChannelInteractionInfo = new LinkedHashMap<>(); - Map readTvChannelChannelListCommandParams = - new LinkedHashMap(); - InteractionInfo readTvChannelChannelListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TvChannelCluster) cluster) - .readChannelListAttribute( - (ChipClusters.TvChannelCluster.ChannelListAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedTvChannelClusterChannelListAttributeCallback(), - readTvChannelChannelListCommandParams); - readTvChannelInteractionInfo.put( - "readChannelListAttribute", readTvChannelChannelListAttributeInteractionInfo); - Map readTvChannelAttributeListCommandParams = - new LinkedHashMap(); - InteractionInfo readTvChannelAttributeListAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TvChannelCluster) cluster) - .readAttributeListAttribute( - (ChipClusters.TvChannelCluster.AttributeListAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedTvChannelClusterAttributeListAttributeCallback(), - readTvChannelAttributeListCommandParams); - readTvChannelInteractionInfo.put( - "readAttributeListAttribute", readTvChannelAttributeListAttributeInteractionInfo); - Map readTvChannelClusterRevisionCommandParams = - new LinkedHashMap(); - InteractionInfo readTvChannelClusterRevisionAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.TvChannelCluster) cluster) - .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readTvChannelClusterRevisionCommandParams); - readTvChannelInteractionInfo.put( - "readClusterRevisionAttribute", readTvChannelClusterRevisionAttributeInteractionInfo); - readAttributeMap.put("tvChannel", readTvChannelInteractionInfo); Map readTargetNavigatorInteractionInfo = new LinkedHashMap<>(); Map readTargetNavigatorTargetNavigatorListCommandParams = new LinkedHashMap(); @@ -7855,7 +7937,8 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionLiftAttribute( - (ChipClusters.IntegerAttributeCallback) callback); + (ChipClusters.WindowCoveringCluster.CurrentPositionLiftAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionLiftCommandParams); @@ -7869,7 +7952,8 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionTiltAttribute( - (ChipClusters.IntegerAttributeCallback) callback); + (ChipClusters.WindowCoveringCluster.CurrentPositionTiltAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionTiltCommandParams); @@ -7895,7 +7979,9 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionLiftPercentageAttribute( - (ChipClusters.IntegerAttributeCallback) callback); + (ChipClusters.WindowCoveringCluster + .CurrentPositionLiftPercentageAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionLiftPercentageCommandParams); @@ -7909,7 +7995,9 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionTiltPercentageAttribute( - (ChipClusters.IntegerAttributeCallback) callback); + (ChipClusters.WindowCoveringCluster + .CurrentPositionTiltPercentageAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionTiltPercentageCommandParams); @@ -7937,7 +8025,9 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readTargetPositionLiftPercent100thsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); + (ChipClusters.WindowCoveringCluster + .TargetPositionLiftPercent100thsAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readWindowCoveringTargetPositionLiftPercent100thsCommandParams); @@ -7952,7 +8042,9 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readTargetPositionTiltPercent100thsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); + (ChipClusters.WindowCoveringCluster + .TargetPositionTiltPercent100thsAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readWindowCoveringTargetPositionTiltPercent100thsCommandParams); @@ -7979,7 +8071,9 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionLiftPercent100thsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); + (ChipClusters.WindowCoveringCluster + .CurrentPositionLiftPercent100thsAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionLiftPercent100thsCommandParams); @@ -7994,7 +8088,9 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.WindowCoveringCluster) cluster) .readCurrentPositionTiltPercent100thsAttribute( - (ChipClusters.IntegerAttributeCallback) callback); + (ChipClusters.WindowCoveringCluster + .CurrentPositionTiltPercent100thsAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readWindowCoveringCurrentPositionTiltPercent100thsCommandParams); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java index c5e421a2fddfc9..a9142c66b7e062 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java @@ -140,6 +140,8 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("bridgedActions", writeBridgedActionsInteractionInfo); Map writeBridgedDeviceBasicInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("bridgedDeviceBasic", writeBridgedDeviceBasicInteractionInfo); + Map writeChannelInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("channel", writeChannelInteractionInfo); Map writeColorControlInteractionInfo = new LinkedHashMap<>(); Map writeColorControlColorControlOptionsCommandParams = new LinkedHashMap(); @@ -743,25 +745,6 @@ public Map> getWriteAttributeMap() { "otaSoftwareUpdateProvider", writeOtaSoftwareUpdateProviderInteractionInfo); Map writeOtaSoftwareUpdateRequestorInteractionInfo = new LinkedHashMap<>(); - Map - writeOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams = - new LinkedHashMap(); - CommandParameterInfo otaSoftwareUpdateRequestordefaultOtaProviderCommandParameterInfo = - new CommandParameterInfo("value", byte[].class); - writeOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams.put( - "value", otaSoftwareUpdateRequestordefaultOtaProviderCommandParameterInfo); - InteractionInfo writeOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo = - new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OtaSoftwareUpdateRequestorCluster) cluster) - .writeDefaultOtaProviderAttribute( - (DefaultClusterCallback) callback, (byte[]) commandArguments.get("value")); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeOtaSoftwareUpdateRequestorDefaultOtaProviderCommandParams); - writeOtaSoftwareUpdateRequestorInteractionInfo.put( - "writeDefaultOtaProviderAttribute", - writeOtaSoftwareUpdateRequestorDefaultOtaProviderAttributeInteractionInfo); writeAttributeMap.put( "otaSoftwareUpdateRequestor", writeOtaSoftwareUpdateRequestorInteractionInfo); Map writeOccupancySensingInteractionInfo = new LinkedHashMap<>(); @@ -933,8 +916,6 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("softwareDiagnostics", writeSoftwareDiagnosticsInteractionInfo); Map writeSwitchInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("switch", writeSwitchInteractionInfo); - Map writeTvChannelInteractionInfo = new LinkedHashMap<>(); - writeAttributeMap.put("tvChannel", writeTvChannelInteractionInfo); Map writeTargetNavigatorInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("targetNavigator", writeTargetNavigatorInteractionInfo); Map writeTemperatureMeasurementInteractionInfo = new LinkedHashMap<>(); diff --git a/src/controller/python/ChipDeviceController-ScriptBinding.cpp b/src/controller/python/ChipDeviceController-ScriptBinding.cpp index c16ea817b4c092..e3fb4272c2d1b3 100644 --- a/src/controller/python/ChipDeviceController-ScriptBinding.cpp +++ b/src/controller/python/ChipDeviceController-ScriptBinding.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -87,6 +88,10 @@ chip::Controller::ScriptDevicePairingDelegate sPairingDelegate; chip::Controller::ScriptDeviceAddressUpdateDelegate sDeviceAddressUpdateDelegate; chip::Controller::ExampleOperationalCredentialsIssuer sOperationalCredentialsIssuer; chip::SimpleFabricStorage sFabricStorage; +chip::Platform::ScopedMemoryBuffer sSsidBuf; +chip::Platform::ScopedMemoryBuffer sCredsBuf; +chip::Platform::ScopedMemoryBuffer sThreadBuf; +chip::Controller::CommissioningParameters sCommissioningParameters; } // namespace // NOTE: Remote device ID is in sync with the echo server device id @@ -111,6 +116,8 @@ ChipError::StorageType pychip_DeviceController_ConnectBLE(chip::Controller::Devi uint32_t setupPINCode, chip::NodeId nodeid); ChipError::StorageType pychip_DeviceController_ConnectIP(chip::Controller::DeviceCommissioner * devCtrl, const char * peerAddrStr, uint32_t setupPINCode, chip::NodeId nodeid); +ChipError::StorageType pychip_DeviceController_SetThreadOperationalDataset(const char * threadOperationalDataset, uint32_t size); +ChipError::StorageType pychip_DeviceController_SetWifiCredentials(const char * ssid, const char * credentials); ChipError::StorageType pychip_DeviceController_CloseSession(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeid); ChipError::StorageType pychip_DeviceController_EstablishPASESessionIP(chip::Controller::DeviceCommissioner * devCtrl, const char * peerAddrStr, uint32_t setupPINCode, @@ -316,7 +323,8 @@ ChipError::StorageType pychip_DeviceController_ConnectBLE(chip::Controller::Devi chip::RendezvousParameters() .SetPeerAddress(Transport::PeerAddress(Transport::Type::kBle)) .SetSetupPINCode(setupPINCode) - .SetDiscriminator(discriminator)) + .SetDiscriminator(discriminator), + sCommissioningParameters) .AsInteger(); } @@ -331,7 +339,31 @@ ChipError::StorageType pychip_DeviceController_ConnectIP(chip::Controller::Devic // TODO: IP rendezvous should use TCP connection. addr.SetTransportType(chip::Transport::Type::kUdp).SetIPAddress(peerAddr); params.SetPeerAddress(addr).SetDiscriminator(0); - return devCtrl->PairDevice(nodeid, params).AsInteger(); + return devCtrl->PairDevice(nodeid, params, sCommissioningParameters).AsInteger(); +} + +ChipError::StorageType pychip_DeviceController_SetThreadOperationalDataset(const char * threadOperationalDataset, uint32_t size) +{ + ReturnErrorCodeIf(!sThreadBuf.Alloc(size), CHIP_ERROR_NO_MEMORY.AsInteger()); + memcpy(sThreadBuf.Get(), threadOperationalDataset, size); + sCommissioningParameters.SetThreadOperationalDataset(ByteSpan(sThreadBuf.Get(), size)); + return CHIP_NO_ERROR.AsInteger(); +} +ChipError::StorageType pychip_DeviceController_SetWifiCredentials(const char * ssid, const char * credentials) +{ + size_t ssidSize = strlen(ssid); + ReturnErrorCodeIf(!sSsidBuf.Alloc(ssidSize), CHIP_ERROR_NO_MEMORY.AsInteger()); + memcpy(sSsidBuf.Get(), ssid, ssidSize); + + size_t credsSize = strlen(credentials); + ReturnErrorCodeIf(!sCredsBuf.Alloc(credsSize), CHIP_ERROR_NO_MEMORY.AsInteger()); + memcpy(sCredsBuf.Get(), credentials, credsSize); + + sCommissioningParameters.SetWifiCredentials( + chip::Controller::WifiCredentials(ByteSpan(sSsidBuf.Get(), ssidSize), ByteSpan(sCredsBuf.Get(), credsSize))); + char tmp[128]; + chip::Platform::CopyString(tmp, sCommissioningParameters.GetWifiCredentials().Value().ssid); + return CHIP_NO_ERROR.AsInteger(); } void CloseSessionCallback(DeviceProxy * device, ChipError::StorageType err) @@ -378,7 +410,7 @@ ChipError::StorageType pychip_DeviceController_DiscoverCommissionableNodesLongDiscriminator(chip::Controller::DeviceCommissioner * devCtrl, uint16_t long_discriminator) { - Dnssd::DiscoveryFilter filter(Dnssd::DiscoveryFilterType::kLong, long_discriminator); + Dnssd::DiscoveryFilter filter(Dnssd::DiscoveryFilterType::kLongDiscriminator, long_discriminator); return devCtrl->DiscoverCommissionableNodes(filter).AsInteger(); } @@ -386,14 +418,14 @@ ChipError::StorageType pychip_DeviceController_DiscoverCommissionableNodesShortDiscriminator(chip::Controller::DeviceCommissioner * devCtrl, uint16_t short_discriminator) { - Dnssd::DiscoveryFilter filter(Dnssd::DiscoveryFilterType::kShort, short_discriminator); + Dnssd::DiscoveryFilter filter(Dnssd::DiscoveryFilterType::kShortDiscriminator, short_discriminator); return devCtrl->DiscoverCommissionableNodes(filter).AsInteger(); } ChipError::StorageType pychip_DeviceController_DiscoverCommissionableNodesVendor(chip::Controller::DeviceCommissioner * devCtrl, uint16_t vendor) { - Dnssd::DiscoveryFilter filter(Dnssd::DiscoveryFilterType::kVendor, vendor); + Dnssd::DiscoveryFilter filter(Dnssd::DiscoveryFilterType::kVendorId, vendor); return devCtrl->DiscoverCommissionableNodes(filter).AsInteger(); } @@ -564,7 +596,7 @@ struct GetDeviceCallbacks delete self; } - static void OnConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR error) + static void OnConnectionFailureFn(void * context, PeerId peerId, CHIP_ERROR error) { auto * self = static_cast(context); self->mCallback(nullptr, error.AsInteger()); @@ -625,8 +657,3 @@ ChipError::StorageType pychip_DeviceController_PostTaskOnChipThread(ChipThreadTa PlatformMgr().ScheduleWork(callback, reinterpret_cast(pythonContext)); return CHIP_NO_ERROR.AsInteger(); } - -chip::ChipError::StorageType pychip_InteractionModel_ShutdownSubscription(uint64_t subscriptionId) -{ - return chip::app::InteractionModelEngine::GetInstance()->ShutdownSubscription(subscriptionId).AsInteger(); -} diff --git a/src/controller/python/chip-device-ctrl.py b/src/controller/python/chip-device-ctrl.py index 54bfef54b96b42..c7414487a7ddde 100755 --- a/src/controller/python/chip-device-ctrl.py +++ b/src/controller/python/chip-device-ctrl.py @@ -690,7 +690,7 @@ def do_discover(self, line): group.add_argument( '-s', help='discover commissionable nodes with given short discriminator', type=int) group.add_argument( - '-v', help='discover commissionable nodes wtih given vendor ID', type=int) + '-v', help='discover commissionable nodes with given vendor ID', type=int) group.add_argument( '-t', help='discover commissionable nodes with given device type', type=int) group.add_argument( @@ -896,19 +896,34 @@ def do_zclsubscribe(self, line): def do_setpairingwificredential(self, line): """ - set-pairing-wifi-credential - - Removed, use network commissioning cluster instead. + set-pairing-wifi-credential ssid credentials """ - print("Pairing WiFi Credential is nolonger available, use NetworkCommissioning cluster instead.") + try: + args = shlex.split(line) + if len(args) < 2: + print("Usage:") + self.do_help("set-pairing-wifi-credential") + return + self.devCtrl.SetWifiCredentials( + args[0].encode("utf-8"), args[1].encode("utf-8")) + except Exception as ex: + print(str(ex)) + return def do_setpairingthreadcredential(self, line): """ - set-pairing-thread-credential - - Removed, use network commissioning cluster instead. + set-pairing-thread-credential threadOperationalDataset """ - print("Pairing Thread Credential is nolonger available, use NetworkCommissioning cluster instead.") + try: + args = shlex.split(line) + if len(args) < 1: + print("Usage:") + self.do_help("set-pairing-thread-credential") + return + self.devCtrl.SetThreadOperationalDataset(bytes.fromhex(args[0])) + except Exception as ex: + print(str(ex)) + return def do_opencommissioningwindow(self, line): """ diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index a214eed01a355e..64e9b3ee7792cc 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -58,7 +58,7 @@ # This is a fix for WEAV-429. Jay Logue recommends revisiting this at a later -# date to allow for truely multiple instances so this is temporary. +# date to allow for truly multiple instances so this is temporary. def _singleton(cls): @@ -182,10 +182,17 @@ def ConnectBle(self, bleConnection): def ConnectBLE(self, discriminator, setupPinCode, nodeid): self.state = DCState.RENDEZVOUS_ONGOING - return self._ChipStack.CallAsync( + self._ChipStack.CallAsync( lambda: self._dmLib.pychip_DeviceController_ConnectBLE( self.devCtrl, discriminator, setupPinCode, nodeid) ) + # Wait up to 5 additional seconds for the commissioning complete event + if not self._ChipStack.commissioningCompleteEvent.isSet(): + self._ChipStack.commissioningCompleteEvent.wait(5.0) + if not self._ChipStack.commissioningCompleteEvent.isSet(): + # Error 50 is a timeout + return False + return self._ChipStack.commissioningEventRes == 0 def CloseBLEConnection(self): return self._ChipStack.Call( @@ -235,6 +242,18 @@ def ConnectIP(self, ipaddr, setupPinCode, nodeid): return False return self._ChipStack.commissioningEventRes == 0 + def SetWifiCredentials(self, ssid, credentials): + return self._ChipStack.Call( + lambda: self._dmLib.pychip_DeviceController_SetWifiCredentials( + ssid, credentials) + ) + + def SetThreadOperationalDataset(self, threadOperationalDataset): + return self._ChipStack.Call( + lambda: self._dmLib.pychip_DeviceController_SetThreadOperationalDataset( + threadOperationalDataset, len(threadOperationalDataset)) + ) + def ResolveNode(self, nodeid): return self._ChipStack.CallAsync( lambda: self._dmLib.pychip_DeviceController_UpdateDevice( @@ -631,12 +650,6 @@ def ZCLSubscribeAttribute(self, cluster, attribute, nodeid, endpoint, minInterva raise UnknownAttribute(cluster, attribute) return asyncio.run(self.ReadAttribute(nodeid, [(endpoint, req)], False, reportInterval=(minInterval, maxInterval))) - def ZCLShutdownSubscription(self, subscriptionId: int): - res = self._ChipStack.Call( - lambda: self._dmLib.pychip_InteractionModel_ShutdownSubscription(subscriptionId)) - if res != 0: - raise self._ChipStack.ErrorToException(res) - def ZCLCommandList(self): return self._Cluster.ListClusterCommands() @@ -679,6 +692,14 @@ def _InitLib(self): self._dmLib.pychip_DeviceController_ConnectIP.argtypes = [ c_void_p, c_char_p, c_uint32, c_uint64] + self._dmLib.pychip_DeviceController_SetThreadOperationalDataset.argtypes = [ + c_char_p, c_uint32] + self._dmLib.pychip_DeviceController_SetThreadOperationalDataset.restype = c_uint32 + + self._dmLib.pychip_DeviceController_SetWifiCredentials.argtypes = [ + c_char_p, c_char_p] + self._dmLib.pychip_DeviceController_SetWifiCredentials.restype = c_uint32 + self._dmLib.pychip_DeviceController_Commission.argtypes = [ c_void_p, c_uint64] self._dmLib.pychip_DeviceController_Commission.restype = c_uint32 @@ -770,7 +791,3 @@ def _InitLib(self): self._dmLib.pychip_DeviceController_OpenCommissioningWindow.argtypes = [ c_void_p, c_uint64, c_uint16, c_uint16, c_uint16, c_uint8] self._dmLib.pychip_DeviceController_OpenCommissioningWindow.restype = c_uint32 - - self._dmLib.pychip_InteractionModel_ShutdownSubscription.argtypes = [ - c_uint64] - self._dmLib.pychip_InteractionModel_ShutdownSubscription.restype = c_uint32 diff --git a/src/controller/python/chip/clusters/Attribute.py b/src/controller/python/chip/clusters/Attribute.py index d0027228ab15d3..f49fb670eadf7e 100644 --- a/src/controller/python/chip/clusters/Attribute.py +++ b/src/controller/python/chip/clusters/Attribute.py @@ -417,6 +417,7 @@ def __init__(self, transaction: 'AsyncReadTransaction', subscriptionId, devCtrl) self._readTransaction = transaction self._subscriptionId = subscriptionId self._devCtrl = devCtrl + self._isDone = False def GetAttributes(self): ''' Returns the attribute value cache tracking the latest state on the publisher. @@ -456,7 +457,14 @@ def OnEventChangeCb(self) -> Callable[[EventReadResult, SubscriptionTransaction] return self._onEventChangeCb def Shutdown(self): - self._devCtrl.ZCLShutdownSubscription(self._subscriptionId) + if (self._isDone): + print("Subscription was already terminated previously!") + return + + handle = chip.native.GetLibraryHandle() + handle.pychip_ReadClient_Abort( + self._readTransaction._pReadClient, self._readTransaction._pReadCallback) + self._isDone = True def __repr__(self): return f'' @@ -517,6 +525,12 @@ def __init__(self, future: Future, eventLoop, devCtrl, transactionType: Transact self._transactionType = transactionType self._cache = AttributeCache(returnClusterObject=returnClusterObject) self._changedPathSet = set() + self._pReadClient = None + self._pReadCallback = None + + def SetClientObjPointers(self, pReadClient, pReadCallback): + self._pReadClient = pReadClient + self._pReadCallback = pReadCallback def GetAllEventValues(self): return self._events @@ -795,14 +809,25 @@ def ReadAttributes(future: Future, eventLoop, device, devCtrl, attributes: List[ ctypes.pythonapi.Py_IncRef(ctypes.py_object(transaction)) minInterval = 0 maxInterval = 0 + + readClientObj = ctypes.POINTER(c_void_p)() + readCallbackObj = ctypes.POINTER(c_void_p)() + if subscriptionParameters is not None: minInterval = subscriptionParameters.MinReportIntervalFloorSeconds maxInterval = subscriptionParameters.MaxReportIntervalCeilingSeconds + res = handle.pychip_ReadClient_ReadAttributes( - ctypes.py_object(transaction), device, + ctypes.py_object(transaction), + ctypes.byref(readClientObj), + ctypes.byref(readCallbackObj), + device, ctypes.c_bool(subscriptionParameters is not None), ctypes.c_uint32(minInterval), ctypes.c_uint32(maxInterval), ctypes.c_size_t(len(attributes)), *readargs) + + transaction.SetClientObjPointers(readClientObj, readCallbackObj) + if res != 0: ctypes.pythonapi.Py_DecRef(ctypes.py_object(transaction)) return res diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index cd19b6e5599669..9daa930106d2d7 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -67,22 +67,22 @@ class ChipClusters: "commands": { 0x00000000: { "commandId": 0x00000000, - "commandName": "GetSetupPIN", + "commandName": "GetSetupPINRequest", "args": { "tempAccountIdentifier": "str", }, }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "Login", + 0x00000002: { + "commandId": 0x00000002, + "commandName": "LoginRequest", "args": { "tempAccountIdentifier": "str", "setupPIN": "str", }, }, - 0x00000002: { - "commandId": 0x00000002, - "commandName": "Logout", + 0x00000003: { + "commandId": 0x00000003, + "commandName": "LogoutRequest", "args": { }, }, @@ -164,13 +164,6 @@ class ChipClusters: "clusterName": "ApplicationBasic", "clusterId": 0x0000050D, "commands": { - 0x00000000: { - "commandId": 0x00000000, - "commandName": "ChangeStatus", - "args": { - "status": "int", - }, - }, }, "attributes": { 0x00000000: { @@ -215,6 +208,11 @@ class ChipClusters: "type": "str", "reportable": True, }, + 0x00000007: { + "attributeName": "AllowedVendorList", + "attributeId": 0x00000007, + "type": "int", + }, 0x0000FFFB: { "attributeName": "AttributeList", "attributeId": 0x0000FFFB, @@ -234,7 +232,7 @@ class ChipClusters: "commands": { 0x00000002: { "commandId": 0x00000002, - "commandName": "HideApp", + "commandName": "HideAppRequest", "args": { "catalogVendorId": "int", "applicationId": "str", @@ -242,7 +240,7 @@ class ChipClusters: }, 0x00000000: { "commandId": 0x00000000, - "commandName": "LaunchApp", + "commandName": "LaunchAppRequest", "args": { "data": "str", "catalogVendorId": "int", @@ -251,7 +249,7 @@ class ChipClusters: }, 0x00000001: { "commandId": 0x00000001, - "commandName": "StopApp", + "commandName": "StopAppRequest", "args": { "catalogVendorId": "int", "applicationId": "str", @@ -284,7 +282,7 @@ class ChipClusters: "commands": { 0x00000001: { "commandId": 0x00000001, - "commandName": "RenameOutput", + "commandName": "RenameOutputRequest", "args": { "index": "int", "name": "str", @@ -292,7 +290,7 @@ class ChipClusters: }, 0x00000000: { "commandId": 0x00000000, - "commandName": "SelectOutput", + "commandName": "SelectOutputRequest", "args": { "index": "int", }, @@ -781,6 +779,53 @@ class ChipClusters: }, }, } + _CHANNEL_CLUSTER_INFO = { + "clusterName": "Channel", + "clusterId": 0x00000504, + "commands": { + 0x00000002: { + "commandId": 0x00000002, + "commandName": "ChangeChannelByNumberRequest", + "args": { + "majorNumber": "int", + "minorNumber": "int", + }, + }, + 0x00000000: { + "commandId": 0x00000000, + "commandName": "ChangeChannelRequest", + "args": { + "match": "str", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "SkipChannelRequest", + "args": { + "count": "int", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "ChannelList", + "attributeId": 0x00000000, + "type": "", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _COLOR_CONTROL_CLUSTER_INFO = { "clusterName": "ColorControl", "clusterId": 0x00000300, @@ -1336,18 +1381,16 @@ class ChipClusters: "commands": { 0x00000000: { "commandId": 0x00000000, - "commandName": "LaunchContent", + "commandName": "LaunchContentRequest", "args": { "autoPlay": "bool", "data": "str", - "type": "int", - "value": "str", - "externalIDList": "", + "parameterList": "", }, }, 0x00000001: { "commandId": 0x00000001, - "commandName": "LaunchURL", + "commandName": "LaunchURLRequest", "args": { "contentURL": "str", "displayString": "str", @@ -1362,9 +1405,9 @@ class ChipClusters: }, "attributes": { 0x00000000: { - "attributeName": "AcceptsHeaderList", + "attributeName": "AcceptHeaderList", "attributeId": 0x00000000, - "type": "bytes", + "type": "str", "reportable": True, }, 0x00000001: { @@ -2013,20 +2056,65 @@ class ChipClusters: "clusterName": "GroupKeyManagement", "clusterId": 0x0000003F, "commands": { + 0x00000001: { + "commandId": 0x00000001, + "commandName": "KeySetRead", + "args": { + "groupKeySetID": "int", + }, + }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "KeySetReadAllIndices", + "args": { + "groupKeySetIDs": "int", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "KeySetRemove", + "args": { + "groupKeySetID": "int", + }, + }, + 0x00000000: { + "commandId": 0x00000000, + "commandName": "KeySetWrite", + "args": { + "groupKeySetID": "int", + "securityPolicy": "int", + "epochKey0": "bytes", + "epochStartTime0": "int", + "epochKey1": "bytes", + "epochStartTime1": "int", + "epochKey2": "bytes", + "epochStartTime2": "int", + }, + }, }, "attributes": { 0x00000000: { - "attributeName": "Groups", + "attributeName": "GroupKeyMap", "attributeId": 0x00000000, "type": "", "reportable": True, }, 0x00000001: { - "attributeName": "GroupKeys", + "attributeName": "GroupTable", "attributeId": 0x00000001, "type": "", "reportable": True, }, + 0x00000002: { + "attributeName": "MaxGroupsPerFabric", + "attributeId": 0x00000002, + "type": "int", + }, + 0x00000003: { + "attributeName": "MaxGroupKeysPerFabric", + "attributeId": 0x00000003, + "type": "int", + }, 0x0000FFFB: { "attributeName": "AttributeList", "attributeId": 0x0000FFFB, @@ -2216,7 +2304,7 @@ class ChipClusters: "commands": { 0x00000000: { "commandId": 0x00000000, - "commandName": "SendKey", + "commandName": "SendKeyRequest", "args": { "keyCode": "int", }, @@ -2447,13 +2535,13 @@ class ChipClusters: "commands": { 0x00000002: { "commandId": 0x00000002, - "commandName": "HideInputStatus", + "commandName": "HideInputStatusRequest", "args": { }, }, 0x00000003: { "commandId": 0x00000003, - "commandName": "RenameInput", + "commandName": "RenameInputRequest", "args": { "index": "int", "name": "str", @@ -2461,14 +2549,14 @@ class ChipClusters: }, 0x00000000: { "commandId": 0x00000000, - "commandName": "SelectInput", + "commandName": "SelectInputRequest", "args": { "index": "int", }, }, 0x00000001: { "commandId": 0x00000001, - "commandName": "ShowInputStatus", + "commandName": "ShowInputStatusRequest", "args": { }, }, @@ -2505,70 +2593,70 @@ class ChipClusters: "commands": { 0x00000007: { "commandId": 0x00000007, - "commandName": "MediaFastForward", + "commandName": "FastForwardRequest", "args": { }, }, 0x00000005: { "commandId": 0x00000005, - "commandName": "MediaNext", + "commandName": "NextRequest", "args": { }, }, 0x00000001: { "commandId": 0x00000001, - "commandName": "MediaPause", + "commandName": "PauseRequest", "args": { }, }, 0x00000000: { "commandId": 0x00000000, - "commandName": "MediaPlay", + "commandName": "PlayRequest", "args": { }, }, 0x00000004: { "commandId": 0x00000004, - "commandName": "MediaPrevious", + "commandName": "PreviousRequest", "args": { }, }, 0x00000006: { "commandId": 0x00000006, - "commandName": "MediaRewind", + "commandName": "RewindRequest", "args": { }, }, - 0x0000000A: { - "commandId": 0x0000000A, - "commandName": "MediaSeek", + 0x0000000B: { + "commandId": 0x0000000B, + "commandName": "SeekRequest", "args": { "position": "int", }, }, 0x00000009: { "commandId": 0x00000009, - "commandName": "MediaSkipBackward", + "commandName": "SkipBackwardRequest", "args": { "deltaPositionMilliseconds": "int", }, }, 0x00000008: { "commandId": 0x00000008, - "commandName": "MediaSkipForward", + "commandName": "SkipForwardRequest", "args": { "deltaPositionMilliseconds": "int", }, }, 0x00000003: { "commandId": 0x00000003, - "commandName": "MediaStartOver", + "commandName": "StartOverRequest", "args": { }, }, 0x00000002: { "commandId": 0x00000002, - "commandName": "MediaStop", + "commandName": "StopRequest", "args": { }, }, @@ -2794,16 +2882,16 @@ class ChipClusters: "clusterName": "OtaSoftwareUpdateProvider", "clusterId": 0x00000029, "commands": { - 0x00000001: { - "commandId": 0x00000001, + 0x00000002: { + "commandId": 0x00000002, "commandName": "ApplyUpdateRequest", "args": { "updateToken": "bytes", "newVersion": "int", }, }, - 0x00000002: { - "commandId": 0x00000002, + 0x00000004: { + "commandId": 0x00000004, "commandName": "NotifyUpdateApplied", "args": { "updateToken": "bytes", @@ -2847,25 +2935,38 @@ class ChipClusters: "commandId": 0x00000000, "commandName": "AnnounceOtaProvider", "args": { - "providerLocation": "int", + "providerNodeId": "int", "vendorId": "int", "announcementReason": "int", "metadataForNode": "bytes", + "endpoint": "int", }, }, }, "attributes": { + 0x00000000: { + "attributeName": "DefaultOtaProviders", + "attributeId": 0x00000000, + "type": "", + "reportable": True, + "writable": True, + }, 0x00000001: { - "attributeName": "DefaultOtaProvider", + "attributeName": "UpdatePossible", "attributeId": 0x00000001, - "type": "bytes", + "type": "bool", "reportable": True, - "writable": True, }, 0x00000002: { - "attributeName": "UpdatePossible", + "attributeName": "UpdateState", "attributeId": 0x00000002, - "type": "bool", + "type": "int", + "reportable": True, + }, + 0x00000003: { + "attributeName": "UpdateStateProgress", + "attributeId": 0x00000003, + "type": "int", "reportable": True, }, 0x0000FFFB: { @@ -3727,60 +3828,13 @@ class ChipClusters: }, }, } - _TV_CHANNEL_CLUSTER_INFO = { - "clusterName": "TvChannel", - "clusterId": 0x00000504, - "commands": { - 0x00000000: { - "commandId": 0x00000000, - "commandName": "ChangeChannel", - "args": { - "match": "str", - }, - }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "ChangeChannelByNumber", - "args": { - "majorNumber": "int", - "minorNumber": "int", - }, - }, - 0x00000002: { - "commandId": 0x00000002, - "commandName": "SkipChannel", - "args": { - "count": "int", - }, - }, - }, - "attributes": { - 0x00000000: { - "attributeName": "ChannelList", - "attributeId": 0x00000000, - "type": "", - "reportable": True, - }, - 0x0000FFFB: { - "attributeName": "AttributeList", - "attributeId": 0x0000FFFB, - "type": "int", - }, - 0x0000FFFD: { - "attributeName": "ClusterRevision", - "attributeId": 0x0000FFFD, - "type": "int", - "reportable": True, - }, - }, - } _TARGET_NAVIGATOR_CLUSTER_INFO = { "clusterName": "TargetNavigator", "clusterId": 0x00000505, "commands": { 0x00000000: { "commandId": 0x00000000, - "commandName": "NavigateTarget", + "commandName": "NavigateTargetRequest", "args": { "target": "int", "data": "str", @@ -3798,6 +3852,7 @@ class ChipClusters: "attributeName": "CurrentNavigatorTarget", "attributeId": 0x00000001, "type": "int", + "reportable": True, }, 0x0000FFFB: { "attributeName": "AttributeList", @@ -5199,6 +5254,7 @@ class ChipClusters: "attributeName": "LabelList", "attributeId": 0x00000000, "type": "", + "writable": True, }, 0x0000FFFD: { "attributeName": "ClusterRevision", @@ -5537,6 +5593,7 @@ class ChipClusters: 0x00000045: _BOOLEAN_STATE_CLUSTER_INFO, 0x00000025: _BRIDGED_ACTIONS_CLUSTER_INFO, 0x00000039: _BRIDGED_DEVICE_BASIC_CLUSTER_INFO, + 0x00000504: _CHANNEL_CLUSTER_INFO, 0x00000300: _COLOR_CONTROL_CLUSTER_INFO, 0x0000050A: _CONTENT_LAUNCHER_CLUSTER_INFO, 0x0000001D: _DESCRIPTOR_CLUSTER_INFO, @@ -5573,7 +5630,6 @@ class ChipClusters: 0x00000005: _SCENES_CLUSTER_INFO, 0x00000034: _SOFTWARE_DIAGNOSTICS_CLUSTER_INFO, 0x0000003B: _SWITCH_CLUSTER_INFO, - 0x00000504: _TV_CHANNEL_CLUSTER_INFO, 0x00000505: _TARGET_NAVIGATOR_CLUSTER_INFO, 0x00000402: _TEMPERATURE_MEASUREMENT_CLUSTER_INFO, 0x0000050F: _TEST_CLUSTER_CLUSTER_INFO, @@ -5600,6 +5656,7 @@ class ChipClusters: "BooleanState": _BOOLEAN_STATE_CLUSTER_INFO, "BridgedActions": _BRIDGED_ACTIONS_CLUSTER_INFO, "BridgedDeviceBasic": _BRIDGED_DEVICE_BASIC_CLUSTER_INFO, + "Channel": _CHANNEL_CLUSTER_INFO, "ColorControl": _COLOR_CONTROL_CLUSTER_INFO, "ContentLauncher": _CONTENT_LAUNCHER_CLUSTER_INFO, "Descriptor": _DESCRIPTOR_CLUSTER_INFO, @@ -5636,7 +5693,6 @@ class ChipClusters: "Scenes": _SCENES_CLUSTER_INFO, "SoftwareDiagnostics": _SOFTWARE_DIAGNOSTICS_CLUSTER_INFO, "Switch": _SWITCH_CLUSTER_INFO, - "TvChannel": _TV_CHANNEL_CLUSTER_INFO, "TargetNavigator": _TARGET_NAVIGATOR_CLUSTER_INFO, "TemperatureMeasurement": _TEMPERATURE_MEASUREMENT_CLUSTER_INFO, "TestCluster": _TEST_CLUSTER_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/ClusterObjects.py b/src/controller/python/chip/clusters/ClusterObjects.py index d1f46eace96e88..7b00bcad58cca1 100644 --- a/src/controller/python/chip/clusters/ClusterObjects.py +++ b/src/controller/python/chip/clusters/ClusterObjects.py @@ -140,7 +140,7 @@ def TagDictToLabelDict(self, debugPath: str, tlvData: Dict[int, Any]) -> Dict[st for tag, value in tlvData.items(): descriptor = self.GetFieldByTag(tag) if not descriptor: - # We do not have enough infomation for this field. + # We do not have enough information for this field. ret[tag] = value continue diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 7b17da90f9cd04..2100eff0bde986 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -6570,24 +6570,36 @@ def descriptor(cls) -> ClusterObjectDescriptor: metadataForProvider: 'typing.Optional[bytes]' = None @dataclass - class ApplyUpdateRequest(ClusterCommand): + class QueryImageResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0029 command_id: typing.ClassVar[int] = 0x0001 - is_client: typing.ClassVar[bool] = True + is_client: typing.ClassVar[bool] = False @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="updateToken", Tag=0, Type=bytes), - ClusterObjectFieldDescriptor(Label="newVersion", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=OtaSoftwareUpdateProvider.Enums.OTAQueryStatus), + ClusterObjectFieldDescriptor(Label="delayedActionTime", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="imageURI", Tag=2, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="softwareVersion", Tag=3, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="softwareVersionString", Tag=4, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="updateToken", Tag=5, Type=typing.Optional[bytes]), + ClusterObjectFieldDescriptor(Label="userConsentNeeded", Tag=6, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="metadataForRequestor", Tag=7, Type=typing.Optional[bytes]), ]) - updateToken: 'bytes' = b"" - newVersion: 'uint' = 0 + status: 'OtaSoftwareUpdateProvider.Enums.OTAQueryStatus' = 0 + delayedActionTime: 'typing.Optional[uint]' = None + imageURI: 'typing.Optional[str]' = None + softwareVersion: 'typing.Optional[uint]' = None + softwareVersionString: 'typing.Optional[str]' = None + updateToken: 'typing.Optional[bytes]' = None + userConsentNeeded: 'typing.Optional[bool]' = None + metadataForRequestor: 'typing.Optional[bytes]' = None @dataclass - class NotifyUpdateApplied(ClusterCommand): + class ApplyUpdateRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0029 command_id: typing.ClassVar[int] = 0x0002 is_client: typing.ClassVar[bool] = True @@ -6597,14 +6609,14 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="updateToken", Tag=0, Type=bytes), - ClusterObjectFieldDescriptor(Label="softwareVersion", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="newVersion", Tag=1, Type=uint), ]) updateToken: 'bytes' = b"" - softwareVersion: 'uint' = 0 + newVersion: 'uint' = 0 @dataclass - class QueryImageResponse(ClusterCommand): + class ApplyUpdateResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0029 command_id: typing.ClassVar[int] = 0x0003 is_client: typing.ClassVar[bool] = False @@ -6613,41 +6625,29 @@ class QueryImageResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=OtaSoftwareUpdateProvider.Enums.OTAQueryStatus), - ClusterObjectFieldDescriptor(Label="delayedActionTime", Tag=1, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="imageURI", Tag=2, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="softwareVersion", Tag=3, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="softwareVersionString", Tag=4, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="updateToken", Tag=5, Type=typing.Optional[bytes]), - ClusterObjectFieldDescriptor(Label="userConsentNeeded", Tag=6, Type=typing.Optional[bool]), - ClusterObjectFieldDescriptor(Label="metadataForRequestor", Tag=7, Type=typing.Optional[bytes]), + ClusterObjectFieldDescriptor(Label="action", Tag=0, Type=OtaSoftwareUpdateProvider.Enums.OTAApplyUpdateAction), + ClusterObjectFieldDescriptor(Label="delayedActionTime", Tag=1, Type=uint), ]) - status: 'OtaSoftwareUpdateProvider.Enums.OTAQueryStatus' = 0 - delayedActionTime: 'typing.Optional[uint]' = None - imageURI: 'typing.Optional[str]' = None - softwareVersion: 'typing.Optional[uint]' = None - softwareVersionString: 'typing.Optional[str]' = None - updateToken: 'typing.Optional[bytes]' = None - userConsentNeeded: 'typing.Optional[bool]' = None - metadataForRequestor: 'typing.Optional[bytes]' = None + action: 'OtaSoftwareUpdateProvider.Enums.OTAApplyUpdateAction' = 0 + delayedActionTime: 'uint' = 0 @dataclass - class ApplyUpdateResponse(ClusterCommand): + class NotifyUpdateApplied(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0029 command_id: typing.ClassVar[int] = 0x0004 - is_client: typing.ClassVar[bool] = False + is_client: typing.ClassVar[bool] = True @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="action", Tag=0, Type=OtaSoftwareUpdateProvider.Enums.OTAApplyUpdateAction), - ClusterObjectFieldDescriptor(Label="delayedActionTime", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="updateToken", Tag=0, Type=bytes), + ClusterObjectFieldDescriptor(Label="softwareVersion", Tag=1, Type=uint), ]) - action: 'OtaSoftwareUpdateProvider.Enums.OTAApplyUpdateAction' = 0 - delayedActionTime: 'uint' = 0 + updateToken: 'bytes' = b"" + softwareVersion: 'uint' = 0 class Attributes: @@ -6709,15 +6709,19 @@ class OtaSoftwareUpdateRequestor(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="defaultOtaProvider", Tag=0x00000001, Type=bytes), - ClusterObjectFieldDescriptor(Label="updatePossible", Tag=0x00000002, Type=bool), + ClusterObjectFieldDescriptor(Label="defaultOtaProviders", Tag=0x00000000, Type=typing.List[OtaSoftwareUpdateRequestor.Structs.ProviderLocation]), + ClusterObjectFieldDescriptor(Label="updatePossible", Tag=0x00000001, Type=bool), + ClusterObjectFieldDescriptor(Label="updateState", Tag=0x00000002, Type=OtaSoftwareUpdateRequestor.Enums.UpdateStateEnum), + ClusterObjectFieldDescriptor(Label="updateStateProgress", Tag=0x00000003, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - defaultOtaProvider: 'bytes' = None + defaultOtaProviders: 'typing.List[OtaSoftwareUpdateRequestor.Structs.ProviderLocation]' = None updatePossible: 'bool' = None + updateState: 'OtaSoftwareUpdateRequestor.Enums.UpdateStateEnum' = None + updateStateProgress: 'typing.Union[Nullable, uint]' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None @@ -6747,6 +6751,23 @@ class UpdateStateEnum(IntEnum): kDelayedOnUserConsent = 0x08 + class Structs: + @dataclass + class ProviderLocation(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="providerNodeID", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="endpoint", Tag=2, Type=uint), + ]) + + fabricIndex: 'uint' = 0 + providerNodeID: 'uint' = 0 + endpoint: 'uint' = 0 + + class Commands: @dataclass @@ -6759,34 +6780,36 @@ class AnnounceOtaProvider(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="providerLocation", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="providerNodeId", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="vendorId", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="announcementReason", Tag=2, Type=OtaSoftwareUpdateRequestor.Enums.OTAAnnouncementReason), ClusterObjectFieldDescriptor(Label="metadataForNode", Tag=3, Type=typing.Optional[bytes]), + ClusterObjectFieldDescriptor(Label="endpoint", Tag=4, Type=uint), ]) - providerLocation: 'uint' = 0 + providerNodeId: 'uint' = 0 vendorId: 'uint' = 0 announcementReason: 'OtaSoftwareUpdateRequestor.Enums.OTAAnnouncementReason' = 0 metadataForNode: 'typing.Optional[bytes]' = None + endpoint: 'uint' = 0 class Attributes: @dataclass - class DefaultOtaProvider(ClusterAttributeDescriptor): + class DefaultOtaProviders(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x002A @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000001 + return 0x00000000 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=bytes) + return ClusterObjectFieldDescriptor(Type=typing.List[OtaSoftwareUpdateRequestor.Structs.ProviderLocation]) - value: 'bytes' = b"" + value: 'typing.List[OtaSoftwareUpdateRequestor.Structs.ProviderLocation]' = field(default_factory=lambda: []) @dataclass class UpdatePossible(ClusterAttributeDescriptor): @@ -6796,7 +6819,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000002 + return 0x00000001 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -6804,6 +6827,38 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'bool' = False + @dataclass + class UpdateState(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=OtaSoftwareUpdateRequestor.Enums.UpdateStateEnum) + + value: 'OtaSoftwareUpdateRequestor.Enums.UpdateStateEnum' = 0 + + @dataclass + class UpdateStateProgress(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x002A + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, uint]) + + value: 'typing.Union[Nullable, uint]' = NullValue + @dataclass class AttributeList(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -6868,16 +6923,16 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="previousState", Tag=0, Type=OtaSoftwareUpdateRequestor.Enums.UpdateStateEnum), + ClusterObjectFieldDescriptor(Label="previousState", Tag=0, Type=typing.Union[Nullable, OtaSoftwareUpdateRequestor.Enums.UpdateStateEnum]), ClusterObjectFieldDescriptor(Label="newState", Tag=1, Type=OtaSoftwareUpdateRequestor.Enums.UpdateStateEnum), ClusterObjectFieldDescriptor(Label="reason", Tag=2, Type=OtaSoftwareUpdateRequestor.Enums.ChangeReasonEnum), - ClusterObjectFieldDescriptor(Label="targetSoftwareVersion", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="targetSoftwareVersion", Tag=3, Type=typing.Union[Nullable, uint]), ]) - previousState: 'OtaSoftwareUpdateRequestor.Enums.UpdateStateEnum' = 0 + previousState: 'typing.Union[Nullable, OtaSoftwareUpdateRequestor.Enums.UpdateStateEnum]' = NullValue newState: 'OtaSoftwareUpdateRequestor.Enums.UpdateStateEnum' = 0 reason: 'OtaSoftwareUpdateRequestor.Enums.ChangeReasonEnum' = 0 - targetSoftwareVersion: 'uint' = 0 + targetSoftwareVersion: 'typing.Union[Nullable, uint]' = NullValue @dataclass class VersionApplied(ClusterEvent): @@ -6917,13 +6972,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="softwareVersion", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="bytesDownloaded", Tag=1, Type=uint), ClusterObjectFieldDescriptor(Label="progressPercent", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="platformCode", Tag=3, Type=int), + ClusterObjectFieldDescriptor(Label="platformCode", Tag=3, Type=typing.Union[Nullable, int]), ]) softwareVersion: 'uint' = 0 bytesDownloaded: 'uint' = 0 progressPercent: 'uint' = 0 - platformCode: 'int' = 0 + platformCode: 'typing.Union[Nullable, int]' = NullValue @dataclass @@ -8179,6 +8234,13 @@ class NetworkCommissioningStatus(IntEnum): kIPBindFailed = 0x0B kUnknownError = 0x0C + class WiFiBand(IntEnum): + k2g4 = 0x00 + k3g65 = 0x01 + k5g = 0x02 + k6g = 0x03 + k60g = 0x04 + class Structs: @dataclass @@ -8229,7 +8291,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="ssid", Tag=2, Type=bytes), ClusterObjectFieldDescriptor(Label="bssid", Tag=3, Type=bytes), ClusterObjectFieldDescriptor(Label="channel", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="wiFiBand", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="wiFiBand", Tag=5, Type=NetworkCommissioning.Enums.WiFiBand), ClusterObjectFieldDescriptor(Label="rssi", Tag=6, Type=int), ]) @@ -8237,7 +8299,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ssid: 'bytes' = b"" bssid: 'bytes' = b"" channel: 'uint' = 0 - wiFiBand: 'uint' = 0 + wiFiBand: 'NetworkCommissioning.Enums.WiFiBand' = 0 rssi: 'int' = 0 @@ -8272,14 +8334,14 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields = [ ClusterObjectFieldDescriptor(Label="networkingStatus", Tag=0, Type=NetworkCommissioning.Enums.NetworkCommissioningStatus), ClusterObjectFieldDescriptor(Label="debugText", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="wiFiScanResults", Tag=2, Type=typing.List[NetworkCommissioning.Structs.WiFiInterfaceScanResult]), - ClusterObjectFieldDescriptor(Label="threadScanResults", Tag=3, Type=typing.List[NetworkCommissioning.Structs.ThreadInterfaceScanResult]), + ClusterObjectFieldDescriptor(Label="wiFiScanResults", Tag=2, Type=typing.Optional[typing.List[NetworkCommissioning.Structs.WiFiInterfaceScanResult]]), + ClusterObjectFieldDescriptor(Label="threadScanResults", Tag=3, Type=typing.Optional[typing.List[NetworkCommissioning.Structs.ThreadInterfaceScanResult]]), ]) networkingStatus: 'NetworkCommissioning.Enums.NetworkCommissioningStatus' = 0 debugText: 'str' = "" - wiFiScanResults: 'typing.List[NetworkCommissioning.Structs.WiFiInterfaceScanResult]' = field(default_factory=lambda: []) - threadScanResults: 'typing.List[NetworkCommissioning.Structs.ThreadInterfaceScanResult]' = field(default_factory=lambda: []) + wiFiScanResults: 'typing.Optional[typing.List[NetworkCommissioning.Structs.WiFiInterfaceScanResult]]' = None + threadScanResults: 'typing.Optional[typing.List[NetworkCommissioning.Structs.ThreadInterfaceScanResult]]' = None @dataclass class AddOrUpdateWiFiNetwork(ClusterCommand): @@ -12683,15 +12745,19 @@ class GroupKeyManagement(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="groups", Tag=0x00000000, Type=typing.List[GroupKeyManagement.Structs.GroupState]), - ClusterObjectFieldDescriptor(Label="groupKeys", Tag=0x00000001, Type=typing.List[GroupKeyManagement.Structs.GroupKey]), + ClusterObjectFieldDescriptor(Label="groupKeyMap", Tag=0x00000000, Type=typing.List[GroupKeyManagement.Structs.GroupKey]), + ClusterObjectFieldDescriptor(Label="groupTable", Tag=0x00000001, Type=typing.List[GroupKeyManagement.Structs.GroupInfo]), + ClusterObjectFieldDescriptor(Label="maxGroupsPerFabric", Tag=0x00000002, Type=uint), + ClusterObjectFieldDescriptor(Label="maxGroupKeysPerFabric", Tag=0x00000003, Type=uint), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - groups: 'typing.List[GroupKeyManagement.Structs.GroupState]' = None - groupKeys: 'typing.List[GroupKeyManagement.Structs.GroupKey]' = None + groupKeyMap: 'typing.List[GroupKeyManagement.Structs.GroupKey]' = None + groupTable: 'typing.List[GroupKeyManagement.Structs.GroupInfo]' = None + maxGroupsPerFabric: 'uint' = None + maxGroupKeysPerFabric: 'uint' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None @@ -12703,46 +12769,160 @@ class GroupKeySecurityPolicy(IntEnum): class Structs: + @dataclass + class GroupInfo(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="groupId", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="endpoints", Tag=2, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="groupName", Tag=3, Type=str), + ]) + + fabricIndex: 'uint' = 0 + groupId: 'uint' = 0 + endpoints: 'typing.List[uint]' = field(default_factory=lambda: []) + groupName: 'str' = "" + @dataclass class GroupKey(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="vendorId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="groupKeyIndex", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="groupKeyRoot", Tag=3, Type=bytes), - ClusterObjectFieldDescriptor(Label="groupKeyEpochStartTime", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="groupKeySecurityPolicy", Tag=5, Type=GroupKeyManagement.Enums.GroupKeySecurityPolicy), + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="groupId", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="groupKeySetID", Tag=2, Type=uint), ]) - vendorId: 'uint' = 0 - groupKeyIndex: 'uint' = 0 - groupKeyRoot: 'bytes' = b"" - groupKeyEpochStartTime: 'uint' = 0 - groupKeySecurityPolicy: 'GroupKeyManagement.Enums.GroupKeySecurityPolicy' = 0 + fabricIndex: 'uint' = 0 + groupId: 'uint' = 0 + groupKeySetID: 'uint' = 0 @dataclass - class GroupState(ClusterObject): + class GroupKeySet(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="vendorId", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="vendorGroupId", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="groupKeySetIndex", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="groupKeySetID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="securityPolicy", Tag=1, Type=GroupKeyManagement.Enums.GroupKeySecurityPolicy), + ClusterObjectFieldDescriptor(Label="epochKey0", Tag=2, Type=bytes), + ClusterObjectFieldDescriptor(Label="epochStartTime0", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="epochKey1", Tag=4, Type=bytes), + ClusterObjectFieldDescriptor(Label="epochStartTime1", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="epochKey2", Tag=6, Type=bytes), + ClusterObjectFieldDescriptor(Label="epochStartTime2", Tag=7, Type=uint), ]) - vendorId: 'uint' = 0 - vendorGroupId: 'uint' = 0 - groupKeySetIndex: 'uint' = 0 + groupKeySetID: 'uint' = 0 + securityPolicy: 'GroupKeyManagement.Enums.GroupKeySecurityPolicy' = 0 + epochKey0: 'bytes' = b"" + epochStartTime0: 'uint' = 0 + epochKey1: 'bytes' = b"" + epochStartTime1: 'uint' = 0 + epochKey2: 'bytes' = b"" + epochStartTime2: 'uint' = 0 + + + + class Commands: + @dataclass + class KeySetWrite(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0000 + is_client: typing.ClassVar[bool] = True + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySet", Tag=0, Type=GroupKeyManagement.Structs.GroupKeySet), + ]) + + groupKeySet: 'GroupKeyManagement.Structs.GroupKeySet' = field(default_factory=lambda: GroupKeyManagement.Structs.GroupKeySet()) + + @dataclass + class KeySetRead(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0001 + is_client: typing.ClassVar[bool] = True + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySetID", Tag=0, Type=uint), + ]) + + groupKeySetID: 'uint' = 0 + + @dataclass + class KeySetReadResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0002 + is_client: typing.ClassVar[bool] = False + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySet", Tag=0, Type=GroupKeyManagement.Structs.GroupKeySet), + ]) + + groupKeySet: 'GroupKeyManagement.Structs.GroupKeySet' = field(default_factory=lambda: GroupKeyManagement.Structs.GroupKeySet()) + + @dataclass + class KeySetRemove(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0003 + is_client: typing.ClassVar[bool] = True + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySetID", Tag=0, Type=uint), + ]) + + groupKeySetID: 'uint' = 0 + + @dataclass + class KeySetReadAllIndices(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0004 + is_client: typing.ClassVar[bool] = True + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySetIDs", Tag=0, Type=typing.List[uint]), + ]) + groupKeySetIDs: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class KeySetReadAllIndicesResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x003F + command_id: typing.ClassVar[int] = 0x0005 + is_client: typing.ClassVar[bool] = False + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="groupKeySetIDs", Tag=0, Type=typing.List[uint]), + ]) + + groupKeySetIDs: 'typing.List[uint]' = field(default_factory=lambda: []) class Attributes: @dataclass - class Groups(ClusterAttributeDescriptor): + class GroupKeyMap(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x003F @@ -12753,12 +12933,12 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[GroupKeyManagement.Structs.GroupState]) + return ClusterObjectFieldDescriptor(Type=typing.List[GroupKeyManagement.Structs.GroupKey]) - value: 'typing.List[GroupKeyManagement.Structs.GroupState]' = field(default_factory=lambda: []) + value: 'typing.List[GroupKeyManagement.Structs.GroupKey]' = field(default_factory=lambda: []) @dataclass - class GroupKeys(ClusterAttributeDescriptor): + class GroupTable(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x003F @@ -12769,9 +12949,41 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[GroupKeyManagement.Structs.GroupKey]) + return ClusterObjectFieldDescriptor(Type=typing.List[GroupKeyManagement.Structs.GroupInfo]) - value: 'typing.List[GroupKeyManagement.Structs.GroupKey]' = field(default_factory=lambda: []) + value: 'typing.List[GroupKeyManagement.Structs.GroupInfo]' = field(default_factory=lambda: []) + + @dataclass + class MaxGroupsPerFabric(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003F + + @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 MaxGroupKeysPerFabric(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x003F + + @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 AttributeList(ClusterAttributeDescriptor): @@ -15766,29 +15978,24 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="type", Tag=0x00000000, Type=uint), ClusterObjectFieldDescriptor(Label="physicalClosedLimitLift", Tag=0x00000001, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="physicalClosedLimitTilt", Tag=0x00000002, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="currentPositionLift", Tag=0x00000003, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="currentPositionTilt", Tag=0x00000004, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="currentPositionLift", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="currentPositionTilt", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="numberOfActuationsLift", Tag=0x00000005, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="numberOfActuationsTilt", Tag=0x00000006, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="configStatus", Tag=0x00000007, Type=uint), - ClusterObjectFieldDescriptor(Label="currentPositionLiftPercentage", Tag=0x00000008, Type=uint), - ClusterObjectFieldDescriptor(Label="currentPositionTiltPercentage", Tag=0x00000009, Type=uint), + ClusterObjectFieldDescriptor(Label="currentPositionLiftPercentage", Tag=0x00000008, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="currentPositionTiltPercentage", Tag=0x00000009, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="operationalStatus", Tag=0x0000000A, Type=uint), - ClusterObjectFieldDescriptor(Label="targetPositionLiftPercent100ths", Tag=0x0000000B, Type=uint), - ClusterObjectFieldDescriptor(Label="targetPositionTiltPercent100ths", Tag=0x0000000C, Type=uint), + ClusterObjectFieldDescriptor(Label="targetPositionLiftPercent100ths", Tag=0x0000000B, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="targetPositionTiltPercent100ths", Tag=0x0000000C, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="endProductType", Tag=0x0000000D, Type=uint), - ClusterObjectFieldDescriptor(Label="currentPositionLiftPercent100ths", Tag=0x0000000E, Type=uint), - ClusterObjectFieldDescriptor(Label="currentPositionTiltPercent100ths", Tag=0x0000000F, Type=uint), - ClusterObjectFieldDescriptor(Label="installedOpenLimitLift", Tag=0x00000010, Type=uint), - ClusterObjectFieldDescriptor(Label="installedClosedLimitLift", Tag=0x00000011, Type=uint), - ClusterObjectFieldDescriptor(Label="installedOpenLimitTilt", Tag=0x00000012, Type=uint), - ClusterObjectFieldDescriptor(Label="installedClosedLimitTilt", Tag=0x00000013, Type=uint), - ClusterObjectFieldDescriptor(Label="velocityLift", Tag=0x00000014, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="accelerationTimeLift", Tag=0x00000015, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="decelerationTimeLift", Tag=0x00000016, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="currentPositionLiftPercent100ths", Tag=0x0000000E, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="currentPositionTiltPercent100ths", Tag=0x0000000F, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="installedOpenLimitLift", Tag=0x00000010, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="installedClosedLimitLift", Tag=0x00000011, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="installedOpenLimitTilt", Tag=0x00000012, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="installedClosedLimitTilt", Tag=0x00000013, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="mode", Tag=0x00000017, Type=uint), - ClusterObjectFieldDescriptor(Label="intermediateSetpointsLift", Tag=0x00000018, Type=typing.Optional[bytes]), - ClusterObjectFieldDescriptor(Label="intermediateSetpointsTilt", Tag=0x00000019, Type=typing.Optional[bytes]), ClusterObjectFieldDescriptor(Label="safetyStatus", Tag=0x0000001A, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), @@ -15798,29 +16005,24 @@ def descriptor(cls) -> ClusterObjectDescriptor: type: 'uint' = None physicalClosedLimitLift: 'typing.Optional[uint]' = None physicalClosedLimitTilt: 'typing.Optional[uint]' = None - currentPositionLift: 'typing.Optional[uint]' = None - currentPositionTilt: 'typing.Optional[uint]' = None + currentPositionLift: 'typing.Union[None, Nullable, uint]' = None + currentPositionTilt: 'typing.Union[None, Nullable, uint]' = None numberOfActuationsLift: 'typing.Optional[uint]' = None numberOfActuationsTilt: 'typing.Optional[uint]' = None configStatus: 'uint' = None - currentPositionLiftPercentage: 'uint' = None - currentPositionTiltPercentage: 'uint' = None + currentPositionLiftPercentage: 'typing.Union[None, Nullable, uint]' = None + currentPositionTiltPercentage: 'typing.Union[None, Nullable, uint]' = None operationalStatus: 'uint' = None - targetPositionLiftPercent100ths: 'uint' = None - targetPositionTiltPercent100ths: 'uint' = None + targetPositionLiftPercent100ths: 'typing.Union[None, Nullable, uint]' = None + targetPositionTiltPercent100ths: 'typing.Union[None, Nullable, uint]' = None endProductType: 'uint' = None - currentPositionLiftPercent100ths: 'uint' = None - currentPositionTiltPercent100ths: 'uint' = None - installedOpenLimitLift: 'uint' = None - installedClosedLimitLift: 'uint' = None - installedOpenLimitTilt: 'uint' = None - installedClosedLimitTilt: 'uint' = None - velocityLift: 'typing.Optional[uint]' = None - accelerationTimeLift: 'typing.Optional[uint]' = None - decelerationTimeLift: 'typing.Optional[uint]' = None + currentPositionLiftPercent100ths: 'typing.Union[None, Nullable, uint]' = None + currentPositionTiltPercent100ths: 'typing.Union[None, Nullable, uint]' = None + installedOpenLimitLift: 'typing.Optional[uint]' = None + installedClosedLimitLift: 'typing.Optional[uint]' = None + installedOpenLimitTilt: 'typing.Optional[uint]' = None + installedClosedLimitTilt: 'typing.Optional[uint]' = None mode: 'uint' = None - intermediateSetpointsLift: 'typing.Optional[bytes]' = None - intermediateSetpointsTilt: 'typing.Optional[bytes]' = None safetyStatus: 'typing.Optional[uint]' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None @@ -15994,9 +16196,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class CurrentPositionTilt(ClusterAttributeDescriptor): @@ -16010,9 +16212,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class NumberOfActuationsLift(ClusterAttributeDescriptor): @@ -16074,9 +16276,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class CurrentPositionTiltPercentage(ClusterAttributeDescriptor): @@ -16090,9 +16292,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class OperationalStatus(ClusterAttributeDescriptor): @@ -16122,9 +16324,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class TargetPositionTiltPercent100ths(ClusterAttributeDescriptor): @@ -16138,9 +16340,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class EndProductType(ClusterAttributeDescriptor): @@ -16170,9 +16372,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'uint' = 0 + value: 'typing.Union[None, Nullable, uint]' = None @dataclass class CurrentPositionTiltPercent100ths(ClusterAttributeDescriptor): @@ -16186,99 +16388,19 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class InstalledOpenLimitLift(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0102 - - @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 InstalledClosedLimitLift(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0102 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000011 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class InstalledOpenLimitTilt(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0102 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000012 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class InstalledClosedLimitTilt(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0102 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000013 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class VelocityLift(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0102 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000014 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - value: 'typing.Optional[uint]' = None + value: 'typing.Union[None, Nullable, uint]' = None @dataclass - class AccelerationTimeLift(ClusterAttributeDescriptor): + class InstalledOpenLimitLift(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0102 @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000015 + return 0x00000010 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16287,14 +16409,14 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[uint]' = None @dataclass - class DecelerationTimeLift(ClusterAttributeDescriptor): + class InstalledClosedLimitLift(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0102 @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000016 + return 0x00000011 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: @@ -16303,52 +16425,52 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[uint]' = None @dataclass - class Mode(ClusterAttributeDescriptor): + class InstalledOpenLimitTilt(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0102 @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000017 + return 0x00000012 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - value: 'uint' = 0 + value: 'typing.Optional[uint]' = None @dataclass - class IntermediateSetpointsLift(ClusterAttributeDescriptor): + class InstalledClosedLimitTilt(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0102 @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000018 + return 0x00000013 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[bytes]) + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - value: 'typing.Optional[bytes]' = None + value: 'typing.Optional[uint]' = None @dataclass - class IntermediateSetpointsTilt(ClusterAttributeDescriptor): + class Mode(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x0102 @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000019 + return 0x00000017 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[bytes]) + return ClusterObjectFieldDescriptor(Type=uint) - value: 'typing.Optional[bytes]' = None + value: 'uint' = 0 @dataclass class SafetyStatus(ClusterAttributeDescriptor): @@ -27224,40 +27346,40 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class TvChannel(Cluster): +class Channel(Cluster): id: typing.ClassVar[int] = 0x0504 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="channelList", Tag=0x00000000, Type=typing.List[TvChannel.Structs.TvChannelInfo]), - ClusterObjectFieldDescriptor(Label="channelLineup", Tag=0x00000001, Type=TvChannel.Structs.TvChannelLineupInfo), - ClusterObjectFieldDescriptor(Label="currentChannel", Tag=0x00000002, Type=TvChannel.Structs.TvChannelInfo), + ClusterObjectFieldDescriptor(Label="channelList", Tag=0x00000000, Type=typing.Optional[typing.List[Channel.Structs.ChannelInfo]]), + ClusterObjectFieldDescriptor(Label="channelLineup", Tag=0x00000001, Type=typing.Optional[Channel.Structs.LineupInfo]), + ClusterObjectFieldDescriptor(Label="currentChannel", Tag=0x00000002, Type=typing.Optional[Channel.Structs.ChannelInfo]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - channelList: 'typing.List[TvChannel.Structs.TvChannelInfo]' = None - channelLineup: 'TvChannel.Structs.TvChannelLineupInfo' = None - currentChannel: 'TvChannel.Structs.TvChannelInfo' = None + channelList: 'typing.Optional[typing.List[Channel.Structs.ChannelInfo]]' = None + channelLineup: 'typing.Optional[Channel.Structs.LineupInfo]' = None + currentChannel: 'typing.Optional[Channel.Structs.ChannelInfo]' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None class Enums: - class TvChannelErrorType(IntEnum): + class ErrorTypeEnum(IntEnum): kMultipleMatches = 0x00 kNoMatches = 0x01 - class TvChannelLineupInfoType(IntEnum): + class LineupInfoTypeEnum(IntEnum): kMso = 0x00 class Structs: @dataclass - class TvChannelInfo(ClusterObject): + class ChannelInfo(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -27276,7 +27398,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: affiliateCallSign: 'str' = "" @dataclass - class TvChannelLineupInfo(ClusterObject): + class LineupInfo(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -27284,19 +27406,19 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="operatorName", Tag=1, Type=str), ClusterObjectFieldDescriptor(Label="lineupName", Tag=2, Type=str), ClusterObjectFieldDescriptor(Label="postalCode", Tag=3, Type=str), - ClusterObjectFieldDescriptor(Label="lineupInfoType", Tag=4, Type=TvChannel.Enums.TvChannelLineupInfoType), + ClusterObjectFieldDescriptor(Label="lineupInfoType", Tag=4, Type=Channel.Enums.LineupInfoTypeEnum), ]) operatorName: 'str' = "" lineupName: 'str' = "" postalCode: 'str' = "" - lineupInfoType: 'TvChannel.Enums.TvChannelLineupInfoType' = 0 + lineupInfoType: 'Channel.Enums.LineupInfoTypeEnum' = 0 class Commands: @dataclass - class ChangeChannel(ClusterCommand): + class ChangeChannelRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0504 command_id: typing.ClassVar[int] = 0x0000 is_client: typing.ClassVar[bool] = True @@ -27313,24 +27435,24 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class ChangeChannelResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0504 - command_id: typing.ClassVar[int] = 0x0000 + command_id: typing.ClassVar[int] = 0x0001 is_client: typing.ClassVar[bool] = False @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="channelMatch", Tag=0, Type=TvChannel.Structs.TvChannelInfo), - ClusterObjectFieldDescriptor(Label="errorType", Tag=1, Type=TvChannel.Enums.TvChannelErrorType), + ClusterObjectFieldDescriptor(Label="channelMatch", Tag=0, Type=Channel.Structs.ChannelInfo), + ClusterObjectFieldDescriptor(Label="errorType", Tag=1, Type=Channel.Enums.ErrorTypeEnum), ]) - channelMatch: 'TvChannel.Structs.TvChannelInfo' = field(default_factory=lambda: TvChannel.Structs.TvChannelInfo()) - errorType: 'TvChannel.Enums.TvChannelErrorType' = 0 + channelMatch: 'Channel.Structs.ChannelInfo' = field(default_factory=lambda: Channel.Structs.ChannelInfo()) + errorType: 'Channel.Enums.ErrorTypeEnum' = 0 @dataclass - class ChangeChannelByNumber(ClusterCommand): + class ChangeChannelByNumberRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0504 - command_id: typing.ClassVar[int] = 0x0001 + command_id: typing.ClassVar[int] = 0x0002 is_client: typing.ClassVar[bool] = True @ChipUtility.classproperty @@ -27345,9 +27467,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: minorNumber: 'uint' = 0 @dataclass - class SkipChannel(ClusterCommand): + class SkipChannelRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0504 - command_id: typing.ClassVar[int] = 0x0002 + command_id: typing.ClassVar[int] = 0x0003 is_client: typing.ClassVar[bool] = True @ChipUtility.classproperty @@ -27373,9 +27495,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[TvChannel.Structs.TvChannelInfo]) + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[Channel.Structs.ChannelInfo]]) - value: 'typing.List[TvChannel.Structs.TvChannelInfo]' = field(default_factory=lambda: []) + value: 'typing.Optional[typing.List[Channel.Structs.ChannelInfo]]' = None @dataclass class ChannelLineup(ClusterAttributeDescriptor): @@ -27389,9 +27511,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=TvChannel.Structs.TvChannelLineupInfo) + return ClusterObjectFieldDescriptor(Type=typing.Optional[Channel.Structs.LineupInfo]) - value: 'TvChannel.Structs.TvChannelLineupInfo' = field(default_factory=lambda: TvChannel.Structs.TvChannelLineupInfo()) + value: 'typing.Optional[Channel.Structs.LineupInfo]' = None @dataclass class CurrentChannel(ClusterAttributeDescriptor): @@ -27405,9 +27527,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=TvChannel.Structs.TvChannelInfo) + return ClusterObjectFieldDescriptor(Type=typing.Optional[Channel.Structs.ChannelInfo]) - value: 'TvChannel.Structs.TvChannelInfo' = field(default_factory=lambda: TvChannel.Structs.TvChannelInfo()) + value: 'typing.Optional[Channel.Structs.ChannelInfo]' = None @dataclass class AttributeList(ClusterAttributeDescriptor): @@ -27467,21 +27589,21 @@ class TargetNavigator(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="targetNavigatorList", Tag=0x00000000, Type=typing.List[TargetNavigator.Structs.NavigateTargetTargetInfo]), + ClusterObjectFieldDescriptor(Label="targetNavigatorList", Tag=0x00000000, Type=typing.List[TargetNavigator.Structs.TargetInfo]), ClusterObjectFieldDescriptor(Label="currentNavigatorTarget", Tag=0x00000001, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - targetNavigatorList: 'typing.List[TargetNavigator.Structs.NavigateTargetTargetInfo]' = None + targetNavigatorList: 'typing.List[TargetNavigator.Structs.TargetInfo]' = None currentNavigatorTarget: 'typing.Optional[uint]' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None class Enums: - class NavigateTargetStatus(IntEnum): + class StatusEnum(IntEnum): kSuccess = 0x00 kAppNotAvailable = 0x01 kSystemBusy = 0x02 @@ -27489,7 +27611,7 @@ class NavigateTargetStatus(IntEnum): class Structs: @dataclass - class NavigateTargetTargetInfo(ClusterObject): + class TargetInfo(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -27505,7 +27627,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: class Commands: @dataclass - class NavigateTarget(ClusterCommand): + class NavigateTargetRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0505 command_id: typing.ClassVar[int] = 0x0000 is_client: typing.ClassVar[bool] = True @@ -27524,18 +27646,18 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class NavigateTargetResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0505 - command_id: typing.ClassVar[int] = 0x0000 + command_id: typing.ClassVar[int] = 0x0001 is_client: typing.ClassVar[bool] = False @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=TargetNavigator.Enums.NavigateTargetStatus), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=TargetNavigator.Enums.StatusEnum), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=str), ]) - status: 'TargetNavigator.Enums.NavigateTargetStatus' = 0 + status: 'TargetNavigator.Enums.StatusEnum' = 0 data: 'str' = "" @@ -27552,9 +27674,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[TargetNavigator.Structs.NavigateTargetTargetInfo]) + return ClusterObjectFieldDescriptor(Type=typing.List[TargetNavigator.Structs.TargetInfo]) - value: 'typing.List[TargetNavigator.Structs.NavigateTargetTargetInfo]' = field(default_factory=lambda: []) + value: 'typing.List[TargetNavigator.Structs.TargetInfo]' = field(default_factory=lambda: []) @dataclass class CurrentNavigatorTarget(ClusterAttributeDescriptor): @@ -27630,10 +27752,10 @@ class MediaPlayback(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="playbackState", Tag=0x00000000, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="playbackState", Tag=0x00000000, Type=typing.Optional[MediaPlayback.Enums.PlaybackStateEnum]), ClusterObjectFieldDescriptor(Label="startTime", Tag=0x00000001, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="duration", Tag=0x00000002, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="position", Tag=0x00000003, Type=MediaPlayback.Structs.MediaPlaybackPosition), + ClusterObjectFieldDescriptor(Label="position", Tag=0x00000003, Type=MediaPlayback.Structs.PlaybackPosition), ClusterObjectFieldDescriptor(Label="playbackSpeed", Tag=0x00000004, Type=typing.Optional[float]), ClusterObjectFieldDescriptor(Label="seekRangeEnd", Tag=0x00000005, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="seekRangeStart", Tag=0x00000006, Type=typing.Optional[uint]), @@ -27642,10 +27764,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - playbackState: 'typing.Optional[uint]' = None + playbackState: 'typing.Optional[MediaPlayback.Enums.PlaybackStateEnum]' = None startTime: 'typing.Optional[uint]' = None duration: 'typing.Optional[uint]' = None - position: 'MediaPlayback.Structs.MediaPlaybackPosition' = None + position: 'MediaPlayback.Structs.PlaybackPosition' = None playbackSpeed: 'typing.Optional[float]' = None seekRangeEnd: 'typing.Optional[uint]' = None seekRangeStart: 'typing.Optional[uint]' = None @@ -27654,13 +27776,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class MediaPlaybackState(IntEnum): + class PlaybackStateEnum(IntEnum): kPlaying = 0x00 kPaused = 0x01 kNotPlaying = 0x02 kBuffering = 0x03 - class MediaPlaybackStatus(IntEnum): + class StatusEnum(IntEnum): kSuccess = 0x00 kInvalidStateForCommand = 0x01 kNotAllowed = 0x02 @@ -27671,7 +27793,7 @@ class MediaPlaybackStatus(IntEnum): class Structs: @dataclass - class MediaPlaybackPosition(ClusterObject): + class PlaybackPosition(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -27687,7 +27809,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: class Commands: @dataclass - class MediaPlay(ClusterCommand): + class PlayRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 command_id: typing.ClassVar[int] = 0x0000 is_client: typing.ClassVar[bool] = True @@ -27700,22 +27822,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass - class MediaPlayResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x0000 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), - ]) - - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 - - @dataclass - class MediaPause(ClusterCommand): + class PauseRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 command_id: typing.ClassVar[int] = 0x0001 is_client: typing.ClassVar[bool] = True @@ -27728,22 +27835,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass - class MediaPauseResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x0001 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), - ]) - - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 - - @dataclass - class MediaStop(ClusterCommand): + class StopRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 command_id: typing.ClassVar[int] = 0x0002 is_client: typing.ClassVar[bool] = True @@ -27756,22 +27848,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass - class MediaStopResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x0002 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), - ]) - - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 - - @dataclass - class MediaStartOver(ClusterCommand): + class StartOverRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 command_id: typing.ClassVar[int] = 0x0003 is_client: typing.ClassVar[bool] = True @@ -27784,22 +27861,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass - class MediaStartOverResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x0003 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), - ]) - - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 - - @dataclass - class MediaPrevious(ClusterCommand): + class PreviousRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 command_id: typing.ClassVar[int] = 0x0004 is_client: typing.ClassVar[bool] = True @@ -27812,22 +27874,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass - class MediaPreviousResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x0004 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), - ]) - - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 - - @dataclass - class MediaNext(ClusterCommand): + class NextRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 command_id: typing.ClassVar[int] = 0x0005 is_client: typing.ClassVar[bool] = True @@ -27840,22 +27887,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass - class MediaNextResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x0005 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), - ]) - - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 - - @dataclass - class MediaRewind(ClusterCommand): + class RewindRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 command_id: typing.ClassVar[int] = 0x0006 is_client: typing.ClassVar[bool] = True @@ -27868,22 +27900,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass - class MediaRewindResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x0006 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), - ]) - - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 - - @dataclass - class MediaFastForward(ClusterCommand): + class FastForwardRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 command_id: typing.ClassVar[int] = 0x0007 is_client: typing.ClassVar[bool] = True @@ -27896,22 +27913,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass - class MediaFastForwardResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x0007 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), - ]) - - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 - - @dataclass - class MediaSkipForward(ClusterCommand): + class SkipForwardRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 command_id: typing.ClassVar[int] = 0x0008 is_client: typing.ClassVar[bool] = True @@ -27926,22 +27928,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: deltaPositionMilliseconds: 'uint' = 0 @dataclass - class MediaSkipForwardResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x0008 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), - ]) - - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 - - @dataclass - class MediaSkipBackward(ClusterCommand): + class SkipBackwardRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 command_id: typing.ClassVar[int] = 0x0009 is_client: typing.ClassVar[bool] = True @@ -27956,24 +27943,24 @@ def descriptor(cls) -> ClusterObjectDescriptor: deltaPositionMilliseconds: 'uint' = 0 @dataclass - class MediaSkipBackwardResponse(ClusterCommand): + class PlaybackResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x0009 + command_id: typing.ClassVar[int] = 0x000A is_client: typing.ClassVar[bool] = False @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=MediaPlayback.Enums.StatusEnum), ]) - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 + status: 'MediaPlayback.Enums.StatusEnum' = 0 @dataclass - class MediaSeek(ClusterCommand): + class SeekRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x000A + command_id: typing.ClassVar[int] = 0x000B is_client: typing.ClassVar[bool] = True @ChipUtility.classproperty @@ -27985,21 +27972,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: position: 'uint' = 0 - @dataclass - class MediaSeekResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0506 - command_id: typing.ClassVar[int] = 0x000B - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="mediaPlaybackStatus", Tag=0, Type=MediaPlayback.Enums.MediaPlaybackStatus), - ]) - - mediaPlaybackStatus: 'MediaPlayback.Enums.MediaPlaybackStatus' = 0 - class Attributes: @dataclass @@ -28014,9 +27986,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + return ClusterObjectFieldDescriptor(Type=typing.Optional[MediaPlayback.Enums.PlaybackStateEnum]) - value: 'typing.Optional[uint]' = None + value: 'typing.Optional[MediaPlayback.Enums.PlaybackStateEnum]' = None @dataclass class StartTime(ClusterAttributeDescriptor): @@ -28062,9 +28034,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=MediaPlayback.Structs.MediaPlaybackPosition) + return ClusterObjectFieldDescriptor(Type=MediaPlayback.Structs.PlaybackPosition) - value: 'MediaPlayback.Structs.MediaPlaybackPosition' = field(default_factory=lambda: MediaPlayback.Structs.MediaPlaybackPosition()) + value: 'MediaPlayback.Structs.PlaybackPosition' = field(default_factory=lambda: MediaPlayback.Structs.PlaybackPosition()) @dataclass class PlaybackSpeed(ClusterAttributeDescriptor): @@ -28172,21 +28144,21 @@ class MediaInput(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="mediaInputList", Tag=0x00000000, Type=typing.List[MediaInput.Structs.MediaInputInfo]), + ClusterObjectFieldDescriptor(Label="mediaInputList", Tag=0x00000000, Type=typing.List[MediaInput.Structs.InputInfo]), ClusterObjectFieldDescriptor(Label="currentMediaInput", Tag=0x00000001, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - mediaInputList: 'typing.List[MediaInput.Structs.MediaInputInfo]' = None + mediaInputList: 'typing.List[MediaInput.Structs.InputInfo]' = None currentMediaInput: 'typing.Optional[uint]' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None class Enums: - class MediaInputType(IntEnum): + class InputTypeEnum(IntEnum): kInternal = 0x00 kAux = 0x01 kCoax = 0x02 @@ -28203,19 +28175,19 @@ class MediaInputType(IntEnum): class Structs: @dataclass - class MediaInputInfo(ClusterObject): + class InputInfo(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="index", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="inputType", Tag=2, Type=MediaInput.Enums.MediaInputType), + ClusterObjectFieldDescriptor(Label="inputType", Tag=2, Type=MediaInput.Enums.InputTypeEnum), ClusterObjectFieldDescriptor(Label="name", Tag=3, Type=str), ClusterObjectFieldDescriptor(Label="description", Tag=4, Type=str), ]) index: 'uint' = 0 - inputType: 'MediaInput.Enums.MediaInputType' = 0 + inputType: 'MediaInput.Enums.InputTypeEnum' = 0 name: 'str' = "" description: 'str' = "" @@ -28223,7 +28195,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: class Commands: @dataclass - class SelectInput(ClusterCommand): + class SelectInputRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0507 command_id: typing.ClassVar[int] = 0x0000 is_client: typing.ClassVar[bool] = True @@ -28238,7 +28210,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: index: 'uint' = 0 @dataclass - class ShowInputStatus(ClusterCommand): + class ShowInputStatusRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0507 command_id: typing.ClassVar[int] = 0x0001 is_client: typing.ClassVar[bool] = True @@ -28251,7 +28223,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass - class HideInputStatus(ClusterCommand): + class HideInputStatusRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0507 command_id: typing.ClassVar[int] = 0x0002 is_client: typing.ClassVar[bool] = True @@ -28264,7 +28236,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass - class RenameInput(ClusterCommand): + class RenameInputRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0507 command_id: typing.ClassVar[int] = 0x0003 is_client: typing.ClassVar[bool] = True @@ -28294,9 +28266,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[MediaInput.Structs.MediaInputInfo]) + return ClusterObjectFieldDescriptor(Type=typing.List[MediaInput.Structs.InputInfo]) - value: 'typing.List[MediaInput.Structs.MediaInputInfo]' = field(default_factory=lambda: []) + value: 'typing.List[MediaInput.Structs.InputInfo]' = field(default_factory=lambda: []) @dataclass class CurrentMediaInput(ClusterAttributeDescriptor): @@ -28467,7 +28439,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class KeypadInputCecKeyCode(IntEnum): + class CecKeyCode(IntEnum): kSelect = 0x00 kUp = 0x01 kDown = 0x02 @@ -28555,7 +28527,7 @@ class KeypadInputCecKeyCode(IntEnum): kF5 = 0x75 kData = 0x76 - class KeypadInputStatus(IntEnum): + class StatusEnum(IntEnum): kSuccess = 0x00 kUnsupportedKey = 0x01 kInvalidKeyInCurrentState = 0x02 @@ -28564,7 +28536,7 @@ class KeypadInputStatus(IntEnum): class Commands: @dataclass - class SendKey(ClusterCommand): + class SendKeyRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0509 command_id: typing.ClassVar[int] = 0x0000 is_client: typing.ClassVar[bool] = True @@ -28573,25 +28545,25 @@ class SendKey(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="keyCode", Tag=0, Type=KeypadInput.Enums.KeypadInputCecKeyCode), + ClusterObjectFieldDescriptor(Label="keyCode", Tag=0, Type=KeypadInput.Enums.CecKeyCode), ]) - keyCode: 'KeypadInput.Enums.KeypadInputCecKeyCode' = 0 + keyCode: 'KeypadInput.Enums.CecKeyCode' = 0 @dataclass class SendKeyResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x0509 - command_id: typing.ClassVar[int] = 0x0000 + command_id: typing.ClassVar[int] = 0x0001 is_client: typing.ClassVar[bool] = False @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=KeypadInput.Enums.KeypadInputStatus), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=KeypadInput.Enums.StatusEnum), ]) - status: 'KeypadInput.Enums.KeypadInputStatus' = 0 + status: 'KeypadInput.Enums.StatusEnum' = 0 class Attributes: @@ -28653,25 +28625,25 @@ class ContentLauncher(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="acceptsHeaderList", Tag=0x00000000, Type=typing.List[bytes]), + ClusterObjectFieldDescriptor(Label="acceptHeaderList", Tag=0x00000000, Type=typing.List[str]), ClusterObjectFieldDescriptor(Label="supportedStreamingProtocols", Tag=0x00000001, Type=uint), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - acceptsHeaderList: 'typing.List[bytes]' = None + acceptHeaderList: 'typing.List[str]' = None supportedStreamingProtocols: 'uint' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None class Enums: - class ContentLaunchMetricType(IntEnum): + class MetricTypeEnum(IntEnum): kPixels = 0x00 kPercentage = 0x01 - class ContentLaunchParameterEnum(IntEnum): + class ParameterEnum(IntEnum): kActor = 0x00 kChannel = 0x01 kCharacter = 0x02 @@ -28686,7 +28658,7 @@ class ContentLaunchParameterEnum(IntEnum): kSportsTeam = 0x0B kType = 0x0C - class ContentLaunchStatus(IntEnum): + class StatusEnum(IntEnum): kSuccess = 0x00 kUrlNotAvailable = 0x01 kAuthFailed = 0x02 @@ -28694,22 +28666,22 @@ class ContentLaunchStatus(IntEnum): class Structs: @dataclass - class ContentLaunchDimension(ClusterObject): + class Dimension(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="width", Tag=1, Type=float), ClusterObjectFieldDescriptor(Label="height", Tag=2, Type=float), - ClusterObjectFieldDescriptor(Label="metric", Tag=3, Type=ContentLauncher.Enums.ContentLaunchMetricType), + ClusterObjectFieldDescriptor(Label="metric", Tag=3, Type=ContentLauncher.Enums.MetricTypeEnum), ]) width: 'float' = 0.0 height: 'float' = 0.0 - metric: 'ContentLauncher.Enums.ContentLaunchMetricType' = 0 + metric: 'ContentLauncher.Enums.MetricTypeEnum' = 0 @dataclass - class ContentLaunchAdditionalInfo(ClusterObject): + class AdditionalInfo(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -28722,61 +28694,72 @@ def descriptor(cls) -> ClusterObjectDescriptor: value: 'str' = "" @dataclass - class ContentLaunchParamater(ClusterObject): + class Parameter(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="type", Tag=1, Type=ContentLauncher.Enums.ContentLaunchParameterEnum), + ClusterObjectFieldDescriptor(Label="type", Tag=1, Type=ContentLauncher.Enums.ParameterEnum), ClusterObjectFieldDescriptor(Label="value", Tag=2, Type=str), - ClusterObjectFieldDescriptor(Label="externalIDList", Tag=3, Type=typing.List[ContentLauncher.Structs.ContentLaunchAdditionalInfo]), + ClusterObjectFieldDescriptor(Label="externalIDList", Tag=3, Type=typing.List[ContentLauncher.Structs.AdditionalInfo]), ]) - type: 'ContentLauncher.Enums.ContentLaunchParameterEnum' = 0 + type: 'ContentLauncher.Enums.ParameterEnum' = 0 value: 'str' = "" - externalIDList: 'typing.List[ContentLauncher.Structs.ContentLaunchAdditionalInfo]' = field(default_factory=lambda: []) + externalIDList: 'typing.List[ContentLauncher.Structs.AdditionalInfo]' = field(default_factory=lambda: []) + + @dataclass + class ContentSearch(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="parameterList", Tag=1, Type=typing.List[ContentLauncher.Structs.Parameter]), + ]) + + parameterList: 'typing.List[ContentLauncher.Structs.Parameter]' = field(default_factory=lambda: []) @dataclass - class ContentLaunchStyleInformation(ClusterObject): + class StyleInformation(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="imageUrl", Tag=1, Type=str), ClusterObjectFieldDescriptor(Label="color", Tag=2, Type=str), - ClusterObjectFieldDescriptor(Label="size", Tag=3, Type=ContentLauncher.Structs.ContentLaunchDimension), + ClusterObjectFieldDescriptor(Label="size", Tag=3, Type=ContentLauncher.Structs.Dimension), ]) imageUrl: 'str' = "" color: 'str' = "" - size: 'ContentLauncher.Structs.ContentLaunchDimension' = field(default_factory=lambda: ContentLauncher.Structs.ContentLaunchDimension()) + size: 'ContentLauncher.Structs.Dimension' = field(default_factory=lambda: ContentLauncher.Structs.Dimension()) @dataclass - class ContentLaunchBrandingInformation(ClusterObject): + class BrandingInformation(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="providerName", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="background", Tag=2, Type=ContentLauncher.Structs.ContentLaunchStyleInformation), - ClusterObjectFieldDescriptor(Label="logo", Tag=3, Type=ContentLauncher.Structs.ContentLaunchStyleInformation), - ClusterObjectFieldDescriptor(Label="progressBar", Tag=4, Type=ContentLauncher.Structs.ContentLaunchStyleInformation), - ClusterObjectFieldDescriptor(Label="splash", Tag=5, Type=ContentLauncher.Structs.ContentLaunchStyleInformation), - ClusterObjectFieldDescriptor(Label="waterMark", Tag=6, Type=ContentLauncher.Structs.ContentLaunchStyleInformation), + ClusterObjectFieldDescriptor(Label="background", Tag=2, Type=ContentLauncher.Structs.StyleInformation), + ClusterObjectFieldDescriptor(Label="logo", Tag=3, Type=ContentLauncher.Structs.StyleInformation), + ClusterObjectFieldDescriptor(Label="progressBar", Tag=4, Type=ContentLauncher.Structs.StyleInformation), + ClusterObjectFieldDescriptor(Label="splash", Tag=5, Type=ContentLauncher.Structs.StyleInformation), + ClusterObjectFieldDescriptor(Label="waterMark", Tag=6, Type=ContentLauncher.Structs.StyleInformation), ]) providerName: 'str' = "" - background: 'ContentLauncher.Structs.ContentLaunchStyleInformation' = field(default_factory=lambda: ContentLauncher.Structs.ContentLaunchStyleInformation()) - logo: 'ContentLauncher.Structs.ContentLaunchStyleInformation' = field(default_factory=lambda: ContentLauncher.Structs.ContentLaunchStyleInformation()) - progressBar: 'ContentLauncher.Structs.ContentLaunchStyleInformation' = field(default_factory=lambda: ContentLauncher.Structs.ContentLaunchStyleInformation()) - splash: 'ContentLauncher.Structs.ContentLaunchStyleInformation' = field(default_factory=lambda: ContentLauncher.Structs.ContentLaunchStyleInformation()) - waterMark: 'ContentLauncher.Structs.ContentLaunchStyleInformation' = field(default_factory=lambda: ContentLauncher.Structs.ContentLaunchStyleInformation()) + background: 'ContentLauncher.Structs.StyleInformation' = field(default_factory=lambda: ContentLauncher.Structs.StyleInformation()) + logo: 'ContentLauncher.Structs.StyleInformation' = field(default_factory=lambda: ContentLauncher.Structs.StyleInformation()) + progressBar: 'ContentLauncher.Structs.StyleInformation' = field(default_factory=lambda: ContentLauncher.Structs.StyleInformation()) + splash: 'ContentLauncher.Structs.StyleInformation' = field(default_factory=lambda: ContentLauncher.Structs.StyleInformation()) + waterMark: 'ContentLauncher.Structs.StyleInformation' = field(default_factory=lambda: ContentLauncher.Structs.StyleInformation()) class Commands: @dataclass - class LaunchContent(ClusterCommand): + class LaunchContentRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050A command_id: typing.ClassVar[int] = 0x0000 is_client: typing.ClassVar[bool] = True @@ -28787,32 +28770,15 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields = [ ClusterObjectFieldDescriptor(Label="autoPlay", Tag=0, Type=bool), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="search", Tag=2, Type=typing.List[ContentLauncher.Structs.ContentLaunchParamater]), + ClusterObjectFieldDescriptor(Label="search", Tag=2, Type=typing.List[ContentLauncher.Structs.ContentSearch]), ]) autoPlay: 'bool' = False data: 'str' = "" - search: 'typing.List[ContentLauncher.Structs.ContentLaunchParamater]' = field(default_factory=lambda: []) - - @dataclass - class LaunchContentResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x050A - command_id: typing.ClassVar[int] = 0x0000 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="contentLaunchStatus", Tag=0, Type=ContentLauncher.Enums.ContentLaunchStatus), - ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=str), - ]) - - contentLaunchStatus: 'ContentLauncher.Enums.ContentLaunchStatus' = 0 - data: 'str' = "" + search: 'typing.List[ContentLauncher.Structs.ContentSearch]' = field(default_factory=lambda: []) @dataclass - class LaunchURL(ClusterCommand): + class LaunchURLRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050A command_id: typing.ClassVar[int] = 0x0001 is_client: typing.ClassVar[bool] = True @@ -28823,34 +28789,34 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields = [ ClusterObjectFieldDescriptor(Label="contentURL", Tag=0, Type=str), ClusterObjectFieldDescriptor(Label="displayString", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="brandingInformation", Tag=2, Type=typing.List[ContentLauncher.Structs.ContentLaunchBrandingInformation]), + ClusterObjectFieldDescriptor(Label="brandingInformation", Tag=2, Type=ContentLauncher.Structs.BrandingInformation), ]) contentURL: 'str' = "" displayString: 'str' = "" - brandingInformation: 'typing.List[ContentLauncher.Structs.ContentLaunchBrandingInformation]' = field(default_factory=lambda: []) + brandingInformation: 'ContentLauncher.Structs.BrandingInformation' = field(default_factory=lambda: ContentLauncher.Structs.BrandingInformation()) @dataclass - class LaunchURLResponse(ClusterCommand): + class LaunchResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050A - command_id: typing.ClassVar[int] = 0x0001 + command_id: typing.ClassVar[int] = 0x0002 is_client: typing.ClassVar[bool] = False @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="contentLaunchStatus", Tag=0, Type=ContentLauncher.Enums.ContentLaunchStatus), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ContentLauncher.Enums.StatusEnum), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=str), ]) - contentLaunchStatus: 'ContentLauncher.Enums.ContentLaunchStatus' = 0 + status: 'ContentLauncher.Enums.StatusEnum' = 0 data: 'str' = "" class Attributes: @dataclass - class AcceptsHeaderList(ClusterAttributeDescriptor): + class AcceptHeaderList(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x050A @@ -28861,9 +28827,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[bytes]) + return ClusterObjectFieldDescriptor(Type=typing.List[str]) - value: 'typing.List[bytes]' = field(default_factory=lambda: []) + value: 'typing.List[str]' = field(default_factory=lambda: []) @dataclass class SupportedStreamingProtocols(ClusterAttributeDescriptor): @@ -28939,21 +28905,21 @@ class AudioOutput(Cluster): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="audioOutputList", Tag=0x00000000, Type=typing.List[AudioOutput.Structs.AudioOutputInfo]), + ClusterObjectFieldDescriptor(Label="audioOutputList", Tag=0x00000000, Type=typing.List[AudioOutput.Structs.OutputInfo]), ClusterObjectFieldDescriptor(Label="currentAudioOutput", Tag=0x00000001, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - audioOutputList: 'typing.List[AudioOutput.Structs.AudioOutputInfo]' = None + audioOutputList: 'typing.List[AudioOutput.Structs.OutputInfo]' = None currentAudioOutput: 'typing.Optional[uint]' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None class Enums: - class AudioOutputType(IntEnum): + class OutputTypeEnum(IntEnum): kHdmi = 0x00 kBt = 0x01 kOptical = 0x02 @@ -28964,25 +28930,25 @@ class AudioOutputType(IntEnum): class Structs: @dataclass - class AudioOutputInfo(ClusterObject): + class OutputInfo(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="index", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="outputType", Tag=2, Type=AudioOutput.Enums.AudioOutputType), + ClusterObjectFieldDescriptor(Label="outputType", Tag=2, Type=AudioOutput.Enums.OutputTypeEnum), ClusterObjectFieldDescriptor(Label="name", Tag=3, Type=str), ]) index: 'uint' = 0 - outputType: 'AudioOutput.Enums.AudioOutputType' = 0 + outputType: 'AudioOutput.Enums.OutputTypeEnum' = 0 name: 'str' = "" class Commands: @dataclass - class SelectOutput(ClusterCommand): + class SelectOutputRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050B command_id: typing.ClassVar[int] = 0x0000 is_client: typing.ClassVar[bool] = True @@ -28997,7 +28963,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: index: 'uint' = 0 @dataclass - class RenameOutput(ClusterCommand): + class RenameOutputRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050B command_id: typing.ClassVar[int] = 0x0001 is_client: typing.ClassVar[bool] = True @@ -29027,9 +28993,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[AudioOutput.Structs.AudioOutputInfo]) + return ClusterObjectFieldDescriptor(Type=typing.List[AudioOutput.Structs.OutputInfo]) - value: 'typing.List[AudioOutput.Structs.AudioOutputInfo]' = field(default_factory=lambda: []) + value: 'typing.List[AudioOutput.Structs.OutputInfo]' = field(default_factory=lambda: []) @dataclass class CurrentAudioOutput(ClusterAttributeDescriptor): @@ -29106,20 +29072,20 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="applicationLauncherList", Tag=0x00000000, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="applicationLauncherApp", Tag=0x00000001, Type=ApplicationLauncher.Structs.ApplicationLauncherEndpoint), + ClusterObjectFieldDescriptor(Label="applicationLauncherApp", Tag=0x00000001, Type=ApplicationLauncher.Structs.ApplicationEP), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) applicationLauncherList: 'typing.List[uint]' = None - applicationLauncherApp: 'ApplicationLauncher.Structs.ApplicationLauncherEndpoint' = None + applicationLauncherApp: 'ApplicationLauncher.Structs.ApplicationEP' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None class Enums: - class ApplicationLauncherStatus(IntEnum): + class StatusEnum(IntEnum): kSuccess = 0x00 kAppNotAvailable = 0x01 kSystemBusy = 0x02 @@ -29127,7 +29093,7 @@ class ApplicationLauncherStatus(IntEnum): class Structs: @dataclass - class ApplicationLauncherApp(ClusterObject): + class Application(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -29140,23 +29106,23 @@ def descriptor(cls) -> ClusterObjectDescriptor: applicationId: 'str' = "" @dataclass - class ApplicationLauncherEndpoint(ClusterObject): + class ApplicationEP(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="application", Tag=1, Type=ApplicationLauncher.Structs.ApplicationLauncherApp), + ClusterObjectFieldDescriptor(Label="application", Tag=1, Type=ApplicationLauncher.Structs.Application), ClusterObjectFieldDescriptor(Label="endpoint", Tag=2, Type=str), ]) - application: 'ApplicationLauncher.Structs.ApplicationLauncherApp' = field(default_factory=lambda: ApplicationLauncher.Structs.ApplicationLauncherApp()) + application: 'ApplicationLauncher.Structs.Application' = field(default_factory=lambda: ApplicationLauncher.Structs.Application()) endpoint: 'str' = "" class Commands: @dataclass - class LaunchApp(ClusterCommand): + class LaunchAppRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050C command_id: typing.ClassVar[int] = 0x0000 is_client: typing.ClassVar[bool] = True @@ -29166,31 +29132,14 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ ClusterObjectFieldDescriptor(Label="data", Tag=0, Type=str), - ClusterObjectFieldDescriptor(Label="application", Tag=1, Type=ApplicationLauncher.Structs.ApplicationLauncherApp), - ]) - - data: 'str' = "" - application: 'ApplicationLauncher.Structs.ApplicationLauncherApp' = field(default_factory=lambda: ApplicationLauncher.Structs.ApplicationLauncherApp()) - - @dataclass - class LaunchAppResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x050C - command_id: typing.ClassVar[int] = 0x0000 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ApplicationLauncher.Enums.ApplicationLauncherStatus), - ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="application", Tag=1, Type=ApplicationLauncher.Structs.Application), ]) - status: 'ApplicationLauncher.Enums.ApplicationLauncherStatus' = 0 data: 'str' = "" + application: 'ApplicationLauncher.Structs.Application' = field(default_factory=lambda: ApplicationLauncher.Structs.Application()) @dataclass - class StopApp(ClusterCommand): + class StopAppRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050C command_id: typing.ClassVar[int] = 0x0001 is_client: typing.ClassVar[bool] = True @@ -29199,30 +29148,13 @@ class StopApp(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=ApplicationLauncher.Structs.ApplicationLauncherApp), - ]) - - application: 'ApplicationLauncher.Structs.ApplicationLauncherApp' = field(default_factory=lambda: ApplicationLauncher.Structs.ApplicationLauncherApp()) - - @dataclass - class StopAppResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x050C - command_id: typing.ClassVar[int] = 0x0001 - is_client: typing.ClassVar[bool] = False - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ApplicationLauncher.Enums.ApplicationLauncherStatus), - ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=ApplicationLauncher.Structs.Application), ]) - status: 'ApplicationLauncher.Enums.ApplicationLauncherStatus' = 0 - data: 'str' = "" + application: 'ApplicationLauncher.Structs.Application' = field(default_factory=lambda: ApplicationLauncher.Structs.Application()) @dataclass - class HideApp(ClusterCommand): + class HideAppRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050C command_id: typing.ClassVar[int] = 0x0002 is_client: typing.ClassVar[bool] = True @@ -29231,26 +29163,26 @@ class HideApp(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=ApplicationLauncher.Structs.ApplicationLauncherApp), + ClusterObjectFieldDescriptor(Label="application", Tag=0, Type=ApplicationLauncher.Structs.Application), ]) - application: 'ApplicationLauncher.Structs.ApplicationLauncherApp' = field(default_factory=lambda: ApplicationLauncher.Structs.ApplicationLauncherApp()) + application: 'ApplicationLauncher.Structs.Application' = field(default_factory=lambda: ApplicationLauncher.Structs.Application()) @dataclass - class HideAppResponse(ClusterCommand): + class LauncherResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050C - command_id: typing.ClassVar[int] = 0x0002 + command_id: typing.ClassVar[int] = 0x0003 is_client: typing.ClassVar[bool] = False @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ApplicationLauncher.Enums.ApplicationLauncherStatus), + ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ApplicationLauncher.Enums.StatusEnum), ClusterObjectFieldDescriptor(Label="data", Tag=1, Type=str), ]) - status: 'ApplicationLauncher.Enums.ApplicationLauncherStatus' = 0 + status: 'ApplicationLauncher.Enums.StatusEnum' = 0 data: 'str' = "" @@ -29283,9 +29215,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=ApplicationLauncher.Structs.ApplicationLauncherEndpoint) + return ClusterObjectFieldDescriptor(Type=ApplicationLauncher.Structs.ApplicationEP) - value: 'ApplicationLauncher.Structs.ApplicationLauncherEndpoint' = field(default_factory=lambda: ApplicationLauncher.Structs.ApplicationLauncherEndpoint()) + value: 'ApplicationLauncher.Structs.ApplicationEP' = field(default_factory=lambda: ApplicationLauncher.Structs.ApplicationEP()) @dataclass class AttributeList(ClusterAttributeDescriptor): @@ -29349,9 +29281,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="vendorId", Tag=0x00000001, Type=uint), ClusterObjectFieldDescriptor(Label="applicationName", Tag=0x00000002, Type=str), ClusterObjectFieldDescriptor(Label="productId", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="applicationApp", Tag=0x00000004, Type=ApplicationBasic.Structs.ApplicationBasicApp), - ClusterObjectFieldDescriptor(Label="applicationStatus", Tag=0x00000005, Type=uint), + ClusterObjectFieldDescriptor(Label="applicationApp", Tag=0x00000004, Type=ApplicationBasic.Structs.Application), + ClusterObjectFieldDescriptor(Label="applicationStatus", Tag=0x00000005, Type=ApplicationBasic.Enums.ApplicationStatusEnum), ClusterObjectFieldDescriptor(Label="applicationVersion", Tag=0x00000006, Type=str), + ClusterObjectFieldDescriptor(Label="allowedVendorList", Tag=0x00000007, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), @@ -29361,15 +29294,16 @@ def descriptor(cls) -> ClusterObjectDescriptor: vendorId: 'uint' = None applicationName: 'str' = None productId: 'uint' = None - applicationApp: 'ApplicationBasic.Structs.ApplicationBasicApp' = None - applicationStatus: 'uint' = None + applicationApp: 'ApplicationBasic.Structs.Application' = None + applicationStatus: 'ApplicationBasic.Enums.ApplicationStatusEnum' = None applicationVersion: 'str' = None + allowedVendorList: 'typing.List[uint]' = None attributeList: 'typing.List[uint]' = None featureMap: 'typing.Optional[uint]' = None clusterRevision: 'uint' = None class Enums: - class ApplicationBasicStatus(IntEnum): + class ApplicationStatusEnum(IntEnum): kStopped = 0x00 kActiveVisibleFocus = 0x01 kActiveHidden = 0x02 @@ -29378,7 +29312,7 @@ class ApplicationBasicStatus(IntEnum): class Structs: @dataclass - class ApplicationBasicApp(ClusterObject): + class Application(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( @@ -29392,22 +29326,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: - class Commands: - @dataclass - class ChangeStatus(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x050D - command_id: typing.ClassVar[int] = 0x0000 - is_client: typing.ClassVar[bool] = True - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ClusterObjectFieldDescriptor(Label="status", Tag=0, Type=ApplicationBasic.Enums.ApplicationBasicStatus), - ]) - - status: 'ApplicationBasic.Enums.ApplicationBasicStatus' = 0 - class Attributes: @dataclass @@ -29486,9 +29404,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=ApplicationBasic.Structs.ApplicationBasicApp) + return ClusterObjectFieldDescriptor(Type=ApplicationBasic.Structs.Application) - value: 'ApplicationBasic.Structs.ApplicationBasicApp' = field(default_factory=lambda: ApplicationBasic.Structs.ApplicationBasicApp()) + value: 'ApplicationBasic.Structs.Application' = field(default_factory=lambda: ApplicationBasic.Structs.Application()) @dataclass class ApplicationStatus(ClusterAttributeDescriptor): @@ -29502,9 +29420,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) + return ClusterObjectFieldDescriptor(Type=ApplicationBasic.Enums.ApplicationStatusEnum) - value: 'uint' = 0 + value: 'ApplicationBasic.Enums.ApplicationStatusEnum' = 0 @dataclass class ApplicationVersion(ClusterAttributeDescriptor): @@ -29522,6 +29440,22 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'str' = "" + @dataclass + class AllowedVendorList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x050D + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000007 + + @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 @@ -29593,7 +29527,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: class Commands: @dataclass - class GetSetupPIN(ClusterCommand): + class GetSetupPINRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050E command_id: typing.ClassVar[int] = 0x0000 is_client: typing.ClassVar[bool] = True @@ -29610,7 +29544,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: @dataclass class GetSetupPINResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050E - command_id: typing.ClassVar[int] = 0x0000 + command_id: typing.ClassVar[int] = 0x0001 is_client: typing.ClassVar[bool] = False @ChipUtility.classproperty @@ -29623,9 +29557,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: setupPIN: 'str' = "" @dataclass - class Login(ClusterCommand): + class LoginRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050E - command_id: typing.ClassVar[int] = 0x0001 + command_id: typing.ClassVar[int] = 0x0002 is_client: typing.ClassVar[bool] = True @ChipUtility.classproperty @@ -29640,9 +29574,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: setupPIN: 'str' = "" @dataclass - class Logout(ClusterCommand): + class LogoutRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050E - command_id: typing.ClassVar[int] = 0x0002 + command_id: typing.ClassVar[int] = 0x0003 is_client: typing.ClassVar[bool] = True @ChipUtility.classproperty diff --git a/src/controller/python/chip/clusters/attribute.cpp b/src/controller/python/chip/clusters/attribute.cpp index ccfac39a8722dd..065aff5f701cf5 100644 --- a/src/controller/python/chip/clusters/attribute.cpp +++ b/src/controller/python/chip/clusters/attribute.cpp @@ -33,13 +33,6 @@ using namespace chip::app; using PyObject = void; -extern "C" { -// Encodes n attribute write requests, follows 3 * n arguments, in the (AttributeWritePath*=void *, uint8_t*, size_t) order. -chip::ChipError::StorageType pychip_WriteClient_WriteAttributes(void * appContext, DeviceProxy * device, size_t n, ...); -chip::ChipError::StorageType pychip_ReadClient_ReadAttributes(void * appContext, DeviceProxy * device, bool isSubscription, - uint32_t minInterval, uint32_t maxInterval, size_t n, ...); -} - namespace chip { namespace python { @@ -105,7 +98,7 @@ class ReadClientCallback : public ReadClient::Callback // at the end.) TLV::TLVWriter writer; writer.Init(buffer.get(), bufferLen); - CHIP_ERROR err = writer.CopyElement(TLV::AnonymousTag, *apData); + CHIP_ERROR err = writer.CopyElement(TLV::AnonymousTag(), *apData); if (err != CHIP_NO_ERROR) { app::StatusIB status; @@ -140,7 +133,7 @@ class ReadClientCallback : public ReadClient::Callback // at the end.) TLV::TLVWriter writer; writer.Init(buffer); - err = writer.CopyElement(TLV::AnonymousTag, *apData); + err = writer.CopyElement(TLV::AnonymousTag(), *apData); if (err != CHIP_NO_ERROR) { this->OnError(apReadClient, err); @@ -171,7 +164,8 @@ class ReadClientCallback : public ReadClient::Callback void OnDone(ReadClient * apReadClient) override { gOnReadDoneCallback(mAppContext); - // delete apReadClient; + + delete apReadClient; delete this; }; @@ -180,6 +174,15 @@ class ReadClientCallback : public ReadClient::Callback PyObject * mAppContext; }; +extern "C" { +// Encodes n attribute write requests, follows 3 * n arguments, in the (AttributeWritePath*=void *, uint8_t*, size_t) order. +chip::ChipError::StorageType pychip_WriteClient_WriteAttributes(void * appContext, DeviceProxy * device, size_t n, ...); +chip::ChipError::StorageType pychip_ReadClient_ReadAttributes(void * appContext, ReadClient ** pReadClient, + ReadClientCallback ** pCallback, DeviceProxy * device, + bool isSubscription, uint32_t minInterval, uint32_t maxInterval, + size_t n, ...); +} + using OnWriteResponseCallback = void (*)(PyObject * appContext, chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId, std::underlying_type_t imstatus); @@ -294,8 +297,19 @@ chip::ChipError::StorageType pychip_WriteClient_WriteAttributes(void * appContex return err.AsInteger(); } -chip::ChipError::StorageType pychip_ReadClient_ReadAttributes(void * appContext, DeviceProxy * device, bool isSubscription, - uint32_t minInterval, uint32_t maxInterval, size_t n, ...) +void pychip_ReadClient_Abort(ReadClient * apReadClient, ReadClientCallback * apCallback) +{ + VerifyOrDie(apReadClient != nullptr); + VerifyOrDie(apCallback != nullptr); + + delete apReadClient; + delete apCallback; +} + +chip::ChipError::StorageType pychip_ReadClient_ReadAttributes(void * appContext, ReadClient ** pReadClient, + ReadClientCallback ** pCallback, DeviceProxy * device, + bool isSubscription, uint32_t minInterval, uint32_t maxInterval, + size_t n, ...) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -305,6 +319,7 @@ chip::ChipError::StorageType pychip_ReadClient_ReadAttributes(void * appContext, va_start(args, n); std::unique_ptr readPaths(new AttributePathParams[n]); + std::unique_ptr readClient; { for (size_t i = 0; i < n; i++) @@ -319,13 +334,13 @@ chip::ChipError::StorageType pychip_ReadClient_ReadAttributes(void * appContext, } Optional session = device->GetSecureSession(); - ReadClient * readClient; - VerifyOrExit(session.HasValue(), err = CHIP_ERROR_NOT_CONNECTED); + + readClient = std::make_unique( + InteractionModelEngine::GetInstance(), device->GetExchangeManager(), *callback->GetBufferedReadCallback(), + isSubscription ? ReadClient::InteractionType::Subscribe : ReadClient::InteractionType::Read); + { - app::InteractionModelEngine::GetInstance()->NewReadClient( - &readClient, isSubscription ? ReadClient::InteractionType::Subscribe : ReadClient::InteractionType::Read, - callback->GetBufferedReadCallback()); ReadPrepareParams params(session.Value()); params.mpAttributePathParamsList = readPaths.get(); params.mAttributePathParamsListSize = n; @@ -337,14 +352,14 @@ chip::ChipError::StorageType pychip_ReadClient_ReadAttributes(void * appContext, } err = readClient->SendRequest(params); - - if (err != CHIP_NO_ERROR) - { - readClient->Shutdown(); - } + SuccessOrExit(err); } + *pReadClient = readClient.get(); + *pCallback = callback.get(); + callback.release(); + readClient.release(); exit: va_end(args); @@ -362,6 +377,7 @@ chip::ChipError::StorageType pychip_ReadClient_ReadEvents(void * appContext, Dev va_start(args, n); std::unique_ptr readPaths(new EventPathParams[n]); + std::unique_ptr readClient; { for (size_t i = 0; i < n; i++) @@ -376,13 +392,13 @@ chip::ChipError::StorageType pychip_ReadClient_ReadEvents(void * appContext, Dev } Optional session = device->GetSecureSession(); - ReadClient * readClient; - VerifyOrExit(session.HasValue(), err = CHIP_ERROR_NOT_CONNECTED); + + readClient = + std::make_unique(InteractionModelEngine::GetInstance(), device->GetExchangeManager(), *callback.get(), + isSubscription ? ReadClient::InteractionType::Subscribe : ReadClient::InteractionType::Read); + { - app::InteractionModelEngine::GetInstance()->NewReadClient( - &readClient, isSubscription ? ReadClient::InteractionType::Subscribe : ReadClient::InteractionType::Read, - callback.get()); ReadPrepareParams params(session.Value()); params.mpEventPathParamsList = readPaths.get(); params.mEventPathParamsListSize = n; @@ -394,14 +410,11 @@ chip::ChipError::StorageType pychip_ReadClient_ReadEvents(void * appContext, Dev } err = readClient->SendRequest(params); - - if (err != CHIP_NO_ERROR) - { - readClient->Shutdown(); - } + SuccessOrExit(err); } callback.release(); + readClient.release(); exit: va_end(args); diff --git a/src/controller/python/chip/clusters/command.cpp b/src/controller/python/chip/clusters/command.cpp index b2ecd1a30fb59e..666dc7599d7a23 100644 --- a/src/controller/python/chip/clusters/command.cpp +++ b/src/controller/python/chip/clusters/command.cpp @@ -70,7 +70,7 @@ class CommandSenderCallback : public CommandSender::Callback // Python need to read from full TLV data the TLVReader may contain some unclean states. TLV::TLVWriter writer; writer.Init(buffer); - CHIP_ERROR err = writer.CopyContainer(TLV::AnonymousTag, *aData); + CHIP_ERROR err = writer.CopyContainer(TLV::AnonymousTag(), *aData); if (err != CHIP_NO_ERROR) { app::StatusIB status; diff --git a/src/controller/python/chip/interaction_model/Delegate.cpp b/src/controller/python/chip/interaction_model/Delegate.cpp index 178ade9bf60234..aec920813eb828 100644 --- a/src/controller/python/chip/interaction_model/Delegate.cpp +++ b/src/controller/python/chip/interaction_model/Delegate.cpp @@ -81,50 +81,6 @@ void PythonInteractionModelDelegate::OnError(const app::CommandSender * apComman DeviceControllerInteractionModelDelegate::OnError(apCommandSender, aStatus, aError); } -void PythonInteractionModelDelegate::OnAttributeData(const app::ReadClient * apReadClient, - const app::ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, - const app::StatusIB & status) -{ - // - // We shouldn't be getting list item operations in the provided path since that should be handled by the buffered read callback. - // If we do, that's a bug. - // - VerifyOrDie(!aPath.IsListItemOperation()); - - if (onReportDataFunct != nullptr) - { - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter writer; - uint8_t writerBuffer[CHIP_CONFIG_DEFAULT_UDP_MTU_SIZE]; - writer.Init(writerBuffer); - // When the apData is nullptr, means we did not receive a valid attribute data from server, status will be some error - // status. - if (apData != nullptr) - { - TLV::TLVReader tmpReader; - tmpReader.Init(*apData); - // The Copy operation should succeed since: - // - We used a buffer that is large enough - // - The writer is in a clean state. - err = writer.CopyElement(TLV::AnonymousTag, tmpReader); - } - if (CHIP_NO_ERROR == err) - { - AttributePath path{ .endpointId = aPath.mEndpointId, .clusterId = aPath.mClusterId, .fieldId = aPath.mAttributeId }; - onReportDataFunct(apReadClient->GetPeerNodeId(), 0, - /* TODO: Use real SubscriptionId */ apReadClient->IsSubscriptionType() ? 1 : 0, &path, sizeof(path), - writerBuffer, writer.GetLengthWritten(), to_underlying(status.mStatus)); - } - else - { - // We failed to dump the TLV data to buffer, so we cannot pass valid data to the Python side, this should be a internal - // error of the binding. - ChipLogError(Controller, "Cannot pass TLV data to python: failed to copy TLV: %s", ErrorStr(err)); - } - } - DeviceControllerInteractionModelDelegate::OnAttributeData(apReadClient, aPath, apData, status); -} - void pychip_InteractionModelDelegate_SetCommandResponseStatusCallback( PythonInteractionModelDelegate_OnCommandResponseStatusCodeReceivedFunct f) { @@ -142,11 +98,6 @@ void pychip_InteractionModelDelegate_SetCommandResponseErrorCallback(PythonInter gPythonInteractionModelDelegate.SetOnCommandResponseCallback(f); } -void pychip_InteractionModelDelegate_SetOnReportDataCallback(PythonInteractionModelDelegate_OnReportDataFunct f) -{ - gPythonInteractionModelDelegate.SetOnReportDataCallback(f); -} - void pychip_InteractionModelDelegate_SetOnWriteResponseStatusCallback(PythonInteractionModelDelegate_OnWriteResponseStatusFunct f) { gPythonInteractionModelDelegate.SetOnWriteResponseStatusCallback(f); diff --git a/src/controller/python/chip/interaction_model/Delegate.h b/src/controller/python/chip/interaction_model/Delegate.h index 1e20e8a6508031..4f878e764680e6 100644 --- a/src/controller/python/chip/interaction_model/Delegate.h +++ b/src/controller/python/chip/interaction_model/Delegate.h @@ -80,17 +80,11 @@ typedef void (*PythonInteractionModelDelegate_OnCommandResponseFunct)(uint64_t c typedef void (*PythonInteractionModelDelegate_OnWriteResponseStatusFunct)(void * writeStatusBuf, uint32_t writeStatusBufLen); -typedef void (*PythonInteractionModelDelegate_OnReportDataFunct)(chip::NodeId nodeId, uint64_t readClientAppIdentifier, - uint64_t subscriptionId, void * attributePathBuf, - size_t attributePathBufLen, uint8_t * readTlvData, - size_t readTlvDataLen, uint16_t statusCode); - void pychip_InteractionModelDelegate_SetCommandResponseStatusCallback( PythonInteractionModelDelegate_OnCommandResponseStatusCodeReceivedFunct f); void pychip_InteractionModelDelegate_SetCommandResponseProtocolErrorCallback( PythonInteractionModelDelegate_OnCommandResponseProtocolErrorFunct f); void pychip_InteractionModelDelegate_SetCommandResponseErrorCallback(PythonInteractionModelDelegate_OnCommandResponseFunct f); -void pychip_InteractionModelDelegate_SetOnReportDataCallback(PythonInteractionModelDelegate_OnReportDataFunct f); void pychip_InteractionModelDelegate_SetOnWriteResponseStatusCallback(PythonInteractionModelDelegate_OnWriteResponseStatusFunct f); } @@ -101,13 +95,6 @@ class PythonInteractionModelDelegate : public chip::Controller::DeviceController TLV::TLVReader * aData) override; void OnError(const app::CommandSender * apCommandSender, const app::StatusIB & aStatus, CHIP_ERROR aError) override; - void OnAttributeData(const app::ReadClient * apReadClient, const app::ConcreteDataAttributePath & aPath, - TLV::TLVReader * apData, const app::StatusIB & status) override; - - void OnEventData(const app::ReadClient * apReadClient, const app::EventHeader & aEventHeader, TLV::TLVReader * apData, - const app::StatusIB * apStatus) override - {} - static PythonInteractionModelDelegate & Instance(); void SetOnCommandResponseStatusCodeReceivedCallback(PythonInteractionModelDelegate_OnCommandResponseStatusCodeReceivedFunct f) @@ -124,13 +111,10 @@ class PythonInteractionModelDelegate : public chip::Controller::DeviceController void SetOnWriteResponseStatusCallback(PythonInteractionModelDelegate_OnWriteResponseStatusFunct f) { onWriteResponseFunct = f; } - void SetOnReportDataCallback(PythonInteractionModelDelegate_OnReportDataFunct f) { onReportDataFunct = f; } - private: PythonInteractionModelDelegate_OnCommandResponseStatusCodeReceivedFunct commandResponseStatusFunct = nullptr; PythonInteractionModelDelegate_OnCommandResponseProtocolErrorFunct commandResponseProtocolErrorFunct = nullptr; PythonInteractionModelDelegate_OnCommandResponseFunct commandResponseErrorFunct = nullptr; - PythonInteractionModelDelegate_OnReportDataFunct onReportDataFunct = nullptr; PythonInteractionModelDelegate_OnWriteResponseStatusFunct onWriteResponseFunct = nullptr; }; diff --git a/src/controller/python/chip/interaction_model/__init__.py b/src/controller/python/chip/interaction_model/__init__.py index 5277df326d0f4c..1fbfde26668752 100644 --- a/src/controller/python/chip/interaction_model/__init__.py +++ b/src/controller/python/chip/interaction_model/__init__.py @@ -22,7 +22,7 @@ """Provides Python APIs for CHIP.""" import enum -from .delegate import OnSubscriptionReport, SetAttributeReportCallback, AttributePath, AttributePathIBstruct, EventPath, EventPathIBstruct +from .delegate import AttributePath, AttributePathIBstruct, EventPath, EventPathIBstruct from chip.exceptions import ChipStackException diff --git a/src/controller/python/chip/interaction_model/delegate.py b/src/controller/python/chip/interaction_model/delegate.py index 5e246c6408682c..106c1a4a310888 100644 --- a/src/controller/python/chip/interaction_model/delegate.py +++ b/src/controller/python/chip/interaction_model/delegate.py @@ -99,15 +99,10 @@ class AttributeWriteResult: # void * commandStatusBuf); # typedef void (*PythonInteractionModelDelegate_OnCommandResponseProtocolErrorFunct)(uint64_t commandSenderPtr, uint8_t commandIndex); # typedef void (*PythonInteractionModelDelegate_OnCommandResponseFunct)(uint64_t commandSenderPtr, uint32_t error); -# typedef void (*PythonInteractionModelDelegate_OnReportDataFunct)(chip::NodeId nodeId, uint64_t readClientAppIdentifier, -# void * attributePathBuf, size_t attributePathBufLen, -# uint8_t * readTlvData, size_t readTlvDataLen, uint16_t statusCode); _OnCommandResponseStatusCodeReceivedFunct = CFUNCTYPE( None, c_uint64, c_void_p, c_uint32) _OnCommandResponseProtocolErrorFunct = CFUNCTYPE(None, c_uint64, c_uint8) _OnCommandResponseFunct = CFUNCTYPE(None, c_uint64, c_uint32) -_OnReportDataFunct = CFUNCTYPE( - None, c_uint64, c_uint64, c_ssize_t, c_void_p, c_uint32, c_void_p, c_uint32, c_uint16) _OnWriteResponseStatusFunct = CFUNCTYPE(None, c_void_p, c_uint32) _commandStatusDict = dict() @@ -126,14 +121,6 @@ class AttributeWriteResult: DEFAULT_ATTRIBUTEREAD_APPID = 0 DEFAULT_ATTRIBUTEWRITE_APPID = 0 -_onSubscriptionReport = None - - -class OnSubscriptionReport: - @abstractmethod - def OnData(self, path: AttributePath, subscriptionId: int, data: typing.Any) -> None: - pass - def _GetCommandStatus(commandHandle: int): with _commandStatusLock: @@ -177,32 +164,6 @@ def _OnCommandResponse(commandHandle: int, errorcode: int): _SetCommandStatus(PLACEHOLDER_COMMAND_HANDLE, errorcode) -@ _OnReportDataFunct -def _OnReportData(nodeId: int, appId: int, subscriptionId: int, attrPathBuf, attrPathBufLen: int, tlvDataBuf, tlvDataBufLen: int, statusCode: int): - global _onSubscriptionReport - attrPath = AttributePathIBstruct.parse( - ctypes.string_at(attrPathBuf, attrPathBufLen)) - tlvData = None - path = AttributePath(nodeId, attrPath["EndpointId"], - attrPath["ClusterId"], attrPath["AttributeId"]) - if tlvDataBufLen > 0: - tlvBuf = ctypes.string_at(tlvDataBuf, tlvDataBufLen) - # We converts the data to AnonymousTag, and it becomes Any in decoded values. - tlvData = chip.tlv.TLVReader(tlvBuf).get().get('Any') - - if appId < 256: - # For all attribute read requests using CHIPCluster API, appId is filled by CHIPDevice, and should be smaller than 256 (UINT8_MAX). - appId = DEFAULT_ATTRIBUTEREAD_APPID - - if subscriptionId != 0: - if _onSubscriptionReport: - _onSubscriptionReport.OnData(path, subscriptionId, tlvData) - - with _attributeDictLock: - _attributeDict[appId] = AttributeReadResult( - path, statusCode, tlvData) - - @_OnWriteResponseStatusFunct def _OnWriteResponseStatus(IMAttributeWriteResult, IMAttributeWriteResultLen): status = IMWriteStatus.parse(ctypes.string_at( @@ -230,8 +191,6 @@ def InitIMDelegate(): _OnCommandResponseFunct]) setter.Set("pychip_InteractionModel_GetCommandSenderHandle", c_uint32, [ctypes.POINTER(c_uint64)]) - setter.Set("pychip_InteractionModelDelegate_SetOnReportDataCallback", None, [ - _OnReportDataFunct]) setter.Set("pychip_InteractionModelDelegate_SetOnWriteResponseStatusCallback", None, [ _OnWriteResponseStatusFunct]) @@ -241,8 +200,6 @@ def InitIMDelegate(): _OnCommandResponseProtocolError) handle.pychip_InteractionModelDelegate_SetCommandResponseErrorCallback( _OnCommandResponse) - handle.pychip_InteractionModelDelegate_SetOnReportDataCallback( - _OnReportData) handle.pychip_InteractionModelDelegate_SetOnWriteResponseStatusCallback( _OnWriteResponseStatus) @@ -308,8 +265,3 @@ def GetAttributeReadResponse(appId: int) -> AttributeReadResult: def GetAttributeWriteResponse(appId: int) -> AttributeWriteResult: with _writeStatusDictLock: return _writeStatusDict.get(appId, None) - - -def SetAttributeReportCallback(path: AttributePath, callback: OnSubscriptionReport): - global _onSubscriptionReport - _onSubscriptionReport = callback diff --git a/src/controller/python/test/test_scripts/base.py b/src/controller/python/test/test_scripts/base.py index 695ca48cc66821..ee66766ab16ab0 100644 --- a/src/controller/python/test/test_scripts/base.py +++ b/src/controller/python/test/test_scripts/base.py @@ -150,33 +150,9 @@ def TestCloseSession(self, nodeid: int): f"Failed to close sessions with device {nodeid}: {ex}") return False - def TestNetworkCommissioning(self, nodeid: int, endpoint: int, group: int, dataset: str, network_id: str): - self.logger.info("Commissioning network to device {}".format(nodeid)) - try: - (err, resp) = self.devCtrl.ZCLSend("NetworkCommissioning", "AddOrUpdateThreadNetwork", nodeid, endpoint, group, { - "operationalDataset": bytes.fromhex(dataset), - "breadcrumb": 0}, blocking=True) - self.logger.info(f"Received response: {resp}") - if resp.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: - self.logger.exception("Failed to add Thread network.") - return False - except Exception as ex: - self.logger.exception( - "Failed to send AddOrUpdateThreadNetwork command") - return False - self.logger.info( - "Send ConnectNetwork command to device {}".format(nodeid)) - try: - self.devCtrl.ZCLSend("NetworkCommissioning", "ConnectNetwork", nodeid, endpoint, group, { - "networkID": bytes.fromhex(network_id), - "breadcrumb": 0}, blocking=True) - self.logger.info(f"Received response: {resp}") - if resp.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: - self.logger.exception("Failed to enable Thread network.") - return False - except Exception as ex: - self.logger.exception("Failed to send ConnectNetwork command") - return False + def SetNetworkCommissioningParameters(self, dataset: str): + self.logger.info("Setting network commissioning parameters") + self.devCtrl.SetThreadOperationalDataset(bytes.fromhex(dataset)) return True def TestOnOffCluster(self, nodeid: int, endpoint: int, group: int): diff --git a/src/controller/python/test/test_scripts/mobile-device-test.py b/src/controller/python/test/test_scripts/mobile-device-test.py index 1f542cdc11c1c9..a2d290336d1633 100755 --- a/src/controller/python/test/test_scripts/mobile-device-test.py +++ b/src/controller/python/test/test_scripts/mobile-device-test.py @@ -22,7 +22,8 @@ import sys from optparse import OptionParser from base import TestFail, TestTimeout, BaseTestHelper, FailIfNot, logger -from cluster_objects import ClusterObjectTests +from cluster_objects import NODE_ID, ClusterObjectTests +from network_commissioning import NetworkCommissioningTests import asyncio # The thread network dataset tlv for testing, splited into T-L-V. @@ -79,6 +80,9 @@ def main(): FailIfNot(test.TestDiscovery(discriminator=TEST_DISCRIMINATOR), "Failed to discover any devices.") + FailIfNot(test.SetNetworkCommissioningParameters(dataset=TEST_THREAD_NETWORK_DATASET_TLV), + "Failed to finish network commissioning") + logger.info("Testing key exchange") FailIfNot(test.TestKeyExchange(ip=options.deviceAddress, setuppin=20202021, @@ -92,12 +96,9 @@ def main(): FailIfNot(test.TestResolve(nodeid=1), "Failed to resolve nodeid") + # Still test network commissioning logger.info("Testing network commissioning") - FailIfNot(test.TestNetworkCommissioning(nodeid=1, - endpoint=ENDPOINT_ID, - group=GROUP_ID, - dataset=TEST_THREAD_NETWORK_DATASET_TLV, - network_id=TEST_THREAD_NETWORK_ID), + FailIfNot(asyncio.run(NetworkCommissioningTests(devCtrl=test.devCtrl, nodeid=1).run()), "Failed to finish network commissioning") logger.info("Testing on off cluster") diff --git a/src/controller/python/test/test_scripts/network_commissioning.py b/src/controller/python/test/test_scripts/network_commissioning.py new file mode 100644 index 00000000000000..a76236a7b6da66 --- /dev/null +++ b/src/controller/python/test/test_scripts/network_commissioning.py @@ -0,0 +1,252 @@ +# +# Copyright (c) 2021 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import chip.clusters as Clusters +import logging +from chip.clusters.Attribute import AttributePath, AttributeReadResult, AttributeStatus, ValueDecodeFailure +import chip.interaction_model +import asyncio + +logger = logging.getLogger('NetworkCommissioning') +logger.setLevel(logging.INFO) + +TEST_THREAD_NETWORK_DATASET_TLVS = [bytes.fromhex("0e080000000000010000" + + "000300000c" + + "35060004001fffe0" + + "0208fedcba9876543210" + + "0708fd00000000001234" + + "0510ffeeddccbbaa99887766554433221100" + + "030e54657374696e674e6574776f726b" + + "0102d252" + + "041081cb3b2efa781cc778397497ff520fa50c0302a0ff"), + # End of first TLV + ] +# Network id, for the thread network, current a const value, will be changed to XPANID of the thread network. +TEST_THREAD_NETWORK_IDS = [ + bytes.fromhex("fedcba9876543210"), +] + +TEST_WIFI_SSID = "TestSSID" +TEST_WIFI_PASS = "TestPass" + +WIFI_NETWORK_FEATURE_MAP = 1 +THREAD_NETWORK_FEATURE_MAP = 2 + + +class NetworkCommissioningTests: + def __init__(self, devCtrl, nodeid): + self._devCtrl = devCtrl + self._nodeid = nodeid + + def log_interface_basic_info(self, values): + logger.info(f"The interface supports {values.maxNetworks} networks.") + logger.info( + f"ScanNetworks should take no more than {values.scanMaxTimeSeconds} seconds.") + logger.info( + f"ConnectNetwork should take no more than {values.connectMaxTimeSeconds} seconds.") + logger.info( + f"The feature map of this endpoint is {values.featureMap}.") + + async def test_wifi(self, endpointId): + logger.info(f"Get basic information of the endpoint") + res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[ + (endpointId, + Clusters.NetworkCommissioning.Attributes.ConnectMaxTimeSeconds), + (endpointId, + Clusters.NetworkCommissioning.Attributes.ScanMaxTimeSeconds), + (endpointId, Clusters.NetworkCommissioning.Attributes.MaxNetworks), + (endpointId, Clusters.NetworkCommissioning.Attributes.FeatureMap)], + returnClusterObject=True) + self.log_interface_basic_info( + res[endpointId][Clusters.NetworkCommissioning]) + logger.info(f"Finished getting basic information of the endpoint") + + # Scan networks + logger.info(f"Scan networks") + req = Clusters.NetworkCommissioning.Commands.ScanNetworks( + ssid=b'', breadcrumb=0) + res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) + logger.info(f"Received response: {res}") + if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: + raise AssertionError(f"Unexpected result: {res.networkingStatus}") + + # Remove existing network + logger.info(f"Check network list") + res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) + networkList = res[endpointId][Clusters.NetworkCommissioning].networks + logger.info(f"Got network list: {networkList}") + if len(networkList) != 0: + logger.info(f"Removing existing network") + req = Clusters.NetworkCommissioning.Commands.RemoveNetwork( + networkID=networkList[0].networkID, breadcrumb=0) + res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) + logger.info(f"Received response: {res}") + if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: + raise AssertionError( + f"Unexpected result: {res.networkingStatus}") + + # Add first network + logger.info(f"Adding first test network") + req = Clusters.NetworkCommissioning.Commands.AddOrUpdateWiFiNetwork( + ssid=TEST_WIFI_SSID.encode(), credentials=TEST_WIFI_PASS.encode(), breadcrumb=0) + res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) + logger.info(f"Received response: {res}") + if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: + raise AssertionError(f"Unexpected result: {res.networkingStatus}") + + logger.info(f"Check network list") + res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) + networkList = res[endpointId][Clusters.NetworkCommissioning].networks + logger.info(f"Got network list: {networkList}") + if len(networkList) != 1: + raise AssertionError( + f"Unexpected result: expect 1 networks, but {len(networkList)} networks received") + if networkList[0].networkID != TEST_WIFI_SSID.encode(): + raise AssertionError( + f"Unexpected result: first network ID should be 'TestSSID' got {networkList[0].networkID}") + + logger.info(f"Connect to a network") + req = Clusters.NetworkCommissioning.Commands.ConnectNetwork( + networkID=TEST_WIFI_SSID.encode(), breadcrumb=0) + res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) + logger.info(f"Got response: {res}") + if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: + raise AssertionError(f"Unexpected result: {res.networkingStatus}") + logger.info(f"Device connected to a network.") + + # Note: On Linux, when connecting to a connected network, it will return immediately, however, it will try a reconnect. This will make the below attribute read return false negative values. + await asyncio.sleep(5) + + logger.info(f"Check network is connected") + res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) + networkList = res[endpointId][Clusters.NetworkCommissioning].networks + logger.info(f"Got network list: {networkList}") + if len(networkList) != 1: + raise AssertionError( + f"Unexpected result: expect 1 networks, but {len(networkList)} networks received") + if networkList[0].networkID != TEST_WIFI_SSID.encode(): + raise AssertionError( + f"Unexpected result: first network ID should be 'TestSSID' got {networkList[0].networkID}") + if not networkList[0].connected: + raise AssertionError( + f"Unexpected result: network is not marked as connected") + + async def test_thread(self, endpointId): + logger.info(f"Get basic information of the endpoint") + res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[ + (endpointId, + Clusters.NetworkCommissioning.Attributes.ConnectMaxTimeSeconds), + (endpointId, + Clusters.NetworkCommissioning.Attributes.ScanMaxTimeSeconds), + (endpointId, Clusters.NetworkCommissioning.Attributes.MaxNetworks), + (endpointId, Clusters.NetworkCommissioning.Attributes.FeatureMap)], + returnClusterObject=True) + self.log_interface_basic_info( + res[endpointId][Clusters.NetworkCommissioning]) + logger.info(f"Finished getting basic information of the endpoint") + + # Scan networks + logger.info(f"Scan networks") + req = Clusters.NetworkCommissioning.Commands.ScanNetworks( + ssid=b'', breadcrumb=0) + res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) + logger.info(f"Received response: {res}") + if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: + raise AssertionError(f"Unexpected result: {res.networkingStatus}") + + # Remove existing network + logger.info(f"Check network list") + res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) + networkList = res[endpointId][Clusters.NetworkCommissioning].networks + logger.info(f"Got network list: {networkList}") + if len(networkList) != 0: + logger.info(f"Removing existing network") + req = Clusters.NetworkCommissioning.Commands.RemoveNetwork( + networkID=networkList[0].networkID, breadcrumb=0) + res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) + logger.info(f"Received response: {res}") + if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: + raise AssertionError( + f"Unexpected result: {res.networkingStatus}") + + # Add first network + logger.info(f"Adding first test network") + req = Clusters.NetworkCommissioning.Commands.AddOrUpdateThreadNetwork( + operationalDataset=TEST_THREAD_NETWORK_DATASET_TLVS[0], breadcrumb=0) + res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) + logger.info(f"Received response: {res}") + if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: + raise AssertionError(f"Unexpected result: {res.networkingStatus}") + + logger.info(f"Check network list") + res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) + networkList = res[endpointId][Clusters.NetworkCommissioning].networks + logger.info(f"Got network list: {networkList}") + if len(networkList) != 1: + raise AssertionError( + f"Unexpected result: expect 1 networks, but {len(networkList.Data.value)} networks received") + if networkList[0].networkID != TEST_THREAD_NETWORK_IDS[0]: + raise AssertionError( + f"Unexpected result: first network ID should be {TEST_THREAD_NETWORK_IDS[0]} got {networkList[0].networkID}") + + logger.info(f"Connect to a network") + req = Clusters.NetworkCommissioning.Commands.ConnectNetwork( + networkID=TEST_THREAD_NETWORK_IDS[0], breadcrumb=0) + res = await self._devCtrl.SendCommand(nodeid=self._nodeid, endpoint=endpointId, payload=req) + logger.info(f"Got response: {res}") + if res.networkingStatus != Clusters.NetworkCommissioning.Enums.NetworkCommissioningStatus.kSuccess: + raise AssertionError(f"Unexpected result: {res.networkingStatus}") + logger.info(f"Device connected to a network.") + + # TODO: Linux Thread driver cannot get infomation of current connected networks. + ''' + logger.info(f"Check network list") + res = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(endpointId, Clusters.NetworkCommissioning.Attributes.Networks)], returnClusterObject=True) + networkList = res[endpointId][Clusters.NetworkCommissioning].networks + logger.info(f"Got network list: {networkList}") + if len(networkList) != 1: + raise AssertionError( + f"Unexpected result: expect 1 networks, but {len(networkList.Data.value)} networks received") + if networkList[0].networkID != TEST_THREAD_NETWORK_IDS[0]: + raise AssertionError( + f"Unexpected result: first network ID should be {TEST_THREAD_NETWORK_IDS[0]} got {networkList[0].networkID}") + if not networkList[0].connected: + raise AssertionError( + f"Unexpected result: network is not marked as connected") + ''' + + async def run(self): + try: + endpoints = await self._devCtrl.ReadAttribute(nodeid=self._nodeid, attributes=[(Clusters.NetworkCommissioning.Attributes.FeatureMap)], returnClusterObject=True) + logger.info(endpoints) + for endpoint, obj in endpoints.items(): + clus = obj[Clusters.NetworkCommissioning] + if clus.featureMap == WIFI_NETWORK_FEATURE_MAP: + logger.info( + f"Endpoint {endpoint} is configured as WiFi network, run WiFi commissioning test.") + await self.test_wifi(endpoint) + elif clus.featureMap == THREAD_NETWORK_FEATURE_MAP: + logger.info( + f"Endpoint {endpoint} is configured as Thread network, run Thread commissioning test.") + await self.test_thread(endpoint) + else: + logger.info( + f"Skip endpoint {endpoint} with featureMap {clus.featureMap}") + except Exception as ex: + logger.exception(ex) + return False + return True diff --git a/src/controller/tests/TestReadChunking.cpp b/src/controller/tests/TestReadChunking.cpp index da1a3273d83742..71ce2022de487c 100644 --- a/src/controller/tests/TestReadChunking.cpp +++ b/src/controller/tests/TestReadChunking.cpp @@ -176,7 +176,7 @@ CHIP_ERROR TestAttrAccess::Write(const app::ConcreteDataAttributePath & aPath, a /* * This validates all the various corner cases encountered during chunking by - * artifically reducing the size of a packet buffer used to encode attribute data + * artificially reducing the size of a packet buffer used to encode attribute data * to force chunking to happen over multiple packets even with a small number of attributes * and then slowly increasing the available size by 1 byte in each test iteration and re-running * the report generation logic. This 1-byte incremental approach sweeps through from a base scenario of @@ -196,7 +196,6 @@ void TestCommandInteraction::TestChunking(nlTestSuite * apSuite, void * apContex TestContext & ctx = *static_cast(apContext); auto sessionHandle = ctx.GetSessionBobToAlice(); app::InteractionModelEngine * engine = app::InteractionModelEngine::GetInstance(); - app::ReadClient * readClient; TestAttrAccess testServer; // Initialize the ember side server logic @@ -229,10 +228,10 @@ void TestCommandInteraction::TestChunking(nlTestSuite * apSuite, void * apContex app::InteractionModelEngine::GetInstance()->GetReportingEngine().SetWriterReserved(static_cast(850 + i)); - NL_TEST_ASSERT(apSuite, - engine->NewReadClient(&readClient, app::ReadClient::InteractionType::Read, - &readCallback.mBufferedCallback) == CHIP_NO_ERROR); - NL_TEST_ASSERT(apSuite, readClient->SendRequest(readParams) == CHIP_NO_ERROR); + app::ReadClient readClient(engine, &ctx.GetExchangeManager(), readCallback.mBufferedCallback, + app::ReadClient::InteractionType::Read); + + NL_TEST_ASSERT(apSuite, readClient.SendRequest(readParams) == CHIP_NO_ERROR); // // Service the IO + Engine till we get a ReportEnd callback on the client. @@ -270,7 +269,6 @@ void TestCommandInteraction::TestListChunking(nlTestSuite * apSuite, void * apCo TestContext & ctx = *static_cast(apContext); auto sessionHandle = ctx.GetSessionBobToAlice(); app::InteractionModelEngine * engine = app::InteractionModelEngine::GetInstance(); - app::ReadClient * readClient; TestAttrAccess testServer; // Initialize the ember side server logic @@ -303,10 +301,10 @@ void TestCommandInteraction::TestListChunking(nlTestSuite * apSuite, void * apCo app::InteractionModelEngine::GetInstance()->GetReportingEngine().SetWriterReserved(static_cast(850 + i)); - NL_TEST_ASSERT(apSuite, - engine->NewReadClient(&readClient, app::ReadClient::InteractionType::Read, - &readCallback.mBufferedCallback) == CHIP_NO_ERROR); - NL_TEST_ASSERT(apSuite, readClient->SendRequest(readParams) == CHIP_NO_ERROR); + app::ReadClient readClient(engine, &ctx.GetExchangeManager(), readCallback.mBufferedCallback, + app::ReadClient::InteractionType::Read); + + NL_TEST_ASSERT(apSuite, readClient.SendRequest(readParams) == CHIP_NO_ERROR); // // Service the IO + Engine till we get a ReportEnd callback on the client. @@ -345,7 +343,6 @@ void TestCommandInteraction::TestBadChunking(nlTestSuite * apSuite, void * apCon TestContext & ctx = *static_cast(apContext); auto sessionHandle = ctx.GetSessionBobToAlice(); app::InteractionModelEngine * engine = app::InteractionModelEngine::GetInstance(); - app::ReadClient * readClient; TestAttrAccess testServer; // Initialize the ember side server logic @@ -365,31 +362,30 @@ void TestCommandInteraction::TestBadChunking(nlTestSuite * apSuite, void * apCon TestReadCallback readCallback; - NL_TEST_ASSERT(apSuite, - engine->NewReadClient(&readClient, app::ReadClient::InteractionType::Read, &readCallback.mBufferedCallback) == - CHIP_NO_ERROR); - NL_TEST_ASSERT(apSuite, readClient->SendRequest(readParams) == CHIP_NO_ERROR); - - // - // Service the IO + Engine till we get a ReportEnd callback on the client. - // The server should return an empty list as attribute data for the first report (for list chunking), and encodes nothing (then - // shuts down the read handler) for the second report. - // - for (int j = 0; j < 2; j++) { - ctx.DrainAndServiceIO(); - chip::app::InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - ctx.DrainAndServiceIO(); - } + app::ReadClient readClient(engine, &ctx.GetExchangeManager(), readCallback.mBufferedCallback, + app::ReadClient::InteractionType::Read); - // Nothing is actually encoded. buffered callback does not handle the message to us. - NL_TEST_ASSERT(apSuite, readCallback.mAttributeCount == 0); + NL_TEST_ASSERT(apSuite, readClient.SendRequest(readParams) == CHIP_NO_ERROR); + + // + // Service the IO + Engine till we get a ReportEnd callback on the client. + // The server should return an empty list as attribute data for the first report (for list chunking), and encodes nothing + // (then shuts down the read handler) for the second report. + // + for (int j = 0; j < 2; j++) + { + ctx.DrainAndServiceIO(); + chip::app::InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); + ctx.DrainAndServiceIO(); + } - // The server should shutted down, while the client is still alive (pending for the attribute data.) - NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 1); + // Nothing is actually encoded. buffered callback does not handle the message to us. + NL_TEST_ASSERT(apSuite, readCallback.mAttributeCount == 0); - // On real apps, this is done by a timeout. - readClient->Shutdown(); + // The server should shutted down, while the client is still alive (pending for the attribute data.) + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 1); + } // Sanity check NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index 62bb41a6ca6277..1c3556ca0961ad 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -274,7 +274,6 @@ void TestReadInteraction::TestReadAttributeTimeout(nlTestSuite * apSuite, void * ctx.DrainAndServiceIO(); - NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadClients() == 1); NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 2); ctx.GetExchangeManager().ExpireExchangesForSession(ctx.GetSessionBobToAlice()); @@ -282,7 +281,6 @@ void TestReadInteraction::TestReadAttributeTimeout(nlTestSuite * apSuite, void * ctx.DrainAndServiceIO(); NL_TEST_ASSERT(apSuite, !onSuccessCbInvoked && onFailureCbInvoked); - NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadClients() == 0); // // TODO: Figure out why I cannot enable this line below. diff --git a/src/credentials/CHIPCert.cpp b/src/credentials/CHIPCert.cpp index aea781de5dbe18..a01194770746f9 100644 --- a/src/credentials/CHIPCert.cpp +++ b/src/credentials/CHIPCert.cpp @@ -136,7 +136,7 @@ CHIP_ERROR ChipCertificateSet::LoadCert(const ByteSpan chipCert, BitFlags(attestationElements.size())); outerContainerType = TLV::kTLVType_NotSpecified; - ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(1), certificationDeclaration)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(2), attestationNonce)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(3), timestamp)); @@ -191,7 +198,7 @@ CHIP_ERROR ConstructNOCSRElements(const ByteSpan & csr, const ByteSpan & csrNonc tlvWriter.Init(nocsrElements.data(), static_cast(nocsrElements.size())); outerContainerType = TLV::kTLVType_NotSpecified; - ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(1), csr)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(2), csrNonce)); if (!vendor_reserved1.empty()) @@ -214,6 +221,83 @@ CHIP_ERROR ConstructNOCSRElements(const ByteSpan & csr, const ByteSpan & csrNonc return CHIP_NO_ERROR; } +CHIP_ERROR DeconstructNOCSRElements(const ByteSpan & nocsrElements, ByteSpan & csr, ByteSpan & csrNonce, + ByteSpan & vendor_reserved1, ByteSpan & vendor_reserved2, ByteSpan & vendor_reserved3) +{ + bool csrExists = false; + bool csrNonceExists = false; + bool gotFirstContextTag = false; + uint32_t lastContextTagId = 0; + + TLV::ContiguousBufferTLVReader tlvReader; + TLV::TLVType containerType = TLV::kTLVType_Structure; + + // empty out the optional items initially + vendor_reserved1 = vendor_reserved2 = vendor_reserved3 = ByteSpan(); + + tlvReader.Init(nocsrElements); + ReturnErrorOnFailure(tlvReader.Next(containerType, TLV::AnonymousTag())); + ReturnErrorOnFailure(tlvReader.EnterContainer(containerType)); + + CHIP_ERROR error; + + // process context tags first (should be in sorted order) + while ((error = tlvReader.Next()) == CHIP_NO_ERROR) + { + TLV::Tag tag = tlvReader.GetTag(); + if (!TLV::IsContextTag(tag)) + { + break; + } + + // Ensure tag-order and correct first expected tag + uint32_t contextTagId = TLV::TagNumFromTag(tag); + if (!gotFirstContextTag) + { + // First tag must always be CSR + VerifyOrReturnError(contextTagId == kCsr, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + gotFirstContextTag = true; + } + else + { + // Subsequent tags must always be in order + VerifyOrReturnError(contextTagId > lastContextTagId, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + } + lastContextTagId = contextTagId; + + switch (contextTagId) + { + case kCsr: + ReturnErrorOnFailure(tlvReader.GetByteView(csr)); + csrExists = true; + break; + case kCsrNonce: + ReturnErrorOnFailure(tlvReader.GetByteView(csrNonce)); + csrNonceExists = true; + break; + case kVendorReserved1: + ReturnErrorOnFailure(tlvReader.Get(vendor_reserved1)); + break; + case kVendorReserved2: + ReturnErrorOnFailure(tlvReader.Get(vendor_reserved2)); + break; + case kVendorReserved3: + ReturnErrorOnFailure(tlvReader.Get(vendor_reserved3)); + break; + default: + // unrecognized TLV element + return CHIP_ERROR_INVALID_TLV_ELEMENT; + } + } + + VerifyOrReturnError(error == CHIP_NO_ERROR || error == CHIP_END_OF_TLV, error); + + const bool allTagsNeededPresent = csrExists && csrNonceExists; + VerifyOrReturnError(allTagsNeededPresent, CHIP_ERROR_MISSING_TLV_ELEMENT); + + return CHIP_NO_ERROR; +} + } // namespace Credentials } // namespace chip diff --git a/src/credentials/DeviceAttestationConstructor.h b/src/credentials/DeviceAttestationConstructor.h index 8aaebeef4592b7..242171a5c9e9db 100644 --- a/src/credentials/DeviceAttestationConstructor.h +++ b/src/credentials/DeviceAttestationConstructor.h @@ -27,10 +27,10 @@ namespace Credentials { constexpr size_t kExpectedAttestationNonceSize = 32; /** - * @brief Take the attestation elements buffer and return each component seperately. + * @brief Take the attestation elements buffer and return each component separately. * All output data stays valid while attestationElements buffer is valid. * - * @param[in] attestationElements ByteSpan containg source of Attestation Elements data. + * @param[in] attestationElements ByteSpan containing source of Attestation Elements data. * @param[out] certificationDeclaration * @param[out] attestationNonce * @param[out] timestamp @@ -82,5 +82,19 @@ CHIP_ERROR ConstructNOCSRElements(const ByteSpan & csr, const ByteSpan & csrNonc const ByteSpan & vendor_reserved2, const ByteSpan & vendor_reserved3, MutableByteSpan & nocsrElements); +/** + * @brief Take the NOCSR elements buffer and return each component seperately. + * All output data stays valid while nocsrElements buffer is valid. + * + * @param[in] nocsrElements ByteSpan containg source of NOCSR Elements data + * @param[out] csr Certificate Signing Request Body + * @param[out] csrNonce CSR Nonce + * @param[out] vendor_reserved1 Optional vendor_reserved1 blob, empty if omitted + * @param[out] vendor_reserved2 Optional vendor_reserved2 blob, empty if omitted + * @param[out] vendor_reserved3 Optional vendor_reserved3 blob, empty if omitted + */ +CHIP_ERROR DeconstructNOCSRElements(const ByteSpan & nocsrElements, ByteSpan & csr, ByteSpan & csrNonce, + ByteSpan & vendor_reserved1, ByteSpan & vendor_reserved2, ByteSpan & vendor_reserved3); + } // namespace Credentials } // namespace chip diff --git a/src/credentials/DeviceAttestationVendorReserved.h b/src/credentials/DeviceAttestationVendorReserved.h index 63cb15c64a85c8..f016d8799f8cc5 100644 --- a/src/credentials/DeviceAttestationVendorReserved.h +++ b/src/credentials/DeviceAttestationVendorReserved.h @@ -49,7 +49,7 @@ class DeviceAttestationVendorReservedDeconstructor mAttestationData = attestationElements; mTlvReader.Init(mAttestationData); - ReturnErrorOnFailure(mTlvReader.Next(containerType, TLV::AnonymousTag)); + ReturnErrorOnFailure(mTlvReader.Next(containerType, TLV::AnonymousTag())); ReturnErrorOnFailure(mTlvReader.EnterContainer(containerType)); // position to first ProfileTag diff --git a/src/credentials/DeviceAttestationVerifier.cpp b/src/credentials/DeviceAttestationVerifier.cpp index e4cd29ca6fa6f9..02e2a0013b00dc 100644 --- a/src/credentials/DeviceAttestationVerifier.cpp +++ b/src/credentials/DeviceAttestationVerifier.cpp @@ -62,6 +62,19 @@ class UnimplementedDACVerifier : public DeviceAttestationVerifier (void) deviceInfo; return AttestationVerificationResult::kNotImplemented; } + + CHIP_ERROR VerifyNodeOperationalCSRInformation(const ByteSpan & nocsrElementsBuffer, + const ByteSpan & attestationChallengeBuffer, + const ByteSpan & attestationSignatureBuffer, + const Crypto::P256PublicKey & dacPublicKey, const ByteSpan & csrNonce) override + { + (void) nocsrElementsBuffer; + (void) attestationChallengeBuffer; + (void) attestationSignatureBuffer; + (void) dacPublicKey; + (void) csrNonce; + return CHIP_ERROR_NOT_IMPLEMENTED; + } }; // Default to avoid nullptr on getter and cleanly handle new products/clients before diff --git a/src/credentials/DeviceAttestationVerifier.h b/src/credentials/DeviceAttestationVerifier.h index 16e241de4d244a..b056c78637e61d 100644 --- a/src/credentials/DeviceAttestationVerifier.h +++ b/src/credentials/DeviceAttestationVerifier.h @@ -244,10 +244,24 @@ class DeviceAttestationVerifier // TODO: Validate Firmware Information + /** + * @brief Verify an operational certificate signing request payload against the DAC's public key. + * + * @param[in] nocsrElementsBuffer Buffer containing CSR elements as per specifications section 11.22.5.6. NOCSR Elements. + * @param[in] attestationChallengeBuffer Buffer containing the attestation challenge from the secure session + * @param[in] attestationSignatureBuffer Buffer containing the signature portion of CSR Response + * @param[in] dacPublicKey Public Key from the DAC's certificate received from device. + * @param[in] csrNonce Buffer containing CSR nonce. + */ + virtual CHIP_ERROR VerifyNodeOperationalCSRInformation(const ByteSpan & nocsrElementsBuffer, + const ByteSpan & attestationChallengeBuffer, + const ByteSpan & attestationSignatureBuffer, + const Crypto::P256PublicKey & dacPublicKey, + const ByteSpan & csrNonce) = 0; + protected: - CHIP_ERROR ValidateAttestationSignature(const chip::Crypto::P256PublicKey & pubkey, const ByteSpan & attestationElements, - const ByteSpan & attestationChallenge, - const chip::Crypto::P256ECDSASignature & signature); + CHIP_ERROR ValidateAttestationSignature(const Crypto::P256PublicKey & pubkey, const ByteSpan & attestationElements, + const ByteSpan & attestationChallenge, const Crypto::P256ECDSASignature & signature); }; /** diff --git a/src/credentials/GroupDataProvider.h b/src/credentials/GroupDataProvider.h index ce9a2914c4b1a3..eccc7d50d2271b 100644 --- a/src/credentials/GroupDataProvider.h +++ b/src/credentials/GroupDataProvider.h @@ -30,9 +30,6 @@ namespace Credentials { class GroupDataProvider { public: - static constexpr uint16_t kMaxGroupsPerFabric = CHIP_CONFIG_MAX_GROUPS_PER_FABRIC; - static constexpr uint16_t kMaxGroupKeysPerFabric = CHIP_CONFIG_MAX_GROUP_KEYS_PER_FABRIC; - struct GroupInfo { static constexpr size_t kGroupNameMax = CHIP_CONFIG_MAX_GROUP_NAME_LENGTH; @@ -141,6 +138,27 @@ class GroupDataProvider } }; + /** + * Interface to listen for changes in the Group info. + */ + class GroupListener + { + public: + virtual ~GroupListener() = default; + /** + * Callback invoked when a new group is added. + * + * @param[in] new_group GroupInfo structure of the new group. + */ + virtual void OnGroupAdded(chip::FabricIndex fabric_index, const GroupInfo & new_group) = 0; + /** + * Callback invoked when an existing group is removed. + * + * @param[in] removed_state GroupInfo structure of the removed group. + */ + virtual void OnGroupRemoved(chip::FabricIndex fabric_index, const GroupInfo & old_group) = 0; + }; + /** * Template used to iterate the stored group data */ @@ -174,13 +192,21 @@ class GroupDataProvider using EndpointIterator = Iterator; using KeySetIterator = Iterator; - GroupDataProvider() = default; + GroupDataProvider(uint16_t maxGroupsPerFabric = CHIP_CONFIG_MAX_GROUPS_PER_FABRIC, + uint16_t maxGroupKeysPerFabric = CHIP_CONFIG_MAX_GROUP_KEYS_PER_FABRIC) : + mMaxGroupsPerFabric(maxGroupsPerFabric), + mMaxGroupKeysPerFabric(maxGroupKeysPerFabric) + {} + virtual ~GroupDataProvider() = default; // Not copyable GroupDataProvider(const GroupDataProvider &) = delete; GroupDataProvider & operator=(const GroupDataProvider &) = delete; + uint16_t GetMaxGroupsPerFabric() { return mMaxGroupsPerFabric; } + uint16_t GetMaxGroupKeysPerFabric() { return mMaxGroupKeysPerFabric; } + /** * Initialize the GroupDataProvider, including any persistent data store * initialization. Must be called once before any other API succeeds. @@ -198,6 +224,7 @@ class GroupDataProvider // By id virtual CHIP_ERROR SetGroupInfo(chip::FabricIndex fabric_index, const GroupInfo & info) = 0; virtual CHIP_ERROR GetGroupInfo(chip::FabricIndex fabric_index, chip::GroupId group_id, GroupInfo & info) = 0; + virtual CHIP_ERROR RemoveGroupInfo(chip::FabricIndex fabric_index, chip::GroupId group_id) = 0; // By index virtual CHIP_ERROR SetGroupInfoAt(chip::FabricIndex fabric_index, size_t index, const GroupInfo & info) = 0; virtual CHIP_ERROR GetGroupInfoAt(chip::FabricIndex fabric_index, size_t index, GroupInfo & info) = 0; @@ -210,16 +237,16 @@ class GroupDataProvider // Iterators /** * Creates an iterator that may be used to obtain the list of groups associated with the given fabric. - * The number of concurrent instances of this iterator is limited. In order to release the allocated memory, - * the iterator's Release() method must be called after the iteration is finished. + * In order to release the allocated memory, the Release() method must be called after the iteration is finished. + * Modifying the group table during the iteration is currently not supported, and may yield unexpected behaviour. * @retval An instance of EndpointIterator on success * @retval nullptr if no iterator instances are available. */ virtual GroupInfoIterator * IterateGroupInfo(chip::FabricIndex fabric_index) = 0; /** * Creates an iterator that may be used to obtain the list of (group, endpoint) pairs associated with the given fabric. - * The number of concurrent instances of this iterator is limited. In order to release the allocated memory, - * the iterator's Release() method must be called after the iteration is finished. + * In order to release the allocated memory, the Release() method must be called after the iteration is finished. + * Modifying the group table during the iteration is currently not supported, and may yield unexpected behaviour. * @retval An instance of EndpointIterator on success * @retval nullptr if no iterator instances are available. */ @@ -232,14 +259,16 @@ class GroupDataProvider virtual CHIP_ERROR SetGroupKeyAt(chip::FabricIndex fabric_index, size_t index, const GroupKey & info) = 0; virtual CHIP_ERROR GetGroupKeyAt(chip::FabricIndex fabric_index, size_t index, GroupKey & info) = 0; virtual CHIP_ERROR RemoveGroupKeyAt(chip::FabricIndex fabric_index, size_t index) = 0; + virtual CHIP_ERROR RemoveGroupKeys(chip::FabricIndex fabric_index) = 0; + /** * Creates an iterator that may be used to obtain the list of (group, keyset) pairs associated with the given fabric. - * The number of concurrent instances of this iterator is limited. In order to release the allocated memory, - * the iterator's Release() method must be called after the iteration is finished. + * In order to release the allocated memory, the Release() method must be called after the iteration is finished. + * Modifying the keyset mappings during the iteration is currently not supported, and may yield unexpected behaviour. * @retval An instance of GroupKeyIterator on success * @retval nullptr if no iterator instances are available. */ - virtual GroupKeyIterator * IterateGroupKey(chip::FabricIndex fabric_index) = 0; + virtual GroupKeyIterator * IterateGroupKeys(chip::FabricIndex fabric_index) = 0; // // Key Sets @@ -250,8 +279,8 @@ class GroupDataProvider virtual CHIP_ERROR RemoveKeySet(chip::FabricIndex fabric_index, chip::KeysetId keyset_id) = 0; /** * Creates an iterator that may be used to obtain the list of key sets associated with the given fabric. - * The number of concurrent instances of this iterator is limited. In order to release the allocated memory, - * the iterator's Release() method must be called after the iteration is finished. + * In order to release the allocated memory, the Release() method must be called after the iteration is finished. + * Modifying the key sets table during the iteration is currently not supported, and may yield unexpected behaviour. * @retval An instance of KeySetIterator on success * @retval nullptr if no iterator instances are available. */ @@ -262,6 +291,22 @@ class GroupDataProvider // General virtual CHIP_ERROR Decrypt(PacketHeader packetHeader, PayloadHeader & payloadHeader, System::PacketBufferHandle & msg) = 0; + + // Listener + void SetListener(GroupListener * listener) { mListener = listener; }; + void RemoveListener() { mListener = nullptr; }; + +protected: + void GroupAdded(chip::FabricIndex fabric_index, const GroupInfo & new_group) + { + if (mListener) + { + mListener->OnGroupAdded(fabric_index, new_group); + } + } + const uint16_t mMaxGroupsPerFabric; + const uint16_t mMaxGroupKeysPerFabric; + GroupListener * mListener = nullptr; }; /** diff --git a/src/credentials/GroupDataProviderImpl.cpp b/src/credentials/GroupDataProviderImpl.cpp index 47e78122794528..add79179d59bb9 100644 --- a/src/credentials/GroupDataProviderImpl.cpp +++ b/src/credentials/GroupDataProviderImpl.cpp @@ -32,17 +32,17 @@ struct PersistentData { virtual ~PersistentData() = default; - virtual void UpdateKey(DefaultStorageKeyAllocator & key) = 0; - virtual void Clear() = 0; - virtual CHIP_ERROR Serialize(TLV::TLVWriter & writer) const = 0; - virtual CHIP_ERROR Deserialize(TLV::TLVReader & reader) = 0; + virtual CHIP_ERROR UpdateKey(DefaultStorageKeyAllocator & key) = 0; + virtual CHIP_ERROR Serialize(TLV::TLVWriter & writer) const = 0; + virtual CHIP_ERROR Deserialize(TLV::TLVReader & reader) = 0; + virtual void Clear() = 0; CHIP_ERROR Save(chip::PersistentStorageDelegate & storage) { uint8_t buffer[kMaxSerializedSize] = { 0 }; DefaultStorageKeyAllocator key; // Update storage key - UpdateKey(key); + ReturnErrorOnFailure(UpdateKey(key)); // Serialize the data TLV::TLVWriter writer; @@ -62,11 +62,13 @@ struct PersistentData Clear(); // Update storage key - UpdateKey(key); + ReturnErrorOnFailure(UpdateKey(key)); // Load the serialized data - uint16_t size = static_cast(sizeof(buffer)); - ReturnErrorOnFailure(storage.SyncGetKeyValue(key.KeyName(), buffer, size)); + uint16_t size = static_cast(sizeof(buffer)); + CHIP_ERROR err = storage.SyncGetKeyValue(key.KeyName(), buffer, size); + VerifyOrReturnError(CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND != err, CHIP_ERROR_NOT_FOUND); + ReturnErrorOnFailure(err); // Decode serialized data TLV::TLVReader reader; @@ -78,7 +80,7 @@ struct PersistentData { DefaultStorageKeyAllocator key; // Update storage key - UpdateKey(key); + ReturnErrorOnFailure(UpdateKey(key)); // Delete stored data return storage.SyncDeleteKeyValue(key.KeyName()); } @@ -100,12 +102,12 @@ struct LinkedData : public PersistentData struct FabricData : public PersistentData { - static const TLV::Tag kTagFirstGroup = TLV::ContextTag(1); - static const TLV::Tag kTagGroupCount = TLV::ContextTag(2); - static const TLV::Tag kTagFirstMap = TLV::ContextTag(3); - static const TLV::Tag kTagMapCount = TLV::ContextTag(4); - static const TLV::Tag kTagFirstKeyset = TLV::ContextTag(5); - static const TLV::Tag kTagKeysetCount = TLV::ContextTag(6); + static constexpr TLV::Tag TagFirstGroup() { return TLV::ContextTag(1); } + static constexpr TLV::Tag TagGroupCount() { return TLV::ContextTag(2); } + static constexpr TLV::Tag TagFirstMap() { return TLV::ContextTag(3); } + static constexpr TLV::Tag TagMapCount() { return TLV::ContextTag(4); } + static constexpr TLV::Tag TagFirstKeyset() { return TLV::ContextTag(5); } + static constexpr TLV::Tag TagKeysetCount() { return TLV::ContextTag(6); } chip::FabricIndex fabric_index = kUndefinedFabricIndex; chip::GroupId first_group = kUndefinedGroupId; @@ -118,7 +120,12 @@ struct FabricData : public PersistentData FabricData() = default; FabricData(chip::FabricIndex fabric) : fabric_index(fabric) {} - void UpdateKey(DefaultStorageKeyAllocator & key) override { key.FabricGroups(fabric_index); } + CHIP_ERROR UpdateKey(DefaultStorageKeyAllocator & key) override + { + VerifyOrReturnError(kUndefinedFabricIndex != fabric_index, CHIP_ERROR_INVALID_FABRIC_ID); + key.FabricGroups(fabric_index); + return CHIP_NO_ERROR; + } void Clear() override { @@ -131,42 +138,42 @@ struct FabricData : public PersistentData CHIP_ERROR Serialize(TLV::TLVWriter & writer) const override { TLV::TLVType container; - ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, container)); + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, container)); - ReturnErrorOnFailure(writer.Put(kTagFirstGroup, static_cast(first_group))); - ReturnErrorOnFailure(writer.Put(kTagGroupCount, static_cast(group_count))); - ReturnErrorOnFailure(writer.Put(kTagFirstMap, static_cast(first_map))); - ReturnErrorOnFailure(writer.Put(kTagMapCount, static_cast(map_count))); - ReturnErrorOnFailure(writer.Put(kTagFirstKeyset, static_cast(first_keyset))); - ReturnErrorOnFailure(writer.Put(kTagKeysetCount, static_cast(keyset_count))); + ReturnErrorOnFailure(writer.Put(TagFirstGroup(), static_cast(first_group))); + ReturnErrorOnFailure(writer.Put(TagGroupCount(), static_cast(group_count))); + ReturnErrorOnFailure(writer.Put(TagFirstMap(), static_cast(first_map))); + ReturnErrorOnFailure(writer.Put(TagMapCount(), static_cast(map_count))); + ReturnErrorOnFailure(writer.Put(TagFirstKeyset(), static_cast(first_keyset))); + ReturnErrorOnFailure(writer.Put(TagKeysetCount(), static_cast(keyset_count))); return writer.EndContainer(container); } CHIP_ERROR Deserialize(TLV::TLVReader & reader) override { - ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag)); + ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag())); VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_INTERNAL); TLV::TLVType container; ReturnErrorOnFailure(reader.EnterContainer(container)); // first_group - ReturnErrorOnFailure(reader.Next(kTagFirstGroup)); + ReturnErrorOnFailure(reader.Next(TagFirstGroup())); ReturnErrorOnFailure(reader.Get(first_group)); // group_count - ReturnErrorOnFailure(reader.Next(kTagGroupCount)); + ReturnErrorOnFailure(reader.Next(TagGroupCount())); ReturnErrorOnFailure(reader.Get(group_count)); // first_map - ReturnErrorOnFailure(reader.Next(kTagFirstMap)); + ReturnErrorOnFailure(reader.Next(TagFirstMap())); ReturnErrorOnFailure(reader.Get(first_map)); // map_count - ReturnErrorOnFailure(reader.Next(kTagMapCount)); + ReturnErrorOnFailure(reader.Next(TagMapCount())); ReturnErrorOnFailure(reader.Get(map_count)); // first_keyset - ReturnErrorOnFailure(reader.Next(kTagFirstKeyset)); + ReturnErrorOnFailure(reader.Next(TagFirstKeyset())); ReturnErrorOnFailure(reader.Get(first_keyset)); // keyset_count - ReturnErrorOnFailure(reader.Next(kTagKeysetCount)); + ReturnErrorOnFailure(reader.Next(TagKeysetCount())); ReturnErrorOnFailure(reader.Get(keyset_count)); return reader.ExitContainer(container); @@ -175,11 +182,11 @@ struct FabricData : public PersistentData struct GroupData : public GroupDataProvider::GroupInfo, LinkedData { - static const TLV::Tag kTagGroupId = TLV::ContextTag(1); - static const TLV::Tag kTagName = TLV::ContextTag(2); - static const TLV::Tag kTagFirstEndpoint = TLV::ContextTag(3); - static const TLV::Tag kTagEndpointCount = TLV::ContextTag(4); - static const TLV::Tag kTagNext = TLV::ContextTag(5); + static constexpr TLV::Tag TagGroupId() { return TLV::ContextTag(1); } + static constexpr TLV::Tag TagName() { return TLV::ContextTag(2); } + static constexpr TLV::Tag TagFirstEndpoint() { return TLV::ContextTag(3); } + static constexpr TLV::Tag TagEndpointCount() { return TLV::ContextTag(4); } + static constexpr TLV::Tag TagNext() { return TLV::ContextTag(5); } chip::FabricIndex fabric_index = kUndefinedFabricIndex; chip::EndpointId first_endpoint = kInvalidEndpointId; @@ -189,7 +196,12 @@ struct GroupData : public GroupDataProvider::GroupInfo, LinkedData GroupData(chip::FabricIndex fabric) : GroupInfo(), LinkedData(), fabric_index(fabric) {} GroupData(chip::FabricIndex fabric, uint16_t link_id) : GroupInfo(), LinkedData(link_id), fabric_index(fabric) {} - void UpdateKey(DefaultStorageKeyAllocator & key) override { key.FabricGroup(fabric_index, id); } + CHIP_ERROR UpdateKey(DefaultStorageKeyAllocator & key) override + { + VerifyOrReturnError(kUndefinedFabricIndex != fabric_index, CHIP_ERROR_INVALID_FABRIC_ID); + key.FabricGroup(fabric_index, id); + return CHIP_NO_ERROR; + } void Clear() override { @@ -203,40 +215,40 @@ struct GroupData : public GroupDataProvider::GroupInfo, LinkedData CHIP_ERROR Serialize(TLV::TLVWriter & writer) const override { TLV::TLVType container; - ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, container)); + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, container)); size_t name_size = strnlen(name, GroupDataProvider::GroupInfo::kGroupNameMax); - ReturnErrorOnFailure(writer.Put(kTagGroupId, static_cast(group_id))); - ReturnErrorOnFailure(writer.PutString(kTagName, name, static_cast(name_size))); - ReturnErrorOnFailure(writer.Put(kTagFirstEndpoint, static_cast(first_endpoint))); - ReturnErrorOnFailure(writer.Put(kTagEndpointCount, static_cast(endpoint_count))); - ReturnErrorOnFailure(writer.Put(kTagNext, static_cast(next))); + ReturnErrorOnFailure(writer.Put(TagGroupId(), static_cast(group_id))); + ReturnErrorOnFailure(writer.PutString(TagName(), name, static_cast(name_size))); + ReturnErrorOnFailure(writer.Put(TagFirstEndpoint(), static_cast(first_endpoint))); + ReturnErrorOnFailure(writer.Put(TagEndpointCount(), static_cast(endpoint_count))); + ReturnErrorOnFailure(writer.Put(TagNext(), static_cast(next))); return writer.EndContainer(container); } CHIP_ERROR Deserialize(TLV::TLVReader & reader) override { - ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag)); + ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag())); VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_INTERNAL); TLV::TLVType container; ReturnErrorOnFailure(reader.EnterContainer(container)); // group_id - ReturnErrorOnFailure(reader.Next(kTagGroupId)); + ReturnErrorOnFailure(reader.Next(TagGroupId())); ReturnErrorOnFailure(reader.Get(group_id)); // name - ReturnErrorOnFailure(reader.Next(kTagName)); + ReturnErrorOnFailure(reader.Next(TagName())); ReturnErrorOnFailure(reader.GetString(name, sizeof(name))); size_t size = strnlen(name, kGroupNameMax); name[size] = 0; // first_endpoint - ReturnErrorOnFailure(reader.Next(kTagFirstEndpoint)); + ReturnErrorOnFailure(reader.Next(TagFirstEndpoint())); ReturnErrorOnFailure(reader.Get(first_endpoint)); // endpoint_count - ReturnErrorOnFailure(reader.Next(kTagEndpointCount)); + ReturnErrorOnFailure(reader.Next(TagEndpointCount())); ReturnErrorOnFailure(reader.Get(endpoint_count)); // next - ReturnErrorOnFailure(reader.Next(kTagNext)); + ReturnErrorOnFailure(reader.Next(TagNext())); ReturnErrorOnFailure(reader.Get(next)); return reader.ExitContainer(container); @@ -305,9 +317,9 @@ struct GroupData : public GroupDataProvider::GroupInfo, LinkedData struct KeyMapData : public GroupDataProvider::GroupKey, LinkedData { - static const TLV::Tag kTagGroupId = TLV::ContextTag(1); - static const TLV::Tag kTagKeysetId = TLV::ContextTag(2); - static const TLV::Tag kTagNext = TLV::ContextTag(3); + static constexpr TLV::Tag TagGroupId() { return TLV::ContextTag(1); } + static constexpr TLV::Tag TagKeysetId() { return TLV::ContextTag(2); } + static constexpr TLV::Tag TagNext() { return TLV::ContextTag(3); } chip::FabricIndex fabric_index = kUndefinedFabricIndex; chip::GroupId group_id = kUndefinedGroupId; @@ -318,37 +330,42 @@ struct KeyMapData : public GroupDataProvider::GroupKey, LinkedData GroupKey(group, keyset), LinkedData(link_id), fabric_index(fabric) {} - void UpdateKey(DefaultStorageKeyAllocator & key) override { key.FabricGroupKey(fabric_index, id); } + CHIP_ERROR UpdateKey(DefaultStorageKeyAllocator & key) override + { + VerifyOrReturnError(kUndefinedFabricIndex != fabric_index, CHIP_ERROR_INVALID_FABRIC_ID); + key.FabricGroupKey(fabric_index, id); + return CHIP_NO_ERROR; + } void Clear() override {} CHIP_ERROR Serialize(TLV::TLVWriter & writer) const override { TLV::TLVType container; - ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, container)); + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, container)); - ReturnErrorOnFailure(writer.Put(kTagGroupId, static_cast(group_id))); - ReturnErrorOnFailure(writer.Put(kTagKeysetId, static_cast(keyset_id))); - ReturnErrorOnFailure(writer.Put(kTagNext, static_cast(next))); + ReturnErrorOnFailure(writer.Put(TagGroupId(), static_cast(group_id))); + ReturnErrorOnFailure(writer.Put(TagKeysetId(), static_cast(keyset_id))); + ReturnErrorOnFailure(writer.Put(TagNext(), static_cast(next))); return writer.EndContainer(container); } CHIP_ERROR Deserialize(TLV::TLVReader & reader) override { - ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag)); + ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag())); VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_INTERNAL); TLV::TLVType container; ReturnErrorOnFailure(reader.EnterContainer(container)); // first_endpoint - ReturnErrorOnFailure(reader.Next(kTagGroupId)); + ReturnErrorOnFailure(reader.Next(TagGroupId())); ReturnErrorOnFailure(reader.Get(group_id)); // endpoint_count - ReturnErrorOnFailure(reader.Next(kTagKeysetId)); + ReturnErrorOnFailure(reader.Next(TagKeysetId())); ReturnErrorOnFailure(reader.Get(keyset_id)); // next - ReturnErrorOnFailure(reader.Next(kTagNext)); + ReturnErrorOnFailure(reader.Next(TagNext())); ReturnErrorOnFailure(reader.Get(next)); return reader.ExitContainer(container); @@ -417,8 +434,8 @@ struct KeyMapData : public GroupDataProvider::GroupKey, LinkedData struct EndpointData : GroupDataProvider::GroupEndpoint, LinkedData { - static const TLV::Tag kTagEndpoint = TLV::ContextTag(1); - static const TLV::Tag kTagNext = TLV::ContextTag(2); + static constexpr TLV::Tag TagEndpoint() { return TLV::ContextTag(1); } + static constexpr TLV::Tag TagNext() { return TLV::ContextTag(2); } chip::FabricIndex fabric_index = kUndefinedFabricIndex; uint16_t group_link_id = 0; @@ -430,33 +447,38 @@ struct EndpointData : GroupDataProvider::GroupEndpoint, LinkedData LinkedData(link_id), fabric_index(fabric), group_link_id(group_linked_id) {} - void UpdateKey(DefaultStorageKeyAllocator & key) override { key.FabricGroupEndpoint(fabric_index, group_link_id, id); } + CHIP_ERROR UpdateKey(DefaultStorageKeyAllocator & key) override + { + VerifyOrReturnError(kUndefinedFabricIndex != fabric_index, CHIP_ERROR_INVALID_FABRIC_ID); + key.FabricGroupEndpoint(fabric_index, group_link_id, id); + return CHIP_NO_ERROR; + } void Clear() override { next = kInvalidEndpointId; } CHIP_ERROR Serialize(TLV::TLVWriter & writer) const override { TLV::TLVType container; - ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, container)); + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, container)); - ReturnErrorOnFailure(writer.Put(kTagEndpoint, static_cast(endpoint_id))); - ReturnErrorOnFailure(writer.Put(kTagNext, static_cast(next))); + ReturnErrorOnFailure(writer.Put(TagEndpoint(), static_cast(endpoint_id))); + ReturnErrorOnFailure(writer.Put(TagNext(), static_cast(next))); return writer.EndContainer(container); } CHIP_ERROR Deserialize(TLV::TLVReader & reader) override { - ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag)); + ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag())); VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_INTERNAL); TLV::TLVType container; ReturnErrorOnFailure(reader.EnterContainer(container)); // endpoint_id - ReturnErrorOnFailure(reader.Next(kTagEndpoint)); + ReturnErrorOnFailure(reader.Next(TagEndpoint())); ReturnErrorOnFailure(reader.Get(endpoint_id)); // next - ReturnErrorOnFailure(reader.Next(kTagNext)); + ReturnErrorOnFailure(reader.Next(TagNext())); ReturnErrorOnFailure(reader.Get(next)); return reader.ExitContainer(container); @@ -499,13 +521,13 @@ struct EndpointData : GroupDataProvider::GroupEndpoint, LinkedData struct KeySetData : public GroupDataProvider::KeySet, PersistentData { - static const TLV::Tag kTagKeySetId = TLV::ContextTag(1); - static const TLV::Tag kTagPolicy = TLV::ContextTag(2); - static const TLV::Tag kTagNumKeys = TLV::ContextTag(3); - static const TLV::Tag kTagEpochKeys = TLV::ContextTag(4); - static const TLV::Tag kTagStartTime = TLV::ContextTag(5); - static const TLV::Tag kTagKey = TLV::ContextTag(6); - static const TLV::Tag kTagNext = TLV::ContextTag(7); + static constexpr TLV::Tag TagKeySetId() { return TLV::ContextTag(1); } + static constexpr TLV::Tag TagPolicy() { return TLV::ContextTag(2); } + static constexpr TLV::Tag TagNumKeys() { return TLV::ContextTag(3); } + static constexpr TLV::Tag TagEpochKeys() { return TLV::ContextTag(4); } + static constexpr TLV::Tag TagStartTime() { return TLV::ContextTag(5); } + static constexpr TLV::Tag TagKey() { return TLV::ContextTag(6); } + static constexpr TLV::Tag TagNext() { return TLV::ContextTag(7); } chip::FabricIndex fabric_index = kUndefinedFabricIndex; chip::KeysetId next = 0xffff; @@ -518,7 +540,13 @@ struct KeySetData : public GroupDataProvider::KeySet, PersistentData(keyset_id))); + ReturnErrorOnFailure(writer.Put(TagKeySetId(), static_cast(keyset_id))); // policy - ReturnErrorOnFailure(writer.Put(kTagPolicy, static_cast(policy))); + ReturnErrorOnFailure(writer.Put(TagPolicy(), static_cast(policy))); // num_keys_used - ReturnErrorOnFailure(writer.Put(kTagNumKeys, static_cast(num_keys_used))); + ReturnErrorOnFailure(writer.Put(TagNumKeys(), static_cast(num_keys_used))); // epoch_keys { TLV::TLVType array, item; - ReturnErrorOnFailure(writer.StartContainer(kTagEpochKeys, TLV::kTLVType_Array, array)); + ReturnErrorOnFailure(writer.StartContainer(TagEpochKeys(), TLV::kTLVType_Array, array)); for (auto & epoch : epoch_keys) { - ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, item)); - ReturnErrorOnFailure(writer.Put(kTagStartTime, static_cast(epoch.start_time))); - ReturnErrorOnFailure(writer.Put(kTagKey, ByteSpan(epoch.key, GroupDataProvider::EpochKey::kLengthBytes))); + ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, item)); + ReturnErrorOnFailure(writer.Put(TagStartTime(), static_cast(epoch.start_time))); + ReturnErrorOnFailure(writer.Put(TagKey(), ByteSpan(epoch.key, GroupDataProvider::EpochKey::kLengthBytes))); ReturnErrorOnFailure(writer.EndContainer(item)); } ReturnErrorOnFailure(writer.EndContainer(array)); } // next keyset - ReturnErrorOnFailure(writer.Put(kTagNext, static_cast(next))); + ReturnErrorOnFailure(writer.Put(TagNext(), static_cast(next))); return writer.EndContainer(container); } CHIP_ERROR Deserialize(TLV::TLVReader & reader) override { - ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag)); + ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag())); VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_INTERNAL); TLV::TLVType container; ReturnErrorOnFailure(reader.EnterContainer(container)); // keyset_id - ReturnErrorOnFailure(reader.Next(kTagKeySetId)); + ReturnErrorOnFailure(reader.Next(TagKeySetId())); ReturnErrorOnFailure(reader.Get(keyset_id)); // policy - ReturnErrorOnFailure(reader.Next(kTagPolicy)); + ReturnErrorOnFailure(reader.Next(TagPolicy())); ReturnErrorOnFailure(reader.Get(policy)); // num_keys_used - ReturnErrorOnFailure(reader.Next(kTagNumKeys)); + ReturnErrorOnFailure(reader.Next(TagNumKeys())); ReturnErrorOnFailure(reader.Get(num_keys_used)); { // epoch_keys - ReturnErrorOnFailure(reader.Next(kTagEpochKeys)); + ReturnErrorOnFailure(reader.Next(TagEpochKeys())); VerifyOrReturnError(TLV::kTLVType_Array == reader.GetType(), CHIP_ERROR_INTERNAL); TLV::TLVType array, item; ReturnErrorOnFailure(reader.EnterContainer(array)); for (auto & epoch : epoch_keys) { - ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag)); + ReturnErrorOnFailure(reader.Next(TLV::AnonymousTag())); VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_INTERNAL); ReturnErrorOnFailure(reader.EnterContainer(item)); // start_time - ReturnErrorOnFailure(reader.Next(kTagStartTime)); + ReturnErrorOnFailure(reader.Next(TagStartTime())); ReturnErrorOnFailure(reader.Get(epoch.start_time)); // key ByteSpan key; // epoch.key, - ReturnErrorOnFailure(reader.Next(kTagKey)); + ReturnErrorOnFailure(reader.Next(TagKey())); ReturnErrorOnFailure(reader.Get(key)); VerifyOrReturnError(GroupDataProvider::EpochKey::kLengthBytes == key.size(), CHIP_ERROR_INTERNAL); memcpy(epoch.key, key.data(), GroupDataProvider::EpochKey::kLengthBytes); @@ -602,7 +630,7 @@ struct KeySetData : public GroupDataProvider::KeySet, PersistentDataOnGroupRemoved(fabric_index, group); + } + return CHIP_NO_ERROR; } bool GroupDataProviderImpl::HasEndpoint(chip::FabricIndex fabric_index, chip::GroupId group_id, chip::EndpointId endpoint_id) @@ -832,7 +892,8 @@ CHIP_ERROR GroupDataProviderImpl::AddEndpoint(chip::FabricIndex fabric_index, ch GroupData group; // Load fabric data (defaults to zero) - fabric.Load(mStorage); + CHIP_ERROR err = fabric.Load(mStorage); + VerifyOrReturnError(CHIP_NO_ERROR == err || CHIP_ERROR_NOT_FOUND == err, err); if (!group.Find(mStorage, fabric, group_id)) { @@ -850,7 +911,9 @@ CHIP_ERROR GroupDataProviderImpl::AddEndpoint(chip::FabricIndex fabric_index, ch // Update fabric fabric.first_group = group.id; fabric.group_count++; - return fabric.Save(mStorage); + ReturnErrorOnFailure(fabric.Save(mStorage)); + GroupAdded(fabric_index, group); + return CHIP_NO_ERROR; } // Existing group @@ -887,9 +950,9 @@ CHIP_ERROR GroupDataProviderImpl::RemoveEndpoint(chip::FabricIndex fabric_index, GroupData group; EndpointData endpoint; - VerifyOrReturnError(CHIP_NO_ERROR == fabric.Load(mStorage), CHIP_ERROR_INVALID_FABRIC_ID); - VerifyOrReturnError(group.Find(mStorage, fabric, group_id), CHIP_ERROR_KEY_NOT_FOUND); - VerifyOrReturnError(endpoint.Find(mStorage, fabric, group, endpoint_id), CHIP_ERROR_KEY_NOT_FOUND); + ReturnErrorOnFailure(fabric.Load(mStorage)); + VerifyOrReturnError(group.Find(mStorage, fabric, group_id), CHIP_ERROR_NOT_FOUND); + VerifyOrReturnError(endpoint.Find(mStorage, fabric, group, endpoint_id), CHIP_ERROR_NOT_FOUND); // Existing endpoint endpoint.Delete(mStorage); @@ -920,7 +983,7 @@ CHIP_ERROR GroupDataProviderImpl::RemoveEndpoint(chip::FabricIndex fabric_index, FabricData fabric(fabric_index); - VerifyOrReturnError(CHIP_NO_ERROR == fabric.Load(mStorage), CHIP_ERROR_INVALID_FABRIC_ID); + ReturnErrorOnFailure(fabric.Load(mStorage)); GroupData group(fabric_index, fabric.first_group); size_t group_index = 0; @@ -1106,6 +1169,32 @@ void GroupDataProviderImpl::EndpointIteratorImpl::Release() mProvider.mEndpointIterators.ReleaseObject(this); } +CHIP_ERROR GroupDataProviderImpl::RemoveEndpoints(chip::FabricIndex fabric_index, chip::GroupId group_id) +{ + VerifyOrReturnError(mInitialized, CHIP_ERROR_INTERNAL); + + FabricData fabric(fabric_index); + GroupData group; + + VerifyOrReturnError(CHIP_NO_ERROR == fabric.Load(mStorage), CHIP_ERROR_INVALID_FABRIC_ID); + VerifyOrReturnError(group.Find(mStorage, fabric, group_id), CHIP_ERROR_KEY_NOT_FOUND); + + EndpointData endpoint(fabric_index, group.id, group.first_endpoint); + size_t endpoint_index = 0; + while (endpoint_index < group.endpoint_count) + { + ReturnErrorOnFailure(endpoint.Load(mStorage)); + endpoint.Delete(mStorage); + endpoint.id = endpoint.next; + endpoint_index++; + } + group.first_endpoint = kInvalidEndpointId; + group.endpoint_count = 0; + ReturnErrorOnFailure(group.Save(mStorage)); + + return CHIP_NO_ERROR; +} + // // Group-Key map // @@ -1118,7 +1207,8 @@ CHIP_ERROR GroupDataProviderImpl::SetGroupKeyAt(chip::FabricIndex fabric_index, KeyMapData map(fabric_index); // Load fabric, defaults to zero - fabric.Load(mStorage); + CHIP_ERROR err = fabric.Load(mStorage); + VerifyOrReturnError(CHIP_NO_ERROR == err || CHIP_ERROR_NOT_FOUND == err, err); // If the group exists, the index must match bool found = map.Find(mStorage, fabric, in_map); @@ -1136,6 +1226,7 @@ CHIP_ERROR GroupDataProviderImpl::SetGroupKeyAt(chip::FabricIndex fabric_index, // Insert last VerifyOrReturnError(fabric.map_count == index, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(fabric.map_count < mMaxGroupKeysPerFabric, CHIP_ERROR_INVALID_LIST_LENGTH); map.next = 0; ReturnErrorOnFailure(map.Save(mStorage)); @@ -1165,8 +1256,8 @@ CHIP_ERROR GroupDataProviderImpl::GetGroupKeyAt(chip::FabricIndex fabric_index, FabricData fabric(fabric_index); KeyMapData map; - VerifyOrReturnError(CHIP_NO_ERROR == fabric.Load(mStorage), CHIP_ERROR_INVALID_FABRIC_ID); - VerifyOrReturnError(map.Get(mStorage, fabric, index), CHIP_ERROR_KEY_NOT_FOUND); + ReturnErrorOnFailure(fabric.Load(mStorage)); + VerifyOrReturnError(map.Get(mStorage, fabric, index), CHIP_ERROR_NOT_FOUND); // Target map found out_map.group_id = map.group_id; @@ -1181,8 +1272,8 @@ CHIP_ERROR GroupDataProviderImpl::RemoveGroupKeyAt(chip::FabricIndex fabric_inde FabricData fabric(fabric_index); KeyMapData map; - VerifyOrReturnError(CHIP_NO_ERROR == fabric.Load(mStorage), CHIP_ERROR_INVALID_FABRIC_ID); - VerifyOrReturnError(map.Get(mStorage, fabric, index), CHIP_ERROR_KEY_NOT_FOUND); + ReturnErrorOnFailure(fabric.Load(mStorage)); + VerifyOrReturnError(map.Get(mStorage, fabric, index), CHIP_ERROR_NOT_FOUND); ReturnErrorOnFailure(map.Delete(mStorage)); if (map.first) @@ -1206,7 +1297,32 @@ CHIP_ERROR GroupDataProviderImpl::RemoveGroupKeyAt(chip::FabricIndex fabric_inde return fabric.Save(mStorage); } -GroupDataProvider::GroupKeyIterator * GroupDataProviderImpl::IterateGroupKey(chip::FabricIndex fabric_index) +CHIP_ERROR GroupDataProviderImpl::RemoveGroupKeys(chip::FabricIndex fabric_index) +{ + VerifyOrReturnError(mInitialized, CHIP_ERROR_INTERNAL); + + FabricData fabric(fabric_index); + VerifyOrReturnError(CHIP_NO_ERROR == fabric.Load(mStorage), CHIP_ERROR_INVALID_FABRIC_ID); + + size_t count = 0; + KeyMapData map(fabric_index, fabric.first_map); + while (count++ < fabric.map_count) + { + if (CHIP_NO_ERROR != map.Load(mStorage)) + { + break; + } + map.Delete(mStorage); + map.id = map.next; + } + + // Update fabric + fabric.first_map = 0; + fabric.map_count = 0; + return fabric.Save(mStorage); +} + +GroupDataProvider::GroupKeyIterator * GroupDataProviderImpl::IterateGroupKeys(chip::FabricIndex fabric_index) { VerifyOrReturnError(mInitialized, nullptr); return mGroupKeyIterators.CreateObject(*this, fabric_index); @@ -1264,7 +1380,8 @@ CHIP_ERROR GroupDataProviderImpl::SetKeySet(chip::FabricIndex fabric_index, cons KeySetData keyset; // Load fabric, defaults to zero - fabric.Load(mStorage); + CHIP_ERROR err = fabric.Load(mStorage); + VerifyOrReturnError(CHIP_NO_ERROR == err || CHIP_ERROR_NOT_FOUND == err, err); // Search existing keyset bool found = keyset.Find(mStorage, fabric, in_keyset.keyset_id); @@ -1298,10 +1415,10 @@ CHIP_ERROR GroupDataProviderImpl::GetKeySet(chip::FabricIndex fabric_index, uint FabricData fabric(fabric_index); KeySetData keyset; - VerifyOrReturnError(CHIP_NO_ERROR == fabric.Load(mStorage), CHIP_ERROR_INVALID_FABRIC_ID); - VerifyOrReturnError(keyset.Find(mStorage, fabric, target_id), CHIP_ERROR_KEY_NOT_FOUND); + ReturnErrorOnFailure(fabric.Load(mStorage)); + VerifyOrReturnError(keyset.Find(mStorage, fabric, target_id), CHIP_ERROR_NOT_FOUND); - VerifyOrReturnError(keyset.Find(mStorage, fabric, target_id), CHIP_ERROR_KEY_NOT_FOUND); + VerifyOrReturnError(keyset.Find(mStorage, fabric, target_id), CHIP_ERROR_NOT_FOUND); // Target keyset found out_keyset.policy = keyset.policy; @@ -1317,8 +1434,8 @@ CHIP_ERROR GroupDataProviderImpl::RemoveKeySet(chip::FabricIndex fabric_index, u FabricData fabric(fabric_index); KeySetData keyset; - VerifyOrReturnError(CHIP_NO_ERROR == fabric.Load(mStorage), CHIP_ERROR_INVALID_FABRIC_ID); - VerifyOrReturnError(keyset.Find(mStorage, fabric, target_id), CHIP_ERROR_KEY_NOT_FOUND); + ReturnErrorOnFailure(fabric.Load(mStorage)); + VerifyOrReturnError(keyset.Find(mStorage, fabric, target_id), CHIP_ERROR_NOT_FOUND); ReturnErrorOnFailure(keyset.Delete(mStorage)); if (keyset.first) @@ -1396,7 +1513,8 @@ CHIP_ERROR GroupDataProviderImpl::RemoveFabric(chip::FabricIndex fabric_index) // Fabric data defaults to zero, so if not entry is found, no mappings, or keys are removed // However, states has a separate list, and needs to be removed regardless - fabric.Load(mStorage); + CHIP_ERROR err = fabric.Load(mStorage); + VerifyOrReturnError(CHIP_NO_ERROR == err || CHIP_ERROR_NOT_FOUND == err, err); // Remove Group mappings diff --git a/src/credentials/GroupDataProviderImpl.h b/src/credentials/GroupDataProviderImpl.h index bd96080842e425..8162261fed5047 100644 --- a/src/credentials/GroupDataProviderImpl.h +++ b/src/credentials/GroupDataProviderImpl.h @@ -29,6 +29,11 @@ class GroupDataProviderImpl : public GroupDataProvider static constexpr size_t kIteratorsMax = CHIP_CONFIG_MAX_GROUP_CONCURRENT_ITERATORS; GroupDataProviderImpl(chip::PersistentStorageDelegate & storage_delegate) : mStorage(storage_delegate) {} + GroupDataProviderImpl(chip::PersistentStorageDelegate & storage_delegate, uint16_t maxGroupsPerFabric, + uint16_t maxGroupKeysPerFabric) : + GroupDataProvider(maxGroupsPerFabric, maxGroupKeysPerFabric), + mStorage(storage_delegate) + {} virtual ~GroupDataProviderImpl() {} CHIP_ERROR Init() override; @@ -41,6 +46,7 @@ class GroupDataProviderImpl : public GroupDataProvider // By id CHIP_ERROR SetGroupInfo(chip::FabricIndex fabric_index, const GroupInfo & info) override; CHIP_ERROR GetGroupInfo(chip::FabricIndex fabric_index, chip::GroupId group_id, GroupInfo & info) override; + CHIP_ERROR RemoveGroupInfo(chip::FabricIndex fabric_index, chip::GroupId group_id) override; // By index CHIP_ERROR SetGroupInfoAt(chip::FabricIndex fabric_index, size_t index, const GroupInfo & info) override; CHIP_ERROR GetGroupInfoAt(chip::FabricIndex fabric_index, size_t index, GroupInfo & info) override; @@ -61,7 +67,8 @@ class GroupDataProviderImpl : public GroupDataProvider CHIP_ERROR SetGroupKeyAt(chip::FabricIndex fabric_index, size_t index, const GroupKey & info) override; CHIP_ERROR GetGroupKeyAt(chip::FabricIndex fabric_index, size_t index, GroupKey & info) override; CHIP_ERROR RemoveGroupKeyAt(chip::FabricIndex fabric_index, size_t index) override; - GroupKeyIterator * IterateGroupKey(chip::FabricIndex fabric_index) override; + CHIP_ERROR RemoveGroupKeys(chip::FabricIndex fabric_index) override; + GroupKeyIterator * IterateGroupKeys(chip::FabricIndex fabric_index) override; // // Key Sets @@ -146,6 +153,7 @@ class GroupDataProviderImpl : public GroupDataProvider size_t mCount = 0; size_t mTotal = 0; }; + CHIP_ERROR RemoveEndpoints(chip::FabricIndex fabric_index, chip::GroupId group_id); chip::PersistentStorageDelegate & mStorage; bool mInitialized = false; diff --git a/src/credentials/examples/DefaultDeviceAttestationVerifier.cpp b/src/credentials/examples/DefaultDeviceAttestationVerifier.cpp index ac8d2242e372c6..23850c7156eee0 100644 --- a/src/credentials/examples/DefaultDeviceAttestationVerifier.cpp +++ b/src/credentials/examples/DefaultDeviceAttestationVerifier.cpp @@ -16,6 +16,7 @@ */ #include "DefaultDeviceAttestationVerifier.h" +#include #include #include #include @@ -160,6 +161,11 @@ class DefaultDACVerifier : public DeviceAttestationVerifier const ByteSpan & firmwareInfo, const DeviceInfoForAttestation & deviceInfo) override; + CHIP_ERROR VerifyNodeOperationalCSRInformation(const ByteSpan & nocsrElementsBuffer, + const ByteSpan & attestationChallengeBuffer, + const ByteSpan & attestationSignatureBuffer, const P256PublicKey & dacPublicKey, + const ByteSpan & csrNonce) override; + protected: DefaultDACVerifier() {} @@ -367,6 +373,39 @@ AttestationVerificationResult DefaultDACVerifier::ValidateCertificateDeclaration return AttestationVerificationResult::kSuccess; } +CHIP_ERROR DefaultDACVerifier::VerifyNodeOperationalCSRInformation(const ByteSpan & nocsrElementsBuffer, + const ByteSpan & attestationChallengeBuffer, + const ByteSpan & attestationSignatureBuffer, + const P256PublicKey & dacPublicKey, const ByteSpan & csrNonce) +{ + VerifyOrReturnError(!nocsrElementsBuffer.empty() && !attestationChallengeBuffer.empty() && + !attestationSignatureBuffer.empty() && !csrNonce.empty(), + CHIP_ERROR_INVALID_ARGUMENT); + + VerifyOrReturnError(csrNonce.size() == Controller::kOpCSRNonceLength, CHIP_ERROR_INVALID_ARGUMENT); + + ByteSpan csrSpan; + ByteSpan csrNonceSpan; + ByteSpan vendorReserved1Span; + ByteSpan vendorReserved2Span; + ByteSpan vendorReserved3Span; + ReturnErrorOnFailure(DeconstructNOCSRElements(nocsrElementsBuffer, csrSpan, csrNonceSpan, vendorReserved1Span, + vendorReserved2Span, vendorReserved3Span)); + + // Verify that Nonce matches with what we sent + VerifyOrReturnError(csrNonceSpan.data_equal(csrNonce), CHIP_ERROR_INVALID_ARGUMENT); + + // Validate overall attestation signature on attestation information + P256ECDSASignature signature; + // SetLength will fail if signature doesn't fit + ReturnErrorOnFailure(signature.SetLength(attestationSignatureBuffer.size())); + memcpy(signature.Bytes(), attestationSignatureBuffer.data(), attestationSignatureBuffer.size()); + + ReturnErrorOnFailure(ValidateAttestationSignature(dacPublicKey, nocsrElementsBuffer, attestationChallengeBuffer, signature)); + + return CHIP_NO_ERROR; +} + } // namespace const AttestationTrustStore * GetTestAttestationTrustStore() diff --git a/src/credentials/tests/TestDeviceAttestationConstruction.cpp b/src/credentials/tests/TestDeviceAttestationConstruction.cpp index 7852905724bad1..7ed7b5abb39d38 100644 --- a/src/credentials/tests/TestDeviceAttestationConstruction.cpp +++ b/src/credentials/tests/TestDeviceAttestationConstruction.cpp @@ -567,6 +567,72 @@ static void TestNocsrElements_Construction(nlTestSuite * inSuite, void * inConte NL_TEST_ASSERT(inSuite, nocsrElementsSpan.data_equal(ByteSpan(kNoCsrElementsVector))); } +static void TestNocsrElements_Deconstruction(nlTestSuite * inSuite, void * inContext) +{ + static constexpr uint8_t kNocsrNonce[32] = { + 0x81, 0x4a, 0x4d, 0x4c, 0x1c, 0x4a, 0x8e, 0xbb, 0xea, 0xdb, 0x0a, 0xe2, 0x82, 0xf9, 0x91, 0xeb, + 0x13, 0xac, 0x5f, 0x9f, 0xce, 0x94, 0x30, 0x93, 0x19, 0xaa, 0x94, 0x09, 0x6c, 0x8c, 0xd4, 0xb8, + }; + + static constexpr uint8_t kExampleCsr[221] = { + 0x30, 0x81, 0xda, 0x30, 0x81, 0x81, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, + 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x41, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, + 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x5c, 0xa2, 0x79, 0xe3, 0x66, + 0x82, 0xc2, 0xd4, 0x6c, 0xe7, 0xd4, 0xcf, 0x89, 0x67, 0x84, 0x67, 0x08, 0xb5, 0xb9, 0xf8, 0x5b, 0x9c, 0xda, 0xfd, + 0x8c, 0xa8, 0x85, 0x26, 0x12, 0xcb, 0x0f, 0x0c, 0x7a, 0x71, 0x31, 0x4e, 0xc8, 0xdc, 0x9c, 0x96, 0x34, 0xdd, 0xee, + 0xfe, 0xe9, 0xf6, 0x3f, 0x0e, 0x8b, 0xd7, 0xda, 0xcf, 0xc3, 0xb6, 0xa4, 0x53, 0x2a, 0xad, 0xd8, 0x9a, 0x96, 0x51, + 0xcd, 0x6e, 0xa0, 0x11, 0x30, 0x0f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x0e, 0x31, 0x02, + 0x30, 0x00, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, + 0x02, 0x20, 0x0e, 0x67, 0x5e, 0xe1, 0xb3, 0xbb, 0xfe, 0x15, 0x2a, 0x17, 0x4a, 0xf5, 0x35, 0xe2, 0x2d, 0x55, 0xce, + 0x10, 0xc1, 0x50, 0xca, 0xc0, 0x1b, 0x31, 0x18, 0xde, 0x05, 0xe8, 0xfd, 0x9f, 0x10, 0x48, 0x02, 0x21, 0x00, 0xd8, + 0x8c, 0x57, 0xcc, 0x6e, 0x74, 0xf0, 0xe5, 0x48, 0x8a, 0x26, 0x16, 0x7a, 0x07, 0xfd, 0x6d, 0xbe, 0xf1, 0xaa, 0xad, + 0x72, 0x1c, 0x58, 0x0b, 0x6e, 0xae, 0x21, 0xbe, 0x5e, 0x6d, 0x0c, 0x72, + }; + + const uint8_t kVendorReserved1[23] = { + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31, + }; + + const uint8_t kVendorReserved3[24] = { + 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + }; + + const uint8_t kNoCsrElementsVector[314] = { + 0x15, 0x30, 0x01, 0xdd, 0x30, 0x81, 0xda, 0x30, 0x81, 0x81, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x41, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x5c, 0xa2, 0x79, 0xe3, + 0x66, 0x82, 0xc2, 0xd4, 0x6c, 0xe7, 0xd4, 0xcf, 0x89, 0x67, 0x84, 0x67, 0x08, 0xb5, 0xb9, 0xf8, 0x5b, 0x9c, 0xda, 0xfd, + 0x8c, 0xa8, 0x85, 0x26, 0x12, 0xcb, 0x0f, 0x0c, 0x7a, 0x71, 0x31, 0x4e, 0xc8, 0xdc, 0x9c, 0x96, 0x34, 0xdd, 0xee, 0xfe, + 0xe9, 0xf6, 0x3f, 0x0e, 0x8b, 0xd7, 0xda, 0xcf, 0xc3, 0xb6, 0xa4, 0x53, 0x2a, 0xad, 0xd8, 0x9a, 0x96, 0x51, 0xcd, 0x6e, + 0xa0, 0x11, 0x30, 0x0f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x0e, 0x31, 0x02, 0x30, 0x00, 0x30, + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20, 0x0e, 0x67, + 0x5e, 0xe1, 0xb3, 0xbb, 0xfe, 0x15, 0x2a, 0x17, 0x4a, 0xf5, 0x35, 0xe2, 0x2d, 0x55, 0xce, 0x10, 0xc1, 0x50, 0xca, 0xc0, + 0x1b, 0x31, 0x18, 0xde, 0x05, 0xe8, 0xfd, 0x9f, 0x10, 0x48, 0x02, 0x21, 0x00, 0xd8, 0x8c, 0x57, 0xcc, 0x6e, 0x74, 0xf0, + 0xe5, 0x48, 0x8a, 0x26, 0x16, 0x7a, 0x07, 0xfd, 0x6d, 0xbe, 0xf1, 0xaa, 0xad, 0x72, 0x1c, 0x58, 0x0b, 0x6e, 0xae, 0x21, + 0xbe, 0x5e, 0x6d, 0x0c, 0x72, 0x30, 0x02, 0x20, 0x81, 0x4a, 0x4d, 0x4c, 0x1c, 0x4a, 0x8e, 0xbb, 0xea, 0xdb, 0x0a, 0xe2, + 0x82, 0xf9, 0x91, 0xeb, 0x13, 0xac, 0x5f, 0x9f, 0xce, 0x94, 0x30, 0x93, 0x19, 0xaa, 0x94, 0x09, 0x6c, 0x8c, 0xd4, 0xb8, + 0x30, 0x03, 0x17, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x64, 0x31, 0x30, 0x05, 0x18, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, + }; + + ByteSpan csrSpan; + ByteSpan csrNonceSpan; + ByteSpan vendorReserved1Span; + ByteSpan vendorReserved2Span; + ByteSpan vendorReserved3Span; + CHIP_ERROR err = DeconstructNOCSRElements(ByteSpan(kNoCsrElementsVector), csrSpan, csrNonceSpan, vendorReserved1Span, + vendorReserved2Span, vendorReserved3Span); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, csrSpan.data_equal(ByteSpan(kExampleCsr))); + NL_TEST_ASSERT(inSuite, csrNonceSpan.data_equal(ByteSpan(kNocsrNonce))); + NL_TEST_ASSERT(inSuite, vendorReserved1Span.data_equal(ByteSpan(kVendorReserved1))); + NL_TEST_ASSERT(inSuite, vendorReserved2Span.empty()); + NL_TEST_ASSERT(inSuite, vendorReserved3Span.data_equal(ByteSpan(kVendorReserved3))); +} + /** * Test Suite. It lists all the test functions. */ @@ -580,6 +646,7 @@ static const nlTest sTests[] = { NL_TEST_DEF("Test Device Attestation Elements Deconstruction - Corrupted/Out of Order TLV", TestAttestationElements_DeconstructionUnordered), NL_TEST_DEF("Test Device Attestation Elements Deconstruction - No vendor reserved", TestAttestationElements_DeconstructionNoVendorReserved), NL_TEST_DEF("Test Device NOCSR Elements Construction", TestNocsrElements_Construction), + NL_TEST_DEF("Test Device NOCSR Elements Deconstruction", TestNocsrElements_Deconstruction), NL_TEST_SENTINEL() }; // clang-format on diff --git a/src/credentials/tests/TestDeviceAttestationCredentials.cpp b/src/credentials/tests/TestDeviceAttestationCredentials.cpp index 1f880fd4bc2f81..9a40934401a091 100644 --- a/src/credentials/tests/TestDeviceAttestationCredentials.cpp +++ b/src/credentials/tests/TestDeviceAttestationCredentials.cpp @@ -287,6 +287,71 @@ static void TestDACVerifierExample_CertDeclarationVerification(nlTestSuite * inS NL_TEST_ASSERT(inSuite, attestation_result == AttestationVerificationResult::kSuccess); } +static void TestDACVerifierExample_NocsrInformationVerification(nlTestSuite * inSuite, void * inContext) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + constexpr uint8_t nocsrElementsTestVector[] = { + 0x15, 0x30, 0x01, 0xdd, 0x30, 0x81, 0xda, 0x30, 0x81, 0x81, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x41, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x5c, 0xa2, 0x79, 0xe3, + 0x66, 0x82, 0xc2, 0xd4, 0x6c, 0xe7, 0xd4, 0xcf, 0x89, 0x67, 0x84, 0x67, 0x08, 0xb5, 0xb9, 0xf8, 0x5b, 0x9c, 0xda, 0xfd, + 0x8c, 0xa8, 0x85, 0x26, 0x12, 0xcb, 0x0f, 0x0c, 0x7a, 0x71, 0x31, 0x4e, 0xc8, 0xdc, 0x9c, 0x96, 0x34, 0xdd, 0xee, 0xfe, + 0xe9, 0xf6, 0x3f, 0x0e, 0x8b, 0xd7, 0xda, 0xcf, 0xc3, 0xb6, 0xa4, 0x53, 0x2a, 0xad, 0xd8, 0x9a, 0x96, 0x51, 0xcd, 0x6e, + 0xa0, 0x11, 0x30, 0x0f, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x0e, 0x31, 0x02, 0x30, 0x00, 0x30, + 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20, 0x0e, 0x67, + 0x5e, 0xe1, 0xb3, 0xbb, 0xfe, 0x15, 0x2a, 0x17, 0x4a, 0xf5, 0x35, 0xe2, 0x2d, 0x55, 0xce, 0x10, 0xc1, 0x50, 0xca, 0xc0, + 0x1b, 0x31, 0x18, 0xde, 0x05, 0xe8, 0xfd, 0x9f, 0x10, 0x48, 0x02, 0x21, 0x00, 0xd8, 0x8c, 0x57, 0xcc, 0x6e, 0x74, 0xf0, + 0xe5, 0x48, 0x8a, 0x26, 0x16, 0x7a, 0x07, 0xfd, 0x6d, 0xbe, 0xf1, 0xaa, 0xad, 0x72, 0x1c, 0x58, 0x0b, 0x6e, 0xae, 0x21, + 0xbe, 0x5e, 0x6d, 0x0c, 0x72, 0x30, 0x02, 0x20, 0x81, 0x4a, 0x4d, 0x4c, 0x1c, 0x4a, 0x8e, 0xbb, 0xea, 0xdb, 0x0a, 0xe2, + 0x82, 0xf9, 0x91, 0xeb, 0x13, 0xac, 0x5f, 0x9f, 0xce, 0x94, 0x30, 0x93, 0x19, 0xaa, 0x94, 0x09, 0x6c, 0x8c, 0xd4, 0xb8, + 0x30, 0x03, 0x17, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x64, 0x31, 0x30, 0x05, 0x18, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, + }; + constexpr uint8_t attestationChallengeTestVector[] = { 0x7a, 0x49, 0x53, 0x05, 0xd0, 0x77, 0x79, 0xa4, + 0x94, 0xdd, 0x39, 0xa0, 0x85, 0x1b, 0x66, 0x0d }; + constexpr uint8_t csrNonceTestVector[] = { 0x81, 0x4a, 0x4d, 0x4c, 0x1c, 0x4a, 0x8e, 0xbb, 0xea, 0xdb, 0x0a, + 0xe2, 0x82, 0xf9, 0x91, 0xeb, 0x13, 0xac, 0x5f, 0x9f, 0xce, 0x94, + 0x30, 0x93, 0x19, 0xaa, 0x94, 0x09, 0x6c, 0x8c, 0xd4, 0xb8 }; + constexpr uint8_t attestationSignatureTestVector[] = { 0x87, 0x8e, 0x46, 0xcf, 0xfa, 0x83, 0xc8, 0x32, 0x96, 0xeb, 0x27, + 0x2e, 0xbc, 0x37, 0x1c, 0x1f, 0xef, 0xee, 0x6d, 0x69, 0x54, 0xf3, + 0x78, 0x9f, 0xd3, 0xd2, 0x27, 0xe1, 0x64, 0x13, 0xd3, 0xd4, 0x75, + 0xa6, 0x2f, 0xd0, 0x12, 0xb9, 0x19, 0xd9, 0x95, 0x8b, 0xc7, 0x3d, + 0x7c, 0x63, 0xb3, 0xcc, 0x1e, 0xf2, 0xb6, 0x2c, 0x18, 0xe0, 0xcc, + 0x10, 0x2e, 0xd1, 0xba, 0x4d, 0xac, 0x85, 0xfe, 0xea }; + constexpr uint8_t wrongAttestationSignatureTestVector[] = { + /* added 1 to first index */ + 0x88, 0x8e, 0x46, 0xcf, 0xfa, 0x83, 0xc8, 0x32, 0x96, 0xeb, 0x27, 0x2e, 0xbc, 0x37, 0x1c, 0x1f, + 0xef, 0xee, 0x6d, 0x69, 0x54, 0xf3, 0x78, 0x9f, 0xd3, 0xd2, 0x27, 0xe1, 0x64, 0x13, 0xd3, 0xd4, + 0x75, 0xa6, 0x2f, 0xd0, 0x12, 0xb9, 0x19, 0xd9, 0x95, 0x8b, 0xc7, 0x3d, 0x7c, 0x63, 0xb3, 0xcc, + 0x1e, 0xf2, 0xb6, 0x2c, 0x18, 0xe0, 0xcc, 0x10, 0x2e, 0xd1, 0xba, 0x4d, 0xac, 0x85, 0xfe, 0xea + }; + constexpr uint8_t attestationPublicKey[] = { 0x04, 0xce, 0x5c, 0xf8, 0xef, 0xb0, 0x5d, 0x4e, 0xee, 0x79, 0x0d, 0x0a, 0x71, + 0xd5, 0xc0, 0x11, 0xbb, 0x74, 0x72, 0x40, 0xdb, 0xa2, 0x14, 0x58, 0x84, 0x5d, + 0x33, 0xe3, 0x4b, 0x0a, 0xf6, 0x65, 0x16, 0x33, 0x06, 0x3a, 0x80, 0x4b, 0x2f, + 0xf8, 0x5d, 0xca, 0xb2, 0x01, 0x9a, 0x0a, 0xb6, 0xf5, 0x59, 0x57, 0x75, 0xfe, + 0x8d, 0x85, 0xfb, 0xd7, 0xa0, 0x7c, 0x8e, 0x83, 0x7d, 0xa4, 0xd5, 0xa8, 0xb9 }; + + DeviceAttestationVerifier * exampleDacVerifier = GetDefaultDACVerifier(GetTestAttestationTrustStore()); + NL_TEST_ASSERT(inSuite, exampleDacVerifier != nullptr); + + P256PublicKey dacPubkey; + NL_TEST_ASSERT(inSuite, sizeof(attestationPublicKey) == dacPubkey.Length()); + memcpy(dacPubkey.Bytes(), attestationPublicKey, dacPubkey.Length()); + + err = exampleDacVerifier->VerifyNodeOperationalCSRInformation( + ByteSpan(nocsrElementsTestVector), ByteSpan(attestationChallengeTestVector), ByteSpan(attestationSignatureTestVector), + dacPubkey, ByteSpan(csrNonceTestVector)); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + // now test with invalid signature + err = exampleDacVerifier->VerifyNodeOperationalCSRInformation( + ByteSpan(nocsrElementsTestVector), ByteSpan(attestationChallengeTestVector), ByteSpan(wrongAttestationSignatureTestVector), + dacPubkey, ByteSpan(csrNonceTestVector)); + NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_SIGNATURE); +} + static void TestAttestationTrustStore(nlTestSuite * inSuite, void * inContext) { // SKID to trigger CHIP_ERROR_INVALID_ARGUMENT @@ -375,6 +440,7 @@ static const nlTest sTests[] = { NL_TEST_DEF("Test the 'for testing' Paa Root Store", TestAttestationTrustStore), NL_TEST_DEF("Test Example Device Attestation Information Verification", TestDACVerifierExample_AttestationInfoVerification), NL_TEST_DEF("Test Example Device Attestation Certification Declaration Verification", TestDACVerifierExample_CertDeclarationVerification), + NL_TEST_DEF("Test Example Device Attestation Node Operational CSR Information Verification", TestDACVerifierExample_NocsrInformationVerification), NL_TEST_SENTINEL() }; // clang-format on diff --git a/src/credentials/tests/TestGroupDataProvider.cpp b/src/credentials/tests/TestGroupDataProvider.cpp index 2012f7933b53bd..928aca95382114 100644 --- a/src/credentials/tests/TestGroupDataProvider.cpp +++ b/src/credentials/tests/TestGroupDataProvider.cpp @@ -48,6 +48,9 @@ static const size_t kSize2 = strlen(kValue2) + 1; constexpr chip::FabricIndex kFabric1 = 1; constexpr chip::FabricIndex kFabric2 = 7; +constexpr uint16_t kMaxGroupsPerFabric = 5; +constexpr uint16_t kMaxGroupKeysPerFabric = 8; + constexpr chip::GroupId kGroup1 = kMinFabricGroupId; constexpr chip::GroupId kGroup2 = 0x2222; constexpr chip::GroupId kGroup3 = kMaxFabricGroupId; @@ -95,6 +98,37 @@ static KeySet kKeySet1(kKeysetId1, KeySet::SecurityPolicy::kLowLatency, 1); static KeySet kKeySet2(kKeysetId2, KeySet::SecurityPolicy::kLowLatency, 2); static KeySet kKeySet3(kKeysetId3, KeySet::SecurityPolicy::kStandard, 3); +class TestListener : public GroupDataProvider::GroupListener +{ +public: + chip::FabricIndex fabric_index = kUndefinedFabricIndex; + GroupInfo latest; + size_t added_count = 0; + size_t removed_count = 0; + + void Reset() + { + fabric_index = kUndefinedFabricIndex; + latest = GroupInfo(); + added_count = 0; + removed_count = 0; + } + + void OnGroupAdded(chip::FabricIndex fabric, const GroupInfo & new_group) override + { + fabric_index = fabric; + latest = new_group; + added_count++; + } + void OnGroupRemoved(chip::FabricIndex fabric, const GroupInfo & old_group) override + { + fabric_index = fabric; + latest = old_group; + removed_count++; + } +}; +static TestListener sListener; + void TestStorageDelegate(nlTestSuite * apSuite, void * apContext) { chip::TestPersistentStorageDelegate delegate; @@ -139,6 +173,8 @@ void TestGroupInfo(nlTestSuite * apSuite, void * apContext) // Set Group Info + sListener.Reset(); + // Out-of-order NL_TEST_ASSERT(apSuite, CHIP_ERROR_INVALID_ARGUMENT == provider->SetGroupInfoAt(kFabric1, 2, kGroupInfo1_1)); @@ -156,7 +192,11 @@ void TestGroupInfo(nlTestSuite * apSuite, void * apContext) // Get Group Info NL_TEST_ASSERT(apSuite, CHIP_ERROR_INVALID_FABRIC_ID == provider->GetGroupInfoAt(kUndefinedFabricIndex, 0, group)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetGroupInfoAt(kFabric2, 999, group)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupInfoAt(kFabric2, 999, group)); + + NL_TEST_ASSERT(apSuite, sListener.latest == kGroupInfo2_3); + NL_TEST_ASSERT(apSuite, 6 == sListener.added_count); + NL_TEST_ASSERT(apSuite, 0 == sListener.removed_count); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupInfoAt(kFabric2, 2, group)); NL_TEST_ASSERT(apSuite, group == kGroupInfo2_3); @@ -173,12 +213,15 @@ void TestGroupInfo(nlTestSuite * apSuite, void * apContext) // Remove Groups - NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveGroupInfoAt(kFabric1, 2)); + NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveGroupInfo(kFabric1, kGroup3)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveGroupInfoAt(kFabric2, 0)); + NL_TEST_ASSERT(apSuite, sListener.latest == kGroupInfo2_1); + NL_TEST_ASSERT(apSuite, 6 == sListener.added_count); + NL_TEST_ASSERT(apSuite, 2 == sListener.removed_count); // Remaining entries shift up - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetGroupInfoAt(kFabric2, 2, group)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupInfoAt(kFabric2, 2, group)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupInfoAt(kFabric2, 1, group)); NL_TEST_ASSERT(apSuite, group == kGroupInfo2_3); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupInfoAt(kFabric2, 0, group)); @@ -187,7 +230,7 @@ void TestGroupInfo(nlTestSuite * apSuite, void * apContext) NL_TEST_ASSERT(apSuite, group == kGroupInfo1_2); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupInfoAt(kFabric1, 0, group)); NL_TEST_ASSERT(apSuite, group == kGroupInfo1_1); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetGroupInfoAt(kFabric1, 3, group)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupInfoAt(kFabric1, 3, group)); // Overwrite with new group @@ -199,6 +242,9 @@ void TestGroupInfo(nlTestSuite * apSuite, void * apContext) NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupInfoAt(kFabric2, 0, group)); NL_TEST_ASSERT(apSuite, group == kGroupInfo3_4); + NL_TEST_ASSERT(apSuite, sListener.latest == kGroupInfo3_4); + NL_TEST_ASSERT(apSuite, 8 == sListener.added_count); + NL_TEST_ASSERT(apSuite, 2 == sListener.removed_count); // Overwrite existing group, index must match @@ -213,18 +259,24 @@ void TestGroupInfo(nlTestSuite * apSuite, void * apContext) NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupInfoAt(kFabric2, 1, group)); NL_TEST_ASSERT(apSuite, group == kGroupInfo1_3); + NL_TEST_ASSERT(apSuite, sListener.latest == kGroupInfo3_4); + NL_TEST_ASSERT(apSuite, 8 == sListener.added_count); + NL_TEST_ASSERT(apSuite, 2 == sListener.removed_count); // By group_id - // New + // Override existing NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->SetGroupInfo(kFabric1, kGroupInfo3_5)); - // Override + // New group NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->SetGroupInfo(kFabric2, kGroupInfo3_2)); // Not found - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetGroupInfo(kFabric2, kGroup5, group)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupInfo(kFabric2, kGroup5, group)); // Existing NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupInfo(kFabric2, kGroup2, group)); NL_TEST_ASSERT(apSuite, group == kGroupInfo3_2); + NL_TEST_ASSERT(apSuite, sListener.latest == kGroupInfo3_2); + NL_TEST_ASSERT(apSuite, 9 == sListener.added_count); + NL_TEST_ASSERT(apSuite, 2 == sListener.removed_count); } void TestGroupInfoIterator(nlTestSuite * apSuite, void * apContext) @@ -337,11 +389,11 @@ void TestEndpoints(nlTestSuite * apSuite, void * apContext) // Remove - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->RemoveEndpoint(kFabric1, kGroup1, kEndpointId4)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->RemoveEndpoint(kFabric1, kGroup1, kEndpointId4)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveEndpoint(kFabric1, kGroup1, kEndpointId0)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveEndpoint(kFabric1, kGroup2, kEndpointId3)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->RemoveEndpoint(kFabric2, kGroup5, kEndpointId0)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->RemoveEndpoint(kFabric2, kGroup5, kEndpointId0)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveEndpoint(kFabric2, kGroup2, kEndpointId1)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveEndpoint(kFabric2, kGroup3, kEndpointId2)); @@ -456,7 +508,7 @@ void TestEndpointIterator(nlTestSuite * apSuite, void * apContext) } } -void TestGroupKey(nlTestSuite * apSuite, void * apContext) +void TestGroupKeys(nlTestSuite * apSuite, void * apContext) { GroupDataProvider * provider = GetGroupDataProvider(); NL_TEST_ASSERT(apSuite, provider); @@ -489,7 +541,7 @@ void TestGroupKey(nlTestSuite * apSuite, void * apContext) // Get Group Info NL_TEST_ASSERT(apSuite, CHIP_ERROR_INVALID_FABRIC_ID == provider->GetGroupKeyAt(kUndefinedFabricIndex, 0, pair)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetGroupKeyAt(kFabric2, 999, pair)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric2, 999, pair)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric1, 3, pair)); NL_TEST_ASSERT(apSuite, pair == kGroup1Keyset3); @@ -514,7 +566,7 @@ void TestGroupKey(nlTestSuite * apSuite, void * apContext) NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveGroupKeyAt(kFabric1, 2)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveGroupKeyAt(kFabric2, 0)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetGroupKeyAt(kFabric1, 3, pair)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric1, 3, pair)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric1, 2, pair)); NL_TEST_ASSERT(apSuite, pair == kGroup1Keyset3); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric1, 1, pair)); @@ -522,7 +574,7 @@ void TestGroupKey(nlTestSuite * apSuite, void * apContext) NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric1, 0, pair)); NL_TEST_ASSERT(apSuite, pair == kGroup1Keyset0); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetGroupKeyAt(kFabric2, 3, pair)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric2, 3, pair)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric2, 2, pair)); NL_TEST_ASSERT(apSuite, pair == kGroup2Keyset3); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric2, 1, pair)); @@ -542,6 +594,23 @@ void TestGroupKey(nlTestSuite * apSuite, void * apContext) NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric2, 0, pair)); NL_TEST_ASSERT(apSuite, pair == kGroup3Keyset1); + + // Remove all + + NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveGroupKeys(kFabric1)); + + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric1, 3, pair)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric1, 2, pair)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric1, 1, pair)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric1, 0, pair)); + + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupKeyAt(kFabric2, 3, pair)); + NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric2, 2, pair)); + NL_TEST_ASSERT(apSuite, pair == kGroup2Keyset3); + NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric2, 1, pair)); + NL_TEST_ASSERT(apSuite, pair == kGroup2Keyset2); + NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupKeyAt(kFabric2, 0, pair)); + NL_TEST_ASSERT(apSuite, pair == kGroup3Keyset1); } void TestGroupKeyIterator(nlTestSuite * apSuite, void * apContext) @@ -577,7 +646,7 @@ void TestGroupKeyIterator(nlTestSuite * apSuite, void * apContext) kGroup1Keyset0, kGroup1Keyset1, kGroup1Keyset2, kGroup1Keyset3 }; size_t expected_f1_count = sizeof(expected_f1) / sizeof(GroupKey); - auto it = provider->IterateGroupKey(kFabric1); + auto it = provider->IterateGroupKeys(kFabric1); size_t count = 0; NL_TEST_ASSERT(apSuite, it); if (it) @@ -596,7 +665,7 @@ void TestGroupKeyIterator(nlTestSuite * apSuite, void * apContext) GroupKey expected_f2[] = { kGroup2Keyset0, kGroup2Keyset1, kGroup2Keyset2, kGroup2Keyset3 }; size_t expected_f2_count = sizeof(expected_f2) / sizeof(GroupKey); - it = provider->IterateGroupKey(kFabric2); + it = provider->IterateGroupKeys(kFabric2); NL_TEST_ASSERT(apSuite, it); if (it) { @@ -655,14 +724,14 @@ void TestKeySets(nlTestSuite * apSuite, void * apContext) // Remove Keysets - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->RemoveKeySet(kFabric1, 0xffff)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->RemoveKeySet(kFabric1, 0xffff)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveKeySet(kFabric1, kKeysetId1)); // First NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveKeySet(kFabric1, kKeysetId3)); // Last NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveKeySet(kFabric2, kKeysetId2)); // Middle - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId3, keyset)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId1, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId3, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId1, keyset)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetKeySet(kFabric1, kKeysetId0, keyset)); NL_TEST_ASSERT(apSuite, keyset == kKeySet0); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetKeySet(kFabric1, kKeysetId2, keyset)); @@ -670,7 +739,7 @@ void TestKeySets(nlTestSuite * apSuite, void * apContext) NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetKeySet(kFabric2, kKeysetId3, keyset)); NL_TEST_ASSERT(apSuite, keyset == kKeySet3); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric2, kKeysetId2, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric2, kKeysetId2, keyset)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetKeySet(kFabric2, kKeysetId1, keyset)); NL_TEST_ASSERT(apSuite, keyset == kKeySet1); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetKeySet(kFabric2, kKeysetId0, keyset)); @@ -678,23 +747,23 @@ void TestKeySets(nlTestSuite * apSuite, void * apContext) // Remove all - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->RemoveKeySet(kFabric1, kKeysetId3)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->RemoveKeySet(kFabric1, kKeysetId1)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->RemoveKeySet(kFabric1, kKeysetId3)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->RemoveKeySet(kFabric1, kKeysetId1)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveKeySet(kFabric1, kKeysetId0)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveKeySet(kFabric1, kKeysetId2)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveKeySet(kFabric2, kKeysetId3)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->RemoveKeySet(kFabric2, kKeysetId2)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->RemoveKeySet(kFabric2, kKeysetId2)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveKeySet(kFabric2, kKeysetId1)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->RemoveKeySet(kFabric2, kKeysetId0)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId3, keyset)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId1, keyset)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId0, keyset)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId2, keyset)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric2, kKeysetId3, keyset)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric2, kKeysetId2, keyset)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric2, kKeysetId1, keyset)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_KEY_NOT_FOUND == provider->GetKeySet(kFabric2, kKeysetId0, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId3, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId1, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId0, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric1, kKeysetId2, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric2, kKeysetId3, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric2, kKeysetId2, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric2, kKeysetId1, keyset)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric2, kKeysetId0, keyset)); } void TestKeySetIterator(nlTestSuite * apSuite, void * apContext) @@ -890,9 +959,9 @@ void TestPerFabricData(nlTestSuite * apSuite, void * apContext) // Group Info - NL_TEST_ASSERT(apSuite, CHIP_ERROR_INVALID_FABRIC_ID == provider->GetGroupInfoAt(kFabric1, 0, group)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_INVALID_FABRIC_ID == provider->GetGroupInfoAt(kFabric1, 1, group)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_INVALID_FABRIC_ID == provider->GetGroupInfoAt(kFabric1, 2, group)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupInfoAt(kFabric1, 0, group)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupInfoAt(kFabric1, 1, group)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetGroupInfoAt(kFabric1, 2, group)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupInfoAt(kFabric2, 0, group)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupInfoAt(kFabric2, 1, group)); NL_TEST_ASSERT(apSuite, CHIP_NO_ERROR == provider->GetGroupInfoAt(kFabric2, 2, group)); @@ -917,9 +986,9 @@ void TestPerFabricData(nlTestSuite * apSuite, void * apContext) NL_TEST_ASSERT(apSuite, 0 == memcmp(kKeySet0.epoch_keys, keys.epoch_keys, sizeof(kKeySet0.epoch_keys[0]) * kKeySet0.num_keys_used)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_INVALID_FABRIC_ID == provider->GetKeySet(kFabric1, 202, keys)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_INVALID_FABRIC_ID == provider->GetKeySet(kFabric1, 404, keys)); - NL_TEST_ASSERT(apSuite, CHIP_ERROR_INVALID_FABRIC_ID == provider->GetKeySet(kFabric1, 606, keys)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric1, 202, keys)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric1, 404, keys)); + NL_TEST_ASSERT(apSuite, CHIP_ERROR_NOT_FOUND == provider->GetKeySet(kFabric1, 606, keys)); } } // namespace TestGroups @@ -929,7 +998,8 @@ void TestPerFabricData(nlTestSuite * apSuite, void * apContext) namespace { static chip::TestPersistentStorageDelegate sDelegate; -static GroupDataProviderImpl sProvider(sDelegate); +static GroupDataProviderImpl sProvider(sDelegate, chip::app::TestGroups::kMaxGroupsPerFabric, + chip::app::TestGroups::kMaxGroupKeysPerFabric); static EpochKey kEpochKeys0[] = { { 0x1111111111111111, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, @@ -956,6 +1026,9 @@ int Test_Setup(void * inContext) VerifyOrReturnError(CHIP_NO_ERROR == chip::Platform::MemoryInit(), FAILURE); VerifyOrReturnError(CHIP_NO_ERROR == sProvider.Init(), FAILURE); + // Event listener + sProvider.SetListener(&chip::app::TestGroups::sListener); + memcpy(chip::app::TestGroups::kKeySet0.epoch_keys, kEpochKeys0, sizeof(kEpochKeys0)); memcpy(chip::app::TestGroups::kKeySet1.epoch_keys, kEpochKeys1, sizeof(kEpochKeys1)); memcpy(chip::app::TestGroups::kKeySet2.epoch_keys, kEpochKeys2, sizeof(kEpochKeys2)); @@ -982,7 +1055,7 @@ const nlTest sTests[] = { NL_TEST_DEF("TestStorageDelegate", chip::app::TestGrou NL_TEST_DEF("TestGroupInfoIterator", chip::app::TestGroups::TestGroupInfoIterator), NL_TEST_DEF("TestEndpoints", chip::app::TestGroups::TestEndpoints), NL_TEST_DEF("TestEndpointIterator", chip::app::TestGroups::TestEndpointIterator), - NL_TEST_DEF("TestGroupKey", chip::app::TestGroups::TestGroupKey), + NL_TEST_DEF("TestGroupKeys", chip::app::TestGroups::TestGroupKeys), NL_TEST_DEF("TestGroupKeyIterator", chip::app::TestGroups::TestGroupKeyIterator), NL_TEST_DEF("TestKeySets", chip::app::TestGroups::TestKeySets), NL_TEST_DEF("TestKeySetIterator", chip::app::TestGroups::TestKeySetIterator), diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index 3eaae07b470c5a..ab6f3bcab20161 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -820,7 +820,7 @@ class Spake2p size_t Lin_len); /** - * @brief Start the Spake2+ process as a prover (i.e. a commisioner). + * @brief Start the Spake2+ process as a prover (i.e. a commissioner). * * @param my_identity The prover identity. May be NULL if identities are not established. * @param my_identity_len The prover identity length. diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index dbe45f13b11f79..b36d5467106fb5 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -170,7 +170,7 @@ CHIP_ERROR AES_CCM_encrypt(const uint8_t * plaintext, size_t plaintext_length, c VerifyOrExit(tag != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); VerifyOrExit(_isValidTagLength(tag_length), error = CHIP_ERROR_INVALID_ARGUMENT); - // TODO: Remove suport for AES-256 since not in 1.0 + // TODO: Remove support for AES-256 since not in 1.0 // Determine crypto type by key length type = (key_length == kAES_CCM128_Key_Length) ? EVP_aes_128_ccm() : EVP_aes_256_ccm(); @@ -279,7 +279,7 @@ CHIP_ERROR AES_CCM_decrypt(const uint8_t * ciphertext, size_t ciphertext_length, VerifyOrExit(iv != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); VerifyOrExit(iv_length > 0, error = CHIP_ERROR_INVALID_ARGUMENT); - // TODO: Remove suport for AES-256 since not in 1.0 + // TODO: Remove support for AES-256 since not in 1.0 // Determine crypto type by key length type = (key_length == kAES_CCM128_Key_Length) ? EVP_aes_128_ccm() : EVP_aes_256_ccm(); diff --git a/src/crypto/tests/CHIPCryptoPALTest.cpp b/src/crypto/tests/CHIPCryptoPALTest.cpp index a378a11852c709..1dc409dc7838de 100644 --- a/src/crypto/tests/CHIPCryptoPALTest.cpp +++ b/src/crypto/tests/CHIPCryptoPALTest.cpp @@ -615,7 +615,7 @@ static void TestAsn1Conversions(nlTestSuite * inSuite, void * inContext) out_der_sig.Calloc(out_der_sig_allocated_size); NL_TEST_ASSERT(inSuite, out_der_sig); - // Test converstion from ASN.1 ER to raw + // Test conversion from ASN.1 ER to raw MutableByteSpan out_raw_sig_span(out_raw_sig.Get(), out_raw_sig_allocated_size); CHIP_ERROR status = EcdsaAsn1SignatureToRaw(vector->fe_length_bytes, diff --git a/src/crypto/tests/qemu_crypto_tests.sh b/src/crypto/tests/qemu_crypto_tests.sh deleted file mode 120000 index 8fbe617c97a267..00000000000000 --- a/src/crypto/tests/qemu_crypto_tests.sh +++ /dev/null @@ -1 +0,0 @@ -../../../scripts/tools/qemu_run_test.sh \ No newline at end of file diff --git a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h index 70c3431627eecf..44bcf732832763 100644 --- a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h +++ b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h @@ -35,6 +35,7 @@ BOOL CHIPIsDevicePaired(uint64_t id); BOOL CHIPGetConnectedDevice(CHIPDeviceConnectionCallback completionHandler); BOOL CHIPGetConnectedDeviceWithID(uint64_t deviceId, CHIPDeviceConnectionCallback completionHandler); void CHIPUnpairDeviceWithID(uint64_t deviceId); +CHIPDevice * CHIPGetDeviceBeingCommissioned(void); @interface CHIPToolPersistentStorageDelegate : NSObject diff --git a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m index e9e964dc57874b..9b4f09ce5fe64a 100644 --- a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m +++ b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m @@ -76,18 +76,34 @@ void CHIPSetNextAvailableDeviceID(uint64_t id) return controller; } -BOOL CHIPGetConnectedDevice(CHIPDeviceConnectionCallback completionHandler) +uint64_t CHIPGetLastPairedDeviceId(void) { - CHIPDeviceController * controller = InitializeCHIP(); - uint64_t deviceId = CHIPGetNextAvailableDeviceID(); if (deviceId > 1) { - // Let's use the last device that was paired deviceId--; - return [controller getConnectedDevice:deviceId queue:dispatch_get_main_queue() completionHandler:completionHandler]; } + return deviceId; +} + +BOOL CHIPGetConnectedDevice(CHIPDeviceConnectionCallback completionHandler) +{ + CHIPDeviceController * controller = InitializeCHIP(); - return NO; + // Let's use the last device that was paired + uint64_t deviceId = CHIPGetLastPairedDeviceId(); + return [controller getConnectedDevice:deviceId queue:dispatch_get_main_queue() completionHandler:completionHandler]; +} + +CHIPDevice * CHIPGetDeviceBeingCommissioned(void) +{ + NSError * error; + CHIPDeviceController * controller = InitializeCHIP(); + CHIPDevice * device = [controller getDeviceBeingCommissioned:CHIPGetLastPairedDeviceId() error:&error]; + if (error) { + NSLog(@"Error retrieving device being commissioned for deviceId %llu", CHIPGetLastPairedDeviceId()); + return nil; + } + return device; } BOOL CHIPGetConnectedDeviceWithID(uint64_t deviceId, CHIPDeviceConnectionCallback completionHandler) diff --git a/src/darwin/CHIPTool/CHIPTool/Info.plist b/src/darwin/CHIPTool/CHIPTool/Info.plist index 76f6de3383393b..ddf42a9109093c 100644 --- a/src/darwin/CHIPTool/CHIPTool/Info.plist +++ b/src/darwin/CHIPTool/CHIPTool/Info.plist @@ -16,8 +16,28 @@ $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString 1.0 + CFBundleURLTypes + + + CFBundleURLName + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleURLSchemes + + mt + + + CFBundleVersion 1 + LSEnvironment + + CommissioningCustomFlowLedgerUrl + https://dcl.dev.dsr-corporation.com/api/modelinfo/models + CommissioningCustomFlowReturnUrl + mt://modelinfo?payload + CommissioningCustomFlowUseMockFlag + + LSRequiresIPhoneOS NFCReaderUsageDescription diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/AppDelegate.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/AppDelegate.m index 873b7da2459a27..746b76a442038d 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/AppDelegate.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/AppDelegate.m @@ -33,4 +33,19 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [self.window makeKeyAndVisible]; return YES; } + +- (BOOL)application:(UIApplication *)application + openURL:(NSURL *)url + options:(NSDictionary *)options +{ + // custom commissioning flow + UIAlertController * alert = [UIAlertController alertControllerWithTitle:@"Info" + message:@"Commissioning flow Completed." + preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction * ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]; + [alert addAction:ok]; + [self.window.rootViewController presentViewController:alert animated:YES completion:nil]; + NSLog(@"Do custom commissioning inbound logic here."); + return YES; +} @end diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m index 419a644f6aa4eb..15c639d87b0c63 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m @@ -148,7 +148,7 @@ - (IBAction)bind:(id)sender completionHandler:^(NSError * _Nullable error) { NSString * resultString = (error == nil) ? @"Bind command: success!" - : [NSString stringWithFormat:@"An error occured: 0x%02lx", error.code]; + : [NSString stringWithFormat:@"An error occurred: 0x%02lx", error.code]; NSLog(resultString, nil); }]; } else { @@ -180,7 +180,7 @@ - (IBAction)unbind:(id)sender completionHandler:^(NSError * _Nullable error) { NSString * resultString = (error == nil) ? @"Unbind command: success!" - : [NSString stringWithFormat:@"An error occured: 0x%02lx", error.code]; + : [NSString stringWithFormat:@"An error occurred: 0x%02lx", error.code]; NSLog(resultString, nil); }]; } else { diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Echo client/EchoViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Echo client/EchoViewController.m index 7a4606fbf0813b..a77321a393a235 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Echo client/EchoViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Echo client/EchoViewController.m @@ -117,8 +117,9 @@ - (IBAction)sendMessage:(id)sender [self updateResult:@"MfgSpecificPing command sent..."]; [cluster mfgSpecificPingWithCompletionHandler:^(NSError * _Nullable error) { - NSString * resultString = (error == nil) ? @"MfgSpecificPing command: success!" - : [NSString stringWithFormat:@"An error occured: 0x%02lx", error.code]; + NSString * resultString = (error == nil) + ? @"MfgSpecificPing command: success!" + : [NSString stringWithFormat:@"An error occurred: 0x%02lx", error.code]; [self updateResult:resultString]; }]; } else { diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/OnOffCluster/OnOffViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/OnOffCluster/OnOffViewController.m index 215fe9c355311c..3801e6366a377e 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/OnOffCluster/OnOffViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/OnOffCluster/OnOffViewController.m @@ -244,7 +244,7 @@ - (IBAction)onButtonTapped:(id)sender queue:dispatch_get_main_queue()]; [onOff onWithCompletionHandler:^(NSError * error) { NSString * resultString = (error != nil) - ? [NSString stringWithFormat:@"An error occured: 0x%02lx", error.code] + ? [NSString stringWithFormat:@"An error occurred: 0x%02lx", error.code] : @"On command success"; [self updateResult:resultString]; }]; @@ -273,7 +273,7 @@ - (IBAction)offButtonTapped:(id)sender queue:dispatch_get_main_queue()]; [onOff offWithCompletionHandler:^(NSError * error) { NSString * resultString = (error != nil) - ? [NSString stringWithFormat:@"An error occured: 0x%02lx", error.code] + ? [NSString stringWithFormat:@"An error occurred: 0x%02lx", error.code] : @"Off command success"; [self updateResult:resultString]; }]; @@ -302,7 +302,7 @@ - (IBAction)toggleButtonTapped:(id)sender queue:dispatch_get_main_queue()]; [onOff toggleWithCompletionHandler:^(NSError * error) { NSString * resultString = (error != nil) - ? [NSString stringWithFormat:@"An error occured: 0x%02lx", error.code] + ? [NSString stringWithFormat:@"An error occurred: 0x%02lx", error.code] : @"Toggle command success"; [self updateResult:resultString]; }]; diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m index f0894ce787cf16..5fb53e994670f9 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m @@ -22,6 +22,7 @@ #import "DefaultsUtils.h" #import "DeviceSelector.h" #import +#import // system imports #import @@ -65,6 +66,13 @@ @interface QRCodeViewController () @property (strong, nonatomic) UILabel * productID; @property (strong, nonatomic) UILabel * serialNumber; +@property (strong, nonatomic) UIButton * readFromLedgerButton; +@property (strong, nonatomic) UIButton * redirectButton; +@property (strong, nonatomic) UILabel * commissioningFlowLabel; +@property (strong, nonatomic) UILabel * commissioningCustomFlowUrl; +@property (strong, nonatomic) UIView * deviceModelInfoView; +@property (strong, nonatomic) NSDictionary * ledgerRespond; + @property (strong, nonatomic) UIActivityIndicatorView * activityIndicator; @property (strong, nonatomic) UILabel * errorLabel; @@ -105,6 +113,9 @@ - (void)setupUI // Setup nav bar button [self changeNavBarButtonToCamera]; + // Initialize all Labels + [self initializeAllLabels]; + // Title UILabel * titleLabel = [CHIPUIViewUtils addTitle:@"QR Code Parser" toView:self.view]; @@ -113,7 +124,7 @@ - (void)setupUI stackView.axis = UILayoutConstraintAxisVertical; stackView.distribution = UIStackViewDistributionFill; stackView.alignment = UIStackViewAlignmentLeading; - stackView.spacing = 15; + stackView.spacing = 10; [self.view addSubview:stackView]; stackView.translatesAutoresizingMaskIntoConstraints = false; @@ -170,9 +181,29 @@ - (void)setupUI [_setupPayloadView.topAnchor constraintEqualToAnchor:stackView.bottomAnchor constant:10].active = YES; [_setupPayloadView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor constant:30].active = YES; [_setupPayloadView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-30].active = YES; - [_setupPayloadView.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.bottomAnchor constant:-30].active = YES; + [_setupPayloadView.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.bottomAnchor constant:-60].active = YES; + + _deviceModelInfoView = [UIView new]; + [self.view addSubview:_deviceModelInfoView]; + + _deviceModelInfoView.translatesAutoresizingMaskIntoConstraints = false; + [_deviceModelInfoView.topAnchor constraintEqualToAnchor:stackView.bottomAnchor constant:10].active = YES; + [_deviceModelInfoView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor constant:30].active = YES; + [_deviceModelInfoView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-30].active = YES; + [_deviceModelInfoView.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.bottomAnchor constant:-60].active + = YES; - [self addViewsToSetupPayloadView]; + // manual entry field + _manualCodeLabel = [UILabel new]; + _manualCodeLabel.text = @"00000000000000000000"; + _manualCodeLabel.textColor = UIColor.systemBlueColor; + _manualCodeLabel.font = [UIFont systemFontOfSize:17]; + _manualCodeLabel.textAlignment = NSTextAlignmentRight; + [_setupPayloadView addSubview:_manualCodeLabel]; + + _manualCodeLabel.translatesAutoresizingMaskIntoConstraints = false; + [_manualCodeLabel.topAnchor constraintEqualToAnchor:_setupPayloadView.topAnchor].active = YES; + [_manualCodeLabel.trailingAnchor constraintEqualToAnchor:_setupPayloadView.trailingAnchor].active = YES; // activity indicator _activityIndicator = [UIActivityIndicatorView new]; @@ -219,37 +250,73 @@ - (void)setupUI [_resetButton.widthAnchor constraintEqualToConstant:60].active = YES; [_resetButton.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.bottomAnchor constant:-30].active = YES; [_resetButton.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-30].active = YES; + + // Read from Ledger button + _readFromLedgerButton = [UIButton new]; + [_readFromLedgerButton setTitle:@"Read from Ledger" forState:UIControlStateNormal]; + [_readFromLedgerButton addTarget:self action:@selector(readFromLedgerApi:) forControlEvents:UIControlEventTouchUpInside]; + _readFromLedgerButton.backgroundColor = UIColor.systemBlueColor; + _readFromLedgerButton.titleLabel.font = [UIFont systemFontOfSize:17]; + _readFromLedgerButton.titleLabel.textColor = [UIColor whiteColor]; + _readFromLedgerButton.layer.cornerRadius = 5; + _readFromLedgerButton.clipsToBounds = YES; + _readFromLedgerButton.hidden = YES; + [self.view addSubview:_readFromLedgerButton]; + + _readFromLedgerButton.translatesAutoresizingMaskIntoConstraints = false; + [_readFromLedgerButton.widthAnchor constraintEqualToConstant:200].active = YES; + [_readFromLedgerButton.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.bottomAnchor constant:-30].active + = YES; + [_readFromLedgerButton.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-30].active = YES; + + // Redirect Custom Flow button + _redirectButton = [UIButton new]; + [_redirectButton setTitle:@"Redirect" forState:UIControlStateNormal]; + [_redirectButton addTarget:self action:@selector(redirectToUrl:) forControlEvents:UIControlEventTouchUpInside]; + _redirectButton.backgroundColor = UIColor.systemBlueColor; + _redirectButton.titleLabel.font = [UIFont systemFontOfSize:17]; + _redirectButton.titleLabel.textColor = [UIColor whiteColor]; + _redirectButton.layer.cornerRadius = 5; + _redirectButton.clipsToBounds = YES; + _redirectButton.hidden = YES; + [self.view addSubview:_redirectButton]; + + _redirectButton.translatesAutoresizingMaskIntoConstraints = false; + [_redirectButton.widthAnchor constraintEqualToConstant:200].active = YES; + [_redirectButton.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.bottomAnchor constant:-30].active = YES; + [_redirectButton.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-30].active = YES; } -- (void)addViewsToSetupPayloadView +- (void)initializeAllLabels { - // manual entry field - _manualCodeLabel = [UILabel new]; - _manualCodeLabel.text = @"00000000000000000000"; - _manualCodeLabel.textColor = UIColor.systemBlueColor; - _manualCodeLabel.font = [UIFont systemFontOfSize:17]; - _manualCodeLabel.textAlignment = NSTextAlignmentRight; - [_setupPayloadView addSubview:_manualCodeLabel]; - - _manualCodeLabel.translatesAutoresizingMaskIntoConstraints = false; - [_manualCodeLabel.topAnchor constraintEqualToAnchor:_setupPayloadView.topAnchor].active = YES; - [_manualCodeLabel.trailingAnchor constraintEqualToAnchor:_setupPayloadView.trailingAnchor].active = YES; + _versionLabel = [UILabel new]; + _discriminatorLabel = [UILabel new]; + _setupPinCodeLabel = [UILabel new]; + _rendezVousInformation = [UILabel new]; + _vendorID = [UILabel new]; + _productID = [UILabel new]; + _serialNumber = [UILabel new]; + _commissioningFlowLabel = [UILabel new]; + _commissioningCustomFlowUrl = [UILabel new]; +} +- (void)addDetailSubview:(UIView *)superView +{ // Results scroll view UIScrollView * resultsScrollView = [UIScrollView new]; - [_setupPayloadView addSubview:resultsScrollView]; + [superView addSubview:resultsScrollView]; resultsScrollView.translatesAutoresizingMaskIntoConstraints = false; - [resultsScrollView.topAnchor constraintEqualToAnchor:_manualCodeLabel.bottomAnchor constant:10].active = YES; - [resultsScrollView.leadingAnchor constraintEqualToAnchor:_setupPayloadView.leadingAnchor].active = YES; - [resultsScrollView.trailingAnchor constraintEqualToAnchor:_setupPayloadView.trailingAnchor].active = YES; - [resultsScrollView.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.bottomAnchor constant:-20].active = YES; + [resultsScrollView.topAnchor constraintEqualToAnchor:superView.topAnchor constant:10].active = YES; + [resultsScrollView.leadingAnchor constraintEqualToAnchor:superView.leadingAnchor].active = YES; + [resultsScrollView.trailingAnchor constraintEqualToAnchor:superView.trailingAnchor].active = YES; + [resultsScrollView.bottomAnchor constraintEqualToAnchor:superView.bottomAnchor constant:-20].active = YES; UIStackView * parserResultsView = [UIStackView new]; parserResultsView.axis = UILayoutConstraintAxisVertical; parserResultsView.distribution = UIStackViewDistributionEqualSpacing; parserResultsView.alignment = UIStackViewAlignmentLeading; - parserResultsView.spacing = 15; + parserResultsView.spacing = 5; [resultsScrollView addSubview:parserResultsView]; parserResultsView.translatesAutoresizingMaskIntoConstraints = false; @@ -257,33 +324,60 @@ - (void)addViewsToSetupPayloadView [parserResultsView.leadingAnchor constraintEqualToAnchor:resultsScrollView.leadingAnchor].active = YES; [parserResultsView.trailingAnchor constraintEqualToAnchor:resultsScrollView.trailingAnchor].active = YES; [parserResultsView.bottomAnchor constraintEqualToAnchor:resultsScrollView.bottomAnchor].active = YES; - [self addResultsUIToStackView:parserResultsView]; + + if (superView == _setupPayloadView) { + [superView addSubview:_manualCodeLabel]; + [self addResultsUIToStackView:parserResultsView]; + } else if (superView == _deviceModelInfoView) { + [self addDeviceInfoUIToStackView:parserResultsView]; + } } - (void)addResultsUIToStackView:(UIStackView *)stackView { - NSArray * resultLabelTexts = - @[ @"version", @"discriminator", @"setup pin code", @"rendez vous information", @"vendor ID", @"product ID", @"serial #" ]; - _versionLabel = [UILabel new]; - _discriminatorLabel = [UILabel new]; - _setupPinCodeLabel = [UILabel new]; - _rendezVousInformation = [UILabel new]; - _vendorID = [UILabel new]; - _productID = [UILabel new]; - _serialNumber = [UILabel new]; - NSArray * resultLabels = - @[ _versionLabel, _discriminatorLabel, _setupPinCodeLabel, _rendezVousInformation, _vendorID, _productID, _serialNumber ]; - for (int i = 0; i < resultLabels.count && i < resultLabels.count; i++) { + NSArray * resultLabelTexts = @[ + @"Version", @"Vendor ID", @"Product ID", @"Discriminator", @"Setup PIN Code", @"Rendez Vous Information", @"Serial #", + @"Commissioning Flow" + ]; + NSArray * resultLabels = @[ + _versionLabel, _vendorID, _productID, _discriminatorLabel, _setupPinCodeLabel, _rendezVousInformation, _serialNumber, + _commissioningFlowLabel + ]; + [self addItemToStackView:stackView resultLabels:resultLabels resultLabelTexts:resultLabelTexts]; +} + +- (void)addDeviceInfoUIToStackView:(UIStackView *)stackView +{ + NSArray * resultLabelTexts = @[ @"Vendor ID", @"Product ID", @"Commissioning URL" ]; + NSArray * resultLabels = @[ _vendorID, _productID, _commissioningCustomFlowUrl ]; + [self addItemToStackView:stackView resultLabels:resultLabels resultLabelTexts:resultLabelTexts]; +} + +- (void)addItemToStackView:(UIStackView *)stackView + resultLabels:(NSArray *)resultLabels + resultLabelTexts:(NSArray *)resultLabelTexts +{ + for (int i = 0; i < resultLabels.count && i < resultLabelTexts.count; i++) { UILabel * label = [UILabel new]; label.text = [resultLabelTexts objectAtIndex:i]; UILabel * result = [resultLabels objectAtIndex:i]; - result.text = @"N/A"; + if (!result.text) + result.text = @"N/A"; UIStackView * labelStackView = [CHIPUIViewUtils stackViewWithLabel:label result:result]; labelStackView.translatesAutoresizingMaskIntoConstraints = false; [stackView addArrangedSubview:labelStackView]; } } +- (void)updateResultViewUI:(UIView *)superView +{ + NSArray * viewsToRemove = [superView subviews]; + for (UIView * v in viewsToRemove) { + [v removeFromSuperview]; + } + [self addDetailSubview:superView]; +} + // MARK: UIViewController methods - (void)viewDidDisappear:(BOOL)animated @@ -396,6 +490,9 @@ - (void)onPairingComplete:(NSError *)error - (void)manualCodeInitialState { + _deviceModelInfoView.hidden = YES; + _readFromLedgerButton.hidden = YES; + _redirectButton.hidden = YES; _setupPayloadView.hidden = YES; _resetButton.hidden = YES; _activityIndicator.hidden = YES; @@ -423,6 +520,9 @@ - (void)scanningStartState _setupPayloadView.hidden = YES; _resetButton.hidden = YES; _errorLabel.hidden = YES; + _deviceModelInfoView.hidden = YES; + _redirectButton.hidden = YES; + _readFromLedgerButton.hidden = YES; } - (void)manualCodeEnteredStartState @@ -536,66 +636,50 @@ - (void)retrieveAndSendWifiCredentials - (void)addOrUpdateWiFiNetwork:(NSString *)ssid password:(NSString *)password { - if (CHIPGetConnectedDevice(^(CHIPDevice * _Nullable chipDevice, NSError * _Nullable error) { - if (chipDevice) { - self.cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:chipDevice - endpoint:0 - queue:dispatch_get_main_queue()]; - __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams alloc] init]; - params.ssid = [ssid dataUsingEncoding:NSUTF8StringEncoding]; - params.credentials = [password dataUsingEncoding:NSUTF8StringEncoding]; - params.breadcrumb = @(0); - - __weak typeof(self) weakSelf = self; - [self->_cluster - addOrUpdateWiFiNetworkWithParams:params - completionHandler:^( - CHIPNetworkCommissioningClusterAddOrUpdateWiFiNetworkResponseParams * _Nullable response, - NSError * _Nullable error) { - // TODO: addOrUpdateWiFiNetworkWithParams - // returns status in its response, - // not via the NSError! - [weakSelf onAddNetworkResponse:error isWiFi:YES]; - }]; - } else { - NSLog(@"Status: Failed to establish a connection with the device"); - } - })) { - NSLog(@"Status: Waiting for connection with the device"); + CHIPDevice * chipDevice = CHIPGetDeviceBeingCommissioned(); + if (chipDevice) { + self.cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:chipDevice endpoint:0 queue:dispatch_get_main_queue()]; + __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams alloc] init]; + params.ssid = [ssid dataUsingEncoding:NSUTF8StringEncoding]; + params.credentials = [password dataUsingEncoding:NSUTF8StringEncoding]; + params.breadcrumb = @(0); + + __weak typeof(self) weakSelf = self; + [self->_cluster + addOrUpdateWiFiNetworkWithParams:params + completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable response, + NSError * _Nullable error) { + // TODO: addWiFiNetworkWithParams + // returns status in its response, + // not via the NSError! + [weakSelf onAddNetworkResponse:error isWiFi:YES]; + }]; } else { - NSLog(@"Status: Failed to trigger the connection with the device"); + NSLog(@"Status: Failed to find a device being commissioned"); } } - (void)addOrUpdateThreadNetwork:(NSData *)threadDataSet { - if (CHIPGetConnectedDevice(^(CHIPDevice * _Nullable chipDevice, NSError * _Nullable error) { - if (chipDevice) { - self.cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:chipDevice - endpoint:0 - queue:dispatch_get_main_queue()]; - __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateThreadNetworkParams alloc] init]; - params.operationalDataset = threadDataSet; - params.breadcrumb = @(0); - - __weak typeof(self) weakSelf = self; - [self->_cluster - addOrUpdateThreadNetworkWithParams:params - completionHandler:^( - CHIPNetworkCommissioningClusterAddOrUpdateThreadNetworkResponseParams * _Nullable response, - NSError * _Nullable error) { - // TODO: addOrUpdateThreadNetworkWithParams - // returns status in its response, - // not via the NSError! - [weakSelf onAddNetworkResponse:error isWiFi:NO]; - }]; - } else { - NSLog(@"Status: Failed to establish a connection with the device"); - } - })) { - NSLog(@"Status: Waiting for connection with the device"); + CHIPDevice * chipDevice = CHIPGetDeviceBeingCommissioned(); + if (chipDevice) { + self.cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:chipDevice endpoint:0 queue:dispatch_get_main_queue()]; + __auto_type * params = [[CHIPNetworkCommissioningClusterAddOrUpdateThreadNetworkParams alloc] init]; + params.operationalDataset = threadDataSet; + params.breadcrumb = @(0); + + __weak typeof(self) weakSelf = self; + [self->_cluster + addOrUpdateThreadNetworkWithParams:params + completionHandler:^(CHIPNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable response, + NSError * _Nullable error) { + // TODO: addThreadNetworkWithParams + // returns status in its response, + // not via the NSError! + [weakSelf onAddNetworkResponse:error isWiFi:NO]; + }]; } else { - NSLog(@"Status: Failed to trigger the connection with the device"); + NSLog(@"Status: Failed to find a device being commissioned"); } } @@ -670,6 +754,13 @@ - (void)updateUIFields:(CHIPSetupPayload *)payload rawPayload:(nullable NSString // TODO: Only display vid and pid if present _vendorID.text = [NSString stringWithFormat:@"%@", payload.vendorID]; _productID.text = [NSString stringWithFormat:@"%@", payload.productID]; + _commissioningFlowLabel.text = [NSString stringWithFormat:@"%lu", payload.commissioningFlow]; + + [self updateResultViewUI:_setupPayloadView]; + + if (payload.commissioningFlow == kCommissioningFlowCustom) { + _readFromLedgerButton.hidden = NO; + } } - (void)parseOptionalData:(CHIPSetupPayload *)payload @@ -885,6 +976,126 @@ - (IBAction)enteredManualCode:(id)sender [_manualCodeTextField resignFirstResponder]; } +// Ledger + +- (IBAction)readFromLedgerApi:(id)sender +{ + NSLog(@"Clicked readFromLedger..."); + _readFromLedgerButton.hidden = YES; + _setupPayloadView.hidden = YES; + _activityIndicator.hidden = NO; + [_activityIndicator startAnimating]; + + [self updateResultViewUI:_deviceModelInfoView]; + [self updateLedgerFields]; +} + +- (void)updateLedgerFields +{ + // check vendor Id and product Id + NSLog(@"Validating Vender Id and Product Id..."); + if ([_vendorID.text isEqual:@"N/A"] || [_productID.text isEqual:@"N/A"]) { + NSError * error = [[NSError alloc] initWithDomain:@"com.chiptool.customflow" + code:1 + userInfo:@{ NSLocalizedDescriptionKey : @"Vendor ID or Product Id is invalid." }]; + [self showError:error]; + return; + } + // make API call + NSLog(@"Making API call..."); + [self getRequest:[[[NSBundle mainBundle] objectForInfoDictionaryKey:@"LSEnvironment"] + objectForKey:@"CommissioningCustomFlowLedgerUrl"] + vendorId:self->_vendorID.text + productId:self->_productID.text]; +} + +- (void)getRequest:(NSString *)url vendorId:(NSString *)vendorId productId:(NSString *)productId +{ + [_activityIndicator startAnimating]; + _activityIndicator.hidden = NO; + NSString * targetUrl = [NSString stringWithFormat:@"%@/%@/%@", url, vendorId, productId]; + NSMutableURLRequest * request = [[NSMutableURLRequest alloc] init]; + [request setHTTPMethod:@"GET"]; + [request setURL:[NSURL URLWithString:targetUrl]]; + + [[[NSURLSession sharedSession] + dataTaskWithRequest:request + completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { + NSString * myString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSLog(@"Data received: %@", myString); + self->_ledgerRespond = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; + [self getRequestCallback]; + }] resume]; +} + +- (void)getRequestCallback +{ + BOOL commissioningCustomFlowUseMockFlag = (BOOL) + [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"LSEnvironment"] objectForKey:@"CommissioningCustomFlowUseMockFlag"]; + // use mock respond if useMockFlag is TRUE + if (commissioningCustomFlowUseMockFlag) { + NSLog(@"Using mock respond"); + _ledgerRespond = @{ + @"height" : @"mockHeight", + @"result" : @ { + @"vid" : @1, + @"pid" : @1, + @"cid" : @1, + @"name" : @"mockName", + @"owner" : @"mockOwner", + @"description" : @"mockDescription", + @"sku" : @"mockSku", + @"firmware_version" : @"mockFirmware", + @"hardware_version" : @"mockHardware", + @"tis_or_trp_testing_completed" : @TRUE, + @"CommissioningCustomFlowUrl" : @"https://lijusankar.github.io/commissioning-react-app/" + } + }; + } + dispatch_async(dispatch_get_main_queue(), ^{ + self->_commissioningCustomFlowUrl.text = + [[self->_ledgerRespond objectForKey:@"result"] objectForKey:@"CommissioningCustomFlowUrl"]; + [self->_activityIndicator stopAnimating]; + self->_activityIndicator.hidden = YES; + self->_deviceModelInfoView.hidden = NO; + self->_redirectButton.hidden = NO; + }); +} + +// redirect +- (IBAction)redirectToUrl:(id)sender +{ + [self redirectToUrl]; +} + +- (void)redirectToUrl +{ + NSArray * redirectPayload = @[ @{ + @"version" : _versionLabel.text, + @"vendorID" : _vendorID.text, + @"productID" : _productID.text, + @"commissioingFlow" : _commissioningFlowLabel.text, + @"discriminator" : _discriminatorLabel.text, + @"setupPinCode" : _setupPinCodeLabel.text, + @"serialNumber" : _serialNumber.text, + @"rendezvousInformation" : _rendezVousInformation.text + } ]; + NSString * returnUrl = + [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"LSEnvironment"] objectForKey:@"CommissioningCustomFlowReturnUrl"]; + NSString * base64EncodedString = [self encodeStringTo64:redirectPayload]; + NSString * urlString = + [NSString stringWithFormat:@"%@?payload=%@&returnUrl=%@", _commissioningCustomFlowUrl.text, base64EncodedString, returnUrl]; + NSURL * url = [NSURL URLWithString:urlString]; + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; +} + +- (NSString *)encodeStringTo64:(NSArray *)fromArray +{ + NSData * jsonData = [NSJSONSerialization dataWithJSONObject:fromArray options:NSJSONWritingWithoutEscapingSlashes error:nil]; + NSString * base64String = [jsonData base64EncodedStringWithOptions:kNilOptions]; + return base64String; +} + @synthesize description; @end diff --git a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj index ba44bc65861ef6..312dd839b20624 100644 --- a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj @@ -620,6 +620,7 @@ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-Wl,-unexported_symbol,\"__Z*\""; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx"; SUPPORTS_TEXT_BASED_API = YES; @@ -671,6 +672,7 @@ "-framework", CoreBluetooth, "-lnetwork", + "-Wl,-unexported_symbol,\"__Z*\"", ); "OTHER_LDFLAGS[sdk=macosx*]" = ( "-framework", @@ -680,6 +682,7 @@ CoreBluetooth, "-framework", CoreData, + "-Wl,-unexported_symbol,\"__Z*\"", ); PRODUCT_BUNDLE_IDENTIFIER = com.chip.CHIP; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -753,6 +756,7 @@ MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-Wl,-unexported_symbol,\"__Z*\""; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx"; SUPPORTS_TEXT_BASED_API = YES; @@ -803,6 +807,7 @@ Foundation, "-framework", CoreBluetooth, + "-Wl,-unexported_symbol,\"__Z*\"", ); PRODUCT_BUNDLE_IDENTIFIER = com.chip.CHIP; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -838,7 +843,7 @@ BA09EB772474882200605257 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; B20252A12459E34F00F97062 /* Build configuration list for PBXNativeTarget "CHIP" */ = { isa = XCConfigurationList; @@ -847,7 +852,7 @@ BA09EB782474882200605257 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; B20252A42459E34F00F97062 /* Build configuration list for PBXNativeTarget "CHIPTests" */ = { isa = XCConfigurationList; @@ -856,7 +861,7 @@ BA09EB792474882200605257 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/src/darwin/Framework/CHIP/CHIPCallbackBridgeBase_internal.h b/src/darwin/Framework/CHIP/CHIPCallbackBridgeBase_internal.h index 35a97dc7bffb17..cef8ff70cbf955 100644 --- a/src/darwin/Framework/CHIP/CHIPCallbackBridgeBase_internal.h +++ b/src/darwin/Framework/CHIP/CHIPCallbackBridgeBase_internal.h @@ -41,12 +41,12 @@ template class CHIPCallbackBridge { }); if (CHIP_NO_ERROR != err) { - dispatch_async(queue, ^{ - handler(nil, [CHIPError errorForCHIPErrorCode:err]); - }); + NSLog(@"Failure performing action. C++-mangled success callback type: '%s', error: %s", typeid(T).name(), + chip::ErrorStr(err)); - NSString * errorStr = [NSString stringWithFormat:@"%s: %s", typeid(T).name(), chip::ErrorStr(err)]; - @throw [NSException exceptionWithName:errorStr reason:nil userInfo:nil]; + // Take the normal async error-reporting codepath. This will also + // handle cleaning us up properly. + DispatchFailure(this, [CHIPError errorForCHIPErrorCode:err]); } }; diff --git a/src/darwin/Framework/CHIP/CHIPDevice.mm b/src/darwin/Framework/CHIP/CHIPDevice.mm index 5550073b77cdbe..a79c645202ecc1 100644 --- a/src/darwin/Framework/CHIP/CHIPDevice.mm +++ b/src/darwin/Framework/CHIP/CHIPDevice.mm @@ -19,6 +19,7 @@ #import "CHIPDevice_Internal.h" #import "CHIPError_Internal.h" #import "CHIPLogging.h" +#include "lib/core/CHIPError.h" #include #include @@ -116,17 +117,15 @@ void OnAttributeData(const ReadClient * apReadClient, const ConcreteDataAttribut NSMutableArray * _Nullable mReports = nil; // Our lifetime management is a little complicated. On error we - // attempt to shut down the ReadClient, but asynchronously. While + // attempt to delete the ReadClient, but asynchronously. While // that's pending, someone else (e.g. an error it runs into) could - // shut it down. And if someone else does shut it down we want to - // make sure we delete ourselves. + // delete it too. And if someone else does attempt to delete it, we want to + // make sure we delete ourselves as well. // // To handle this, enforce the following rules: // - // 1) mReadClient becomes null when OnDone is called, since that - // means it has shut down and we should not shut it down. - // 2) We guarantee that mReportCallback is only invoked with an error once. - // 3) We ensure that we delete ourselves only from OnDone or a queued-up + // 1) We guarantee that mReportCallback is only invoked with an error once. + // 2) We ensure that we delete ourselves and the passed in ReadClient only from OnDone or a queued-up // error callback, but not both, by tracking whether we have a queued-up // deletion. ReadClient * mReadClient = nullptr; @@ -156,31 +155,22 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue params.mAttributePathParamsListSize = 1; auto callback = new SubscriptionCallback(queue, reportHandler, subscriptionEstablishedHandler); + ReadClient * readClient = new ReadClient(InteractionModelEngine::GetInstance(), device->GetExchangeManager(), + callback->GetBufferedCallback(), ReadClient::InteractionType::Subscribe); - ReadClient * readClient; - CHIP_ERROR err = InteractionModelEngine::GetInstance()->NewReadClient( - &readClient, ReadClient::InteractionType::Subscribe, &(callback->GetBufferedCallback())); + CHIP_ERROR err = readClient->SendRequest(params); if (err != CHIP_NO_ERROR) { dispatch_async(queue, ^{ reportHandler(nil, [CHIPError errorForCHIPErrorCode:err]); }); - delete callback; - return; - } - err = readClient->SendRequest(params); - if (err != CHIP_NO_ERROR) { - dispatch_async(queue, ^{ - reportHandler(nil, [CHIPError errorForCHIPErrorCode:err]); - }); - readClient->Shutdown(); + delete readClient; delete callback; return; } - // Callback will be deleted when OnDone is called or an error is + // Callback and ReadClient will be deleted when OnDone is called or an error is // encountered. - callback->SetReadClient(readClient); } @end @@ -271,11 +261,9 @@ - (instancetype)initWithPath:(const ConcreteDataAttributePath &)path value:(null { if (!mHaveQueuedDeletion) { delete this; + delete apReadClient; return; // Make sure we touch nothing else. } - - // Ensure that we don't try to shut down the already-shut-down ReadClient. - mReadClient = nullptr; } void SubscriptionCallback::OnSubscriptionEstablished(const ReadClient * apReadClient) @@ -302,17 +290,17 @@ - (instancetype)initWithPath:(const ConcreteDataAttributePath &)path value:(null // Already have an error report pending which will delete us. return; } + __block ReportCallback callback = mReportCallback; __block auto * myself = this; mReportCallback = nil; dispatch_async(mQueue, ^{ callback(nil, err); - if (mReadClient) { - mReadClient->Shutdown(); // This will not delete us, because - // mHaveQueuedDeletion is set. - }; + + delete mReadClient; delete myself; }); + mHaveQueuedDeletion = true; } } // anonymous namespace diff --git a/src/darwin/Framework/CHIP/CHIPDeviceConnectionBridge.h b/src/darwin/Framework/CHIP/CHIPDeviceConnectionBridge.h index a83cc533ded234..354bfa73453b8f 100644 --- a/src/darwin/Framework/CHIP/CHIPDeviceConnectionBridge.h +++ b/src/darwin/Framework/CHIP/CHIPDeviceConnectionBridge.h @@ -49,7 +49,7 @@ class CHIPDeviceConnectionBridge : public chip::ReferenceCounted mOnConnectFailed; static void OnConnected(void * context, chip::OperationalDeviceProxy * device); - static void OnConnectionFailure(void * context, chip::NodeId deviceId, CHIP_ERROR error); + static void OnConnectionFailure(void * context, chip::PeerId peerId, CHIP_ERROR error); }; NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/CHIPDeviceConnectionBridge.mm b/src/darwin/Framework/CHIP/CHIPDeviceConnectionBridge.mm index ac0241a7c614f7..acad191da1969a 100644 --- a/src/darwin/Framework/CHIP/CHIPDeviceConnectionBridge.mm +++ b/src/darwin/Framework/CHIP/CHIPDeviceConnectionBridge.mm @@ -29,7 +29,7 @@ }); } -void CHIPDeviceConnectionBridge::OnConnectionFailure(void * context, chip::NodeId deviceId, CHIP_ERROR error) +void CHIPDeviceConnectionBridge::OnConnectionFailure(void * context, chip::PeerId peerId, CHIP_ERROR error) { auto * object = static_cast(context); dispatch_async(object->mQueue, ^{ diff --git a/src/darwin/Framework/CHIP/CHIPOperationalCredentialsDelegate.mm b/src/darwin/Framework/CHIP/CHIPOperationalCredentialsDelegate.mm index f56795af9052bf..6f9d5d0811b989 100644 --- a/src/darwin/Framework/CHIP/CHIPOperationalCredentialsDelegate.mm +++ b/src/darwin/Framework/CHIP/CHIPOperationalCredentialsDelegate.mm @@ -251,7 +251,7 @@ static BOOL isRunningTests(void) } VerifyOrReturnError(reader.GetType() == kTLVType_Structure, CHIP_ERROR_WRONG_TLV_TYPE); - VerifyOrReturnError(reader.GetTag() == AnonymousTag, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrReturnError(reader.GetTag() == AnonymousTag(), CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); TLVType containerType; ReturnErrorOnFailure(reader.EnterContainer(containerType)); diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index 153d4c76ee405a..f111d35b765750 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -39,6 +39,16 @@ void WaitForMs(XCTestExpectation * expectation, dispatch_queue_t queue, unsigned }); } +void Log(XCTestExpectation * expectation, dispatch_queue_t queue, NSString * message){ + NSLog(@"%@", message); + [expectation fulfill]; +} + +// Stub for User Prompts for XCTests to run. +void UserPrompt(XCTestExpectation * expectation, dispatch_queue_t queue, NSString * message) { + [expectation fulfill]; +} + void WaitForCommissionee(XCTestExpectation * expectation, dispatch_queue_t queue) { CHIPDeviceController * controller = [CHIPDeviceController sharedController]; diff --git a/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt b/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt index edd4515f47cb81..316a1ca1f2a8d9 100644 --- a/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/test_cluster.zapt @@ -24,7 +24,7 @@ ResponseHandler {{> subscribeDataCallback}} = nil; {{#if (isTestOnlyCluster cluster)}} dispatch_queue_t queue = dispatch_get_main_queue(); - {{command}}(expectation, queue{{#chip_tests_item_parameters}}, {{definedValue}}{{/chip_tests_item_parameters}}); + {{command}}(expectation, queue{{#chip_tests_item_parameters}}, {{#if (isString type)}}@"{{/if}}{{definedValue}}{{#if (isString type)}}"{{/if}}{{/chip_tests_item_parameters}}); {{else}} CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -135,19 +135,30 @@ ResponseHandler {{> subscribeDataCallback}} = nil; {{#if expectedConstraints.minValue}} { {{> actualValue}} - XCTAssertGreaterThanOrEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{expectedConstraints.minValue}}); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.minValue type}}); + } } {{/if}} {{#if expectedConstraints.maxValue}} { {{> actualValue}} - XCTAssertLessThanOrEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{expectedConstraints.maxValue}}); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.maxValue type}}); + } } {{/if}} {{#if expectedConstraints.notValue}} { {{> actualValue}} - XCTAssertNotEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{expectedConstraints.notValue}}); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue {{asObjectiveCNumberType "" type true}}Value], {{asTypedLiteral expectedConstraints.notValue type}}); + } + } + {{else if (isLiteralNull expectedConstraints.notValue)}} + { + {{> actualValue}} + XCTAssertFalse(actualValue == nil); } {{/if}} {{/if}} diff --git a/src/darwin/Framework/CHIP/templates/tests.js b/src/darwin/Framework/CHIP/templates/tests.js index 1a2eaed22404d2..0f317e229a7d4d 100644 --- a/src/darwin/Framework/CHIP/templates/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests.js @@ -54,6 +54,14 @@ function getTests() 'Test_TC_CC_9_3', ]; + const DeviceDiscovery = [ + 'Test_TC_DD_1_5', + 'Test_TC_DD_1_6', + 'Test_TC_DD_1_7', + 'Test_TC_DD_1_8', + 'Test_TC_DD_1_9', + ]; + const DeviceManagement = [ 'Test_TC_DM_1_1', 'Test_TC_DM_3_1', @@ -169,7 +177,9 @@ function getTests() 'TestDescriptorCluster', 'TestBasicInformation', 'TestGroupsCluster', + 'TestGroupKeyManagementCluster', 'TestIdentifyCluster', + 'TestLogCommands', 'TestOperationalCredentialsCluster', 'TestModeSelectCluster', ]; @@ -188,6 +198,7 @@ function getTests() BinaryInput, // BooleanState, // ColorControl, // + DeviceDiscovery, // DeviceManagement, // ElectricalMeasurement, // FlowMeasurement, // diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index 5df08da8882552..7407f5c3ec4d82 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -371,9 +371,13 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (*aError != CHIP_NO_ERROR) { return nil; } - CHIPApplicationBasicClusterApplicationBasicApp * _Nonnull value; - value = [CHIPApplicationBasicClusterApplicationBasicApp new]; + CHIPApplicationBasicClusterApplication * _Nonnull value; + value = [CHIPApplicationBasicClusterApplication new]; value.catalogVendorId = [NSNumber numberWithUnsignedShort:cppValue.catalogVendorId]; + value.catalogVendorId = [NSNumber numberWithUnsignedShort:cppValue.catalogVendorId]; + value.applicationId = [[NSString alloc] initWithBytes:cppValue.applicationId.data() + length:cppValue.applicationId.size() + encoding:NSUTF8StringEncoding]; value.applicationId = [[NSString alloc] initWithBytes:cppValue.applicationId.data() length:cppValue.applicationId.size() encoding:NSUTF8StringEncoding]; @@ -387,7 +391,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } case Attributes::ApplicationVersion::Id: { @@ -401,6 +405,32 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = [[NSString alloc] initWithBytes:cppValue.data() length:cppValue.size() encoding:NSUTF8StringEncoding]; return value; } + case Attributes::AllowedVendorList::Id: { + using TypeInfo = Attributes::AllowedVendorList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + } + value = array_0; + return value; + } case Attributes::AttributeList::Id: { using TypeInfo = Attributes::AttributeList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -531,8 +561,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPAudioOutputClusterAudioOutputInfo * newElement_0; - newElement_0 = [CHIPAudioOutputClusterAudioOutputInfo new]; + CHIPAudioOutputClusterOutputInfo * newElement_0; + newElement_0 = [CHIPAudioOutputClusterOutputInfo new]; newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; newElement_0.outputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.outputType)]; newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() @@ -1315,6 +1345,89 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader } break; } + case Clusters::Channel::Id: { + using namespace Clusters::Channel; + switch (aPath.mAttributeId) { + case Attributes::ChannelList::Id: { + using TypeInfo = Attributes::ChannelList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPChannelClusterChannelInfo * newElement_0; + newElement_0 = [CHIPChannelClusterChannelInfo new]; + newElement_0.majorNumber = [NSNumber numberWithUnsignedShort:entry_0.majorNumber]; + newElement_0.minorNumber = [NSNumber numberWithUnsignedShort:entry_0.minorNumber]; + newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() + length:entry_0.name.size() + encoding:NSUTF8StringEncoding]; + newElement_0.callSign = [[NSString alloc] initWithBytes:entry_0.callSign.data() + length:entry_0.callSign.size() + encoding:NSUTF8StringEncoding]; + newElement_0.affiliateCallSign = [[NSString alloc] initWithBytes:entry_0.affiliateCallSign.data() + length:entry_0.affiliateCallSign.size() + encoding:NSUTF8StringEncoding]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + } + value = array_0; + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + } + value = array_0; + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; + break; + } + break; + } case Clusters::ColorControl::Id: { using namespace Clusters::ColorControl; switch (aPath.mAttributeId) { @@ -1936,8 +2049,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader case Clusters::ContentLauncher::Id: { using namespace Clusters::ContentLauncher; switch (aPath.mAttributeId) { - case Attributes::AcceptsHeaderList::Id: { - using TypeInfo = Attributes::AcceptsHeaderList::TypeInfo; + case Attributes::AcceptHeaderList::Id: { + using TypeInfo = Attributes::AcceptHeaderList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -1948,8 +2061,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSData * newElement_0; - newElement_0 = [NSData dataWithBytes:entry_0.data() length:entry_0.size()]; + NSString * newElement_0; + newElement_0 = [[NSString alloc] initWithBytes:entry_0.data() length:entry_0.size() encoding:NSUTF8StringEncoding]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -3242,8 +3355,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader case Clusters::GroupKeyManagement::Id: { using namespace Clusters::GroupKeyManagement; switch (aPath.mAttributeId) { - case Attributes::Groups::Id: { - using TypeInfo = Attributes::Groups::TypeInfo; + case Attributes::GroupKeyMap::Id: { + using TypeInfo = Attributes::GroupKeyMap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -3254,11 +3367,11 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupState * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupState new]; - newElement_0.vendorId = [NSNumber numberWithUnsignedShort:entry_0.vendorId]; - newElement_0.vendorGroupId = [NSNumber numberWithUnsignedShort:entry_0.vendorGroupId]; - newElement_0.groupKeySetIndex = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetIndex]; + CHIPGroupKeyManagementClusterGroupKey * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupKey new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedShort:entry_0.fabricIndex]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -3271,8 +3384,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = array_0; return value; } - case Attributes::GroupKeys::Id: { - using TypeInfo = Attributes::GroupKeys::TypeInfo; + case Attributes::GroupTable::Id: { + using TypeInfo = Attributes::GroupTable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -3283,14 +3396,29 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupKey * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupKey new]; - newElement_0.vendorId = [NSNumber numberWithUnsignedShort:entry_0.vendorId]; - newElement_0.groupKeyIndex = [NSNumber numberWithUnsignedShort:entry_0.groupKeyIndex]; - newElement_0.groupKeyRoot = [NSData dataWithBytes:entry_0.groupKeyRoot.data() length:entry_0.groupKeyRoot.size()]; - newElement_0.groupKeyEpochStartTime = [NSNumber numberWithUnsignedLongLong:entry_0.groupKeyEpochStartTime]; - newElement_0.groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.groupKeySecurityPolicy)]; + CHIPGroupKeyManagementClusterGroupInfo * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupInfo new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedShort:entry_0.fabricIndex]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.endpoints.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedShort:entry_2]; + [array_2 addObject:newElement_2]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + } + newElement_0.endpoints = array_2; + newElement_0.groupName = [[NSString alloc] initWithBytes:entry_0.groupName.data() + length:entry_0.groupName.size() + encoding:NSUTF8StringEncoding]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -3303,6 +3431,28 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = array_0; return value; } + case Attributes::MaxGroupsPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupsPerFabric::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::MaxGroupKeysPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupKeysPerFabric::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } case Attributes::AttributeList::Id: { using TypeInfo = Attributes::AttributeList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -3911,8 +4061,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPMediaInputClusterMediaInputInfo * newElement_0; - newElement_0 = [CHIPMediaInputClusterMediaInputInfo new]; + CHIPMediaInputClusterInputInfo * newElement_0; + newElement_0 = [CHIPMediaInputClusterInputInfo new]; newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; newElement_0.inputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.inputType)]; newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() @@ -3998,7 +4148,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } case Attributes::StartTime::Id: { @@ -4405,15 +4555,33 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader case Clusters::OtaSoftwareUpdateRequestor::Id: { using namespace Clusters::OtaSoftwareUpdateRequestor; switch (aPath.mAttributeId) { - case Attributes::DefaultOtaProvider::Id: { - using TypeInfo = Attributes::DefaultOtaProvider::TypeInfo; + case Attributes::DefaultOtaProviders::Id: { + using TypeInfo = Attributes::DefaultOtaProviders::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSData * _Nonnull value; - value = [NSData dataWithBytes:cppValue.data() length:cppValue.size()]; + NSArray * _Nonnull value; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPOtaSoftwareUpdateRequestorClusterProviderLocation * newElement_0; + newElement_0 = [CHIPOtaSoftwareUpdateRequestorClusterProviderLocation new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + newElement_0.providerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.providerNodeID]; + newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + } + value = array_0; return value; } case Attributes::UpdatePossible::Id: { @@ -4427,6 +4595,32 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = [NSNumber numberWithBool:cppValue]; return value; } + case Attributes::UpdateState::Id: { + using TypeInfo = Attributes::UpdateState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::UpdateStateProgress::Id: { + using TypeInfo = Attributes::UpdateStateProgress::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } case Attributes::AttributeList::Id: { using TypeInfo = Attributes::AttributeList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -5924,89 +6118,6 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader } break; } - case Clusters::TvChannel::Id: { - using namespace Clusters::TvChannel; - switch (aPath.mAttributeId) { - case Attributes::ChannelList::Id: { - using TypeInfo = Attributes::ChannelList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - CHIPTvChannelClusterTvChannelInfo * newElement_0; - newElement_0 = [CHIPTvChannelClusterTvChannelInfo new]; - newElement_0.majorNumber = [NSNumber numberWithUnsignedShort:entry_0.majorNumber]; - newElement_0.minorNumber = [NSNumber numberWithUnsignedShort:entry_0.minorNumber]; - newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() - length:entry_0.name.size() - encoding:NSUTF8StringEncoding]; - newElement_0.callSign = [[NSString alloc] initWithBytes:entry_0.callSign.data() - length:entry_0.callSign.size() - encoding:NSUTF8StringEncoding]; - newElement_0.affiliateCallSign = [[NSString alloc] initWithBytes:entry_0.affiliateCallSign.data() - length:entry_0.affiliateCallSign.size() - encoding:NSUTF8StringEncoding]; - [array_0 addObject:newElement_0]; - } - { // Scope for the error so we will know what it's named - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - } - value = array_0; - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - { // Scope for the error so we will know what it's named - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - } - value = array_0; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH; - break; - } - break; - } case Clusters::TargetNavigator::Id: { using namespace Clusters::TargetNavigator; switch (aPath.mAttributeId) { @@ -6022,8 +6133,8 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPTargetNavigatorClusterNavigateTargetTargetInfo * newElement_0; - newElement_0 = [CHIPTargetNavigatorClusterNavigateTargetTargetInfo new]; + CHIPTargetNavigatorClusterTargetInfo * newElement_0; + newElement_0 = [CHIPTargetNavigatorClusterTargetInfo new]; newElement_0.identifier = [NSNumber numberWithUnsignedChar:entry_0.identifier]; newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() length:entry_0.name.size() @@ -9012,8 +9123,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::CurrentPositionTilt::Id: { @@ -9023,8 +9138,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::ConfigStatus::Id: { @@ -9045,8 +9164,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } case Attributes::CurrentPositionTiltPercentage::Id: { @@ -9056,8 +9179,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } case Attributes::OperationalStatus::Id: { @@ -9078,8 +9205,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::TargetPositionTiltPercent100ths::Id: { @@ -9089,8 +9220,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::EndProductType::Id: { @@ -9111,8 +9246,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::CurrentPositionTiltPercent100ths::Id: { @@ -9122,8 +9261,12 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } case Attributes::InstalledOpenLimitLift::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index e041b5dc1bdf8d..be7bc5c59b8bde 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -989,6 +989,45 @@ } } +void CHIPApplicationBasicAllowedVendorListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + } + objCValue = array_0; + DispatchSuccess(context, objCValue); +}; + +void CHIPApplicationBasicAllowedVendorListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPApplicationBasicAttributeListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -1108,15 +1147,15 @@ } void CHIPAudioOutputAudioOutputListListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & value) + const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPAudioOutputClusterAudioOutputInfo * newElement_0; - newElement_0 = [CHIPAudioOutputClusterAudioOutputInfo new]; + CHIPAudioOutputClusterOutputInfo * newElement_0; + newElement_0 = [CHIPAudioOutputClusterOutputInfo new]; newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; newElement_0.outputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.outputType)]; newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() @@ -1571,6 +1610,95 @@ } } +void CHIPChannelChannelListListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPChannelClusterChannelInfo * newElement_0; + newElement_0 = [CHIPChannelClusterChannelInfo new]; + newElement_0.majorNumber = [NSNumber numberWithUnsignedShort:entry_0.majorNumber]; + newElement_0.minorNumber = [NSNumber numberWithUnsignedShort:entry_0.minorNumber]; + newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() + length:entry_0.name.size() + encoding:NSUTF8StringEncoding]; + newElement_0.callSign = [[NSString alloc] initWithBytes:entry_0.callSign.data() + length:entry_0.callSign.size() + encoding:NSUTF8StringEncoding]; + newElement_0.affiliateCallSign = [[NSString alloc] initWithBytes:entry_0.affiliateCallSign.data() + length:entry_0.affiliateCallSign.size() + encoding:NSUTF8StringEncoding]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + } + objCValue = array_0; + DispatchSuccess(context, objCValue); +}; + +void CHIPChannelChannelListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPChannelAttributeListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + } + objCValue = array_0; + DispatchSuccess(context, objCValue); +}; + +void CHIPChannelAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPColorControlAttributeListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -1610,16 +1738,16 @@ } } -void CHIPContentLauncherAcceptsHeaderListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) +void CHIPContentLauncherAcceptHeaderListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSData * newElement_0; - newElement_0 = [NSData dataWithBytes:entry_0.data() length:entry_0.size()]; + NSString * newElement_0; + newElement_0 = [[NSString alloc] initWithBytes:entry_0.data() length:entry_0.size() encoding:NSUTF8StringEncoding]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -1633,9 +1761,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPContentLauncherAcceptsHeaderListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPContentLauncherAcceptHeaderListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -2455,19 +2583,19 @@ } } -void CHIPGroupKeyManagementGroupsListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & value) +void CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupState * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupState new]; - newElement_0.vendorId = [NSNumber numberWithUnsignedShort:entry_0.vendorId]; - newElement_0.vendorGroupId = [NSNumber numberWithUnsignedShort:entry_0.vendorGroupId]; - newElement_0.groupKeySetIndex = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetIndex]; + CHIPGroupKeyManagementClusterGroupKey * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupKey new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedShort:entry_0.fabricIndex]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -2481,9 +2609,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -2497,21 +2625,37 @@ } } -void CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & value) +void CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPGroupKeyManagementClusterGroupKey * newElement_0; - newElement_0 = [CHIPGroupKeyManagementClusterGroupKey new]; - newElement_0.vendorId = [NSNumber numberWithUnsignedShort:entry_0.vendorId]; - newElement_0.groupKeyIndex = [NSNumber numberWithUnsignedShort:entry_0.groupKeyIndex]; - newElement_0.groupKeyRoot = [NSData dataWithBytes:entry_0.groupKeyRoot.data() length:entry_0.groupKeyRoot.size()]; - newElement_0.groupKeyEpochStartTime = [NSNumber numberWithUnsignedLongLong:entry_0.groupKeyEpochStartTime]; - newElement_0.groupKeySecurityPolicy = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.groupKeySecurityPolicy)]; + CHIPGroupKeyManagementClusterGroupInfo * newElement_0; + newElement_0 = [CHIPGroupKeyManagementClusterGroupInfo new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedShort:entry_0.fabricIndex]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.endpoints.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedShort:entry_2]; + [array_2 addObject:newElement_2]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + } + newElement_0.endpoints = array_2; + newElement_0.groupName = [[NSString alloc] initWithBytes:entry_0.groupName.data() + length:entry_0.groupName.size() + encoding:NSUTF8StringEncoding]; [array_0 addObject:newElement_0]; } { // Scope for the error so we will know what it's named @@ -2525,9 +2669,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPGroupKeyManagementGroupKeysListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -2815,15 +2959,15 @@ } void CHIPMediaInputMediaInputListListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & value) + const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPMediaInputClusterMediaInputInfo * newElement_0; - newElement_0 = [CHIPMediaInputClusterMediaInputInfo new]; + CHIPMediaInputClusterInputInfo * newElement_0; + newElement_0 = [CHIPMediaInputClusterInputInfo new]; newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; newElement_0.inputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.inputType)]; newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() @@ -3103,6 +3247,50 @@ } } +void CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> & value) +{ + NSArray * _Nonnull objCValue; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPOtaSoftwareUpdateRequestorClusterProviderLocation * newElement_0; + newElement_0 = [CHIPOtaSoftwareUpdateRequestorClusterProviderLocation new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + newElement_0.providerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.providerNodeID]; + newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + } + objCValue = array_0; + DispatchSuccess(context, objCValue); +}; + +void CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( + void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPOtaSoftwareUpdateRequestorAttributeListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -3823,106 +4011,16 @@ } } -void CHIPTvChannelChannelListListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - CHIPTvChannelClusterTvChannelInfo * newElement_0; - newElement_0 = [CHIPTvChannelClusterTvChannelInfo new]; - newElement_0.majorNumber = [NSNumber numberWithUnsignedShort:entry_0.majorNumber]; - newElement_0.minorNumber = [NSNumber numberWithUnsignedShort:entry_0.minorNumber]; - newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() - length:entry_0.name.size() - encoding:NSUTF8StringEncoding]; - newElement_0.callSign = [[NSString alloc] initWithBytes:entry_0.callSign.data() - length:entry_0.callSign.size() - encoding:NSUTF8StringEncoding]; - newElement_0.affiliateCallSign = [[NSString alloc] initWithBytes:entry_0.affiliateCallSign.data() - length:entry_0.affiliateCallSign.size() - encoding:NSUTF8StringEncoding]; - [array_0 addObject:newElement_0]; - } - { // Scope for the error so we will know what it's named - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); - return; - } - } - objCValue = array_0; - DispatchSuccess(context, objCValue); -}; - -void CHIPTvChannelChannelListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) -{ - auto * self = static_cast(context); - if (!self->mQueue) { - return; - } - - if (self->mEstablishedHandler != nil) { - dispatch_async(self->mQueue, self->mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - self->mEstablishedHandler = nil; - } -} - -void CHIPTvChannelAttributeListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - { // Scope for the error so we will know what it's named - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); - return; - } - } - objCValue = array_0; - DispatchSuccess(context, objCValue); -}; - -void CHIPTvChannelAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) -{ - auto * self = static_cast(context); - if (!self->mQueue) { - return; - } - - if (self->mEstablishedHandler != nil) { - dispatch_async(self->mQueue, self->mEstablishedHandler); - // On failure, mEstablishedHandler will be cleaned up by our destructor, - // but we can clean it up earlier on successful subscription - // establishment. - self->mEstablishedHandler = nil; - } -} - void CHIPTargetNavigatorTargetNavigatorListListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & value) + const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; auto * array_0 = [NSMutableArray new]; auto iter_0 = value.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - CHIPTargetNavigatorClusterNavigateTargetTargetInfo * newElement_0; - newElement_0 = [CHIPTargetNavigatorClusterNavigateTargetTargetInfo new]; + CHIPTargetNavigatorClusterTargetInfo * newElement_0; + newElement_0 = [CHIPTargetNavigatorClusterTargetInfo new]; newElement_0.identifier = [NSNumber numberWithUnsignedChar:entry_0.identifier]; newElement_0.name = [[NSString alloc] initWithBytes:entry_0.name.data() length:entry_0.name.size() @@ -4980,10 +5078,10 @@ DispatchSuccess(context, response); }; -void CHIPApplicationLauncherClusterHideAppResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::HideAppResponse::DecodableType & data) +void CHIPApplicationLauncherClusterLauncherResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & data) { - auto * response = [CHIPApplicationLauncherClusterHideAppResponseParams new]; + auto * response = [CHIPApplicationLauncherClusterLauncherResponseParams new]; { response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; } @@ -4993,23 +5091,34 @@ DispatchSuccess(context, response); }; -void CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType & data) +void CHIPChannelClusterChangeChannelResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & data) { - auto * response = [CHIPApplicationLauncherClusterLaunchAppResponseParams new]; + auto * response = [CHIPChannelClusterChangeChannelResponseParams new]; { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; + response.channelMatch = [CHIPChannelClusterChannelInfo new]; + response.channelMatch.majorNumber = [NSNumber numberWithUnsignedShort:data.channelMatch.majorNumber]; + response.channelMatch.minorNumber = [NSNumber numberWithUnsignedShort:data.channelMatch.minorNumber]; + response.channelMatch.name = [[NSString alloc] initWithBytes:data.channelMatch.name.data() + length:data.channelMatch.name.size() + encoding:NSUTF8StringEncoding]; + response.channelMatch.callSign = [[NSString alloc] initWithBytes:data.channelMatch.callSign.data() + length:data.channelMatch.callSign.size() + encoding:NSUTF8StringEncoding]; + response.channelMatch.affiliateCallSign = [[NSString alloc] initWithBytes:data.channelMatch.affiliateCallSign.data() + length:data.channelMatch.affiliateCallSign.size() + encoding:NSUTF8StringEncoding]; } { - response.data = [[NSString alloc] initWithBytes:data.data.data() length:data.data.size() encoding:NSUTF8StringEncoding]; + response.errorType = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.errorType)]; } DispatchSuccess(context, response); }; -void CHIPApplicationLauncherClusterStopAppResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::StopAppResponse::DecodableType & data) +void CHIPContentLauncherClusterLaunchResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::DecodableType & data) { - auto * response = [CHIPApplicationLauncherClusterStopAppResponseParams new]; + auto * response = [CHIPContentLauncherClusterLaunchResponseParams new]; { response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; } @@ -5019,32 +5128,6 @@ DispatchSuccess(context, response); }; -void CHIPContentLauncherClusterLaunchContentResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType & data) -{ - auto * response = [CHIPContentLauncherClusterLaunchContentResponseParams new]; - { - response.contentLaunchStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.contentLaunchStatus)]; - } - { - response.data = [[NSString alloc] initWithBytes:data.data.data() length:data.data.size() encoding:NSUTF8StringEncoding]; - } - DispatchSuccess(context, response); -}; - -void CHIPContentLauncherClusterLaunchURLResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType & data) -{ - auto * response = [CHIPContentLauncherClusterLaunchURLResponseParams new]; - { - response.contentLaunchStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.contentLaunchStatus)]; - } - { - response.data = [[NSString alloc] initWithBytes:data.data.data() length:data.data.size() encoding:NSUTF8StringEncoding]; - } - DispatchSuccess(context, response); -}; - void CHIPDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data) { @@ -5245,6 +5328,53 @@ DispatchSuccess(context, response); }; +void CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data) +{ + auto * response = [CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams new]; + { + auto * array_0 = [NSMutableArray new]; + auto iter_0 = data.groupKeySetIDs.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + } + response.groupKeySetIDs = array_0; + } + DispatchSuccess(context, response); +}; + +void CHIPGroupKeyManagementClusterKeySetReadResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data) +{ + auto * response = [CHIPGroupKeyManagementClusterKeySetReadResponseParams new]; + { + response.groupKeySet = [CHIPGroupKeyManagementClusterGroupKeySet new]; + response.groupKeySet.groupKeySetID = [NSNumber numberWithUnsignedShort:data.groupKeySet.groupKeySetID]; + response.groupKeySet.securityPolicy = + [NSNumber numberWithUnsignedChar:chip::to_underlying(data.groupKeySet.securityPolicy)]; + response.groupKeySet.epochKey0 = [NSData dataWithBytes:data.groupKeySet.epochKey0.data() + length:data.groupKeySet.epochKey0.size()]; + response.groupKeySet.epochStartTime0 = [NSNumber numberWithUnsignedLongLong:data.groupKeySet.epochStartTime0]; + response.groupKeySet.epochKey1 = [NSData dataWithBytes:data.groupKeySet.epochKey1.data() + length:data.groupKeySet.epochKey1.size()]; + response.groupKeySet.epochStartTime1 = [NSNumber numberWithUnsignedLongLong:data.groupKeySet.epochStartTime1]; + response.groupKeySet.epochKey2 = [NSData dataWithBytes:data.groupKeySet.epochKey2.data() + length:data.groupKeySet.epochKey2.size()]; + response.groupKeySet.epochStartTime2 = [NSNumber numberWithUnsignedLongLong:data.groupKeySet.epochStartTime2]; + } + DispatchSuccess(context, response); +}; + void CHIPGroupsClusterAddGroupResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data) { @@ -5337,112 +5467,12 @@ DispatchSuccess(context, response); }; -void CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType & data) -{ - auto * response = [CHIPMediaPlaybackClusterMediaFastForwardResponseParams new]; - { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; - } - DispatchSuccess(context, response); -}; - -void CHIPMediaPlaybackClusterMediaNextResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType & data) -{ - auto * response = [CHIPMediaPlaybackClusterMediaNextResponseParams new]; - { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; - } - DispatchSuccess(context, response); -}; - -void CHIPMediaPlaybackClusterMediaPauseResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType & data) -{ - auto * response = [CHIPMediaPlaybackClusterMediaPauseResponseParams new]; - { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; - } - DispatchSuccess(context, response); -}; - -void CHIPMediaPlaybackClusterMediaPlayResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType & data) -{ - auto * response = [CHIPMediaPlaybackClusterMediaPlayResponseParams new]; - { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; - } - DispatchSuccess(context, response); -}; - -void CHIPMediaPlaybackClusterMediaPreviousResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType & data) -{ - auto * response = [CHIPMediaPlaybackClusterMediaPreviousResponseParams new]; - { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; - } - DispatchSuccess(context, response); -}; - -void CHIPMediaPlaybackClusterMediaRewindResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType & data) -{ - auto * response = [CHIPMediaPlaybackClusterMediaRewindResponseParams new]; - { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; - } - DispatchSuccess(context, response); -}; - -void CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType & data) -{ - auto * response = [CHIPMediaPlaybackClusterMediaSeekResponseParams new]; - { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; - } - DispatchSuccess(context, response); -}; - -void CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType & data) -{ - auto * response = [CHIPMediaPlaybackClusterMediaSkipBackwardResponseParams new]; - { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; - } - DispatchSuccess(context, response); -}; - -void CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType & data) -{ - auto * response = [CHIPMediaPlaybackClusterMediaSkipForwardResponseParams new]; - { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; - } - DispatchSuccess(context, response); -}; - -void CHIPMediaPlaybackClusterMediaStartOverResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType & data) -{ - auto * response = [CHIPMediaPlaybackClusterMediaStartOverResponseParams new]; - { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; - } - DispatchSuccess(context, response); -}; - -void CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType & data) +void CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & data) { - auto * response = [CHIPMediaPlaybackClusterMediaStopResponseParams new]; + auto * response = [CHIPMediaPlaybackClusterPlaybackResponseParams new]; { - response.mediaPlaybackStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.mediaPlaybackStatus)]; + response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; } DispatchSuccess(context, response); }; @@ -5493,56 +5523,64 @@ encoding:NSUTF8StringEncoding]; } { - auto * array_0 = [NSMutableArray new]; - auto iter_0 = data.wiFiScanResults.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - CHIPNetworkCommissioningClusterWiFiInterfaceScanResult * newElement_0; - newElement_0 = [CHIPNetworkCommissioningClusterWiFiInterfaceScanResult new]; - newElement_0.security = [NSNumber numberWithUnsignedChar:entry_0.security]; - newElement_0.ssid = [NSData dataWithBytes:entry_0.ssid.data() length:entry_0.ssid.size()]; - newElement_0.bssid = [NSData dataWithBytes:entry_0.bssid.data() length:entry_0.bssid.size()]; - newElement_0.channel = [NSNumber numberWithUnsignedChar:entry_0.channel]; - newElement_0.wiFiBand = [NSNumber numberWithUnsignedInt:entry_0.wiFiBand]; - newElement_0.rssi = [NSNumber numberWithChar:entry_0.rssi]; - [array_0 addObject:newElement_0]; - } - { // Scope for the error so we will know what it's named - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); - return; + if (data.wiFiScanResults.HasValue()) { + auto * array_1 = [NSMutableArray new]; + auto iter_1 = data.wiFiScanResults.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + CHIPNetworkCommissioningClusterWiFiInterfaceScanResult * newElement_1; + newElement_1 = [CHIPNetworkCommissioningClusterWiFiInterfaceScanResult new]; + newElement_1.security = [NSNumber numberWithUnsignedChar:entry_1.security]; + newElement_1.ssid = [NSData dataWithBytes:entry_1.ssid.data() length:entry_1.ssid.size()]; + newElement_1.bssid = [NSData dataWithBytes:entry_1.bssid.data() length:entry_1.bssid.size()]; + newElement_1.channel = [NSNumber numberWithUnsignedShort:entry_1.channel]; + newElement_1.wiFiBand = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.wiFiBand)]; + newElement_1.rssi = [NSNumber numberWithChar:entry_1.rssi]; + [array_1 addObject:newElement_1]; } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + } + response.wiFiScanResults = array_1; + } else { + response.wiFiScanResults = nil; } - response.wiFiScanResults = array_0; } { - auto * array_0 = [NSMutableArray new]; - auto iter_0 = data.threadScanResults.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - CHIPNetworkCommissioningClusterThreadInterfaceScanResult * newElement_0; - newElement_0 = [CHIPNetworkCommissioningClusterThreadInterfaceScanResult new]; - newElement_0.panId = [NSNumber numberWithUnsignedLongLong:entry_0.panId]; - newElement_0.extendedPanId = [NSNumber numberWithUnsignedLongLong:entry_0.extendedPanId]; - newElement_0.networkName = [[NSString alloc] initWithBytes:entry_0.networkName.data() - length:entry_0.networkName.size() - encoding:NSUTF8StringEncoding]; - newElement_0.channel = [NSNumber numberWithUnsignedShort:entry_0.channel]; - newElement_0.version = [NSNumber numberWithUnsignedChar:entry_0.version]; - newElement_0.extendedAddress = [NSNumber numberWithUnsignedLongLong:entry_0.extendedAddress]; - newElement_0.rssi = [NSNumber numberWithChar:entry_0.rssi]; - newElement_0.lqi = [NSNumber numberWithUnsignedChar:entry_0.lqi]; - [array_0 addObject:newElement_0]; - } - { // Scope for the error so we will know what it's named - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); - return; + if (data.threadScanResults.HasValue()) { + auto * array_1 = [NSMutableArray new]; + auto iter_1 = data.threadScanResults.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + CHIPNetworkCommissioningClusterThreadInterfaceScanResult * newElement_1; + newElement_1 = [CHIPNetworkCommissioningClusterThreadInterfaceScanResult new]; + newElement_1.panId = [NSNumber numberWithUnsignedLongLong:entry_1.panId]; + newElement_1.extendedPanId = [NSNumber numberWithUnsignedLongLong:entry_1.extendedPanId]; + newElement_1.networkName = [[NSString alloc] initWithBytes:entry_1.networkName.data() + length:entry_1.networkName.size() + encoding:NSUTF8StringEncoding]; + newElement_1.channel = [NSNumber numberWithUnsignedShort:entry_1.channel]; + newElement_1.version = [NSNumber numberWithUnsignedChar:entry_1.version]; + newElement_1.extendedAddress = [NSNumber numberWithUnsignedLongLong:entry_1.extendedAddress]; + newElement_1.rssi = [NSNumber numberWithChar:entry_1.rssi]; + newElement_1.lqi = [NSNumber numberWithUnsignedChar:entry_1.lqi]; + [array_1 addObject:newElement_1]; + } + { // Scope for the error so we will know what it's named + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } } + response.threadScanResults = array_1; + } else { + response.threadScanResults = nil; } - response.threadScanResults = array_0; } DispatchSuccess(context, response); }; @@ -5823,30 +5861,6 @@ DispatchSuccess(context, response); }; -void CHIPTvChannelClusterChangeChannelResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType & data) -{ - auto * response = [CHIPTvChannelClusterChangeChannelResponseParams new]; - { - response.channelMatch = [CHIPTvChannelClusterTvChannelInfo new]; - response.channelMatch.majorNumber = [NSNumber numberWithUnsignedShort:data.channelMatch.majorNumber]; - response.channelMatch.minorNumber = [NSNumber numberWithUnsignedShort:data.channelMatch.minorNumber]; - response.channelMatch.name = [[NSString alloc] initWithBytes:data.channelMatch.name.data() - length:data.channelMatch.name.size() - encoding:NSUTF8StringEncoding]; - response.channelMatch.callSign = [[NSString alloc] initWithBytes:data.channelMatch.callSign.data() - length:data.channelMatch.callSign.size() - encoding:NSUTF8StringEncoding]; - response.channelMatch.affiliateCallSign = [[NSString alloc] initWithBytes:data.channelMatch.affiliateCallSign.data() - length:data.channelMatch.affiliateCallSign.size() - encoding:NSUTF8StringEncoding]; - } - { - response.errorType = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.errorType)]; - } - DispatchSuccess(context, response); -}; - void CHIPTargetNavigatorClusterNavigateTargetResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & data) { @@ -7438,6 +7452,58 @@ } } +void CHIPNetworkCommissioningClusterWiFiBandAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::NetworkCommissioning::WiFiBand value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; + DispatchSuccess(context, objCValue); +}; + +void CHIPNetworkCommissioningClusterWiFiBandAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPNullableNetworkCommissioningClusterWiFiBandAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value.Value())]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPNullableNetworkCommissioningClusterWiFiBandAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPDiagnosticLogsClusterLogsIntentAttributeCallbackBridge::OnSuccessFn( void * context, chip::app::Clusters::DiagnosticLogs::LogsIntent value) { @@ -10717,17 +10783,17 @@ } } -void CHIPTvChannelClusterTvChannelErrorTypeAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::TvChannel::TvChannelErrorType value) +void CHIPChannelClusterErrorTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::Channel::ErrorTypeEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPTvChannelClusterTvChannelErrorTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPChannelClusterErrorTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -10741,8 +10807,8 @@ } } -void CHIPNullableTvChannelClusterTvChannelErrorTypeAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableChannelClusterErrorTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -10753,9 +10819,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableTvChannelClusterTvChannelErrorTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableChannelClusterErrorTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -10769,17 +10835,17 @@ } } -void CHIPTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::TvChannel::TvChannelLineupInfoType value) +void CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::Channel::LineupInfoTypeEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -10793,8 +10859,8 @@ } } -void CHIPNullableTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -10805,10 +10871,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -10822,17 +10887,17 @@ } } -void CHIPTargetNavigatorClusterNavigateTargetStatusAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::TargetNavigator::NavigateTargetStatus value) +void CHIPTargetNavigatorClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::TargetNavigator::StatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPTargetNavigatorClusterNavigateTargetStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -10846,8 +10911,8 @@ } } -void CHIPNullableTargetNavigatorClusterNavigateTargetStatusAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -10858,10 +10923,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableTargetNavigatorClusterNavigateTargetStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -10875,17 +10939,17 @@ } } -void CHIPMediaPlaybackClusterMediaPlaybackStateAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::MediaPlayback::MediaPlaybackState value) +void CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPMediaPlaybackClusterMediaPlaybackStateAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -10899,8 +10963,8 @@ } } -void CHIPNullableMediaPlaybackClusterMediaPlaybackStateAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -10911,10 +10975,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableMediaPlaybackClusterMediaPlaybackStateAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -10928,17 +10991,17 @@ } } -void CHIPMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::MediaPlayback::MediaPlaybackStatus value) +void CHIPMediaPlaybackClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::MediaPlayback::StatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -10952,8 +11015,8 @@ } } -void CHIPNullableMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -10964,10 +11027,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -10981,17 +11043,17 @@ } } -void CHIPMediaInputClusterMediaInputTypeAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::MediaInput::MediaInputType value) +void CHIPMediaInputClusterInputTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::MediaInput::InputTypeEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPMediaInputClusterMediaInputTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPMediaInputClusterInputTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11005,8 +11067,8 @@ } } -void CHIPNullableMediaInputClusterMediaInputTypeAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableMediaInputClusterInputTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -11017,9 +11079,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableMediaInputClusterMediaInputTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableMediaInputClusterInputTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11033,17 +11095,17 @@ } } -void CHIPKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::KeypadInput::KeypadInputCecKeyCode value) +void CHIPKeypadInputClusterCecKeyCodeAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::KeypadInput::CecKeyCode value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPKeypadInputClusterCecKeyCodeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11057,8 +11119,8 @@ } } -void CHIPNullableKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableKeypadInputClusterCecKeyCodeAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -11069,10 +11131,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPNullableKeypadInputClusterCecKeyCodeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11086,17 +11147,17 @@ } } -void CHIPKeypadInputClusterKeypadInputStatusAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::KeypadInput::KeypadInputStatus value) +void CHIPKeypadInputClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::KeypadInput::StatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPKeypadInputClusterKeypadInputStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11110,8 +11171,8 @@ } } -void CHIPNullableKeypadInputClusterKeypadInputStatusAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -11122,9 +11183,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableKeypadInputClusterKeypadInputStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11138,17 +11199,17 @@ } } -void CHIPContentLauncherClusterContentLaunchMetricTypeAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::ContentLauncher::ContentLaunchMetricType value) +void CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::ContentLauncher::MetricTypeEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPContentLauncherClusterContentLaunchMetricTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11162,8 +11223,8 @@ } } -void CHIPNullableContentLauncherClusterContentLaunchMetricTypeAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -11174,11 +11235,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableContentLauncherClusterContentLaunchMetricTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self - = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11192,18 +11251,17 @@ } } -void CHIPContentLauncherClusterContentLaunchParameterEnumAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::ContentLauncher::ContentLaunchParameterEnum value) +void CHIPContentLauncherClusterParameterEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::ContentLauncher::ParameterEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPContentLauncherClusterContentLaunchParameterEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPContentLauncherClusterParameterEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11217,8 +11275,8 @@ } } -void CHIPNullableContentLauncherClusterContentLaunchParameterEnumAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -11229,11 +11287,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableContentLauncherClusterContentLaunchParameterEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self - = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11247,17 +11303,17 @@ } } -void CHIPContentLauncherClusterContentLaunchStatusAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::ContentLauncher::ContentLaunchStatus value) +void CHIPContentLauncherClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::ContentLauncher::StatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPContentLauncherClusterContentLaunchStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11271,8 +11327,8 @@ } } -void CHIPNullableContentLauncherClusterContentLaunchStatusAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -11283,10 +11339,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableContentLauncherClusterContentLaunchStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11300,17 +11355,17 @@ } } -void CHIPAudioOutputClusterAudioOutputTypeAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::AudioOutput::AudioOutputType value) +void CHIPAudioOutputClusterOutputTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::AudioOutput::OutputTypeEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPAudioOutputClusterAudioOutputTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPAudioOutputClusterOutputTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11324,8 +11379,8 @@ } } -void CHIPNullableAudioOutputClusterAudioOutputTypeAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableAudioOutputClusterOutputTypeEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -11336,9 +11391,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableAudioOutputClusterAudioOutputTypeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPNullableAudioOutputClusterOutputTypeEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11352,19 +11407,17 @@ } } -void CHIPApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatus value) +void CHIPApplicationLauncherClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::ApplicationLauncher::StatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self - = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11378,8 +11431,8 @@ } } -void CHIPNullableApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -11390,11 +11443,9 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( - void * context) +void CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast( - context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11408,17 +11459,17 @@ } } -void CHIPApplicationBasicClusterApplicationBasicStatusAttributeCallbackBridge::OnSuccessFn( - void * context, chip::app::Clusters::ApplicationBasic::ApplicationBasicStatus value) +void CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(value)]; DispatchSuccess(context, objCValue); }; -void CHIPApplicationBasicClusterApplicationBasicStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +void CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) { - auto * self = static_cast(context); + auto * self = static_cast(context); if (!self->mQueue) { return; } @@ -11432,8 +11483,8 @@ } } -void CHIPNullableApplicationBasicClusterApplicationBasicStatusAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPNullableApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -11444,11 +11495,11 @@ DispatchSuccess(context, objCValue); }; -void CHIPNullableApplicationBasicClusterApplicationBasicStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( +void CHIPNullableApplicationBasicClusterApplicationStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished( void * context) { auto * self - = static_cast(context); + = static_cast(context); if (!self->mQueue) { return; } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index 1e3603fbe12549..d604a49dacf75c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -33,16 +33,12 @@ typedef void (*NullableVendorIdAttributeCallback)(void *, const chip::app::DataM typedef void (*CHIPAccountLoginClusterGetSetupPINResponseCallbackType)( void *, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType &); -typedef void (*CHIPApplicationLauncherClusterHideAppResponseCallbackType)( - void *, const chip::app::Clusters::ApplicationLauncher::Commands::HideAppResponse::DecodableType &); -typedef void (*CHIPApplicationLauncherClusterLaunchAppResponseCallbackType)( - void *, const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType &); -typedef void (*CHIPApplicationLauncherClusterStopAppResponseCallbackType)( - void *, const chip::app::Clusters::ApplicationLauncher::Commands::StopAppResponse::DecodableType &); -typedef void (*CHIPContentLauncherClusterLaunchContentResponseCallbackType)( - void *, const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType &); -typedef void (*CHIPContentLauncherClusterLaunchURLResponseCallbackType)( - void *, const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType &); +typedef void (*CHIPApplicationLauncherClusterLauncherResponseCallbackType)( + void *, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType &); +typedef void (*CHIPChannelClusterChangeChannelResponseCallbackType)( + void *, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType &); +typedef void (*CHIPContentLauncherClusterLaunchResponseCallbackType)( + void *, const chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::DecodableType &); typedef void (*CHIPDiagnosticLogsClusterRetrieveLogsResponseCallbackType)( void *, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType &); typedef void (*CHIPDoorLockClusterGetCredentialStatusResponseCallbackType)( @@ -57,6 +53,10 @@ typedef void (*CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallb void *, const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType &); typedef void (*CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackType)( void *, const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterKeySetReadResponseCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &); typedef void (*CHIPGroupsClusterAddGroupResponseCallbackType)( void *, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType &); typedef void (*CHIPGroupsClusterGetGroupMembershipResponseCallbackType)( @@ -69,28 +69,8 @@ typedef void (*CHIPIdentifyClusterIdentifyQueryResponseCallbackType)( void *, const chip::app::Clusters::Identify::Commands::IdentifyQueryResponse::DecodableType &); typedef void (*CHIPKeypadInputClusterSendKeyResponseCallbackType)( void *, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaNextResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaPauseResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaPlayResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaPreviousResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaRewindResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaSeekResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaStartOverResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType &); -typedef void (*CHIPMediaPlaybackClusterMediaStopResponseCallbackType)( - void *, const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType &); +typedef void (*CHIPMediaPlaybackClusterPlaybackResponseCallbackType)( + void *, const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType &); typedef void (*CHIPNetworkCommissioningClusterConnectNetworkResponseCallbackType)( void *, const chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType &); typedef void (*CHIPNetworkCommissioningClusterNetworkConfigResponseCallbackType)( @@ -121,8 +101,6 @@ typedef void (*CHIPScenesClusterStoreSceneResponseCallbackType)( void *, const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType &); typedef void (*CHIPScenesClusterViewSceneResponseCallbackType)( void *, const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType &); -typedef void (*CHIPTvChannelClusterChangeChannelResponseCallbackType)( - void *, const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType &); typedef void (*CHIPTargetNavigatorClusterNavigateTargetResponseCallbackType)( void *, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &); typedef void (*CHIPTestClusterClusterBooleanResponseCallbackType)( @@ -237,6 +215,9 @@ typedef void (*NetworkCommissioningClusterNetworkCommissioningStatusAttributeCal void *, chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus); typedef void (*NullableNetworkCommissioningClusterNetworkCommissioningStatusAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*NetworkCommissioningClusterWiFiBandAttributeCallback)(void *, chip::app::Clusters::NetworkCommissioning::WiFiBand); +typedef void (*NullableNetworkCommissioningClusterWiFiBandAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*DiagnosticLogsClusterLogsIntentAttributeCallback)(void *, chip::app::Clusters::DiagnosticLogs::LogsIntent); typedef void (*NullableDiagnosticLogsClusterLogsIntentAttributeCallback)( void *, const chip::app::DataModel::Nullable &); @@ -451,58 +432,50 @@ typedef void (*NullableIasAceClusterIasAcePanelStatusAttributeCallback)( typedef void (*IasAceClusterIasZoneTypeAttributeCallback)(void *, chip::app::Clusters::IasAce::IasZoneType); typedef void (*NullableIasAceClusterIasZoneTypeAttributeCallback)( void *, const chip::app::DataModel::Nullable &); -typedef void (*TvChannelClusterTvChannelErrorTypeAttributeCallback)(void *, chip::app::Clusters::TvChannel::TvChannelErrorType); -typedef void (*NullableTvChannelClusterTvChannelErrorTypeAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*TvChannelClusterTvChannelLineupInfoTypeAttributeCallback)(void *, - chip::app::Clusters::TvChannel::TvChannelLineupInfoType); -typedef void (*NullableTvChannelClusterTvChannelLineupInfoTypeAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*TargetNavigatorClusterNavigateTargetStatusAttributeCallback)( - void *, chip::app::Clusters::TargetNavigator::NavigateTargetStatus); -typedef void (*NullableTargetNavigatorClusterNavigateTargetStatusAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*MediaPlaybackClusterMediaPlaybackStateAttributeCallback)(void *, - chip::app::Clusters::MediaPlayback::MediaPlaybackState); -typedef void (*NullableMediaPlaybackClusterMediaPlaybackStateAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*MediaPlaybackClusterMediaPlaybackStatusAttributeCallback)(void *, - chip::app::Clusters::MediaPlayback::MediaPlaybackStatus); -typedef void (*NullableMediaPlaybackClusterMediaPlaybackStatusAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*MediaInputClusterMediaInputTypeAttributeCallback)(void *, chip::app::Clusters::MediaInput::MediaInputType); -typedef void (*NullableMediaInputClusterMediaInputTypeAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*KeypadInputClusterKeypadInputCecKeyCodeAttributeCallback)(void *, - chip::app::Clusters::KeypadInput::KeypadInputCecKeyCode); -typedef void (*NullableKeypadInputClusterKeypadInputCecKeyCodeAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*KeypadInputClusterKeypadInputStatusAttributeCallback)(void *, chip::app::Clusters::KeypadInput::KeypadInputStatus); -typedef void (*NullableKeypadInputClusterKeypadInputStatusAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*ContentLauncherClusterContentLaunchMetricTypeAttributeCallback)( - void *, chip::app::Clusters::ContentLauncher::ContentLaunchMetricType); -typedef void (*NullableContentLauncherClusterContentLaunchMetricTypeAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*ContentLauncherClusterContentLaunchParameterEnumAttributeCallback)( - void *, chip::app::Clusters::ContentLauncher::ContentLaunchParameterEnum); -typedef void (*NullableContentLauncherClusterContentLaunchParameterEnumAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*ContentLauncherClusterContentLaunchStatusAttributeCallback)( - void *, chip::app::Clusters::ContentLauncher::ContentLaunchStatus); -typedef void (*NullableContentLauncherClusterContentLaunchStatusAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*AudioOutputClusterAudioOutputTypeAttributeCallback)(void *, chip::app::Clusters::AudioOutput::AudioOutputType); -typedef void (*NullableAudioOutputClusterAudioOutputTypeAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*ApplicationLauncherClusterApplicationLauncherStatusAttributeCallback)( - void *, chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatus); -typedef void (*NullableApplicationLauncherClusterApplicationLauncherStatusAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); -typedef void (*ApplicationBasicClusterApplicationBasicStatusAttributeCallback)( - void *, chip::app::Clusters::ApplicationBasic::ApplicationBasicStatus); -typedef void (*NullableApplicationBasicClusterApplicationBasicStatusAttributeCallback)( - void *, const chip::app::DataModel::Nullable &); +typedef void (*ChannelClusterErrorTypeEnumAttributeCallback)(void *, chip::app::Clusters::Channel::ErrorTypeEnum); +typedef void (*NullableChannelClusterErrorTypeEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*ChannelClusterLineupInfoTypeEnumAttributeCallback)(void *, chip::app::Clusters::Channel::LineupInfoTypeEnum); +typedef void (*NullableChannelClusterLineupInfoTypeEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*TargetNavigatorClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::TargetNavigator::StatusEnum); +typedef void (*NullableTargetNavigatorClusterStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*MediaPlaybackClusterPlaybackStateEnumAttributeCallback)(void *, + chip::app::Clusters::MediaPlayback::PlaybackStateEnum); +typedef void (*NullableMediaPlaybackClusterPlaybackStateEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*MediaPlaybackClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::MediaPlayback::StatusEnum); +typedef void (*NullableMediaPlaybackClusterStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*MediaInputClusterInputTypeEnumAttributeCallback)(void *, chip::app::Clusters::MediaInput::InputTypeEnum); +typedef void (*NullableMediaInputClusterInputTypeEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*KeypadInputClusterCecKeyCodeAttributeCallback)(void *, chip::app::Clusters::KeypadInput::CecKeyCode); +typedef void (*NullableKeypadInputClusterCecKeyCodeAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*KeypadInputClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::KeypadInput::StatusEnum); +typedef void (*NullableKeypadInputClusterStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*ContentLauncherClusterMetricTypeEnumAttributeCallback)(void *, chip::app::Clusters::ContentLauncher::MetricTypeEnum); +typedef void (*NullableContentLauncherClusterMetricTypeEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*ContentLauncherClusterParameterEnumAttributeCallback)(void *, chip::app::Clusters::ContentLauncher::ParameterEnum); +typedef void (*NullableContentLauncherClusterParameterEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*ContentLauncherClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::ContentLauncher::StatusEnum); +typedef void (*NullableContentLauncherClusterStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*AudioOutputClusterOutputTypeEnumAttributeCallback)(void *, chip::app::Clusters::AudioOutput::OutputTypeEnum); +typedef void (*NullableAudioOutputClusterOutputTypeEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*ApplicationLauncherClusterStatusEnumAttributeCallback)(void *, chip::app::Clusters::ApplicationLauncher::StatusEnum); +typedef void (*NullableApplicationLauncherClusterStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); +typedef void (*ApplicationBasicClusterApplicationStatusEnumAttributeCallback)( + void *, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum); +typedef void (*NullableApplicationBasicClusterApplicationStatusEnumAttributeCallback)( + void *, const chip::app::DataModel::Nullable &); typedef void (*TestClusterClusterSimpleEnumAttributeCallback)(void *, chip::app::Clusters::TestCluster::SimpleEnum); typedef void (*NullableTestClusterClusterSimpleEnumAttributeCallback)( void *, const chip::app::DataModel::Nullable &); @@ -1396,6 +1369,35 @@ class CHIPAdministratorCommissioningAttributeListListAttributeCallbackSubscripti SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPApplicationBasicAllowedVendorListListAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPApplicationBasicAllowedVendorListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class CHIPApplicationBasicAllowedVendorListListAttributeCallbackSubscriptionBridge + : public CHIPApplicationBasicAllowedVendorListListAttributeCallbackBridge +{ +public: + CHIPApplicationBasicAllowedVendorListListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPApplicationBasicAllowedVendorListListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPApplicationBasicAttributeListListAttributeCallbackBridge : public CHIPCallbackBridge { @@ -1491,8 +1493,7 @@ class CHIPAudioOutputAudioOutputListListAttributeCallbackBridge static void OnSuccessFn( void * context, - const chip::app::DataModel::DecodableList & - value); + const chip::app::DataModel::DecodableList & value); }; class CHIPAudioOutputAudioOutputListListAttributeCallbackSubscriptionBridge @@ -1794,6 +1795,60 @@ class CHIPBridgedDeviceBasicAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPChannelChannelListListAttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPChannelChannelListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn( + void * context, + const chip::app::DataModel::DecodableList & value); +}; + +class CHIPChannelChannelListListAttributeCallbackSubscriptionBridge : public CHIPChannelChannelListListAttributeCallbackBridge +{ +public: + CHIPChannelChannelListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPChannelChannelListListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPChannelAttributeListListAttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPChannelAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class CHIPChannelAttributeListListAttributeCallbackSubscriptionBridge : public CHIPChannelAttributeListListAttributeCallbackBridge +{ +public: + CHIPChannelAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPChannelAttributeListListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPColorControlAttributeListListAttributeCallbackBridge : public CHIPCallbackBridge { @@ -1822,25 +1877,25 @@ class CHIPColorControlAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPContentLauncherAcceptsHeaderListListAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPContentLauncherAcceptHeaderListListAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPContentLauncherAcceptsHeaderListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPContentLauncherAcceptHeaderListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; -class CHIPContentLauncherAcceptsHeaderListListAttributeCallbackSubscriptionBridge - : public CHIPContentLauncherAcceptsHeaderListListAttributeCallbackBridge +class CHIPContentLauncherAcceptHeaderListListAttributeCallbackSubscriptionBridge + : public CHIPContentLauncherAcceptHeaderListListAttributeCallbackBridge { public: - CHIPContentLauncherAcceptsHeaderListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPContentLauncherAcceptsHeaderListListAttributeCallbackBridge(queue, handler, action, true), + CHIPContentLauncherAcceptHeaderListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPContentLauncherAcceptHeaderListListAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -2415,28 +2470,28 @@ class CHIPGeneralDiagnosticsAttributeListListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPGroupKeyManagementGroupsListAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPGroupKeyManagementGroupsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; static void OnSuccessFn( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value); }; -class CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge - : public CHIPGroupKeyManagementGroupsListAttributeCallbackBridge +class CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge + : public CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge { public: - CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPGroupKeyManagementGroupsListAttributeCallbackBridge(queue, handler, action, true), + CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -2446,28 +2501,28 @@ class CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; static void OnSuccessFn( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value); }; -class CHIPGroupKeyManagementGroupKeysListAttributeCallbackSubscriptionBridge - : public CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge +class CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge + : public CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge { public: - CHIPGroupKeyManagementGroupKeysListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge(queue, handler, action, true), + CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -2678,7 +2733,7 @@ class CHIPMediaInputMediaInputListListAttributeCallbackBridge static void OnSuccessFn( void * context, - const chip::app::DataModel::DecodableList & value); + const chip::app::DataModel::DecodableList & value); }; class CHIPMediaInputMediaInputListListAttributeCallbackSubscriptionBridge @@ -2873,6 +2928,37 @@ class CHIPOtaSoftwareUpdateProviderAttributeListListAttributeCallbackSubscriptio SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> & value); +}; + +class CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackSubscriptionBridge + : public CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackBridge +{ +public: + CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPOtaSoftwareUpdateRequestorAttributeListListAttributeCallbackBridge : public CHIPCallbackBridge { @@ -3384,61 +3470,6 @@ class CHIPSwitchAttributeListListAttributeCallbackSubscriptionBridge : public CH SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPTvChannelChannelListListAttributeCallbackBridge : public CHIPCallbackBridge -{ -public: - CHIPTvChannelChannelListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - static void OnSuccessFn( - void * context, - const chip::app::DataModel::DecodableList & value); -}; - -class CHIPTvChannelChannelListListAttributeCallbackSubscriptionBridge : public CHIPTvChannelChannelListListAttributeCallbackBridge -{ -public: - CHIPTvChannelChannelListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPTvChannelChannelListListAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - -class CHIPTvChannelAttributeListListAttributeCallbackBridge : public CHIPCallbackBridge -{ -public: - CHIPTvChannelAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class CHIPTvChannelAttributeListListAttributeCallbackSubscriptionBridge - : public CHIPTvChannelAttributeListListAttributeCallbackBridge -{ -public: - CHIPTvChannelAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPTvChannelAttributeListListAttributeCallbackBridge(queue, handler, action, true), - mEstablishedHandler(establishedHandler) - {} - - static void OnSubscriptionEstablished(void * context); - -private: - SubscriptionEstablishedHandler mEstablishedHandler; -}; - class CHIPTargetNavigatorTargetNavigatorListListAttributeCallbackBridge : public CHIPCallbackBridge { @@ -3448,9 +3479,10 @@ class CHIPTargetNavigatorTargetNavigatorListListAttributeCallbackBridge CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & value); + static void OnSuccessFn( + void * context, + const chip::app::DataModel::DecodableList & + value); }; class CHIPTargetNavigatorTargetNavigatorListListAttributeCallbackSubscriptionBridge @@ -4070,69 +4102,41 @@ class CHIPAccountLoginClusterGetSetupPINResponseCallbackBridge const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType & data); }; -class CHIPApplicationLauncherClusterHideAppResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPApplicationLauncherClusterHideAppResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::ApplicationLauncher::Commands::HideAppResponse::DecodableType & data); -}; - -class CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType & data); -}; - -class CHIPApplicationLauncherClusterStopAppResponseCallbackBridge - : public CHIPCallbackBridge +class CHIPApplicationLauncherClusterLauncherResponseCallbackBridge + : public CHIPCallbackBridge { public: - CHIPApplicationLauncherClusterStopAppResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPApplicationLauncherClusterLauncherResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::Clusters::ApplicationLauncher::Commands::StopAppResponse::DecodableType & data); + const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & data); }; -class CHIPContentLauncherClusterLaunchContentResponseCallbackBridge - : public CHIPCallbackBridge +class CHIPChannelClusterChangeChannelResponseCallbackBridge + : public CHIPCallbackBridge { public: - CHIPContentLauncherClusterLaunchContentResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPChannelClusterChangeChannelResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType & data); + const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & data); }; -class CHIPContentLauncherClusterLaunchURLResponseCallbackBridge - : public CHIPCallbackBridge +class CHIPContentLauncherClusterLaunchResponseCallbackBridge + : public CHIPCallbackBridge { public: - CHIPContentLauncherClusterLaunchURLResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPContentLauncherClusterLaunchResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType & data); + const chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::DecodableType & data); }; class CHIPDiagnosticLogsClusterRetrieveLogsResponseCallbackBridge @@ -4224,6 +4228,33 @@ class CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & data); }; +class CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, + OnSuccessFn, keepAlive){}; + + static void + OnSuccessFn(void * context, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data); +}; + +class CHIPGroupKeyManagementClusterKeySetReadResponseCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPGroupKeyManagementClusterKeySetReadResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data); +}; + class CHIPGroupsClusterAddGroupResponseCallbackBridge : public CHIPCallbackBridge { public: @@ -4292,143 +4323,16 @@ class CHIPKeypadInputClusterSendKeyResponseCallbackBridge const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & data); }; -class CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType & data); -}; - -class CHIPMediaPlaybackClusterMediaNextResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterMediaNextResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType & data); -}; - -class CHIPMediaPlaybackClusterMediaPauseResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterMediaPauseResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType & data); -}; - -class CHIPMediaPlaybackClusterMediaPlayResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterMediaPlayResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType & data); -}; - -class CHIPMediaPlaybackClusterMediaPreviousResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterMediaPreviousResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType & data); -}; - -class CHIPMediaPlaybackClusterMediaRewindResponseCallbackBridge - : public CHIPCallbackBridge +class CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge + : public CHIPCallbackBridge { public: - CHIPMediaPlaybackClusterMediaRewindResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType & data); -}; - -class CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType & data); -}; - -class CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType & data); -}; - -class CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType & data); -}; - -class CHIPMediaPlaybackClusterMediaStartOverResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterMediaStartOverResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType & data); -}; - -class CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType & data); + const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & data); }; class CHIPNetworkCommissioningClusterConnectNetworkResponseCallbackBridge @@ -4618,18 +4522,6 @@ class CHIPScenesClusterViewSceneResponseCallbackBridge : public CHIPCallbackBrid static void OnSuccessFn(void * context, const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType & data); }; -class CHIPTvChannelClusterChangeChannelResponseCallbackBridge - : public CHIPCallbackBridge -{ -public: - CHIPTvChannelClusterChangeChannelResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType & data); -}; - class CHIPTargetNavigatorClusterNavigateTargetResponseCallbackBridge : public CHIPCallbackBridge { @@ -6315,6 +6207,64 @@ class CHIPNullableNetworkCommissioningClusterNetworkCommissioningStatusAttribute SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPNetworkCommissioningClusterWiFiBandAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPNetworkCommissioningClusterWiFiBandAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, chip::app::Clusters::NetworkCommissioning::WiFiBand value); +}; + +class CHIPNetworkCommissioningClusterWiFiBandAttributeCallbackSubscriptionBridge + : public CHIPNetworkCommissioningClusterWiFiBandAttributeCallbackBridge +{ +public: + CHIPNetworkCommissioningClusterWiFiBandAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNetworkCommissioningClusterWiFiBandAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPNullableNetworkCommissioningClusterWiFiBandAttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPNullableNetworkCommissioningClusterWiFiBandAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); +}; + +class CHIPNullableNetworkCommissioningClusterWiFiBandAttributeCallbackSubscriptionBridge + : public CHIPNullableNetworkCommissioningClusterWiFiBandAttributeCallbackBridge +{ +public: + CHIPNullableNetworkCommissioningClusterWiFiBandAttributeCallbackSubscriptionBridge( + dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableNetworkCommissioningClusterWiFiBandAttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPDiagnosticLogsClusterLogsIntentAttributeCallbackBridge : public CHIPCallbackBridge { @@ -9958,25 +9908,25 @@ class CHIPNullableIasAceClusterIasZoneTypeAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPTvChannelClusterTvChannelErrorTypeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPChannelClusterErrorTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPTvChannelClusterTvChannelErrorTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPChannelClusterErrorTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::TvChannel::TvChannelErrorType value); + static void OnSuccessFn(void * context, chip::app::Clusters::Channel::ErrorTypeEnum value); }; -class CHIPTvChannelClusterTvChannelErrorTypeAttributeCallbackSubscriptionBridge - : public CHIPTvChannelClusterTvChannelErrorTypeAttributeCallbackBridge +class CHIPChannelClusterErrorTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPChannelClusterErrorTypeEnumAttributeCallbackBridge { public: - CHIPTvChannelClusterTvChannelErrorTypeAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPTvChannelClusterTvChannelErrorTypeAttributeCallbackBridge(queue, handler, action, true), + CHIPChannelClusterErrorTypeEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPChannelClusterErrorTypeEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -9986,27 +9936,26 @@ class CHIPTvChannelClusterTvChannelErrorTypeAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableTvChannelClusterTvChannelErrorTypeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableChannelClusterErrorTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableTvChannelClusterTvChannelErrorTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableChannelClusterErrorTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableTvChannelClusterTvChannelErrorTypeAttributeCallbackSubscriptionBridge - : public CHIPNullableTvChannelClusterTvChannelErrorTypeAttributeCallbackBridge +class CHIPNullableChannelClusterErrorTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableChannelClusterErrorTypeEnumAttributeCallbackBridge { public: - CHIPNullableTvChannelClusterTvChannelErrorTypeAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableTvChannelClusterTvChannelErrorTypeAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableChannelClusterErrorTypeEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableChannelClusterErrorTypeEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10016,26 +9965,25 @@ class CHIPNullableTvChannelClusterTvChannelErrorTypeAttributeCallbackSubscriptio SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::TvChannel::TvChannelLineupInfoType value); + static void OnSuccessFn(void * context, chip::app::Clusters::Channel::LineupInfoTypeEnum value); }; -class CHIPTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackSubscriptionBridge - : public CHIPTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackBridge +class CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackBridge { public: - CHIPTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackBridge(queue, handler, action, true), + CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPChannelClusterLineupInfoTypeEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10045,27 +9993,27 @@ class CHIPTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackSubscriptionBr SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackSubscriptionBridge - : public CHIPNullableTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackBridge +class CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackBridge { public: - CHIPNullableTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackSubscriptionBridge( + CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableChannelClusterLineupInfoTypeEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10075,26 +10023,25 @@ class CHIPNullableTvChannelClusterTvChannelLineupInfoTypeAttributeCallbackSubscr SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPTargetNavigatorClusterNavigateTargetStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPTargetNavigatorClusterStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPTargetNavigatorClusterNavigateTargetStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPTargetNavigatorClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::TargetNavigator::NavigateTargetStatus value); + static void OnSuccessFn(void * context, chip::app::Clusters::TargetNavigator::StatusEnum value); }; -class CHIPTargetNavigatorClusterNavigateTargetStatusAttributeCallbackSubscriptionBridge - : public CHIPTargetNavigatorClusterNavigateTargetStatusAttributeCallbackBridge +class CHIPTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPTargetNavigatorClusterStatusEnumAttributeCallbackBridge { public: - CHIPTargetNavigatorClusterNavigateTargetStatusAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPTargetNavigatorClusterNavigateTargetStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTargetNavigatorClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10104,28 +10051,27 @@ class CHIPTargetNavigatorClusterNavigateTargetStatusAttributeCallbackSubscriptio SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableTargetNavigatorClusterNavigateTargetStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableTargetNavigatorClusterNavigateTargetStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; - static void - OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableTargetNavigatorClusterNavigateTargetStatusAttributeCallbackSubscriptionBridge - : public CHIPNullableTargetNavigatorClusterNavigateTargetStatusAttributeCallbackBridge +class CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackBridge { public: - CHIPNullableTargetNavigatorClusterNavigateTargetStatusAttributeCallbackSubscriptionBridge( + CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableTargetNavigatorClusterNavigateTargetStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableTargetNavigatorClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10135,26 +10081,26 @@ class CHIPNullableTargetNavigatorClusterNavigateTargetStatusAttributeCallbackSub SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPMediaPlaybackClusterMediaPlaybackStateAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPMediaPlaybackClusterMediaPlaybackStateAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::MediaPlayback::MediaPlaybackState value); + static void OnSuccessFn(void * context, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value); }; -class CHIPMediaPlaybackClusterMediaPlaybackStateAttributeCallbackSubscriptionBridge - : public CHIPMediaPlaybackClusterMediaPlaybackStateAttributeCallbackBridge +class CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge + : public CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge { public: - CHIPMediaPlaybackClusterMediaPlaybackStateAttributeCallbackSubscriptionBridge( + CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPMediaPlaybackClusterMediaPlaybackStateAttributeCallbackBridge(queue, handler, action, true), + CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10164,27 +10110,27 @@ class CHIPMediaPlaybackClusterMediaPlaybackStateAttributeCallbackSubscriptionBri SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableMediaPlaybackClusterMediaPlaybackStateAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableMediaPlaybackClusterMediaPlaybackStateAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableMediaPlaybackClusterMediaPlaybackStateAttributeCallbackSubscriptionBridge - : public CHIPNullableMediaPlaybackClusterMediaPlaybackStateAttributeCallbackBridge +class CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge { public: - CHIPNullableMediaPlaybackClusterMediaPlaybackStateAttributeCallbackSubscriptionBridge( + CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableMediaPlaybackClusterMediaPlaybackStateAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10194,26 +10140,25 @@ class CHIPNullableMediaPlaybackClusterMediaPlaybackStateAttributeCallbackSubscri SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPMediaPlaybackClusterStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPMediaPlaybackClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::MediaPlayback::MediaPlaybackStatus value); + static void OnSuccessFn(void * context, chip::app::Clusters::MediaPlayback::StatusEnum value); }; -class CHIPMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackSubscriptionBridge - : public CHIPMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackBridge +class CHIPMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPMediaPlaybackClusterStatusEnumAttributeCallbackBridge { public: - CHIPMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPMediaPlaybackClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10223,27 +10168,27 @@ class CHIPMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackSubscriptionBr SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackSubscriptionBridge - : public CHIPNullableMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackBridge +class CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackBridge { public: - CHIPNullableMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackSubscriptionBridge( + CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableMediaPlaybackClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10253,25 +10198,25 @@ class CHIPNullableMediaPlaybackClusterMediaPlaybackStatusAttributeCallbackSubscr SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPMediaInputClusterMediaInputTypeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPMediaInputClusterInputTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPMediaInputClusterMediaInputTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPMediaInputClusterInputTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::MediaInput::MediaInputType value); + static void OnSuccessFn(void * context, chip::app::Clusters::MediaInput::InputTypeEnum value); }; -class CHIPMediaInputClusterMediaInputTypeAttributeCallbackSubscriptionBridge - : public CHIPMediaInputClusterMediaInputTypeAttributeCallbackBridge +class CHIPMediaInputClusterInputTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPMediaInputClusterInputTypeEnumAttributeCallbackBridge { public: - CHIPMediaInputClusterMediaInputTypeAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPMediaInputClusterMediaInputTypeAttributeCallbackBridge(queue, handler, action, true), + CHIPMediaInputClusterInputTypeEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPMediaInputClusterInputTypeEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10281,27 +10226,27 @@ class CHIPMediaInputClusterMediaInputTypeAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableMediaInputClusterMediaInputTypeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableMediaInputClusterInputTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableMediaInputClusterMediaInputTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableMediaInputClusterInputTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableMediaInputClusterMediaInputTypeAttributeCallbackSubscriptionBridge - : public CHIPNullableMediaInputClusterMediaInputTypeAttributeCallbackBridge +class CHIPNullableMediaInputClusterInputTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableMediaInputClusterInputTypeEnumAttributeCallbackBridge { public: - CHIPNullableMediaInputClusterMediaInputTypeAttributeCallbackSubscriptionBridge( + CHIPNullableMediaInputClusterInputTypeEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableMediaInputClusterMediaInputTypeAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableMediaInputClusterInputTypeEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10311,26 +10256,25 @@ class CHIPNullableMediaInputClusterMediaInputTypeAttributeCallbackSubscriptionBr SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPKeypadInputClusterCecKeyCodeAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPKeypadInputClusterCecKeyCodeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::KeypadInput::KeypadInputCecKeyCode value); + static void OnSuccessFn(void * context, chip::app::Clusters::KeypadInput::CecKeyCode value); }; -class CHIPKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackSubscriptionBridge - : public CHIPKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackBridge +class CHIPKeypadInputClusterCecKeyCodeAttributeCallbackSubscriptionBridge + : public CHIPKeypadInputClusterCecKeyCodeAttributeCallbackBridge { public: - CHIPKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackBridge(queue, handler, action, true), + CHIPKeypadInputClusterCecKeyCodeAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPKeypadInputClusterCecKeyCodeAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10340,27 +10284,26 @@ class CHIPKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackSubscriptionBr SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableKeypadInputClusterCecKeyCodeAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableKeypadInputClusterCecKeyCodeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackSubscriptionBridge - : public CHIPNullableKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackBridge +class CHIPNullableKeypadInputClusterCecKeyCodeAttributeCallbackSubscriptionBridge + : public CHIPNullableKeypadInputClusterCecKeyCodeAttributeCallbackBridge { public: - CHIPNullableKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableKeypadInputClusterCecKeyCodeAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableKeypadInputClusterCecKeyCodeAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10370,25 +10313,25 @@ class CHIPNullableKeypadInputClusterKeypadInputCecKeyCodeAttributeCallbackSubscr SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPKeypadInputClusterKeypadInputStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPKeypadInputClusterStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPKeypadInputClusterKeypadInputStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPKeypadInputClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::KeypadInput::KeypadInputStatus value); + static void OnSuccessFn(void * context, chip::app::Clusters::KeypadInput::StatusEnum value); }; -class CHIPKeypadInputClusterKeypadInputStatusAttributeCallbackSubscriptionBridge - : public CHIPKeypadInputClusterKeypadInputStatusAttributeCallbackBridge +class CHIPKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPKeypadInputClusterStatusEnumAttributeCallbackBridge { public: - CHIPKeypadInputClusterKeypadInputStatusAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPKeypadInputClusterKeypadInputStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPKeypadInputClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10398,27 +10341,26 @@ class CHIPKeypadInputClusterKeypadInputStatusAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableKeypadInputClusterKeypadInputStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableKeypadInputClusterKeypadInputStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableKeypadInputClusterKeypadInputStatusAttributeCallbackSubscriptionBridge - : public CHIPNullableKeypadInputClusterKeypadInputStatusAttributeCallbackBridge +class CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackBridge { public: - CHIPNullableKeypadInputClusterKeypadInputStatusAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableKeypadInputClusterKeypadInputStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPNullableKeypadInputClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10428,26 +10370,25 @@ class CHIPNullableKeypadInputClusterKeypadInputStatusAttributeCallbackSubscripti SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPContentLauncherClusterContentLaunchMetricTypeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPContentLauncherClusterContentLaunchMetricTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::ContentLauncher::ContentLaunchMetricType value); + static void OnSuccessFn(void * context, chip::app::Clusters::ContentLauncher::MetricTypeEnum value); }; -class CHIPContentLauncherClusterContentLaunchMetricTypeAttributeCallbackSubscriptionBridge - : public CHIPContentLauncherClusterContentLaunchMetricTypeAttributeCallbackBridge +class CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackBridge { public: - CHIPContentLauncherClusterContentLaunchMetricTypeAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPContentLauncherClusterContentLaunchMetricTypeAttributeCallbackBridge(queue, handler, action, true), + CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPContentLauncherClusterMetricTypeEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10457,30 +10398,27 @@ class CHIPContentLauncherClusterContentLaunchMetricTypeAttributeCallbackSubscrip SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableContentLauncherClusterContentLaunchMetricTypeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableContentLauncherClusterContentLaunchMetricTypeAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, - OnSuccessFn, keepAlive){}; + CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; - static void - OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableContentLauncherClusterContentLaunchMetricTypeAttributeCallbackSubscriptionBridge - : public CHIPNullableContentLauncherClusterContentLaunchMetricTypeAttributeCallbackBridge +class CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackBridge { public: - CHIPNullableContentLauncherClusterContentLaunchMetricTypeAttributeCallbackSubscriptionBridge( + CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableContentLauncherClusterContentLaunchMetricTypeAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableContentLauncherClusterMetricTypeEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10490,26 +10428,25 @@ class CHIPNullableContentLauncherClusterContentLaunchMetricTypeAttributeCallback SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPContentLauncherClusterContentLaunchParameterEnumAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPContentLauncherClusterParameterEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPContentLauncherClusterContentLaunchParameterEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPContentLauncherClusterParameterEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::ContentLauncher::ContentLaunchParameterEnum value); + static void OnSuccessFn(void * context, chip::app::Clusters::ContentLauncher::ParameterEnum value); }; -class CHIPContentLauncherClusterContentLaunchParameterEnumAttributeCallbackSubscriptionBridge - : public CHIPContentLauncherClusterContentLaunchParameterEnumAttributeCallbackBridge +class CHIPContentLauncherClusterParameterEnumAttributeCallbackSubscriptionBridge + : public CHIPContentLauncherClusterParameterEnumAttributeCallbackBridge { public: - CHIPContentLauncherClusterContentLaunchParameterEnumAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPContentLauncherClusterContentLaunchParameterEnumAttributeCallbackBridge(queue, handler, action, true), + CHIPContentLauncherClusterParameterEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPContentLauncherClusterParameterEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10519,30 +10456,27 @@ class CHIPContentLauncherClusterContentLaunchParameterEnumAttributeCallbackSubsc SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableContentLauncherClusterContentLaunchParameterEnumAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableContentLauncherClusterContentLaunchParameterEnumAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, - OnSuccessFn, keepAlive){}; + CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; - static void - OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableContentLauncherClusterContentLaunchParameterEnumAttributeCallbackSubscriptionBridge - : public CHIPNullableContentLauncherClusterContentLaunchParameterEnumAttributeCallbackBridge +class CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackBridge { public: - CHIPNullableContentLauncherClusterContentLaunchParameterEnumAttributeCallbackSubscriptionBridge( + CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableContentLauncherClusterContentLaunchParameterEnumAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableContentLauncherClusterParameterEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10552,26 +10486,25 @@ class CHIPNullableContentLauncherClusterContentLaunchParameterEnumAttributeCallb SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPContentLauncherClusterContentLaunchStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPContentLauncherClusterStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPContentLauncherClusterContentLaunchStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPContentLauncherClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::ContentLauncher::ContentLaunchStatus value); + static void OnSuccessFn(void * context, chip::app::Clusters::ContentLauncher::StatusEnum value); }; -class CHIPContentLauncherClusterContentLaunchStatusAttributeCallbackSubscriptionBridge - : public CHIPContentLauncherClusterContentLaunchStatusAttributeCallbackBridge +class CHIPContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPContentLauncherClusterStatusEnumAttributeCallbackBridge { public: - CHIPContentLauncherClusterContentLaunchStatusAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPContentLauncherClusterContentLaunchStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPContentLauncherClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10581,28 +10514,27 @@ class CHIPContentLauncherClusterContentLaunchStatusAttributeCallbackSubscription SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableContentLauncherClusterContentLaunchStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableContentLauncherClusterContentLaunchStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; - static void - OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableContentLauncherClusterContentLaunchStatusAttributeCallbackSubscriptionBridge - : public CHIPNullableContentLauncherClusterContentLaunchStatusAttributeCallbackBridge +class CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackBridge { public: - CHIPNullableContentLauncherClusterContentLaunchStatusAttributeCallbackSubscriptionBridge( + CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableContentLauncherClusterContentLaunchStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableContentLauncherClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10612,25 +10544,25 @@ class CHIPNullableContentLauncherClusterContentLaunchStatusAttributeCallbackSubs SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPAudioOutputClusterAudioOutputTypeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPAudioOutputClusterOutputTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPAudioOutputClusterAudioOutputTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + CHIPAudioOutputClusterOutputTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::AudioOutput::AudioOutputType value); + static void OnSuccessFn(void * context, chip::app::Clusters::AudioOutput::OutputTypeEnum value); }; -class CHIPAudioOutputClusterAudioOutputTypeAttributeCallbackSubscriptionBridge - : public CHIPAudioOutputClusterAudioOutputTypeAttributeCallbackBridge +class CHIPAudioOutputClusterOutputTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPAudioOutputClusterOutputTypeEnumAttributeCallbackBridge { public: - CHIPAudioOutputClusterAudioOutputTypeAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPAudioOutputClusterAudioOutputTypeAttributeCallbackBridge(queue, handler, action, true), + CHIPAudioOutputClusterOutputTypeEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPAudioOutputClusterOutputTypeEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10640,27 +10572,27 @@ class CHIPAudioOutputClusterAudioOutputTypeAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableAudioOutputClusterAudioOutputTypeAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableAudioOutputClusterOutputTypeEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableAudioOutputClusterAudioOutputTypeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPNullableAudioOutputClusterOutputTypeEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableAudioOutputClusterAudioOutputTypeAttributeCallbackSubscriptionBridge - : public CHIPNullableAudioOutputClusterAudioOutputTypeAttributeCallbackBridge +class CHIPNullableAudioOutputClusterOutputTypeEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableAudioOutputClusterOutputTypeEnumAttributeCallbackBridge { public: - CHIPNullableAudioOutputClusterAudioOutputTypeAttributeCallbackSubscriptionBridge( + CHIPNullableAudioOutputClusterOutputTypeEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableAudioOutputClusterAudioOutputTypeAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableAudioOutputClusterOutputTypeEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10670,26 +10602,25 @@ class CHIPNullableAudioOutputClusterAudioOutputTypeAttributeCallbackSubscription SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPApplicationLauncherClusterStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, - OnSuccessFn, keepAlive){}; + CHIPApplicationLauncherClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatus value); + static void OnSuccessFn(void * context, chip::app::Clusters::ApplicationLauncher::StatusEnum value); }; -class CHIPApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackSubscriptionBridge - : public CHIPApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackBridge +class CHIPApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPApplicationLauncherClusterStatusEnumAttributeCallbackBridge { public: - CHIPApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, - SubscriptionEstablishedHandler establishedHandler) : - CHIPApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPApplicationLauncherClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10699,30 +10630,27 @@ class CHIPApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackSu SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, - OnSuccessFn, keepAlive){}; + CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; - static void - OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + static void OnSuccessFn(void * context, + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackSubscriptionBridge - : public CHIPNullableApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackBridge +class CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackBridge { public: - CHIPNullableApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackSubscriptionBridge( + CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableApplicationLauncherClusterApplicationLauncherStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableApplicationLauncherClusterStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10732,26 +10660,26 @@ class CHIPNullableApplicationLauncherClusterApplicationLauncherStatusAttributeCa SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPApplicationBasicClusterApplicationBasicStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPApplicationBasicClusterApplicationBasicStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - CHIPActionBlock action, bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, OnSuccessFn, - keepAlive){}; + CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; - static void OnSuccessFn(void * context, chip::app::Clusters::ApplicationBasic::ApplicationBasicStatus value); + static void OnSuccessFn(void * context, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value); }; -class CHIPApplicationBasicClusterApplicationBasicStatusAttributeCallbackSubscriptionBridge - : public CHIPApplicationBasicClusterApplicationBasicStatusAttributeCallbackBridge +class CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge { public: - CHIPApplicationBasicClusterApplicationBasicStatusAttributeCallbackSubscriptionBridge( + CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPApplicationBasicClusterApplicationBasicStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} @@ -10761,30 +10689,29 @@ class CHIPApplicationBasicClusterApplicationBasicStatusAttributeCallbackSubscrip SubscriptionEstablishedHandler mEstablishedHandler; }; -class CHIPNullableApplicationBasicClusterApplicationBasicStatusAttributeCallbackBridge - : public CHIPCallbackBridge +class CHIPNullableApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge + : public CHIPCallbackBridge { public: - CHIPNullableApplicationBasicClusterApplicationBasicStatusAttributeCallbackBridge(dispatch_queue_t queue, - ResponseHandler handler, - CHIPActionBlock action, - bool keepAlive = false) : - CHIPCallbackBridge(queue, handler, action, - OnSuccessFn, keepAlive){}; + CHIPNullableApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, + OnSuccessFn, keepAlive){}; static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable & value); + const chip::app::DataModel::Nullable & value); }; -class CHIPNullableApplicationBasicClusterApplicationBasicStatusAttributeCallbackSubscriptionBridge - : public CHIPNullableApplicationBasicClusterApplicationBasicStatusAttributeCallbackBridge +class CHIPNullableApplicationBasicClusterApplicationStatusEnumAttributeCallbackSubscriptionBridge + : public CHIPNullableApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge { public: - CHIPNullableApplicationBasicClusterApplicationBasicStatusAttributeCallbackSubscriptionBridge( + CHIPNullableApplicationBasicClusterApplicationStatusEnumAttributeCallbackSubscriptionBridge( dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, SubscriptionEstablishedHandler establishedHandler) : - CHIPNullableApplicationBasicClusterApplicationBasicStatusAttributeCallbackBridge(queue, handler, action, true), + CHIPNullableApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge(queue, handler, action, true), mEstablishedHandler(establishedHandler) {} diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 42dabdd81919e4..be721e0dc860cd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -66,11 +66,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPAccountLogin : CHIPCluster -- (void)getSetupPINWithParams:(CHIPAccountLoginClusterGetSetupPINParams *)params - completionHandler:(void (^)(CHIPAccountLoginClusterGetSetupPINResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)loginWithParams:(CHIPAccountLoginClusterLoginParams *)params completionHandler:(StatusCompletion)completionHandler; -- (void)logoutWithCompletionHandler:(StatusCompletion)completionHandler; +- (void)getSetupPINRequestWithParams:(CHIPAccountLoginClusterGetSetupPINRequestParams *)params + completionHandler:(void (^)(CHIPAccountLoginClusterGetSetupPINResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)loginRequestWithParams:(CHIPAccountLoginClusterLoginRequestParams *)params + completionHandler:(StatusCompletion)completionHandler; +- (void)logoutRequestWithCompletionHandler:(StatusCompletion)completionHandler; - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -125,9 +126,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPApplicationBasic : CHIPCluster -- (void)changeStatusWithParams:(CHIPApplicationBasicClusterChangeStatusParams *)params - completionHandler:(StatusCompletion)completionHandler; - - (void)readAttributeVendorNameWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler; - (void)subscribeAttributeVendorNameWithMinInterval:(uint16_t)minInterval @@ -173,6 +171,9 @@ NS_ASSUME_NONNULL_BEGIN reportHandler: (void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeAllowedVendorListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler; + - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -192,15 +193,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPApplicationLauncher : CHIPCluster -- (void)hideAppWithParams:(CHIPApplicationLauncherClusterHideAppParams *)params - completionHandler:(void (^)(CHIPApplicationLauncherClusterHideAppResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)launchAppWithParams:(CHIPApplicationLauncherClusterLaunchAppParams *)params - completionHandler:(void (^)(CHIPApplicationLauncherClusterLaunchAppResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)stopAppWithParams:(CHIPApplicationLauncherClusterStopAppParams *)params - completionHandler:(void (^)(CHIPApplicationLauncherClusterStopAppResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; +- (void)hideAppRequestWithParams:(CHIPApplicationLauncherClusterHideAppRequestParams *)params + completionHandler:(void (^)(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)launchAppRequestWithParams:(CHIPApplicationLauncherClusterLaunchAppRequestParams *)params + completionHandler:(void (^)(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)stopAppRequestWithParams:(CHIPApplicationLauncherClusterStopAppRequestParams *)params + completionHandler:(void (^)(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; - (void)readAttributeApplicationLauncherListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -230,10 +231,10 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPAudioOutput : CHIPCluster -- (void)renameOutputWithParams:(CHIPAudioOutputClusterRenameOutputParams *)params - completionHandler:(StatusCompletion)completionHandler; -- (void)selectOutputWithParams:(CHIPAudioOutputClusterSelectOutputParams *)params - completionHandler:(StatusCompletion)completionHandler; +- (void)renameOutputRequestWithParams:(CHIPAudioOutputClusterRenameOutputRequestParams *)params + completionHandler:(StatusCompletion)completionHandler; +- (void)selectOutputRequestWithParams:(CHIPAudioOutputClusterSelectOutputRequestParams *)params + completionHandler:(StatusCompletion)completionHandler; - (void)readAttributeAudioOutputListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -663,6 +664,40 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Channel + * + */ +@interface CHIPChannel : CHIPCluster + +- (void)changeChannelByNumberRequestWithParams:(CHIPChannelClusterChangeChannelByNumberRequestParams *)params + completionHandler:(StatusCompletion)completionHandler; +- (void)changeChannelRequestWithParams:(CHIPChannelClusterChangeChannelRequestParams *)params + completionHandler:(void (^)(CHIPChannelClusterChangeChannelResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)skipChannelRequestWithParams:(CHIPChannelClusterSkipChannelRequestParams *)params + completionHandler:(StatusCompletion)completionHandler; + +- (void)readAttributeChannelListWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeChannelListWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; + +- (void)readAttributeAttributeListWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler; + +- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeClusterRevisionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; + +@end + /** * Cluster Color Control * @@ -1147,20 +1182,20 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPContentLauncher : CHIPCluster -- (void)launchContentWithParams:(CHIPContentLauncherClusterLaunchContentParams *)params - completionHandler:(void (^)(CHIPContentLauncherClusterLaunchContentResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)launchURLWithParams:(CHIPContentLauncherClusterLaunchURLParams *)params - completionHandler:(void (^)(CHIPContentLauncherClusterLaunchURLResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; +- (void)launchContentRequestWithParams:(CHIPContentLauncherClusterLaunchContentRequestParams *)params + completionHandler:(void (^)(CHIPContentLauncherClusterLaunchResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)launchURLRequestWithParams:(CHIPContentLauncherClusterLaunchURLRequestParams *)params + completionHandler:(void (^)(CHIPContentLauncherClusterLaunchResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; -- (void)readAttributeAcceptsHeaderListWithCompletionHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeAcceptsHeaderListWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeAcceptHeaderListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeAcceptHeaderListWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; - (void)readAttributeSupportedStreamingProtocolsWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -1808,18 +1843,36 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPGroupKeyManagement : CHIPCluster -- (void)readAttributeGroupsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeGroupsWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)keySetReadWithParams:(CHIPGroupKeyManagementClusterKeySetReadParams *)params + completionHandler:(void (^)(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)keySetReadAllIndicesWithParams:(CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams *)params + completionHandler:(void (^)(CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)keySetRemoveWithParams:(CHIPGroupKeyManagementClusterKeySetRemoveParams *)params + completionHandler:(StatusCompletion)completionHandler; +- (void)keySetWriteWithParams:(CHIPGroupKeyManagementClusterKeySetWriteParams *)params + completionHandler:(StatusCompletion)completionHandler; -- (void)readAttributeGroupKeysWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeGroupKeysWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeGroupKeyMapWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeGroupKeyMapWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; + +- (void)readAttributeGroupTableWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeGroupTableWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; + +- (void)readAttributeMaxGroupsPerFabricWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; + +- (void)readAttributeMaxGroupKeysPerFabricWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -1982,9 +2035,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPKeypadInput : CHIPCluster -- (void)sendKeyWithParams:(CHIPKeypadInputClusterSendKeyParams *)params - completionHandler: - (void (^)(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; +- (void)sendKeyRequestWithParams:(CHIPKeypadInputClusterSendKeyRequestParams *)params + completionHandler:(void (^)(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -2175,12 +2228,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPMediaInput : CHIPCluster -- (void)hideInputStatusWithCompletionHandler:(StatusCompletion)completionHandler; -- (void)renameInputWithParams:(CHIPMediaInputClusterRenameInputParams *)params - completionHandler:(StatusCompletion)completionHandler; -- (void)selectInputWithParams:(CHIPMediaInputClusterSelectInputParams *)params - completionHandler:(StatusCompletion)completionHandler; -- (void)showInputStatusWithCompletionHandler:(StatusCompletion)completionHandler; +- (void)hideInputStatusRequestWithCompletionHandler:(StatusCompletion)completionHandler; +- (void)renameInputRequestWithParams:(CHIPMediaInputClusterRenameInputRequestParams *)params + completionHandler:(StatusCompletion)completionHandler; +- (void)selectInputRequestWithParams:(CHIPMediaInputClusterSelectInputRequestParams *)params + completionHandler:(StatusCompletion)completionHandler; +- (void)showInputStatusRequestWithCompletionHandler:(StatusCompletion)completionHandler; - (void)readAttributeMediaInputListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -2217,31 +2270,31 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPMediaPlayback : CHIPCluster -- (void)mediaFastForwardWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaFastForwardResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)mediaNextWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaNextResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)mediaPauseWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaPauseResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)mediaPlayWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaPlayResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)mediaPreviousWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaPreviousResponseParams * _Nullable data, +- (void)fastForwardRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)nextRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)pauseRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)playRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)previousRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)rewindRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; -- (void)mediaRewindWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaRewindResponseParams * _Nullable data, +- (void)seekRequestWithParams:(CHIPMediaPlaybackClusterSeekRequestParams *)params + completionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)skipBackwardRequestWithParams:(CHIPMediaPlaybackClusterSkipBackwardRequestParams *)params + completionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)skipForwardRequestWithParams:(CHIPMediaPlaybackClusterSkipForwardRequestParams *)params + completionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)startOverRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; +- (void)stopRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, NSError * _Nullable error))completionHandler; -- (void)mediaSeekWithParams:(CHIPMediaPlaybackClusterMediaSeekParams *)params - completionHandler:(void (^)(CHIPMediaPlaybackClusterMediaSeekResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)mediaSkipBackwardWithParams:(CHIPMediaPlaybackClusterMediaSkipBackwardParams *)params - completionHandler:(void (^)(CHIPMediaPlaybackClusterMediaSkipBackwardResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)mediaSkipForwardWithParams:(CHIPMediaPlaybackClusterMediaSkipForwardParams *)params - completionHandler:(void (^)(CHIPMediaPlaybackClusterMediaSkipForwardResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)mediaStartOverWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaStartOverResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)mediaStopWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaStopResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; - (void)readAttributePlaybackStateWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -2459,14 +2512,15 @@ NS_ASSUME_NONNULL_BEGIN - (void)announceOtaProviderWithParams:(CHIPOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderParams *)params completionHandler:(StatusCompletion)completionHandler; -- (void)readAttributeDefaultOtaProviderWithCompletionHandler:(void (^)(NSData * _Nullable value, - NSError * _Nullable error))completionHandler; -- (void)writeAttributeDefaultOtaProviderWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)subscribeAttributeDefaultOtaProviderWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeDefaultOtaProvidersWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)writeAttributeDefaultOtaProvidersWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)subscribeAttributeDefaultOtaProvidersWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; - (void)readAttributeUpdatePossibleWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; @@ -2476,6 +2530,22 @@ NS_ASSUME_NONNULL_BEGIN reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; +- (void)readAttributeUpdateStateWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeUpdateStateWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; + +- (void)readAttributeUpdateStateProgressWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeUpdateStateProgressWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; + - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -3332,48 +3402,15 @@ NS_ASSUME_NONNULL_BEGIN @end -/** - * Cluster TV Channel - * - */ -@interface CHIPTvChannel : CHIPCluster - -- (void)changeChannelWithParams:(CHIPTvChannelClusterChangeChannelParams *)params - completionHandler:(void (^)(CHIPTvChannelClusterChangeChannelResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; -- (void)changeChannelByNumberWithParams:(CHIPTvChannelClusterChangeChannelByNumberParams *)params - completionHandler:(StatusCompletion)completionHandler; -- (void)skipChannelWithParams:(CHIPTvChannelClusterSkipChannelParams *)params completionHandler:(StatusCompletion)completionHandler; - -- (void)readAttributeChannelListWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeChannelListWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler; - -- (void)readAttributeAttributeListWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler; - -- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler; -- (void)subscribeAttributeClusterRevisionWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; - -@end - /** * Cluster Target Navigator * */ @interface CHIPTargetNavigator : CHIPCluster -- (void)navigateTargetWithParams:(CHIPTargetNavigatorClusterNavigateTargetParams *)params - completionHandler:(void (^)(CHIPTargetNavigatorClusterNavigateTargetResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler; +- (void)navigateTargetRequestWithParams:(CHIPTargetNavigatorClusterNavigateTargetRequestParams *)params + completionHandler:(void (^)(CHIPTargetNavigatorClusterNavigateTargetResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler; - (void)readAttributeTargetNavigatorListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -3386,6 +3423,12 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeCurrentNavigatorTargetWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)subscribeAttributeCurrentNavigatorTargetWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))reportHandler; - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; @@ -4946,6 +4989,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeLabelListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index c26fefa3c323ba..1dabf9f13951c6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -287,26 +287,27 @@ @implementation CHIPAccountLogin return &_cppCluster; } -- (void)getSetupPINWithParams:(CHIPAccountLoginClusterGetSetupPINParams *)params - completionHandler:(void (^)(CHIPAccountLoginClusterGetSetupPINResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)getSetupPINRequestWithParams:(CHIPAccountLoginClusterGetSetupPINRequestParams *)params + completionHandler:(void (^)(CHIPAccountLoginClusterGetSetupPINResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - AccountLogin::Commands::GetSetupPIN::Type request; + AccountLogin::Commands::GetSetupPINRequest::Type request; request.tempAccountIdentifier = [self asCharSpan:params.tempAccountIdentifier]; new CHIPAccountLoginClusterGetSetupPINResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall, 10000); }); } -- (void)loginWithParams:(CHIPAccountLoginClusterLoginParams *)params completionHandler:(StatusCompletion)completionHandler +- (void)loginRequestWithParams:(CHIPAccountLoginClusterLoginRequestParams *)params + completionHandler:(StatusCompletion)completionHandler { ListFreer listFreer; - AccountLogin::Commands::Login::Type request; + AccountLogin::Commands::LoginRequest::Type request; request.tempAccountIdentifier = [self asCharSpan:params.tempAccountIdentifier]; request.setupPIN = [self asCharSpan:params.setupPIN]; @@ -322,10 +323,10 @@ new CHIPCommandSuccessCallbackBridge( }); } -- (void)logoutWithCompletionHandler:(StatusCompletion)completionHandler +- (void)logoutRequestWithCompletionHandler:(StatusCompletion)completionHandler { ListFreer listFreer; - AccountLogin::Commands::Logout::Type request; + AccountLogin::Commands::LogoutRequest::Type request; new CHIPCommandSuccessCallbackBridge( self.callbackQueue, @@ -335,7 +336,7 @@ new CHIPCommandSuccessCallbackBridge( ^(Cancelable * success, Cancelable * failure) { auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall, 10000); }); } @@ -532,25 +533,6 @@ @implementation CHIPApplicationBasic return &_cppCluster; } -- (void)changeStatusWithParams:(CHIPApplicationBasicClusterChangeStatusParams *)params - completionHandler:(StatusCompletion)completionHandler -{ - ListFreer listFreer; - ApplicationBasic::Commands::ChangeStatus::Type request; - request.status = static_cast>(params.status.unsignedCharValue); - - new CHIPCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - - (void)readAttributeVendorNameWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler { @@ -667,12 +649,13 @@ new CHIPInt16uAttributeCallbackSubscriptionBridge( - (void)readAttributeApplicationStatusWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = ApplicationBasic::Attributes::ApplicationStatus::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ApplicationBasic::Attributes::ApplicationStatus::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeApplicationStatusWithMinInterval:(uint16_t)minInterval @@ -681,14 +664,15 @@ - (void)subscribeAttributeApplicationStatusWithMinInterval:(uint16_t)minInterval reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt8uAttributeCallbackSubscriptionBridge( + new CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = ApplicationBasic::Attributes::ApplicationStatus::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, + CHIPApplicationBasicClusterApplicationStatusEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -722,6 +706,18 @@ new CHIPCharStringAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } +- (void)readAttributeAllowedVendorListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPApplicationBasicAllowedVendorListListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ApplicationBasic::Attributes::AllowedVendorList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler { @@ -772,53 +768,59 @@ @implementation CHIPApplicationLauncher return &_cppCluster; } -- (void)hideAppWithParams:(CHIPApplicationLauncherClusterHideAppParams *)params - completionHandler:(void (^)(CHIPApplicationLauncherClusterHideAppResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)hideAppRequestWithParams:(CHIPApplicationLauncherClusterHideAppRequestParams *)params + completionHandler:(void (^)(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - ApplicationLauncher::Commands::HideApp::Type request; + ApplicationLauncher::Commands::HideAppRequest::Type request; request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; + request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; + request.application.applicationId = [self asCharSpan:params.application.applicationId]; request.application.applicationId = [self asCharSpan:params.application.applicationId]; - new CHIPApplicationLauncherClusterHideAppResponseCallbackBridge( + new CHIPApplicationLauncherClusterLauncherResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)launchAppWithParams:(CHIPApplicationLauncherClusterLaunchAppParams *)params - completionHandler:(void (^)(CHIPApplicationLauncherClusterLaunchAppResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)launchAppRequestWithParams:(CHIPApplicationLauncherClusterLaunchAppRequestParams *)params + completionHandler:(void (^)(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - ApplicationLauncher::Commands::LaunchApp::Type request; + ApplicationLauncher::Commands::LaunchAppRequest::Type request; request.data = [self asCharSpan:params.data]; request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; + request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; + request.application.applicationId = [self asCharSpan:params.application.applicationId]; request.application.applicationId = [self asCharSpan:params.application.applicationId]; - new CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge( + new CHIPApplicationLauncherClusterLauncherResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)stopAppWithParams:(CHIPApplicationLauncherClusterStopAppParams *)params - completionHandler:(void (^)(CHIPApplicationLauncherClusterStopAppResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)stopAppRequestWithParams:(CHIPApplicationLauncherClusterStopAppRequestParams *)params + completionHandler:(void (^)(CHIPApplicationLauncherClusterLauncherResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - ApplicationLauncher::Commands::StopApp::Type request; + ApplicationLauncher::Commands::StopAppRequest::Type request; + request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; request.application.catalogVendorId = params.application.catalogVendorId.unsignedShortValue; request.application.applicationId = [self asCharSpan:params.application.applicationId]; + request.application.applicationId = [self asCharSpan:params.application.applicationId]; - new CHIPApplicationLauncherClusterStopAppResponseCallbackBridge( + new CHIPApplicationLauncherClusterLauncherResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); @@ -906,11 +908,11 @@ @implementation CHIPAudioOutput return &_cppCluster; } -- (void)renameOutputWithParams:(CHIPAudioOutputClusterRenameOutputParams *)params - completionHandler:(StatusCompletion)completionHandler +- (void)renameOutputRequestWithParams:(CHIPAudioOutputClusterRenameOutputRequestParams *)params + completionHandler:(StatusCompletion)completionHandler { ListFreer listFreer; - AudioOutput::Commands::RenameOutput::Type request; + AudioOutput::Commands::RenameOutputRequest::Type request; request.index = params.index.unsignedCharValue; request.name = [self asCharSpan:params.name]; @@ -926,11 +928,11 @@ new CHIPCommandSuccessCallbackBridge( }); } -- (void)selectOutputWithParams:(CHIPAudioOutputClusterSelectOutputParams *)params - completionHandler:(StatusCompletion)completionHandler +- (void)selectOutputRequestWithParams:(CHIPAudioOutputClusterSelectOutputRequestParams *)params + completionHandler:(StatusCompletion)completionHandler { ListFreer listFreer; - AudioOutput::Commands::SelectOutput::Type request; + AudioOutput::Commands::SelectOutputRequest::Type request; request.index = params.index.unsignedCharValue; new CHIPCommandSuccessCallbackBridge( @@ -2708,6 +2710,140 @@ new CHIPInt16uAttributeCallbackSubscriptionBridge( @end +@implementation CHIPChannel + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)changeChannelByNumberRequestWithParams:(CHIPChannelClusterChangeChannelByNumberRequestParams *)params + completionHandler:(StatusCompletion)completionHandler +{ + ListFreer listFreer; + Channel::Commands::ChangeChannelByNumberRequest::Type request; + request.majorNumber = params.majorNumber.unsignedShortValue; + request.minorNumber = params.minorNumber.unsignedShortValue; + + new CHIPCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)changeChannelRequestWithParams:(CHIPChannelClusterChangeChannelRequestParams *)params + completionHandler:(void (^)(CHIPChannelClusterChangeChannelResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler +{ + ListFreer listFreer; + Channel::Commands::ChangeChannelRequest::Type request; + request.match = [self asCharSpan:params.match]; + + new CHIPChannelClusterChangeChannelResponseCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)skipChannelRequestWithParams:(CHIPChannelClusterSkipChannelRequestParams *)params + completionHandler:(StatusCompletion)completionHandler +{ + ListFreer listFreer; + Channel::Commands::SkipChannelRequest::Type request; + request.count = params.count.unsignedShortValue; + + new CHIPCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)readAttributeChannelListWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPChannelChannelListListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Channel::Attributes::ChannelList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeChannelListWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPChannelChannelListListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Channel::Attributes::ChannelList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, CHIPChannelChannelListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + +- (void)readAttributeAttributeListWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPChannelAttributeListListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Channel::Attributes::AttributeList::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Channel::Attributes::ClusterRevision::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeClusterRevisionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt16uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Channel::Attributes::ClusterRevision::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + +@end + @implementation CHIPColorControl - (chip::Controller::ClusterBase *)getCluster @@ -4922,12 +5058,12 @@ @implementation CHIPContentLauncher return &_cppCluster; } -- (void)launchContentWithParams:(CHIPContentLauncherClusterLaunchContentParams *)params - completionHandler:(void (^)(CHIPContentLauncherClusterLaunchContentResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)launchContentRequestWithParams:(CHIPContentLauncherClusterLaunchContentRequestParams *)params + completionHandler:(void (^)(CHIPContentLauncherClusterLaunchResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - ContentLauncher::Commands::LaunchContent::Type request; + ContentLauncher::Commands::LaunchContentRequest::Type request; request.autoPlay = params.autoPlay.boolValue; request.data = [self asCharSpan:params.data]; { @@ -4940,37 +5076,59 @@ - (void)launchContentWithParams:(CHIPContentLauncherClusterLaunchContentParams * } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < params.search.count; ++i_0) { - if (![params.search[i_0] isKindOfClass:[CHIPContentLauncherClusterContentLaunchParamater class]]) { + if (![params.search[i_0] isKindOfClass:[CHIPContentLauncherClusterContentSearch class]]) { // Wrong kind of value. return; } - auto element_0 = (CHIPContentLauncherClusterContentLaunchParamater *) params.search[i_0]; - listHolder_0->mList[i_0].type = static_castmList[i_0].type)>>( - element_0.type.unsignedCharValue); - listHolder_0->mList[i_0].value = [self asCharSpan:element_0.value]; + auto element_0 = (CHIPContentLauncherClusterContentSearch *) params.search[i_0]; { - using ListType_2 = std::remove_reference_tmList[i_0].externalIDList)>; + using ListType_2 = std::remove_reference_tmList[i_0].parameterList)>; using ListMemberType_2 = ListMemberTypeGetter::Type; - if (element_0.externalIDList.count != 0) { - auto * listHolder_2 = new ListHolder(element_0.externalIDList.count); + if (element_0.parameterList.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.parameterList.count); if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { return; } listFreer.add(listHolder_2); - for (size_t i_2 = 0; i_2 < element_0.externalIDList.count; ++i_2) { - if (![element_0.externalIDList[i_2] - isKindOfClass:[CHIPContentLauncherClusterContentLaunchAdditionalInfo class]]) { + for (size_t i_2 = 0; i_2 < element_0.parameterList.count; ++i_2) { + if (![element_0.parameterList[i_2] isKindOfClass:[CHIPContentLauncherClusterParameter class]]) { // Wrong kind of value. return; } - auto element_2 - = (CHIPContentLauncherClusterContentLaunchAdditionalInfo *) element_0.externalIDList[i_2]; - listHolder_2->mList[i_2].name = [self asCharSpan:element_2.name]; + auto element_2 = (CHIPContentLauncherClusterParameter *) element_0.parameterList[i_2]; + listHolder_2->mList[i_2].type + = static_castmList[i_2].type)>>( + element_2.type.unsignedCharValue); listHolder_2->mList[i_2].value = [self asCharSpan:element_2.value]; + { + using ListType_4 = std::remove_reference_tmList[i_2].externalIDList)>; + using ListMemberType_4 = ListMemberTypeGetter::Type; + if (element_2.externalIDList.count != 0) { + auto * listHolder_4 = new ListHolder(element_2.externalIDList.count); + if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) { + return; + } + listFreer.add(listHolder_4); + for (size_t i_4 = 0; i_4 < element_2.externalIDList.count; ++i_4) { + if (![element_2.externalIDList[i_4] + isKindOfClass:[CHIPContentLauncherClusterAdditionalInfo class]]) { + // Wrong kind of value. + return; + } + auto element_4 = (CHIPContentLauncherClusterAdditionalInfo *) element_2.externalIDList[i_4]; + listHolder_4->mList[i_4].name = [self asCharSpan:element_4.name]; + listHolder_4->mList[i_4].value = [self asCharSpan:element_4.value]; + } + listHolder_2->mList[i_2].externalIDList + = ListType_4(listHolder_4->mList, element_2.externalIDList.count); + } else { + listHolder_2->mList[i_2].externalIDList = ListType_4(); + } + } } - listHolder_0->mList[i_0].externalIDList = ListType_2(listHolder_2->mList, element_0.externalIDList.count); + listHolder_0->mList[i_0].parameterList = ListType_2(listHolder_2->mList, element_0.parameterList.count); } else { - listHolder_0->mList[i_0].externalIDList = ListType_2(); + listHolder_0->mList[i_0].parameterList = ListType_2(); } } } @@ -4980,116 +5138,94 @@ - (void)launchContentWithParams:(CHIPContentLauncherClusterLaunchContentParams * } } - new CHIPContentLauncherClusterLaunchContentResponseCallbackBridge( + new CHIPContentLauncherClusterLaunchResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)launchURLWithParams:(CHIPContentLauncherClusterLaunchURLParams *)params - completionHandler:(void (^)(CHIPContentLauncherClusterLaunchURLResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)launchURLRequestWithParams:(CHIPContentLauncherClusterLaunchURLRequestParams *)params + completionHandler:(void (^)(CHIPContentLauncherClusterLaunchResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - ContentLauncher::Commands::LaunchURL::Type request; + ContentLauncher::Commands::LaunchURLRequest::Type request; request.contentURL = [self asCharSpan:params.contentURL]; request.displayString = [self asCharSpan:params.displayString]; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (params.brandingInformation.count != 0) { - auto * listHolder_0 = new ListHolder(params.brandingInformation.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < params.brandingInformation.count; ++i_0) { - if (![params.brandingInformation[i_0] - isKindOfClass:[CHIPContentLauncherClusterContentLaunchBrandingInformation class]]) { - // Wrong kind of value. - return; - } - auto element_0 = (CHIPContentLauncherClusterContentLaunchBrandingInformation *) params.brandingInformation[i_0]; - listHolder_0->mList[i_0].providerName = [self asCharSpan:element_0.providerName]; - listHolder_0->mList[i_0].background.imageUrl = [self asCharSpan:element_0.background.imageUrl]; - listHolder_0->mList[i_0].background.color = [self asCharSpan:element_0.background.color]; - listHolder_0->mList[i_0].background.size.width = element_0.background.size.width.doubleValue; - listHolder_0->mList[i_0].background.size.height = element_0.background.size.height.doubleValue; - listHolder_0->mList[i_0].background.size.metric - = static_castmList[i_0].background.size.metric)>>( - element_0.background.size.metric.unsignedCharValue); - listHolder_0->mList[i_0].logo.imageUrl = [self asCharSpan:element_0.logo.imageUrl]; - listHolder_0->mList[i_0].logo.color = [self asCharSpan:element_0.logo.color]; - listHolder_0->mList[i_0].logo.size.width = element_0.logo.size.width.doubleValue; - listHolder_0->mList[i_0].logo.size.height = element_0.logo.size.height.doubleValue; - listHolder_0->mList[i_0].logo.size.metric - = static_castmList[i_0].logo.size.metric)>>( - element_0.logo.size.metric.unsignedCharValue); - listHolder_0->mList[i_0].progressBar.imageUrl = [self asCharSpan:element_0.progressBar.imageUrl]; - listHolder_0->mList[i_0].progressBar.color = [self asCharSpan:element_0.progressBar.color]; - listHolder_0->mList[i_0].progressBar.size.width = element_0.progressBar.size.width.doubleValue; - listHolder_0->mList[i_0].progressBar.size.height = element_0.progressBar.size.height.doubleValue; - listHolder_0->mList[i_0].progressBar.size.metric - = static_castmList[i_0].progressBar.size.metric)>>( - element_0.progressBar.size.metric.unsignedCharValue); - listHolder_0->mList[i_0].splash.imageUrl = [self asCharSpan:element_0.splash.imageUrl]; - listHolder_0->mList[i_0].splash.color = [self asCharSpan:element_0.splash.color]; - listHolder_0->mList[i_0].splash.size.width = element_0.splash.size.width.doubleValue; - listHolder_0->mList[i_0].splash.size.height = element_0.splash.size.height.doubleValue; - listHolder_0->mList[i_0].splash.size.metric - = static_castmList[i_0].splash.size.metric)>>( - element_0.splash.size.metric.unsignedCharValue); - listHolder_0->mList[i_0].waterMark.imageUrl = [self asCharSpan:element_0.waterMark.imageUrl]; - listHolder_0->mList[i_0].waterMark.color = [self asCharSpan:element_0.waterMark.color]; - listHolder_0->mList[i_0].waterMark.size.width = element_0.waterMark.size.width.doubleValue; - listHolder_0->mList[i_0].waterMark.size.height = element_0.waterMark.size.height.doubleValue; - listHolder_0->mList[i_0].waterMark.size.metric - = static_castmList[i_0].waterMark.size.metric)>>( - element_0.waterMark.size.metric.unsignedCharValue); - } - request.brandingInformation = ListType_0(listHolder_0->mList, params.brandingInformation.count); - } else { - request.brandingInformation = ListType_0(); - } - } - - new CHIPContentLauncherClusterLaunchURLResponseCallbackBridge( + request.brandingInformation.providerName = [self asCharSpan:params.brandingInformation.providerName]; + request.brandingInformation.background.imageUrl = [self asCharSpan:params.brandingInformation.background.imageUrl]; + request.brandingInformation.background.color = [self asCharSpan:params.brandingInformation.background.color]; + request.brandingInformation.background.size.width = params.brandingInformation.background.size.width.doubleValue; + request.brandingInformation.background.size.height = params.brandingInformation.background.size.height.doubleValue; + request.brandingInformation.background.size.metric + = static_cast>( + params.brandingInformation.background.size.metric.unsignedCharValue); + request.brandingInformation.logo.imageUrl = [self asCharSpan:params.brandingInformation.logo.imageUrl]; + request.brandingInformation.logo.color = [self asCharSpan:params.brandingInformation.logo.color]; + request.brandingInformation.logo.size.width = params.brandingInformation.logo.size.width.doubleValue; + request.brandingInformation.logo.size.height = params.brandingInformation.logo.size.height.doubleValue; + request.brandingInformation.logo.size.metric + = static_cast>( + params.brandingInformation.logo.size.metric.unsignedCharValue); + request.brandingInformation.progressBar.imageUrl = [self asCharSpan:params.brandingInformation.progressBar.imageUrl]; + request.brandingInformation.progressBar.color = [self asCharSpan:params.brandingInformation.progressBar.color]; + request.brandingInformation.progressBar.size.width = params.brandingInformation.progressBar.size.width.doubleValue; + request.brandingInformation.progressBar.size.height = params.brandingInformation.progressBar.size.height.doubleValue; + request.brandingInformation.progressBar.size.metric + = static_cast>( + params.brandingInformation.progressBar.size.metric.unsignedCharValue); + request.brandingInformation.splash.imageUrl = [self asCharSpan:params.brandingInformation.splash.imageUrl]; + request.brandingInformation.splash.color = [self asCharSpan:params.brandingInformation.splash.color]; + request.brandingInformation.splash.size.width = params.brandingInformation.splash.size.width.doubleValue; + request.brandingInformation.splash.size.height = params.brandingInformation.splash.size.height.doubleValue; + request.brandingInformation.splash.size.metric + = static_cast>( + params.brandingInformation.splash.size.metric.unsignedCharValue); + request.brandingInformation.waterMark.imageUrl = [self asCharSpan:params.brandingInformation.waterMark.imageUrl]; + request.brandingInformation.waterMark.color = [self asCharSpan:params.brandingInformation.waterMark.color]; + request.brandingInformation.waterMark.size.width = params.brandingInformation.waterMark.size.width.doubleValue; + request.brandingInformation.waterMark.size.height = params.brandingInformation.waterMark.size.height.doubleValue; + request.brandingInformation.waterMark.size.metric + = static_cast>( + params.brandingInformation.waterMark.size.metric.unsignedCharValue); + + new CHIPContentLauncherClusterLaunchResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)readAttributeAcceptsHeaderListWithCompletionHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completionHandler +- (void)readAttributeAcceptHeaderListWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler { - new CHIPContentLauncherAcceptsHeaderListListAttributeCallbackBridge( + new CHIPContentLauncherAcceptHeaderListListAttributeCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = ContentLauncher::Attributes::AcceptsHeaderList::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = ContentLauncher::Attributes::AcceptHeaderList::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeAcceptsHeaderListWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeAcceptHeaderListWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPContentLauncherAcceptsHeaderListListAttributeCallbackSubscriptionBridge( + new CHIPContentLauncherAcceptHeaderListListAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = ContentLauncher::Attributes::AcceptsHeaderList::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = ContentLauncher::Attributes::AcceptHeaderList::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, minInterval, maxInterval, - CHIPContentLauncherAcceptsHeaderListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + CHIPContentLauncherAcceptHeaderListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -7580,65 +7716,188 @@ @implementation CHIPGroupKeyManagement return &_cppCluster; } -- (void)readAttributeGroupsWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +- (void)keySetReadWithParams:(CHIPGroupKeyManagementClusterKeySetReadParams *)params + completionHandler:(void (^)(CHIPGroupKeyManagementClusterKeySetReadResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { - new CHIPGroupKeyManagementGroupsListAttributeCallbackBridge( + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetRead::Type request; + request.groupKeySetID = params.groupKeySetID.unsignedShortValue; + + new CHIPGroupKeyManagementClusterKeySetReadResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = GroupKeyManagement::Attributes::Groups::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeGroupsWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +- (void)keySetReadAllIndicesWithParams:(CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams *)params + completionHandler:(void (^)(CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { - new CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge( - self.callbackQueue, reportHandler, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = GroupKeyManagement::Attributes::Groups::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, - CHIPGroupKeyManagementGroupsListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); - }, - subscriptionEstablishedHandler); -} + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetReadAllIndices::Type request; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (params.groupKeySetIDs.count != 0) { + auto * listHolder_0 = new ListHolder(params.groupKeySetIDs.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < params.groupKeySetIDs.count; ++i_0) { + if (![params.groupKeySetIDs[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return; + } + auto element_0 = (NSNumber *) params.groupKeySetIDs[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedShortValue; + } + request.groupKeySetIDs = ListType_0(listHolder_0->mList, params.groupKeySetIDs.count); + } else { + request.groupKeySetIDs = ListType_0(); + } + } -- (void)readAttributeGroupKeysWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPGroupKeyManagementGroupKeysListAttributeCallbackBridge( + new CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = GroupKeyManagement::Attributes::GroupKeys::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn + = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeGroupKeysWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +- (void)keySetRemoveWithParams:(CHIPGroupKeyManagementClusterKeySetRemoveParams *)params + completionHandler:(StatusCompletion)completionHandler { - new CHIPGroupKeyManagementGroupKeysListAttributeCallbackSubscriptionBridge( - self.callbackQueue, reportHandler, + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetRemove::Type request; + request.groupKeySetID = params.groupKeySetID.unsignedShortValue; + + new CHIPCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = GroupKeyManagement::Attributes::GroupKeys::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)keySetWriteWithParams:(CHIPGroupKeyManagementClusterKeySetWriteParams *)params + completionHandler:(StatusCompletion)completionHandler +{ + ListFreer listFreer; + GroupKeyManagement::Commands::KeySetWrite::Type request; + request.groupKeySet.groupKeySetID = params.groupKeySet.groupKeySetID.unsignedShortValue; + request.groupKeySet.securityPolicy = static_cast>( + params.groupKeySet.securityPolicy.unsignedCharValue); + request.groupKeySet.epochKey0 = [self asByteSpan:params.groupKeySet.epochKey0]; + request.groupKeySet.epochStartTime0 = params.groupKeySet.epochStartTime0.unsignedLongLongValue; + request.groupKeySet.epochKey1 = [self asByteSpan:params.groupKeySet.epochKey1]; + request.groupKeySet.epochStartTime1 = params.groupKeySet.epochStartTime1.unsignedLongLongValue; + request.groupKeySet.epochKey2 = [self asByteSpan:params.groupKeySet.epochKey2]; + request.groupKeySet.epochStartTime2 = params.groupKeySet.epochStartTime2.unsignedLongLongValue; + + new CHIPCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)readAttributeGroupKeyMapWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeGroupKeyMapWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPGroupKeyManagementGroupKeyMapListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + +- (void)readAttributeGroupTableWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPGroupKeyManagementGroupTableListAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GroupKeyManagement::Attributes::GroupTable::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeGroupTableWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GroupKeyManagement::Attributes::GroupTable::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, minInterval, maxInterval, - CHIPGroupKeyManagementGroupKeysListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + CHIPGroupKeyManagementGroupTableListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } +- (void)readAttributeMaxGroupsPerFabricWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)readAttributeMaxGroupKeysPerFabricWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler { @@ -8266,12 +8525,12 @@ @implementation CHIPKeypadInput return &_cppCluster; } -- (void)sendKeyWithParams:(CHIPKeypadInputClusterSendKeyParams *)params - completionHandler: - (void (^)(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable data, NSError * _Nullable error))completionHandler +- (void)sendKeyRequestWithParams:(CHIPKeypadInputClusterSendKeyRequestParams *)params + completionHandler:(void (^)(CHIPKeypadInputClusterSendKeyResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - KeypadInput::Commands::SendKey::Type request; + KeypadInput::Commands::SendKeyRequest::Type request; request.keyCode = static_cast>(params.keyCode.unsignedCharValue); new CHIPKeypadInputClusterSendKeyResponseCallbackBridge( @@ -9160,10 +9419,10 @@ @implementation CHIPMediaInput return &_cppCluster; } -- (void)hideInputStatusWithCompletionHandler:(StatusCompletion)completionHandler +- (void)hideInputStatusRequestWithCompletionHandler:(StatusCompletion)completionHandler { ListFreer listFreer; - MediaInput::Commands::HideInputStatus::Type request; + MediaInput::Commands::HideInputStatusRequest::Type request; new CHIPCommandSuccessCallbackBridge( self.callbackQueue, @@ -9177,10 +9436,11 @@ new CHIPCommandSuccessCallbackBridge( }); } -- (void)renameInputWithParams:(CHIPMediaInputClusterRenameInputParams *)params completionHandler:(StatusCompletion)completionHandler +- (void)renameInputRequestWithParams:(CHIPMediaInputClusterRenameInputRequestParams *)params + completionHandler:(StatusCompletion)completionHandler { ListFreer listFreer; - MediaInput::Commands::RenameInput::Type request; + MediaInput::Commands::RenameInputRequest::Type request; request.index = params.index.unsignedCharValue; request.name = [self asCharSpan:params.name]; @@ -9196,10 +9456,11 @@ new CHIPCommandSuccessCallbackBridge( }); } -- (void)selectInputWithParams:(CHIPMediaInputClusterSelectInputParams *)params completionHandler:(StatusCompletion)completionHandler +- (void)selectInputRequestWithParams:(CHIPMediaInputClusterSelectInputRequestParams *)params + completionHandler:(StatusCompletion)completionHandler { ListFreer listFreer; - MediaInput::Commands::SelectInput::Type request; + MediaInput::Commands::SelectInputRequest::Type request; request.index = params.index.unsignedCharValue; new CHIPCommandSuccessCallbackBridge( @@ -9214,10 +9475,10 @@ new CHIPCommandSuccessCallbackBridge( }); } -- (void)showInputStatusWithCompletionHandler:(StatusCompletion)completionHandler +- (void)showInputStatusRequestWithCompletionHandler:(StatusCompletion)completionHandler { ListFreer listFreer; - MediaInput::Commands::ShowInputStatus::Type request; + MediaInput::Commands::ShowInputStatusRequest::Type request; new CHIPCommandSuccessCallbackBridge( self.callbackQueue, @@ -9341,161 +9602,161 @@ @implementation CHIPMediaPlayback return &_cppCluster; } -- (void)mediaFastForwardWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaFastForwardResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)fastForwardRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaFastForward::Type request; + MediaPlayback::Commands::FastForwardRequest::Type request; - new CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)mediaNextWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaNextResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)nextRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaNext::Type request; + MediaPlayback::Commands::NextRequest::Type request; - new CHIPMediaPlaybackClusterMediaNextResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)mediaPauseWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaPauseResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)pauseRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaPause::Type request; + MediaPlayback::Commands::PauseRequest::Type request; - new CHIPMediaPlaybackClusterMediaPauseResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)mediaPlayWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaPlayResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)playRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaPlay::Type request; + MediaPlayback::Commands::PlayRequest::Type request; - new CHIPMediaPlaybackClusterMediaPlayResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)mediaPreviousWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaPreviousResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)previousRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaPrevious::Type request; + MediaPlayback::Commands::PreviousRequest::Type request; - new CHIPMediaPlaybackClusterMediaPreviousResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)mediaRewindWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaRewindResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)rewindRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaRewind::Type request; + MediaPlayback::Commands::RewindRequest::Type request; - new CHIPMediaPlaybackClusterMediaRewindResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)mediaSeekWithParams:(CHIPMediaPlaybackClusterMediaSeekParams *)params - completionHandler:(void (^)(CHIPMediaPlaybackClusterMediaSeekResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)seekRequestWithParams:(CHIPMediaPlaybackClusterSeekRequestParams *)params + completionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaSeek::Type request; + MediaPlayback::Commands::SeekRequest::Type request; request.position = params.position.unsignedLongLongValue; - new CHIPMediaPlaybackClusterMediaSeekResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)mediaSkipBackwardWithParams:(CHIPMediaPlaybackClusterMediaSkipBackwardParams *)params - completionHandler:(void (^)(CHIPMediaPlaybackClusterMediaSkipBackwardResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)skipBackwardRequestWithParams:(CHIPMediaPlaybackClusterSkipBackwardRequestParams *)params + completionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaSkipBackward::Type request; + MediaPlayback::Commands::SkipBackwardRequest::Type request; request.deltaPositionMilliseconds = params.deltaPositionMilliseconds.unsignedLongLongValue; - new CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)mediaSkipForwardWithParams:(CHIPMediaPlaybackClusterMediaSkipForwardParams *)params - completionHandler:(void (^)(CHIPMediaPlaybackClusterMediaSkipForwardResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)skipForwardRequestWithParams:(CHIPMediaPlaybackClusterSkipForwardRequestParams *)params + completionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaSkipForward::Type request; + MediaPlayback::Commands::SkipForwardRequest::Type request; request.deltaPositionMilliseconds = params.deltaPositionMilliseconds.unsignedLongLongValue; - new CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)mediaStartOverWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaStartOverResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)startOverRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaStartOver::Type request; + MediaPlayback::Commands::StartOverRequest::Type request; - new CHIPMediaPlaybackClusterMediaStartOverResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)mediaStopWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterMediaStopResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)stopRequestWithCompletionHandler:(void (^)(CHIPMediaPlaybackClusterPlaybackResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - MediaPlayback::Commands::MediaStop::Type request; + MediaPlayback::Commands::StopRequest::Type request; - new CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge( + new CHIPMediaPlaybackClusterPlaybackResponseCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); }); @@ -9504,12 +9765,13 @@ new CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge( - (void)readAttributePlaybackStateWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = MediaPlayback::Attributes::PlaybackState::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = MediaPlayback::Attributes::PlaybackState::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributePlaybackStateWithMinInterval:(uint16_t)minInterval @@ -9518,14 +9780,15 @@ - (void)subscribeAttributePlaybackStateWithMinInterval:(uint16_t)minInterval reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt8uAttributeCallbackSubscriptionBridge( + new CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = MediaPlayback::Attributes::PlaybackState::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, + CHIPMediaPlaybackClusterPlaybackStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -10361,7 +10624,7 @@ - (void)announceOtaProviderWithParams:(CHIPOtaSoftwareUpdateRequestorClusterAnno { ListFreer listFreer; OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Type request; - request.providerLocation = params.providerLocation.unsignedLongLongValue; + request.providerNodeId = params.providerNodeId.unsignedLongLongValue; request.vendorId = static_cast>(params.vendorId.unsignedShortValue); request.announcementReason = static_cast>(params.announcementReason.unsignedCharValue); @@ -10369,6 +10632,7 @@ - (void)announceOtaProviderWithParams:(CHIPOtaSoftwareUpdateRequestorClusterAnno auto & definedValue_0 = request.metadataForNode.Emplace(); definedValue_0 = [self asByteSpan:params.metadataForNode]; } + request.endpoint = params.endpoint.unsignedShortValue; new CHIPCommandSuccessCallbackBridge( self.callbackQueue, @@ -10382,19 +10646,19 @@ new CHIPCommandSuccessCallbackBridge( }); } -- (void)readAttributeDefaultOtaProviderWithCompletionHandler:(void (^)(NSData * _Nullable value, - NSError * _Nullable error))completionHandler +- (void)readAttributeDefaultOtaProvidersWithCompletionHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completionHandler { - new CHIPOctetStringAttributeCallbackBridge( + new CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProviders::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeDefaultOtaProviderWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeDefaultOtaProvidersWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -10403,29 +10667,55 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::TypeInfo; + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProviders::TypeInfo; TypeInfo::Type cppValue; - cppValue = [self asByteSpan:value]; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[CHIPOtaSoftwareUpdateRequestorClusterProviderLocation class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (CHIPOtaSoftwareUpdateRequestorClusterProviderLocation *) value[i_0]; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].providerNodeID = element_0.providerNodeID.unsignedLongLongValue; + listHolder_0->mList[i_0].endpoint = element_0.endpoint.unsignedShortValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)subscribeAttributeDefaultOtaProviderWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeDefaultOtaProvidersWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPOctetStringAttributeCallbackSubscriptionBridge( + new CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProviders::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPOctetStringAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, + CHIPOtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackSubscriptionBridge:: + OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -10459,6 +10749,67 @@ new CHIPBooleanAttributeCallbackSubscriptionBridge( subscriptionEstablishedHandler); } +- (void)readAttributeUpdateStateWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPOtaSoftwareUpdateRequestorClusterUpdateStateEnumAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateState::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeUpdateStateWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPOtaSoftwareUpdateRequestorClusterUpdateStateEnumAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateState::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, + CHIPOtaSoftwareUpdateRequestorClusterUpdateStateEnumAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + +- (void)readAttributeUpdateStateProgressWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPNullableInt8uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeUpdateStateProgressWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPNullableInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, CHIPNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler { @@ -13640,192 +13991,30 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( } - (void)readAttributeMultiPressMaxWithCompletionHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = Switch::Attributes::MultiPressMax::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeMultiPressMaxWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - new CHIPInt8uAttributeCallbackSubscriptionBridge( - self.callbackQueue, reportHandler, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = Switch::Attributes::MultiPressMax::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); - }, - subscriptionEstablishedHandler); -} - -- (void)readAttributeAttributeListWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPSwitchAttributeListListAttributeCallbackBridge( - self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = Switch::Attributes::AttributeList::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)readAttributeFeatureMapWithCompletionHandler:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = Switch::Attributes::FeatureMap::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeFeatureMapWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - new CHIPInt32uAttributeCallbackSubscriptionBridge( - self.callbackQueue, reportHandler, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = Switch::Attributes::FeatureMap::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); - }, - subscriptionEstablishedHandler); -} - -- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler -{ - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = Switch::Attributes::ClusterRevision::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeClusterRevisionWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - new CHIPInt16uAttributeCallbackSubscriptionBridge( - self.callbackQueue, reportHandler, - ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = Switch::Attributes::ClusterRevision::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); - }, - subscriptionEstablishedHandler); -} - -@end - -@implementation CHIPTvChannel - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)changeChannelWithParams:(CHIPTvChannelClusterChangeChannelParams *)params - completionHandler:(void (^)(CHIPTvChannelClusterChangeChannelResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler -{ - ListFreer listFreer; - TvChannel::Commands::ChangeChannel::Type request; - request.match = [self asCharSpan:params.match]; - - new CHIPTvChannelClusterChangeChannelResponseCallbackBridge( - self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)changeChannelByNumberWithParams:(CHIPTvChannelClusterChangeChannelByNumberParams *)params - completionHandler:(StatusCompletion)completionHandler -{ - ListFreer listFreer; - TvChannel::Commands::ChangeChannelByNumber::Type request; - request.majorNumber = params.majorNumber.unsignedShortValue; - request.minorNumber = params.minorNumber.unsignedShortValue; - - new CHIPCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)skipChannelWithParams:(CHIPTvChannelClusterSkipChannelParams *)params completionHandler:(StatusCompletion)completionHandler -{ - ListFreer listFreer; - TvChannel::Commands::SkipChannel::Type request; - request.count = params.count.unsignedShortValue; - - new CHIPCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.InvokeCommand(request, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)readAttributeChannelListWithCompletionHandler:(void (^)( - NSArray * _Nullable value, NSError * _Nullable error))completionHandler + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPTvChannelChannelListListAttributeCallbackBridge( - self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = TvChannel::Attributes::ChannelList::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Switch::Attributes::MultiPressMax::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } -- (void)subscribeAttributeChannelListWithMinInterval:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeMultiPressMaxWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPTvChannelChannelListListAttributeCallbackSubscriptionBridge( + new CHIPInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = TvChannel::Attributes::ChannelList::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = Switch::Attributes::MultiPressMax::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, - CHIPTvChannelChannelListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -13833,20 +14022,48 @@ new CHIPTvChannelChannelListListAttributeCallbackSubscriptionBridge( - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPTvChannelAttributeListListAttributeCallbackBridge( + new CHIPSwitchAttributeListListAttributeCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = TvChannel::Attributes::AttributeList::TypeInfo; - auto successFn = Callback::FromCancelable(success); + using TypeInfo = Switch::Attributes::AttributeList::TypeInfo; + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); } +- (void)readAttributeFeatureMapWithCompletionHandler:(void (^)( + NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Switch::Attributes::FeatureMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeFeatureMapWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt32uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = Switch::Attributes::FeatureMap::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = TvChannel::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = Switch::Attributes::ClusterRevision::TypeInfo; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); @@ -13862,7 +14079,7 @@ - (void)subscribeAttributeClusterRevisionWithMinInterval:(uint16_t)minInterval new CHIPInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = TvChannel::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = Switch::Attributes::ClusterRevision::TypeInfo; auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, @@ -13880,12 +14097,12 @@ @implementation CHIPTargetNavigator return &_cppCluster; } -- (void)navigateTargetWithParams:(CHIPTargetNavigatorClusterNavigateTargetParams *)params - completionHandler:(void (^)(CHIPTargetNavigatorClusterNavigateTargetResponseParams * _Nullable data, - NSError * _Nullable error))completionHandler +- (void)navigateTargetRequestWithParams:(CHIPTargetNavigatorClusterNavigateTargetRequestParams *)params + completionHandler:(void (^)(CHIPTargetNavigatorClusterNavigateTargetResponseParams * _Nullable data, + NSError * _Nullable error))completionHandler { ListFreer listFreer; - TargetNavigator::Commands::NavigateTarget::Type request; + TargetNavigator::Commands::NavigateTargetRequest::Type request; request.target = params.target.unsignedCharValue; request.data = [self asCharSpan:params.data]; @@ -13940,6 +14157,25 @@ new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Ca }); } +- (void)subscribeAttributeCurrentNavigatorTargetWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TargetNavigator::Attributes::CurrentNavigatorTarget::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + minInterval, maxInterval, CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + }, + subscriptionEstablishedHandler); +} + - (void)readAttributeAttributeListWithCompletionHandler:(void (^)( NSArray * _Nullable value, NSError * _Nullable error))completionHandler { @@ -21555,6 +21791,48 @@ new CHIPUserLabelLabelListListAttributeCallbackBridge( }); } +- (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = UserLabel::Attributes::LabelList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[CHIPUserLabelClusterLabelStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (CHIPUserLabelClusterLabelStruct *) value[i_0]; + listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label]; + listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label]; + listHolder_0->mList[i_0].value = [self asCharSpan:element_0.value]; + listHolder_0->mList[i_0].value = [self asCharSpan:element_0.value]; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { @@ -22267,12 +22545,13 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( - (void)readAttributeCurrentPositionLiftWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = WindowCovering::Attributes::CurrentPositionLift::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = WindowCovering::Attributes::CurrentPositionLift::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeCurrentPositionLiftWithMinInterval:(uint16_t)minInterval @@ -22282,14 +22561,14 @@ - (void)subscribeAttributeCurrentPositionLiftWithMinInterval:(uint16_t)minInterv reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt16uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = WindowCovering::Attributes::CurrentPositionLift::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -22297,12 +22576,13 @@ new CHIPInt16uAttributeCallbackSubscriptionBridge( - (void)readAttributeCurrentPositionTiltWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = WindowCovering::Attributes::CurrentPositionTilt::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = WindowCovering::Attributes::CurrentPositionTilt::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeCurrentPositionTiltWithMinInterval:(uint16_t)minInterval @@ -22312,14 +22592,14 @@ - (void)subscribeAttributeCurrentPositionTiltWithMinInterval:(uint16_t)minInterv reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt16uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = WindowCovering::Attributes::CurrentPositionTilt::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -22355,12 +22635,13 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( - (void)readAttributeCurrentPositionLiftPercentageWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt8uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeCurrentPositionLiftPercentageWithMinInterval:(uint16_t)minInterval @@ -22370,14 +22651,14 @@ - (void)subscribeAttributeCurrentPositionLiftPercentageWithMinInterval:(uint16_t reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt8uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, CHIPNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -22385,12 +22666,13 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( - (void)readAttributeCurrentPositionTiltPercentageWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt8uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeCurrentPositionTiltPercentageWithMinInterval:(uint16_t)minInterval @@ -22400,14 +22682,14 @@ - (void)subscribeAttributeCurrentPositionTiltPercentageWithMinInterval:(uint16_t reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt8uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt8uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, CHIPNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -22444,12 +22726,13 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( - (void)readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeTargetPositionLiftPercent100thsWithMinInterval:(uint16_t)minInterval @@ -22459,14 +22742,14 @@ - (void)subscribeAttributeTargetPositionLiftPercent100thsWithMinInterval:(uint16 reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt16uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -22474,12 +22757,13 @@ new CHIPInt16uAttributeCallbackSubscriptionBridge( - (void)readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeTargetPositionTiltPercent100thsWithMinInterval:(uint16_t)minInterval @@ -22489,14 +22773,14 @@ - (void)subscribeAttributeTargetPositionTiltPercent100thsWithMinInterval:(uint16 reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt16uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -22533,12 +22817,13 @@ new CHIPInt8uAttributeCallbackSubscriptionBridge( - (void)readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeCurrentPositionLiftPercent100thsWithMinInterval:(uint16_t)minInterval @@ -22548,14 +22833,14 @@ - (void)subscribeAttributeCurrentPositionLiftPercent100thsWithMinInterval:(uint1 reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt16uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } @@ -22563,12 +22848,13 @@ new CHIPInt16uAttributeCallbackSubscriptionBridge( - (void)readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPNullableInt16uAttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)subscribeAttributeCurrentPositionTiltPercent100thsWithMinInterval:(uint16_t)minInterval @@ -22578,14 +22864,14 @@ - (void)subscribeAttributeCurrentPositionTiltPercent100thsWithMinInterval:(uint1 reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt16uAttributeCallbackSubscriptionBridge( + new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - minInterval, maxInterval, CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); + minInterval, maxInterval, CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished); }, subscriptionEstablishedHandler); } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h index 64b30b5637d32c..043118d96a06a5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h @@ -73,6 +73,10 @@ @property (readonly) chip::Controller::BridgedDeviceBasicCluster cppCluster; @end +@interface CHIPChannel () +@property (readonly) chip::Controller::ChannelCluster cppCluster; +@end + @interface CHIPColorControl () @property (readonly) chip::Controller::ColorControlCluster cppCluster; @end @@ -217,10 +221,6 @@ @property (readonly) chip::Controller::SwitchCluster cppCluster; @end -@interface CHIPTvChannel () -@property (readonly) chip::Controller::TvChannelCluster cppCluster; -@end - @interface CHIPTargetNavigator () @property (readonly) chip::Controller::TargetNavigatorCluster cppCluster; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h index 856d8402c6acbf..089485bf995a66 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h @@ -591,18 +591,6 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestParams : NSObject -@property (strong, nonatomic) NSData * _Nonnull updateToken; -@property (strong, nonatomic, getter=getNewVersion) NSNumber * _Nonnull newVersion; -- (instancetype)init; -@end - -@interface CHIPOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedParams : NSObject -@property (strong, nonatomic) NSData * _Nonnull updateToken; -@property (strong, nonatomic) NSNumber * _Nonnull softwareVersion; -- (instancetype)init; -@end - @interface CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull status; @property (strong, nonatomic) NSNumber * _Nullable delayedActionTime; @@ -615,17 +603,30 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestParams : NSObject +@property (strong, nonatomic) NSData * _Nonnull updateToken; +@property (strong, nonatomic, getter=getNewVersion) NSNumber * _Nonnull newVersion; +- (instancetype)init; +@end + @interface CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull action; @property (strong, nonatomic) NSNumber * _Nonnull delayedActionTime; - (instancetype)init; @end +@interface CHIPOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedParams : NSObject +@property (strong, nonatomic) NSData * _Nonnull updateToken; +@property (strong, nonatomic) NSNumber * _Nonnull softwareVersion; +- (instancetype)init; +@end + @interface CHIPOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull providerLocation; +@property (strong, nonatomic) NSNumber * _Nonnull providerNodeId; @property (strong, nonatomic) NSNumber * _Nonnull vendorId; @property (strong, nonatomic) NSNumber * _Nonnull announcementReason; @property (strong, nonatomic) NSData * _Nullable metadataForNode; +@property (strong, nonatomic) NSNumber * _Nonnull endpoint; - (instancetype)init; @end @@ -671,8 +672,8 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPNetworkCommissioningClusterScanNetworksResponseParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull networkingStatus; @property (strong, nonatomic) NSString * _Nonnull debugText; -@property (strong, nonatomic) NSArray * _Nonnull wiFiScanResults; -@property (strong, nonatomic) NSArray * _Nonnull threadScanResults; +@property (strong, nonatomic) NSArray * _Nullable wiFiScanResults; +@property (strong, nonatomic) NSArray * _Nullable threadScanResults; - (instancetype)init; @end @@ -825,6 +826,36 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPGroupKeyManagementClusterKeySetWriteParams : NSObject +@property (strong, nonatomic) CHIPGroupKeyManagementClusterGroupKeySet * _Nonnull groupKeySet; +- (instancetype)init; +@end + +@interface CHIPGroupKeyManagementClusterKeySetReadParams : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetID; +- (instancetype)init; +@end + +@interface CHIPGroupKeyManagementClusterKeySetReadResponseParams : NSObject +@property (strong, nonatomic) CHIPGroupKeyManagementClusterGroupKeySet * _Nonnull groupKeySet; +- (instancetype)init; +@end + +@interface CHIPGroupKeyManagementClusterKeySetRemoveParams : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetID; +- (instancetype)init; +@end + +@interface CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams : NSObject +@property (strong, nonatomic) NSArray * _Nonnull groupKeySetIDs; +- (instancetype)init; +@end + +@interface CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams : NSObject +@property (strong, nonatomic) NSArray * _Nonnull groupKeySetIDs; +- (instancetype)init; +@end + @interface CHIPModeSelectClusterChangeToModeParams : NSObject @property (strong, nonatomic, getter=getNewMode) NSNumber * _Nonnull newMode; - (instancetype)init; @@ -1503,29 +1534,29 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPTvChannelClusterChangeChannelParams : NSObject +@interface CHIPChannelClusterChangeChannelRequestParams : NSObject @property (strong, nonatomic) NSString * _Nonnull match; - (instancetype)init; @end -@interface CHIPTvChannelClusterChangeChannelResponseParams : NSObject -@property (strong, nonatomic) CHIPTvChannelClusterTvChannelInfo * _Nonnull channelMatch; +@interface CHIPChannelClusterChangeChannelResponseParams : NSObject +@property (strong, nonatomic) CHIPChannelClusterChannelInfo * _Nonnull channelMatch; @property (strong, nonatomic) NSNumber * _Nonnull errorType; - (instancetype)init; @end -@interface CHIPTvChannelClusterChangeChannelByNumberParams : NSObject +@interface CHIPChannelClusterChangeChannelByNumberRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull majorNumber; @property (strong, nonatomic) NSNumber * _Nonnull minorNumber; - (instancetype)init; @end -@interface CHIPTvChannelClusterSkipChannelParams : NSObject +@interface CHIPChannelClusterSkipChannelRequestParams : NSObject @property (strong, nonatomic, getter=getCount) NSNumber * _Nonnull count; - (instancetype)init; @end -@interface CHIPTargetNavigatorClusterNavigateTargetParams : NSObject +@interface CHIPTargetNavigatorClusterNavigateTargetRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull target; @property (strong, nonatomic) NSString * _Nonnull data; - (instancetype)init; @@ -1537,88 +1568,38 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPMediaPlaybackClusterMediaPlayResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; -- (instancetype)init; -@end - -@interface CHIPMediaPlaybackClusterMediaPauseResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; -- (instancetype)init; -@end - -@interface CHIPMediaPlaybackClusterMediaStopResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; -- (instancetype)init; -@end - -@interface CHIPMediaPlaybackClusterMediaStartOverResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; -- (instancetype)init; -@end - -@interface CHIPMediaPlaybackClusterMediaPreviousResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; -- (instancetype)init; -@end - -@interface CHIPMediaPlaybackClusterMediaNextResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; -- (instancetype)init; -@end - -@interface CHIPMediaPlaybackClusterMediaRewindResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; -- (instancetype)init; -@end - -@interface CHIPMediaPlaybackClusterMediaFastForwardResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; -- (instancetype)init; -@end - -@interface CHIPMediaPlaybackClusterMediaSkipForwardParams : NSObject +@interface CHIPMediaPlaybackClusterSkipForwardRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull deltaPositionMilliseconds; - (instancetype)init; @end -@interface CHIPMediaPlaybackClusterMediaSkipForwardResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; -- (instancetype)init; -@end - -@interface CHIPMediaPlaybackClusterMediaSkipBackwardParams : NSObject +@interface CHIPMediaPlaybackClusterSkipBackwardRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull deltaPositionMilliseconds; - (instancetype)init; @end -@interface CHIPMediaPlaybackClusterMediaSkipBackwardResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; +@interface CHIPMediaPlaybackClusterPlaybackResponseParams : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull status; - (instancetype)init; @end -@interface CHIPMediaPlaybackClusterMediaSeekParams : NSObject +@interface CHIPMediaPlaybackClusterSeekRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull position; - (instancetype)init; @end -@interface CHIPMediaPlaybackClusterMediaSeekResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull mediaPlaybackStatus; -- (instancetype)init; -@end - -@interface CHIPMediaInputClusterSelectInputParams : NSObject +@interface CHIPMediaInputClusterSelectInputRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull index; - (instancetype)init; @end -@interface CHIPMediaInputClusterRenameInputParams : NSObject +@interface CHIPMediaInputClusterRenameInputRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull index; @property (strong, nonatomic) NSString * _Nonnull name; - (instancetype)init; @end -@interface CHIPKeypadInputClusterSendKeyParams : NSObject +@interface CHIPKeypadInputClusterSendKeyRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull keyCode; - (instancetype)init; @end @@ -1628,83 +1609,60 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPContentLauncherClusterLaunchContentParams : NSObject +@interface CHIPContentLauncherClusterLaunchContentRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull autoPlay; @property (strong, nonatomic) NSString * _Nonnull data; @property (strong, nonatomic) NSArray * _Nonnull search; - (instancetype)init; @end -@interface CHIPContentLauncherClusterLaunchContentResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull contentLaunchStatus; -@property (strong, nonatomic) NSString * _Nonnull data; -- (instancetype)init; -@end - -@interface CHIPContentLauncherClusterLaunchURLParams : NSObject +@interface CHIPContentLauncherClusterLaunchURLRequestParams : NSObject @property (strong, nonatomic) NSString * _Nonnull contentURL; @property (strong, nonatomic) NSString * _Nonnull displayString; -@property (strong, nonatomic) NSArray * _Nonnull brandingInformation; +@property (strong, nonatomic) CHIPContentLauncherClusterBrandingInformation * _Nonnull brandingInformation; - (instancetype)init; @end -@interface CHIPContentLauncherClusterLaunchURLResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull contentLaunchStatus; +@interface CHIPContentLauncherClusterLaunchResponseParams : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull status; @property (strong, nonatomic) NSString * _Nonnull data; - (instancetype)init; @end -@interface CHIPAudioOutputClusterSelectOutputParams : NSObject +@interface CHIPAudioOutputClusterSelectOutputRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull index; - (instancetype)init; @end -@interface CHIPAudioOutputClusterRenameOutputParams : NSObject +@interface CHIPAudioOutputClusterRenameOutputRequestParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull index; @property (strong, nonatomic) NSString * _Nonnull name; - (instancetype)init; @end -@interface CHIPApplicationLauncherClusterLaunchAppParams : NSObject +@interface CHIPApplicationLauncherClusterLaunchAppRequestParams : NSObject @property (strong, nonatomic) NSString * _Nonnull data; -@property (strong, nonatomic) CHIPApplicationLauncherClusterApplicationLauncherApp * _Nonnull application; +@property (strong, nonatomic) CHIPApplicationLauncherClusterApplication * _Nonnull application; - (instancetype)init; @end -@interface CHIPApplicationLauncherClusterLaunchAppResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull status; -@property (strong, nonatomic) NSString * _Nonnull data; +@interface CHIPApplicationLauncherClusterStopAppRequestParams : NSObject +@property (strong, nonatomic) CHIPApplicationLauncherClusterApplication * _Nonnull application; - (instancetype)init; @end -@interface CHIPApplicationLauncherClusterStopAppParams : NSObject -@property (strong, nonatomic) CHIPApplicationLauncherClusterApplicationLauncherApp * _Nonnull application; +@interface CHIPApplicationLauncherClusterHideAppRequestParams : NSObject +@property (strong, nonatomic) CHIPApplicationLauncherClusterApplication * _Nonnull application; - (instancetype)init; @end -@interface CHIPApplicationLauncherClusterStopAppResponseParams : NSObject +@interface CHIPApplicationLauncherClusterLauncherResponseParams : NSObject @property (strong, nonatomic) NSNumber * _Nonnull status; @property (strong, nonatomic) NSString * _Nonnull data; - (instancetype)init; @end -@interface CHIPApplicationLauncherClusterHideAppParams : NSObject -@property (strong, nonatomic) CHIPApplicationLauncherClusterApplicationLauncherApp * _Nonnull application; -- (instancetype)init; -@end - -@interface CHIPApplicationLauncherClusterHideAppResponseParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull status; -@property (strong, nonatomic) NSString * _Nonnull data; -- (instancetype)init; -@end - -@interface CHIPApplicationBasicClusterChangeStatusParams : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull status; -- (instancetype)init; -@end - -@interface CHIPAccountLoginClusterGetSetupPINParams : NSObject +@interface CHIPAccountLoginClusterGetSetupPINRequestParams : NSObject @property (strong, nonatomic) NSString * _Nonnull tempAccountIdentifier; - (instancetype)init; @end @@ -1714,7 +1672,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPAccountLoginClusterLoginParams : NSObject +@interface CHIPAccountLoginClusterLoginRequestParams : NSObject @property (strong, nonatomic) NSString * _Nonnull tempAccountIdentifier; @property (strong, nonatomic) NSString * _Nonnull setupPIN; - (instancetype)init; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm index caf82e865dd04d..bef15fd467df48 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm @@ -1238,65 +1238,65 @@ - (instancetype)init } @end -@implementation CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestParams +@implementation CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseParams - (instancetype)init { if (self = [super init]) { - _updateToken = [NSData data]; + _status = @(0); - _newVersion = @(0); + _delayedActionTime = nil; + + _imageURI = nil; + + _softwareVersion = nil; + + _softwareVersionString = nil; + + _updateToken = nil; + + _userConsentNeeded = nil; + + _metadataForRequestor = nil; } return self; } @end -@implementation CHIPOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedParams +@implementation CHIPOtaSoftwareUpdateProviderClusterApplyUpdateRequestParams - (instancetype)init { if (self = [super init]) { _updateToken = [NSData data]; - _softwareVersion = @(0); + _newVersion = @(0); } return self; } @end -@implementation CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseParams +@implementation CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseParams - (instancetype)init { if (self = [super init]) { - _status = @(0); - - _delayedActionTime = nil; - - _imageURI = nil; - - _softwareVersion = nil; - - _softwareVersionString = nil; - - _updateToken = nil; - - _userConsentNeeded = nil; + _action = @(0); - _metadataForRequestor = nil; + _delayedActionTime = @(0); } return self; } @end -@implementation CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseParams +@implementation CHIPOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedParams - (instancetype)init { if (self = [super init]) { - _action = @(0); + _updateToken = [NSData data]; - _delayedActionTime = @(0); + _softwareVersion = @(0); } return self; } @@ -1307,13 +1307,15 @@ - (instancetype)init { if (self = [super init]) { - _providerLocation = @(0); + _providerNodeId = @(0); _vendorId = @(0); _announcementReason = @(0); _metadataForNode = nil; + + _endpoint = @(0); } return self; } @@ -1412,9 +1414,9 @@ - (instancetype)init _debugText = @""; - _wiFiScanResults = [NSArray array]; + _wiFiScanResults = nil; - _threadScanResults = [NSArray array]; + _threadScanResults = nil; } return self; } @@ -1742,6 +1744,72 @@ - (instancetype)init } @end +@implementation CHIPGroupKeyManagementClusterKeySetWriteParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySet = [CHIPGroupKeyManagementClusterGroupKeySet new]; + } + return self; +} +@end + +@implementation CHIPGroupKeyManagementClusterKeySetReadParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySetID = @(0); + } + return self; +} +@end + +@implementation CHIPGroupKeyManagementClusterKeySetReadResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySet = [CHIPGroupKeyManagementClusterGroupKeySet new]; + } + return self; +} +@end + +@implementation CHIPGroupKeyManagementClusterKeySetRemoveParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySetID = @(0); + } + return self; +} +@end + +@implementation CHIPGroupKeyManagementClusterKeySetReadAllIndicesParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySetIDs = [NSArray array]; + } + return self; +} +@end + +@implementation CHIPGroupKeyManagementClusterKeySetReadAllIndicesResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _groupKeySetIDs = [NSArray array]; + } + return self; +} +@end + @implementation CHIPModeSelectClusterChangeToModeParams - (instancetype)init { @@ -3189,7 +3257,7 @@ - (instancetype)init } @end -@implementation CHIPTvChannelClusterChangeChannelParams +@implementation CHIPChannelClusterChangeChannelRequestParams - (instancetype)init { if (self = [super init]) { @@ -3200,12 +3268,12 @@ - (instancetype)init } @end -@implementation CHIPTvChannelClusterChangeChannelResponseParams +@implementation CHIPChannelClusterChangeChannelResponseParams - (instancetype)init { if (self = [super init]) { - _channelMatch = [CHIPTvChannelClusterTvChannelInfo new]; + _channelMatch = [CHIPChannelClusterChannelInfo new]; _errorType = @(0); } @@ -3213,7 +3281,7 @@ - (instancetype)init } @end -@implementation CHIPTvChannelClusterChangeChannelByNumberParams +@implementation CHIPChannelClusterChangeChannelByNumberRequestParams - (instancetype)init { if (self = [super init]) { @@ -3226,7 +3294,7 @@ - (instancetype)init } @end -@implementation CHIPTvChannelClusterSkipChannelParams +@implementation CHIPChannelClusterSkipChannelRequestParams - (instancetype)init { if (self = [super init]) { @@ -3237,7 +3305,7 @@ - (instancetype)init } @end -@implementation CHIPTargetNavigatorClusterNavigateTargetParams +@implementation CHIPTargetNavigatorClusterNavigateTargetRequestParams - (instancetype)init { if (self = [super init]) { @@ -3263,95 +3331,7 @@ - (instancetype)init } @end -@implementation CHIPMediaPlaybackClusterMediaPlayResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _mediaPlaybackStatus = @(0); - } - return self; -} -@end - -@implementation CHIPMediaPlaybackClusterMediaPauseResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _mediaPlaybackStatus = @(0); - } - return self; -} -@end - -@implementation CHIPMediaPlaybackClusterMediaStopResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _mediaPlaybackStatus = @(0); - } - return self; -} -@end - -@implementation CHIPMediaPlaybackClusterMediaStartOverResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _mediaPlaybackStatus = @(0); - } - return self; -} -@end - -@implementation CHIPMediaPlaybackClusterMediaPreviousResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _mediaPlaybackStatus = @(0); - } - return self; -} -@end - -@implementation CHIPMediaPlaybackClusterMediaNextResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _mediaPlaybackStatus = @(0); - } - return self; -} -@end - -@implementation CHIPMediaPlaybackClusterMediaRewindResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _mediaPlaybackStatus = @(0); - } - return self; -} -@end - -@implementation CHIPMediaPlaybackClusterMediaFastForwardResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _mediaPlaybackStatus = @(0); - } - return self; -} -@end - -@implementation CHIPMediaPlaybackClusterMediaSkipForwardParams +@implementation CHIPMediaPlaybackClusterSkipForwardRequestParams - (instancetype)init { if (self = [super init]) { @@ -3362,18 +3342,7 @@ - (instancetype)init } @end -@implementation CHIPMediaPlaybackClusterMediaSkipForwardResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _mediaPlaybackStatus = @(0); - } - return self; -} -@end - -@implementation CHIPMediaPlaybackClusterMediaSkipBackwardParams +@implementation CHIPMediaPlaybackClusterSkipBackwardRequestParams - (instancetype)init { if (self = [super init]) { @@ -3384,18 +3353,18 @@ - (instancetype)init } @end -@implementation CHIPMediaPlaybackClusterMediaSkipBackwardResponseParams +@implementation CHIPMediaPlaybackClusterPlaybackResponseParams - (instancetype)init { if (self = [super init]) { - _mediaPlaybackStatus = @(0); + _status = @(0); } return self; } @end -@implementation CHIPMediaPlaybackClusterMediaSeekParams +@implementation CHIPMediaPlaybackClusterSeekRequestParams - (instancetype)init { if (self = [super init]) { @@ -3406,18 +3375,7 @@ - (instancetype)init } @end -@implementation CHIPMediaPlaybackClusterMediaSeekResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _mediaPlaybackStatus = @(0); - } - return self; -} -@end - -@implementation CHIPMediaInputClusterSelectInputParams +@implementation CHIPMediaInputClusterSelectInputRequestParams - (instancetype)init { if (self = [super init]) { @@ -3428,7 +3386,7 @@ - (instancetype)init } @end -@implementation CHIPMediaInputClusterRenameInputParams +@implementation CHIPMediaInputClusterRenameInputRequestParams - (instancetype)init { if (self = [super init]) { @@ -3441,7 +3399,7 @@ - (instancetype)init } @end -@implementation CHIPKeypadInputClusterSendKeyParams +@implementation CHIPKeypadInputClusterSendKeyRequestParams - (instancetype)init { if (self = [super init]) { @@ -3463,7 +3421,7 @@ - (instancetype)init } @end -@implementation CHIPContentLauncherClusterLaunchContentParams +@implementation CHIPContentLauncherClusterLaunchContentRequestParams - (instancetype)init { if (self = [super init]) { @@ -3478,20 +3436,7 @@ - (instancetype)init } @end -@implementation CHIPContentLauncherClusterLaunchContentResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _contentLaunchStatus = @(0); - - _data = @""; - } - return self; -} -@end - -@implementation CHIPContentLauncherClusterLaunchURLParams +@implementation CHIPContentLauncherClusterLaunchURLRequestParams - (instancetype)init { if (self = [super init]) { @@ -3500,18 +3445,18 @@ - (instancetype)init _displayString = @""; - _brandingInformation = [NSArray array]; + _brandingInformation = [CHIPContentLauncherClusterBrandingInformation new]; } return self; } @end -@implementation CHIPContentLauncherClusterLaunchURLResponseParams +@implementation CHIPContentLauncherClusterLaunchResponseParams - (instancetype)init { if (self = [super init]) { - _contentLaunchStatus = @(0); + _status = @(0); _data = @""; } @@ -3519,7 +3464,7 @@ - (instancetype)init } @end -@implementation CHIPAudioOutputClusterSelectOutputParams +@implementation CHIPAudioOutputClusterSelectOutputRequestParams - (instancetype)init { if (self = [super init]) { @@ -3530,7 +3475,7 @@ - (instancetype)init } @end -@implementation CHIPAudioOutputClusterRenameOutputParams +@implementation CHIPAudioOutputClusterRenameOutputRequestParams - (instancetype)init { if (self = [super init]) { @@ -3543,44 +3488,42 @@ - (instancetype)init } @end -@implementation CHIPApplicationLauncherClusterLaunchAppParams +@implementation CHIPApplicationLauncherClusterLaunchAppRequestParams - (instancetype)init { if (self = [super init]) { _data = @""; - _application = [CHIPApplicationLauncherClusterApplicationLauncherApp new]; + _application = [CHIPApplicationLauncherClusterApplication new]; } return self; } @end -@implementation CHIPApplicationLauncherClusterLaunchAppResponseParams +@implementation CHIPApplicationLauncherClusterStopAppRequestParams - (instancetype)init { if (self = [super init]) { - _status = @(0); - - _data = @""; + _application = [CHIPApplicationLauncherClusterApplication new]; } return self; } @end -@implementation CHIPApplicationLauncherClusterStopAppParams +@implementation CHIPApplicationLauncherClusterHideAppRequestParams - (instancetype)init { if (self = [super init]) { - _application = [CHIPApplicationLauncherClusterApplicationLauncherApp new]; + _application = [CHIPApplicationLauncherClusterApplication new]; } return self; } @end -@implementation CHIPApplicationLauncherClusterStopAppResponseParams +@implementation CHIPApplicationLauncherClusterLauncherResponseParams - (instancetype)init { if (self = [super init]) { @@ -3593,42 +3536,7 @@ - (instancetype)init } @end -@implementation CHIPApplicationLauncherClusterHideAppParams -- (instancetype)init -{ - if (self = [super init]) { - - _application = [CHIPApplicationLauncherClusterApplicationLauncherApp new]; - } - return self; -} -@end - -@implementation CHIPApplicationLauncherClusterHideAppResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _status = @(0); - - _data = @""; - } - return self; -} -@end - -@implementation CHIPApplicationBasicClusterChangeStatusParams -- (instancetype)init -{ - if (self = [super init]) { - - _status = @(0); - } - return self; -} -@end - -@implementation CHIPAccountLoginClusterGetSetupPINParams +@implementation CHIPAccountLoginClusterGetSetupPINRequestParams - (instancetype)init { if (self = [super init]) { @@ -3650,7 +3558,7 @@ - (instancetype)init } @end -@implementation CHIPAccountLoginClusterLoginParams +@implementation CHIPAccountLoginClusterLoginRequestParams - (instancetype)init { if (self = [super init]) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h index 9c6267167c22df..a0e2fa8d42d9fa 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h @@ -101,6 +101,13 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPOtaSoftwareUpdateRequestorClusterProviderLocation : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSNumber * _Nonnull providerNodeID; +@property (strong, nonatomic) NSNumber * _Nonnull endpoint; +- (instancetype)init; +@end + @interface CHIPGeneralCommissioningClusterBasicCommissioningInfoType : NSObject @property (strong, nonatomic) NSNumber * _Nonnull failSafeExpiryLengthMs; - (instancetype)init; @@ -230,19 +237,30 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPGroupKeyManagementClusterGroupInfo : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSArray * _Nonnull endpoints; +@property (strong, nonatomic) NSString * _Nonnull groupName; +- (instancetype)init; +@end + @interface CHIPGroupKeyManagementClusterGroupKey : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull vendorId; -@property (strong, nonatomic) NSNumber * _Nonnull groupKeyIndex; -@property (strong, nonatomic) NSData * _Nonnull groupKeyRoot; -@property (strong, nonatomic) NSNumber * _Nonnull groupKeyEpochStartTime; -@property (strong, nonatomic) NSNumber * _Nonnull groupKeySecurityPolicy; +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSNumber * _Nonnull groupId; +@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetID; - (instancetype)init; @end -@interface CHIPGroupKeyManagementClusterGroupState : NSObject -@property (strong, nonatomic) NSNumber * _Nonnull vendorId; -@property (strong, nonatomic) NSNumber * _Nonnull vendorGroupId; -@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetIndex; +@interface CHIPGroupKeyManagementClusterGroupKeySet : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull groupKeySetID; +@property (strong, nonatomic) NSNumber * _Nonnull securityPolicy; +@property (strong, nonatomic) NSData * _Nonnull epochKey0; +@property (strong, nonatomic) NSNumber * _Nonnull epochStartTime0; +@property (strong, nonatomic) NSData * _Nonnull epochKey1; +@property (strong, nonatomic) NSNumber * _Nonnull epochStartTime1; +@property (strong, nonatomic) NSData * _Nonnull epochKey2; +@property (strong, nonatomic) NSNumber * _Nonnull epochStartTime2; - (instancetype)init; @end @@ -283,7 +301,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPTvChannelClusterTvChannelInfo : NSObject +@interface CHIPChannelClusterChannelInfo : NSObject @property (strong, nonatomic) NSNumber * _Nonnull majorNumber; @property (strong, nonatomic) NSNumber * _Nonnull minorNumber; @property (strong, nonatomic) NSString * _Nonnull name; @@ -292,7 +310,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPTvChannelClusterTvChannelLineupInfo : NSObject +@interface CHIPChannelClusterLineupInfo : NSObject @property (strong, nonatomic) NSString * _Nonnull operatorName; @property (strong, nonatomic) NSString * _Nonnull lineupName; @property (strong, nonatomic) NSString * _Nonnull postalCode; @@ -300,19 +318,19 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPTargetNavigatorClusterNavigateTargetTargetInfo : NSObject +@interface CHIPTargetNavigatorClusterTargetInfo : NSObject @property (strong, nonatomic) NSNumber * _Nonnull identifier; @property (strong, nonatomic) NSString * _Nonnull name; - (instancetype)init; @end -@interface CHIPMediaPlaybackClusterMediaPlaybackPosition : NSObject +@interface CHIPMediaPlaybackClusterPlaybackPosition : NSObject @property (strong, nonatomic) NSNumber * _Nonnull updatedAt; @property (strong, nonatomic) NSNumber * _Nonnull position; - (instancetype)init; @end -@interface CHIPMediaInputClusterMediaInputInfo : NSObject +@interface CHIPMediaInputClusterInputInfo : NSObject @property (strong, nonatomic) NSNumber * _Nonnull index; @property (strong, nonatomic) NSNumber * _Nonnull inputType; @property (strong, nonatomic) NSString * _Nonnull name; @@ -320,63 +338,68 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end -@interface CHIPContentLauncherClusterContentLaunchDimension : NSObject +@interface CHIPContentLauncherClusterDimension : NSObject @property (strong, nonatomic) NSNumber * _Nonnull width; @property (strong, nonatomic) NSNumber * _Nonnull height; @property (strong, nonatomic) NSNumber * _Nonnull metric; - (instancetype)init; @end -@interface CHIPContentLauncherClusterContentLaunchAdditionalInfo : NSObject +@interface CHIPContentLauncherClusterAdditionalInfo : NSObject @property (strong, nonatomic) NSString * _Nonnull name; @property (strong, nonatomic) NSString * _Nonnull value; - (instancetype)init; @end -@interface CHIPContentLauncherClusterContentLaunchParamater : NSObject +@interface CHIPContentLauncherClusterParameter : NSObject @property (strong, nonatomic) NSNumber * _Nonnull type; @property (strong, nonatomic) NSString * _Nonnull value; @property (strong, nonatomic) NSArray * _Nonnull externalIDList; - (instancetype)init; @end -@interface CHIPContentLauncherClusterContentLaunchStyleInformation : NSObject +@interface CHIPContentLauncherClusterContentSearch : NSObject +@property (strong, nonatomic) NSArray * _Nonnull parameterList; +- (instancetype)init; +@end + +@interface CHIPContentLauncherClusterStyleInformation : NSObject @property (strong, nonatomic) NSString * _Nonnull imageUrl; @property (strong, nonatomic) NSString * _Nonnull color; -@property (strong, nonatomic) CHIPContentLauncherClusterContentLaunchDimension * _Nonnull size; +@property (strong, nonatomic) CHIPContentLauncherClusterDimension * _Nonnull size; - (instancetype)init; @end -@interface CHIPContentLauncherClusterContentLaunchBrandingInformation : NSObject +@interface CHIPContentLauncherClusterBrandingInformation : NSObject @property (strong, nonatomic) NSString * _Nonnull providerName; -@property (strong, nonatomic) CHIPContentLauncherClusterContentLaunchStyleInformation * _Nonnull background; -@property (strong, nonatomic) CHIPContentLauncherClusterContentLaunchStyleInformation * _Nonnull logo; -@property (strong, nonatomic) CHIPContentLauncherClusterContentLaunchStyleInformation * _Nonnull progressBar; -@property (strong, nonatomic) CHIPContentLauncherClusterContentLaunchStyleInformation * _Nonnull splash; -@property (strong, nonatomic) CHIPContentLauncherClusterContentLaunchStyleInformation * _Nonnull waterMark; +@property (strong, nonatomic) CHIPContentLauncherClusterStyleInformation * _Nonnull background; +@property (strong, nonatomic) CHIPContentLauncherClusterStyleInformation * _Nonnull logo; +@property (strong, nonatomic) CHIPContentLauncherClusterStyleInformation * _Nonnull progressBar; +@property (strong, nonatomic) CHIPContentLauncherClusterStyleInformation * _Nonnull splash; +@property (strong, nonatomic) CHIPContentLauncherClusterStyleInformation * _Nonnull waterMark; - (instancetype)init; @end -@interface CHIPAudioOutputClusterAudioOutputInfo : NSObject +@interface CHIPAudioOutputClusterOutputInfo : NSObject @property (strong, nonatomic) NSNumber * _Nonnull index; @property (strong, nonatomic) NSNumber * _Nonnull outputType; @property (strong, nonatomic) NSString * _Nonnull name; - (instancetype)init; @end -@interface CHIPApplicationLauncherClusterApplicationLauncherApp : NSObject +@interface CHIPApplicationLauncherClusterApplication : NSObject @property (strong, nonatomic) NSNumber * _Nonnull catalogVendorId; @property (strong, nonatomic) NSString * _Nonnull applicationId; - (instancetype)init; @end -@interface CHIPApplicationLauncherClusterApplicationLauncherEndpoint : NSObject -@property (strong, nonatomic) CHIPApplicationLauncherClusterApplicationLauncherApp * _Nonnull application; +@interface CHIPApplicationLauncherClusterApplicationEP : NSObject +@property (strong, nonatomic) CHIPApplicationLauncherClusterApplication * _Nonnull application; @property (strong, nonatomic) NSString * _Nonnull endpoint; - (instancetype)init; @end -@interface CHIPApplicationBasicClusterApplicationBasicApp : NSObject +@interface CHIPApplicationBasicClusterApplication : NSObject @property (strong, nonatomic) NSNumber * _Nonnull catalogVendorId; @property (strong, nonatomic) NSString * _Nonnull applicationId; - (instancetype)init; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm index 00e1b8bd5e8b4d..ceed1a9f390e45 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm @@ -185,6 +185,21 @@ - (instancetype)init } @end +@implementation CHIPOtaSoftwareUpdateRequestorClusterProviderLocation +- (instancetype)init +{ + if (self = [super init]) { + + _fabricIndex = @(0); + + _providerNodeID = @(0); + + _endpoint = @(0); + } + return self; +} +@end + @implementation CHIPGeneralCommissioningClusterBasicCommissioningInfoType - (instancetype)init { @@ -456,35 +471,58 @@ - (instancetype)init } @end -@implementation CHIPGroupKeyManagementClusterGroupKey +@implementation CHIPGroupKeyManagementClusterGroupInfo - (instancetype)init { if (self = [super init]) { - _vendorId = @(0); + _fabricIndex = @(0); - _groupKeyIndex = @(0); + _groupId = @(0); - _groupKeyRoot = [NSData data]; + _endpoints = [NSArray array]; - _groupKeyEpochStartTime = @(0); + _groupName = @""; + } + return self; +} +@end - _groupKeySecurityPolicy = @(0); +@implementation CHIPGroupKeyManagementClusterGroupKey +- (instancetype)init +{ + if (self = [super init]) { + + _fabricIndex = @(0); + + _groupId = @(0); + + _groupKeySetID = @(0); } return self; } @end -@implementation CHIPGroupKeyManagementClusterGroupState +@implementation CHIPGroupKeyManagementClusterGroupKeySet - (instancetype)init { if (self = [super init]) { - _vendorId = @(0); + _groupKeySetID = @(0); + + _securityPolicy = @(0); + + _epochKey0 = [NSData data]; + + _epochStartTime0 = @(0); + + _epochKey1 = [NSData data]; - _vendorGroupId = @(0); + _epochStartTime1 = @(0); - _groupKeySetIndex = @(0); + _epochKey2 = [NSData data]; + + _epochStartTime2 = @(0); } return self; } @@ -570,7 +608,7 @@ - (instancetype)init } @end -@implementation CHIPTvChannelClusterTvChannelInfo +@implementation CHIPChannelClusterChannelInfo - (instancetype)init { if (self = [super init]) { @@ -589,7 +627,7 @@ - (instancetype)init } @end -@implementation CHIPTvChannelClusterTvChannelLineupInfo +@implementation CHIPChannelClusterLineupInfo - (instancetype)init { if (self = [super init]) { @@ -606,7 +644,7 @@ - (instancetype)init } @end -@implementation CHIPTargetNavigatorClusterNavigateTargetTargetInfo +@implementation CHIPTargetNavigatorClusterTargetInfo - (instancetype)init { if (self = [super init]) { @@ -619,7 +657,7 @@ - (instancetype)init } @end -@implementation CHIPMediaPlaybackClusterMediaPlaybackPosition +@implementation CHIPMediaPlaybackClusterPlaybackPosition - (instancetype)init { if (self = [super init]) { @@ -632,7 +670,7 @@ - (instancetype)init } @end -@implementation CHIPMediaInputClusterMediaInputInfo +@implementation CHIPMediaInputClusterInputInfo - (instancetype)init { if (self = [super init]) { @@ -649,7 +687,7 @@ - (instancetype)init } @end -@implementation CHIPContentLauncherClusterContentLaunchDimension +@implementation CHIPContentLauncherClusterDimension - (instancetype)init { if (self = [super init]) { @@ -664,7 +702,7 @@ - (instancetype)init } @end -@implementation CHIPContentLauncherClusterContentLaunchAdditionalInfo +@implementation CHIPContentLauncherClusterAdditionalInfo - (instancetype)init { if (self = [super init]) { @@ -677,7 +715,7 @@ - (instancetype)init } @end -@implementation CHIPContentLauncherClusterContentLaunchParamater +@implementation CHIPContentLauncherClusterParameter - (instancetype)init { if (self = [super init]) { @@ -692,7 +730,18 @@ - (instancetype)init } @end -@implementation CHIPContentLauncherClusterContentLaunchStyleInformation +@implementation CHIPContentLauncherClusterContentSearch +- (instancetype)init +{ + if (self = [super init]) { + + _parameterList = [NSArray array]; + } + return self; +} +@end + +@implementation CHIPContentLauncherClusterStyleInformation - (instancetype)init { if (self = [super init]) { @@ -701,34 +750,34 @@ - (instancetype)init _color = @""; - _size = [CHIPContentLauncherClusterContentLaunchDimension new]; + _size = [CHIPContentLauncherClusterDimension new]; } return self; } @end -@implementation CHIPContentLauncherClusterContentLaunchBrandingInformation +@implementation CHIPContentLauncherClusterBrandingInformation - (instancetype)init { if (self = [super init]) { _providerName = @""; - _background = [CHIPContentLauncherClusterContentLaunchStyleInformation new]; + _background = [CHIPContentLauncherClusterStyleInformation new]; - _logo = [CHIPContentLauncherClusterContentLaunchStyleInformation new]; + _logo = [CHIPContentLauncherClusterStyleInformation new]; - _progressBar = [CHIPContentLauncherClusterContentLaunchStyleInformation new]; + _progressBar = [CHIPContentLauncherClusterStyleInformation new]; - _splash = [CHIPContentLauncherClusterContentLaunchStyleInformation new]; + _splash = [CHIPContentLauncherClusterStyleInformation new]; - _waterMark = [CHIPContentLauncherClusterContentLaunchStyleInformation new]; + _waterMark = [CHIPContentLauncherClusterStyleInformation new]; } return self; } @end -@implementation CHIPAudioOutputClusterAudioOutputInfo +@implementation CHIPAudioOutputClusterOutputInfo - (instancetype)init { if (self = [super init]) { @@ -743,7 +792,7 @@ - (instancetype)init } @end -@implementation CHIPApplicationLauncherClusterApplicationLauncherApp +@implementation CHIPApplicationLauncherClusterApplication - (instancetype)init { if (self = [super init]) { @@ -756,12 +805,12 @@ - (instancetype)init } @end -@implementation CHIPApplicationLauncherClusterApplicationLauncherEndpoint +@implementation CHIPApplicationLauncherClusterApplicationEP - (instancetype)init { if (self = [super init]) { - _application = [CHIPApplicationLauncherClusterApplicationLauncherApp new]; + _application = [CHIPApplicationLauncherClusterApplication new]; _endpoint = @""; } @@ -769,7 +818,7 @@ - (instancetype)init } @end -@implementation CHIPApplicationBasicClusterApplicationBasicApp +@implementation CHIPApplicationBasicClusterApplication - (instancetype)init { if (self = [super init]) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h index 5aa678b0be1c45..e883fcb8d4b30e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -71,6 +71,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeProductIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeApplicationStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeApplicationVersionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAllowedVendorListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @@ -207,6 +208,18 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Channel + * + */ +@interface CHIPTestChannel : CHIPChannel + +- (void)writeAttributeChannelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; + +@end + /** * Cluster Color Control * @@ -268,7 +281,7 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestContentLauncher : CHIPContentLauncher -- (void)writeAttributeAcceptsHeaderListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeAcceptHeaderListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @@ -433,8 +446,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestGroupKeyManagement : CHIPGroupKeyManagement -- (void)writeAttributeGroupsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeGroupKeysWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeGroupKeyMapWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeGroupTableWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMaxGroupsPerFabricWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeMaxGroupKeysPerFabricWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @@ -604,6 +620,9 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPTestOtaSoftwareUpdateRequestor : CHIPOtaSoftwareUpdateRequestor - (void)writeAttributeUpdatePossibleWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeUpdateStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeUpdateStateProgressWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @@ -813,18 +832,6 @@ NS_ASSUME_NONNULL_BEGIN @end -/** - * Cluster TV Channel - * - */ -@interface CHIPTestTvChannel : CHIPTvChannel - -- (void)writeAttributeChannelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - -@end - /** * Cluster Target Navigator * @@ -1000,7 +1007,6 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestUserLabel : CHIPUserLabel -- (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; @end @@ -1053,22 +1059,24 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPTestWindowCovering : CHIPWindowCovering - (void)writeAttributeTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionLiftWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionTiltWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeCurrentPositionLiftWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeCurrentPositionTiltWithValue:(NSNumber * _Nullable)value + completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeConfigStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionLiftPercentageWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeCurrentPositionLiftPercentageWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionTiltPercentageWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeCurrentPositionTiltPercentageWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeOperationalStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTargetPositionLiftPercent100thsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeTargetPositionLiftPercent100thsWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeTargetPositionTiltPercent100thsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeTargetPositionTiltPercent100thsWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeEndProductTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionLiftPercent100thsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeCurrentPositionLiftPercent100thsWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeCurrentPositionTiltPercent100thsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeCurrentPositionTiltPercent100thsWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeInstalledOpenLimitLiftWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index 633f34100cfdb8..b516ec76659c6d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -391,7 +391,7 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = ApplicationBasic::Attributes::ApplicationStatus::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = static_cast>(value.unsignedCharValue); auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -416,6 +416,46 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeAllowedVendorListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ApplicationBasic::Attributes::AllowedVendorList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = static_castmList[i_0])>>( + element_0.unsignedShortValue); + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -617,11 +657,11 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPAudioOutputClusterAudioOutputInfo class]]) { + if (![value[i_0] isKindOfClass:[CHIPAudioOutputClusterOutputInfo class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (CHIPAudioOutputClusterAudioOutputInfo *) value[i_0]; + auto element_0 = (CHIPAudioOutputClusterOutputInfo *) value[i_0]; listHolder_0->mList[i_0].index = element_0.index.unsignedCharValue; listHolder_0->mList[i_0].outputType = static_castmList[i_0].outputType)>>( @@ -1736,6 +1776,119 @@ new CHIPDefaultSuccessCallbackBridge( @end +@interface CHIPTestChannel () +@property (readonly) chip::Controller::ChannelClusterTest cppCluster; +@end + +@implementation CHIPTestChannel + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)writeAttributeChannelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Channel::Attributes::ChannelList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[CHIPChannelClusterChannelInfo class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (CHIPChannelClusterChannelInfo *) value[i_0]; + listHolder_0->mList[i_0].majorNumber = element_0.majorNumber.unsignedShortValue; + listHolder_0->mList[i_0].minorNumber = element_0.minorNumber.unsignedShortValue; + listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; + listHolder_0->mList[i_0].callSign = [self asCharSpan:element_0.callSign]; + listHolder_0->mList[i_0].affiliateCallSign = [self asCharSpan:element_0.affiliateCallSign]; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Channel::Attributes::AttributeList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) value[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = Channel::Attributes::ClusterRevision::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +@end + @interface CHIPTestColorControl () @property (readonly) chip::Controller::ColorControlClusterTest cppCluster; @end @@ -2522,7 +2675,7 @@ @implementation CHIPTestContentLauncher return &_cppCluster; } -- (void)writeAttributeAcceptsHeaderListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeAcceptHeaderListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -2531,7 +2684,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = ContentLauncher::Attributes::AcceptsHeaderList::TypeInfo; + using TypeInfo = ContentLauncher::Attributes::AcceptHeaderList::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -2543,12 +2696,12 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSData class]]) { + if (![value[i_0] isKindOfClass:[NSString class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (NSData *) value[i_0]; - listHolder_0->mList[i_0] = [self asByteSpan:element_0]; + auto element_0 = (NSString *) value[i_0]; + listHolder_0->mList[i_0] = [self asCharSpan:element_0]; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -4381,7 +4534,7 @@ @implementation CHIPTestGroupKeyManagement return &_cppCluster; } -- (void)writeAttributeGroupsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeGroupKeyMapWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -4390,7 +4543,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::Groups::TypeInfo; + using TypeInfo = GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -4402,14 +4555,14 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupState class]]) { + if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupKey class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (CHIPGroupKeyManagementClusterGroupState *) value[i_0]; - listHolder_0->mList[i_0].vendorId = element_0.vendorId.unsignedShortValue; - listHolder_0->mList[i_0].vendorGroupId = element_0.vendorGroupId.unsignedShortValue; - listHolder_0->mList[i_0].groupKeySetIndex = element_0.groupKeySetIndex.unsignedShortValue; + auto element_0 = (CHIPGroupKeyManagementClusterGroupKey *) value[i_0]; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedShortValue; + listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; + listHolder_0->mList[i_0].groupKeySetID = element_0.groupKeySetID.unsignedShortValue; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -4422,7 +4575,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeGroupKeysWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeGroupTableWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -4431,7 +4584,7 @@ new CHIPDefaultSuccessCallbackBridge( }, ^(Cancelable * success, Cancelable * failure) { ListFreer listFreer; - using TypeInfo = GroupKeyManagement::Attributes::GroupKeys::TypeInfo; + using TypeInfo = GroupKeyManagement::Attributes::GroupTable::TypeInfo; TypeInfo::Type cppValue; { using ListType_0 = std::remove_reference_t; @@ -4443,18 +4596,36 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupKey class]]) { + if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupInfo class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (CHIPGroupKeyManagementClusterGroupKey *) value[i_0]; - listHolder_0->mList[i_0].vendorId = element_0.vendorId.unsignedShortValue; - listHolder_0->mList[i_0].groupKeyIndex = element_0.groupKeyIndex.unsignedShortValue; - listHolder_0->mList[i_0].groupKeyRoot = [self asByteSpan:element_0.groupKeyRoot]; - listHolder_0->mList[i_0].groupKeyEpochStartTime = element_0.groupKeyEpochStartTime.unsignedLongLongValue; - listHolder_0->mList[i_0].groupKeySecurityPolicy - = static_castmList[i_0].groupKeySecurityPolicy)>>( - element_0.groupKeySecurityPolicy.unsignedCharValue); + auto element_0 = (CHIPGroupKeyManagementClusterGroupInfo *) value[i_0]; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedShortValue; + listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue; + { + using ListType_2 = std::remove_reference_tmList[i_0].endpoints)>; + using ListMemberType_2 = ListMemberTypeGetter::Type; + if (element_0.endpoints.count != 0) { + auto * listHolder_2 = new ListHolder(element_0.endpoints.count); + if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_2); + for (size_t i_2 = 0; i_2 < element_0.endpoints.count; ++i_2) { + if (![element_0.endpoints[i_2] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_2 = (NSNumber *) element_0.endpoints[i_2]; + listHolder_2->mList[i_2] = element_2.unsignedShortValue; + } + listHolder_0->mList[i_0].endpoints = ListType_2(listHolder_2->mList, element_0.endpoints.count); + } else { + listHolder_0->mList[i_0].endpoints = ListType_2(); + } + } + listHolder_0->mList[i_0].groupName = [self asCharSpan:element_0.groupName]; } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -4467,6 +4638,43 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeMaxGroupsPerFabricWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeMaxGroupKeysPerFabricWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -5250,11 +5458,11 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPMediaInputClusterMediaInputInfo class]]) { + if (![value[i_0] isKindOfClass:[CHIPMediaInputClusterInputInfo class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (CHIPMediaInputClusterMediaInputInfo *) value[i_0]; + auto element_0 = (CHIPMediaInputClusterInputInfo *) value[i_0]; listHolder_0->mList[i_0].index = element_0.index.unsignedCharValue; listHolder_0->mList[i_0].inputType = static_castmList[i_0].inputType)>>( @@ -5372,7 +5580,7 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = MediaPlayback::Attributes::PlaybackState::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = static_cast>(value.unsignedCharValue); auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -5991,6 +6199,47 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeUpdateStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateState::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeUpdateStateProgressWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedCharValue; + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -8179,119 +8428,6 @@ new CHIPDefaultSuccessCallbackBridge( @end -@interface CHIPTestTvChannel () -@property (readonly) chip::Controller::TvChannelClusterTest cppCluster; -@end - -@implementation CHIPTestTvChannel - -- (chip::Controller::ClusterBase *)getCluster -{ - return &_cppCluster; -} - -- (void)writeAttributeChannelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TvChannel::Attributes::ChannelList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPTvChannelClusterTvChannelInfo class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPTvChannelClusterTvChannelInfo *) value[i_0]; - listHolder_0->mList[i_0].majorNumber = element_0.majorNumber.unsignedShortValue; - listHolder_0->mList[i_0].minorNumber = element_0.minorNumber.unsignedShortValue; - listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; - listHolder_0->mList[i_0].callSign = [self asCharSpan:element_0.callSign]; - listHolder_0->mList[i_0].affiliateCallSign = [self asCharSpan:element_0.affiliateCallSign]; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TvChannel::Attributes::AttributeList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[NSNumber class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (NSNumber *) value[i_0]; - listHolder_0->mList[i_0] = element_0.unsignedIntValue; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = TvChannel::Attributes::ClusterRevision::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -@end - @interface CHIPTestTargetNavigator () @property (readonly) chip::Controller::TargetNavigatorClusterTest cppCluster; @end @@ -8324,11 +8460,11 @@ new CHIPDefaultSuccessCallbackBridge( } listFreer.add(listHolder_0); for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPTargetNavigatorClusterNavigateTargetTargetInfo class]]) { + if (![value[i_0] isKindOfClass:[CHIPTargetNavigatorClusterTargetInfo class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_0 = (CHIPTargetNavigatorClusterNavigateTargetTargetInfo *) value[i_0]; + auto element_0 = (CHIPTargetNavigatorClusterTargetInfo *) value[i_0]; listHolder_0->mList[i_0].identifier = element_0.identifier.unsignedCharValue; listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name]; } @@ -10577,48 +10713,6 @@ @implementation CHIPTestUserLabel return &_cppCluster; } -- (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = UserLabel::Attributes::LabelList::TypeInfo; - TypeInfo::Type cppValue; - { - using ListType_0 = std::remove_reference_t; - using ListMemberType_0 = ListMemberTypeGetter::Type; - if (value.count != 0) { - auto * listHolder_0 = new ListHolder(value.count); - if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { - return CHIP_ERROR_INVALID_ARGUMENT; - } - listFreer.add(listHolder_0); - for (size_t i_0 = 0; i_0 < value.count; ++i_0) { - if (![value[i_0] isKindOfClass:[CHIPUserLabelClusterLabelStruct class]]) { - // Wrong kind of value. - return CHIP_ERROR_INVALID_ARGUMENT; - } - auto element_0 = (CHIPUserLabelClusterLabelStruct *) value[i_0]; - listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label]; - listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label]; - listHolder_0->mList[i_0].value = [self asCharSpan:element_0.value]; - listHolder_0->mList[i_0].value = [self asCharSpan:element_0.value]; - } - cppValue = ListType_0(listHolder_0->mList, value.count); - } else { - cppValue = ListType_0(); - } - } - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11080,7 +11174,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeCurrentPositionLiftWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeCurrentPositionLiftWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -11091,14 +11185,19 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = WindowCovering::Attributes::CurrentPositionLift::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeCurrentPositionTiltWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +- (void)writeAttributeCurrentPositionTiltWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( self.callbackQueue, @@ -11109,7 +11208,12 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = WindowCovering::Attributes::CurrentPositionTilt::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -11134,7 +11238,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeCurrentPositionLiftPercentageWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeCurrentPositionLiftPercentageWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11146,14 +11250,19 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedCharValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeCurrentPositionTiltPercentageWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeCurrentPositionTiltPercentageWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11165,7 +11274,12 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedCharValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -11190,7 +11304,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeTargetPositionLiftPercent100thsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeTargetPositionLiftPercent100thsWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11202,14 +11316,19 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeTargetPositionTiltPercent100thsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeTargetPositionTiltPercent100thsWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11221,7 +11340,12 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -11246,7 +11370,7 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeCurrentPositionLiftPercent100thsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeCurrentPositionLiftPercent100thsWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11258,14 +11382,19 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); }); } -- (void)writeAttributeCurrentPositionTiltPercent100thsWithValue:(NSNumber * _Nonnull)value +- (void)writeAttributeCurrentPositionTiltPercent100thsWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler { new CHIPDefaultSuccessCallbackBridge( @@ -11277,7 +11406,12 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = value.unsignedShortValue; + } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 4fd3677cd01583..cfb6aac8859b70 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -56,6 +56,15 @@ void WaitForMs(XCTestExpectation * expectation, dispatch_queue_t queue, unsigned }); } +void Log(XCTestExpectation * expectation, dispatch_queue_t queue, NSString * message) +{ + NSLog(@"%@", message); + [expectation fulfill]; +} + +// Stub for User Prompts for XCTests to run. +void UserPrompt(XCTestExpectation * expectation, dispatch_queue_t queue, NSString * message) { [expectation fulfill]; } + void WaitForCommissionee(XCTestExpectation * expectation, dispatch_queue_t queue) { CHIPDeviceController * controller = [CHIPDeviceController sharedController]; @@ -521,7 +530,9 @@ - (void)testSendClusterTest_TC_BI_2_1_000009_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 15); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 15); + } } [expectation fulfill]; @@ -1076,7 +1087,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000002_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); + } } [expectation fulfill]; @@ -1170,7 +1183,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000006_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); + } } [expectation fulfill]; @@ -1265,7 +1280,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000010_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -1358,7 +1375,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000014_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -1429,7 +1448,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000017_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -1453,7 +1474,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000018_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 2); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 2); + } } [expectation fulfill]; @@ -2159,7 +2182,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000049_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -2255,7 +2280,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000053_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -2355,7 +2382,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000057_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -2504,7 +2533,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000063_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -2603,7 +2634,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000067_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 254); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 254U); + } } [expectation fulfill]; @@ -2674,7 +2707,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000070_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 4); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 4); + } } [expectation fulfill]; @@ -2769,7 +2804,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000074_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6); + } } [expectation fulfill]; @@ -2839,7 +2876,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000077_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -2908,7 +2947,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000080_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -2996,7 +3037,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000084_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3065,7 +3108,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000087_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3153,7 +3198,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000091_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3222,7 +3269,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000094_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3310,7 +3359,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000098_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3379,7 +3430,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000101_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3467,7 +3520,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000105_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3536,7 +3591,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000108_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3624,7 +3681,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000112_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3693,7 +3752,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000115_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3781,7 +3842,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000119_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3851,7 +3914,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000122_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3921,7 +3986,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000125_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -3991,7 +4058,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000128_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4080,7 +4149,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000132_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4150,7 +4221,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000135_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4239,7 +4312,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000139_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -4309,7 +4384,9 @@ - (void)testSendClusterTest_TC_CC_2_1_000142_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65279U); + } } [expectation fulfill]; @@ -7051,7 +7128,7 @@ - (void)testSendClusterTest_TC_CC_8_1_000002_ReadAttribute } - (void)testSendClusterTest_TC_CC_8_1_000003_ColorLoopSet { - XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributs"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Color Loop Set Command - Set all Attributes"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -7068,7 +7145,7 @@ - (void)testSendClusterTest_TC_CC_8_1_000003_ColorLoopSet params.optionsOverride = [NSNumber numberWithUnsignedChar:0]; [cluster colorLoopSetWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Color Loop Set Command - Set all Attributs Error: %@", err); + NSLog(@"Color Loop Set Command - Set all Attributes Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -9011,6 +9088,108 @@ - (void)testSendClusterTest_TC_CC_9_3_000014_Off [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_DD_1_5_000000_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, + @"Verify that the onboarding payload for NFC tags SHALL use NDEF URI Record Type Definition as defined by NFC Forum in URI " + @"Record Type Definition RTD URI"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_DD_1_6_000000_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, @"Scan the DUTs QR code using a QR code reader"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DD_1_6_000001_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1 verification"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, + @"Verify the QR code gets scanned successfully and the QR code must be of sufficient size and contrast respective to " + @"surface material as to be readable with standard readers such as smartphones in normal lighting conditions"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DD_1_6_000002_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step 2 verificaiton"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, @"Verify QR code version is 1 or higher"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_DD_1_7_000000_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, @"Verify manual pairing code is printed on the device or in additional provided materials"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DD_1_7_000001_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, + @"Verify that the Manual Pairing Code should be printed using a minimum font size of 6 points typically producing a " + @"typeface height of 2.1 mm"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_DD_1_8_000000_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, @"Scan the device QR code using DUT"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DD_1_8_000001_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1 verification"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, + @"Verify the DUT is able to scan and parse the QR code successfully to onboard the device onto the CHIP network"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_DD_1_9_000000_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Precondition"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, @"Verify that the manual pairing code is printed on the device or in additional provided materials"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DD_1_9_000001_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, + @"Provide the 11 digit or 21 digit pairing code from the Device in text speech or any format supported by DUT"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_DD_1_9_000002_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Step 1 verification"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, + @"Verify that the manual pairing code can be provided to DUT and parsed to onboard the device onto the CHIP network"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_DM_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -10577,7 +10756,9 @@ - (void)testSendClusterTest_TC_LVL_3_1_000014_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedCharValue], 255); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], 255); + } } [expectation fulfill]; @@ -11221,7 +11402,9 @@ - (void)testSendClusterTest_TC_OCC_2_1_000001_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 1); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 1); + } } [expectation fulfill]; @@ -11292,7 +11475,9 @@ - (void)testSendClusterTest_TC_OCC_2_1_000004_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 3); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 3); + } } [expectation fulfill]; @@ -11366,11 +11551,15 @@ - (void)testSendClusterTest_TC_OCC_2_1_000007_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 7); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 7); + } } [expectation fulfill]; @@ -14048,7 +14237,9 @@ - (void)testSendClusterTest_TC_RH_2_1_000002_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 9999); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 9999U); + } } [expectation fulfill]; @@ -14437,11 +14628,15 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000003_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 3000); + } } [expectation fulfill]; @@ -14541,11 +14736,15 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000007_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 3000); + } } [expectation fulfill]; @@ -14645,11 +14844,15 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000011_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue shortValue], 3200); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 3200); + } } [expectation fulfill]; @@ -14749,11 +14952,15 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000015_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue shortValue], 3200); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 3200); + } } [expectation fulfill]; @@ -14853,11 +15060,15 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000019_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue shortValue], 2600); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 2600); + } } [expectation fulfill]; @@ -14957,11 +15168,15 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000023_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue shortValue], 2600); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 2600); + } } [expectation fulfill]; @@ -15061,11 +15276,15 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000027_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 3000); + } } [expectation fulfill]; @@ -15165,11 +15384,15 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000031_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], 700); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue shortValue], 3000); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 3000); + } } [expectation fulfill]; @@ -15269,11 +15492,15 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000035_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue shortValue], 3200); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 3200); + } } [expectation fulfill]; @@ -15373,11 +15600,15 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000039_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], 1600); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue shortValue], 3200); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 3200); + } } [expectation fulfill]; @@ -15477,7 +15708,9 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000043_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 5); + } } [expectation fulfill]; @@ -15577,7 +15810,9 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000047_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); + } } [expectation fulfill]; @@ -15674,7 +15909,9 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000051_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue charValue], 25); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue charValue], 25); + } } [expectation fulfill]; @@ -15749,7 +15986,9 @@ - (void)testSendClusterTest_TC_TSTAT_2_1_000054_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 6); + } } [expectation fulfill]; @@ -17904,11 +18143,15 @@ - (void)testSendClusterTest_TC_WNCV_1_1_000001_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 5); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 5U); + } } { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 200); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 200U); + } } [expectation fulfill]; @@ -17955,7 +18198,9 @@ - (void)testSendClusterTest_TC_WNCV_1_1_000003_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedShortValue], 201); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], 201U); + } } [expectation fulfill]; @@ -17979,7 +18224,9 @@ - (void)testSendClusterTest_TC_WNCV_1_1_000004_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 32768); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 32768UL); + } } [expectation fulfill]; @@ -18025,7 +18272,9 @@ - (void)testSendClusterTest_TC_WNCV_1_1_000006_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedIntValue], 32769); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedIntValue], 32769UL); + } } [expectation fulfill]; @@ -18058,7 +18307,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000001_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); + } } [expectation fulfill]; @@ -18103,7 +18354,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000003_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedCharValue], 250); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], 250); + } } [expectation fulfill]; @@ -18127,7 +18380,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000004_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 63); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 63); + } } [expectation fulfill]; @@ -18173,7 +18428,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000006_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedCharValue], 128); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], 128); + } } [expectation fulfill]; @@ -18198,7 +18455,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000007_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 63); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 63); + } } [expectation fulfill]; @@ -18246,7 +18505,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000009_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedCharValue], 128); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], 128); + } } [expectation fulfill]; @@ -18271,7 +18532,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000010_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 23); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 23); + } } [expectation fulfill]; @@ -18319,7 +18582,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000012_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedCharValue], 250); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], 250); + } } [expectation fulfill]; @@ -18343,7 +18608,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000013_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 15); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 15); + } } [expectation fulfill]; @@ -18415,7 +18682,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000016_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); + } } [expectation fulfill]; @@ -18466,7 +18735,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000018_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedShortValue], 20000); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], 20000U); + } } [expectation fulfill]; @@ -18492,7 +18763,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000019_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); + } } [expectation fulfill]; @@ -18543,7 +18816,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000021_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedShortValue], 20000); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], 20000U); + } } [expectation fulfill]; @@ -18569,7 +18844,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000022_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); + } } [expectation fulfill]; @@ -18620,7 +18897,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000024_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedShortValue], 20000); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], 20000U); + } } [expectation fulfill]; @@ -18646,7 +18925,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000025_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); + } } [expectation fulfill]; @@ -18697,7 +18978,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000027_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedShortValue], 20000); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], 20000U); + } } [expectation fulfill]; @@ -18722,7 +19005,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000028_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -18772,7 +19057,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000030_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -18797,7 +19084,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000031_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -18847,7 +19136,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000033_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -18872,7 +19163,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000034_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -18922,7 +19215,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000036_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -18947,7 +19242,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000037_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -18997,7 +19294,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000039_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -19021,7 +19320,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000040_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2047); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 2047U); + } } [expectation fulfill]; @@ -19067,7 +19368,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000042_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedShortValue], 4096); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], 4096U); + } } [expectation fulfill]; @@ -19092,7 +19395,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000043_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -19141,7 +19446,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000045_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -19166,7 +19473,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000046_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -19215,7 +19524,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000048_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65535U); + } } [expectation fulfill]; @@ -19241,7 +19552,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000049_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100); + } } [expectation fulfill]; @@ -19292,7 +19605,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000051_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedCharValue], 200); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], 200); + } } [expectation fulfill]; @@ -19318,7 +19633,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000052_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 100); + } } [expectation fulfill]; @@ -19369,7 +19686,9 @@ - (void)testSendClusterTest_TC_WNCV_2_1_000054_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedCharValue], 200); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], 200); + } } [expectation fulfill]; @@ -19435,7 +19754,9 @@ - (void)testSendClusterTest_TC_WNCV_2_4_000002_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 9); + } } [expectation fulfill]; @@ -19492,7 +19813,9 @@ - (void)testSendClusterTest_TC_WNCV_2_5_000002_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 23); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 23); + } } [expectation fulfill]; @@ -22247,6 +22570,52 @@ - (void)testSendClusterTestCluster_000109_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTestCluster_000110_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING with weird chars"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id octetStringArgument; + octetStringArgument = [[NSData alloc] initWithBytes:"\x0d\x0a\xff\x22\xa0" length:5]; + [cluster writeAttributeOctetStringWithValue:octetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute OCTET_STRING with weird chars Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000111_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING with weird chars"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute OCTET_STRING with weird chars Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"\x0d\x0a\xff\x22\xa0" length:5]]); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000112_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; @@ -22268,7 +22637,7 @@ - (void)testSendClusterTestCluster_000110_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000111_ReadAttribute +- (void)testSendClusterTestCluster_000113_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING"]; @@ -22292,7 +22661,7 @@ - (void)testSendClusterTestCluster_000111_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000112_WriteAttribute +- (void)testSendClusterTestCluster_000114_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; @@ -22313,7 +22682,7 @@ - (void)testSendClusterTestCluster_000112_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000113_ReadAttribute +- (void)testSendClusterTestCluster_000115_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute OCTET_STRING"]; @@ -22337,7 +22706,7 @@ - (void)testSendClusterTestCluster_000113_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000114_WriteAttribute +- (void)testSendClusterTestCluster_000116_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute OCTET_STRING"]; @@ -22359,7 +22728,7 @@ - (void)testSendClusterTestCluster_000114_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000115_ReadAttribute +- (void)testSendClusterTestCluster_000117_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_OCTET_STRING Default Value"]; @@ -22383,7 +22752,7 @@ - (void)testSendClusterTestCluster_000115_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000116_WriteAttribute +- (void)testSendClusterTestCluster_000118_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_OCTET_STRING"]; @@ -22409,7 +22778,7 @@ - (void)testSendClusterTestCluster_000116_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000117_ReadAttribute +- (void)testSendClusterTestCluster_000119_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_OCTET_STRING"]; @@ -22439,7 +22808,7 @@ - (void)testSendClusterTestCluster_000117_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000118_WriteAttribute +- (void)testSendClusterTestCluster_000120_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_OCTET_STRING"]; @@ -22461,7 +22830,7 @@ - (void)testSendClusterTestCluster_000118_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000119_ReadAttribute +- (void)testSendClusterTestCluster_000121_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING Default Value"]; @@ -22485,7 +22854,7 @@ - (void)testSendClusterTestCluster_000119_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000120_WriteAttribute +- (void)testSendClusterTestCluster_000122_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING"]; @@ -22507,7 +22876,7 @@ - (void)testSendClusterTestCluster_000120_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000121_ReadAttribute +- (void)testSendClusterTestCluster_000123_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING"]; @@ -22531,7 +22900,7 @@ - (void)testSendClusterTestCluster_000121_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000122_WriteAttribute +- (void)testSendClusterTestCluster_000124_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING - Value too long"]; @@ -22552,7 +22921,7 @@ - (void)testSendClusterTestCluster_000122_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000123_ReadAttribute +- (void)testSendClusterTestCluster_000125_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute CHAR_STRING"]; @@ -22576,7 +22945,7 @@ - (void)testSendClusterTestCluster_000123_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000124_WriteAttribute +- (void)testSendClusterTestCluster_000126_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute CHAR_STRING - Empty"]; @@ -22598,7 +22967,7 @@ - (void)testSendClusterTestCluster_000124_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000125_ReadAttribute +- (void)testSendClusterTestCluster_000127_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_CHAR_STRING Default Value"]; @@ -22622,7 +22991,7 @@ - (void)testSendClusterTestCluster_000125_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000126_WriteAttribute +- (void)testSendClusterTestCluster_000128_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_CHAR_STRING"]; @@ -22647,7 +23016,7 @@ - (void)testSendClusterTestCluster_000126_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000127_ReadAttribute +- (void)testSendClusterTestCluster_000129_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LONG_CHAR_STRING"]; @@ -22675,7 +23044,7 @@ - (void)testSendClusterTestCluster_000127_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000128_WriteAttribute +- (void)testSendClusterTestCluster_000130_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LONG_CHAR_STRING"]; @@ -22697,7 +23066,7 @@ - (void)testSendClusterTestCluster_000128_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000129_ReadAttribute +- (void)testSendClusterTestCluster_000131_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST_LONG_OCTET_STRING"]; @@ -22761,7 +23130,7 @@ - (void)testSendClusterTestCluster_000129_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000130_ReadAttribute +- (void)testSendClusterTestCluster_000132_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Default Value"]; @@ -22785,7 +23154,7 @@ - (void)testSendClusterTestCluster_000130_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000131_WriteAttribute +- (void)testSendClusterTestCluster_000133_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Max Value"]; @@ -22807,7 +23176,7 @@ - (void)testSendClusterTestCluster_000131_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000132_ReadAttribute +- (void)testSendClusterTestCluster_000134_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Max Value"]; @@ -22831,7 +23200,7 @@ - (void)testSendClusterTestCluster_000132_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000133_WriteAttribute +- (void)testSendClusterTestCluster_000135_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_US Min Value"]; @@ -22853,7 +23222,7 @@ - (void)testSendClusterTestCluster_000133_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000134_ReadAttribute +- (void)testSendClusterTestCluster_000136_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_US Min Value"]; @@ -22877,7 +23246,7 @@ - (void)testSendClusterTestCluster_000134_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000135_ReadAttribute +- (void)testSendClusterTestCluster_000137_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Default Value"]; @@ -22901,7 +23270,7 @@ - (void)testSendClusterTestCluster_000135_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000136_WriteAttribute +- (void)testSendClusterTestCluster_000138_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Max Value"]; @@ -22923,7 +23292,7 @@ - (void)testSendClusterTestCluster_000136_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000137_ReadAttribute +- (void)testSendClusterTestCluster_000139_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Max Value"]; @@ -22947,7 +23316,7 @@ - (void)testSendClusterTestCluster_000137_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000138_WriteAttribute +- (void)testSendClusterTestCluster_000140_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute EPOCH_S Min Value"]; @@ -22969,7 +23338,7 @@ - (void)testSendClusterTestCluster_000138_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000139_ReadAttribute +- (void)testSendClusterTestCluster_000141_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute EPOCH_S Min Value"]; @@ -22993,7 +23362,7 @@ - (void)testSendClusterTestCluster_000139_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000140_ReadAttribute +- (void)testSendClusterTestCluster_000142_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute UNSUPPORTED"]; @@ -23022,7 +23391,7 @@ - (void)testSendClusterTestCluster_000140_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000141_WriteAttribute +- (void)testSendClusterTestCluster_000143_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Writeattribute UNSUPPORTED"]; @@ -23049,7 +23418,7 @@ - (void)testSendClusterTestCluster_000141_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000142_Test +- (void)testSendClusterTestCluster_000144_Test { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command to unsupported endpoint"]; @@ -23067,7 +23436,7 @@ - (void)testSendClusterTestCluster_000142_Test [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000143_Test +- (void)testSendClusterTestCluster_000145_Test { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command to unsupported cluster"]; @@ -23085,7 +23454,7 @@ - (void)testSendClusterTestCluster_000143_Test [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000144_ReadAttribute +- (void)testSendClusterTestCluster_000146_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id Default Value"]; @@ -23109,7 +23478,7 @@ - (void)testSendClusterTestCluster_000144_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000145_WriteAttribute +- (void)testSendClusterTestCluster_000147_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute vendor_id"]; @@ -23131,7 +23500,7 @@ - (void)testSendClusterTestCluster_000145_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000146_ReadAttribute +- (void)testSendClusterTestCluster_000148_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute vendor_id"]; @@ -23155,7 +23524,7 @@ - (void)testSendClusterTestCluster_000146_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000147_WriteAttribute +- (void)testSendClusterTestCluster_000149_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Restore attribute vendor_id"]; @@ -23177,7 +23546,7 @@ - (void)testSendClusterTestCluster_000147_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000148_TestEnumsRequest +- (void)testSendClusterTestCluster_000150_TestEnumsRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send a command with a vendor_id and enum"]; @@ -23210,7 +23579,7 @@ - (void)testSendClusterTestCluster_000148_TestEnumsRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000149_TestStructArgumentRequest +- (void)testSendClusterTestCluster_000151_TestStructArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With Struct Argument and arg1.b is true"]; @@ -23248,7 +23617,7 @@ - (void)testSendClusterTestCluster_000149_TestStructArgumentRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000150_TestStructArgumentRequest +- (void)testSendClusterTestCluster_000152_TestStructArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With Struct Argument and arg1.b is false"]; @@ -23286,7 +23655,7 @@ - (void)testSendClusterTestCluster_000150_TestStructArgumentRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000151_TestNestedStructArgumentRequest +- (void)testSendClusterTestCluster_000153_TestNestedStructArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With Nested Struct Argument and arg1.c.b is true"]; @@ -23335,7 +23704,7 @@ - (void)testSendClusterTestCluster_000151_TestNestedStructArgumentRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000152_TestNestedStructArgumentRequest +- (void)testSendClusterTestCluster_000154_TestNestedStructArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With Nested Struct Argument arg1.c.b is false"]; @@ -23383,7 +23752,7 @@ - (void)testSendClusterTestCluster_000152_TestNestedStructArgumentRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000153_TestNestedStructListArgumentRequest +- (void)testSendClusterTestCluster_000155_TestNestedStructListArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true"]; @@ -23478,7 +23847,7 @@ - (void)testSendClusterTestCluster_000153_TestNestedStructListArgumentRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000154_TestNestedStructListArgumentRequest +- (void)testSendClusterTestCluster_000156_TestNestedStructListArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With Nested Struct List Argument and some fields b of arg1.d are false"]; @@ -23573,7 +23942,7 @@ - (void)testSendClusterTestCluster_000154_TestNestedStructListArgumentRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000155_SimpleStructEchoRequest +- (void)testSendClusterTestCluster_000157_SimpleStructEchoRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With Struct Argument and see what we get back"]; @@ -23620,7 +23989,7 @@ - (void)testSendClusterTestCluster_000155_SimpleStructEchoRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000156_TestListInt8UArgumentRequest +- (void)testSendClusterTestCluster_000158_TestListInt8UArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With List of INT8U and none of them is set to 0"]; @@ -23661,7 +24030,7 @@ - (void)testSendClusterTestCluster_000156_TestListInt8UArgumentRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000157_TestListInt8UArgumentRequest +- (void)testSendClusterTestCluster_000159_TestListInt8UArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With List of INT8U and one of them is set to 0"]; @@ -23703,7 +24072,7 @@ - (void)testSendClusterTestCluster_000157_TestListInt8UArgumentRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000158_TestListInt8UReverseRequest +- (void)testSendClusterTestCluster_000160_TestListInt8UReverseRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With List of INT8U and get it reversed"]; @@ -23752,7 +24121,7 @@ - (void)testSendClusterTestCluster_000158_TestListInt8UReverseRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000159_TestListInt8UReverseRequest +- (void)testSendClusterTestCluster_000161_TestListInt8UReverseRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With empty List of INT8U and get an empty list back"]; @@ -23784,7 +24153,7 @@ - (void)testSendClusterTestCluster_000159_TestListInt8UReverseRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000160_TestListStructArgumentRequest +- (void)testSendClusterTestCluster_000162_TestListStructArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With List of Struct Argument and arg1.b of first item is true"]; @@ -23839,7 +24208,7 @@ - (void)testSendClusterTestCluster_000160_TestListStructArgumentRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000161_TestListStructArgumentRequest +- (void)testSendClusterTestCluster_000163_TestListStructArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command With List of Struct Argument and arg1.b of first item is false"]; @@ -23894,7 +24263,7 @@ - (void)testSendClusterTestCluster_000161_TestListStructArgumentRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000162_TestListNestedStructListArgumentRequest +- (void)testSendClusterTestCluster_000164_TestListNestedStructListArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription: @@ -23994,7 +24363,7 @@ - (void)testSendClusterTestCluster_000162_TestListNestedStructListArgumentReques [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000163_TestListNestedStructListArgumentRequest +- (void)testSendClusterTestCluster_000165_TestListNestedStructListArgumentRequest { XCTestExpectation * expectation = [self expectationWithDescription: @@ -24094,7 +24463,7 @@ - (void)testSendClusterTestCluster_000163_TestListNestedStructListArgumentReques [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000164_WriteAttribute +- (void)testSendClusterTestCluster_000166_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LIST With List of INT8U and none of them is set to 0"]; @@ -24124,7 +24493,7 @@ - (void)testSendClusterTestCluster_000164_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000165_ReadAttribute +- (void)testSendClusterTestCluster_000167_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST With List of INT8U"]; @@ -24152,7 +24521,7 @@ - (void)testSendClusterTestCluster_000165_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000166_WriteAttribute +- (void)testSendClusterTestCluster_000168_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LIST With List of OCTET_STRING"]; @@ -24181,7 +24550,7 @@ - (void)testSendClusterTestCluster_000166_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000167_ReadAttribute +- (void)testSendClusterTestCluster_000169_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST With List of OCTET_STRING"]; @@ -24209,7 +24578,7 @@ - (void)testSendClusterTestCluster_000167_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000168_WriteAttribute +- (void)testSendClusterTestCluster_000170_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute LIST With List of LIST_STRUCT_OCTET_STRING"]; @@ -24251,7 +24620,7 @@ - (void)testSendClusterTestCluster_000168_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000169_ReadAttribute +- (void)testSendClusterTestCluster_000171_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute LIST With List of LIST_STRUCT_OCTET_STRING"]; @@ -24292,7 +24661,7 @@ - (void)testSendClusterTestCluster_000169_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000170_TestNullableOptionalRequest +- (void)testSendClusterTestCluster_000172_TestNullableOptionalRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command with optional arg set."]; @@ -24333,7 +24702,7 @@ - (void)testSendClusterTestCluster_000170_TestNullableOptionalRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000171_TestNullableOptionalRequest +- (void)testSendClusterTestCluster_000173_TestNullableOptionalRequest { XCTestExpectation * expectation = [self expectationWithDescription:@"Send Test Command without its optional arg."]; @@ -24360,7 +24729,7 @@ - (void)testSendClusterTestCluster_000171_TestNullableOptionalRequest [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000172_WriteAttribute +- (void)testSendClusterTestCluster_000174_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BOOLEAN null"]; @@ -24382,7 +24751,7 @@ - (void)testSendClusterTestCluster_000172_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000173_ReadAttribute +- (void)testSendClusterTestCluster_000175_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BOOLEAN null"]; @@ -24406,7 +24775,7 @@ - (void)testSendClusterTestCluster_000173_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000174_WriteAttribute +- (void)testSendClusterTestCluster_000176_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BOOLEAN True"]; @@ -24428,7 +24797,7 @@ - (void)testSendClusterTestCluster_000174_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000175_ReadAttribute +- (void)testSendClusterTestCluster_000177_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BOOLEAN True"]; @@ -24453,7 +24822,7 @@ - (void)testSendClusterTestCluster_000175_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000176_WriteAttribute +- (void)testSendClusterTestCluster_000178_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP8 Max Value"]; @@ -24475,7 +24844,7 @@ - (void)testSendClusterTestCluster_000176_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000177_ReadAttribute +- (void)testSendClusterTestCluster_000179_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP8 Max Value"]; @@ -24500,7 +24869,7 @@ - (void)testSendClusterTestCluster_000177_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000178_WriteAttribute +- (void)testSendClusterTestCluster_000180_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP8 Invalid Value"]; @@ -24522,7 +24891,7 @@ - (void)testSendClusterTestCluster_000178_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000179_ReadAttribute +- (void)testSendClusterTestCluster_000181_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP8 unchanged Value"]; @@ -24547,7 +24916,7 @@ - (void)testSendClusterTestCluster_000179_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000180_WriteAttribute +- (void)testSendClusterTestCluster_000182_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP8 null Value"]; @@ -24569,7 +24938,7 @@ - (void)testSendClusterTestCluster_000180_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000181_ReadAttribute +- (void)testSendClusterTestCluster_000183_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP8 null Value"]; @@ -24593,7 +24962,7 @@ - (void)testSendClusterTestCluster_000181_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000182_WriteAttribute +- (void)testSendClusterTestCluster_000184_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP16 Max Value"]; @@ -24615,7 +24984,7 @@ - (void)testSendClusterTestCluster_000182_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000183_ReadAttribute +- (void)testSendClusterTestCluster_000185_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP16 Max Value"]; @@ -24640,7 +25009,7 @@ - (void)testSendClusterTestCluster_000183_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000184_WriteAttribute +- (void)testSendClusterTestCluster_000186_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP16 Invalid Value"]; @@ -24662,7 +25031,7 @@ - (void)testSendClusterTestCluster_000184_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000185_ReadAttribute +- (void)testSendClusterTestCluster_000187_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP16 unchanged Value"]; @@ -24687,7 +25056,7 @@ - (void)testSendClusterTestCluster_000185_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000186_WriteAttribute +- (void)testSendClusterTestCluster_000188_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP16 null Value"]; @@ -24709,7 +25078,7 @@ - (void)testSendClusterTestCluster_000186_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000187_ReadAttribute +- (void)testSendClusterTestCluster_000189_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP16 null Value"]; @@ -24733,7 +25102,7 @@ - (void)testSendClusterTestCluster_000187_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000188_WriteAttribute +- (void)testSendClusterTestCluster_000190_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP32 Max Value"]; @@ -24755,7 +25124,7 @@ - (void)testSendClusterTestCluster_000188_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000189_ReadAttribute +- (void)testSendClusterTestCluster_000191_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP32 Max Value"]; @@ -24780,7 +25149,7 @@ - (void)testSendClusterTestCluster_000189_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000190_WriteAttribute +- (void)testSendClusterTestCluster_000192_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP32 Invalid Value"]; @@ -24802,7 +25171,7 @@ - (void)testSendClusterTestCluster_000190_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000191_ReadAttribute +- (void)testSendClusterTestCluster_000193_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP32 unchanged Value"]; @@ -24827,7 +25196,7 @@ - (void)testSendClusterTestCluster_000191_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000192_WriteAttribute +- (void)testSendClusterTestCluster_000194_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP32 null Value"]; @@ -24849,7 +25218,7 @@ - (void)testSendClusterTestCluster_000192_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000193_ReadAttribute +- (void)testSendClusterTestCluster_000195_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP32 null Value"]; @@ -24873,7 +25242,7 @@ - (void)testSendClusterTestCluster_000193_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000194_WriteAttribute +- (void)testSendClusterTestCluster_000196_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP64 Max Value"]; @@ -24895,7 +25264,7 @@ - (void)testSendClusterTestCluster_000194_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000195_ReadAttribute +- (void)testSendClusterTestCluster_000197_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP64 Max Value"]; @@ -24920,7 +25289,7 @@ - (void)testSendClusterTestCluster_000195_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000196_WriteAttribute +- (void)testSendClusterTestCluster_000198_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP64 Invalid Value"]; @@ -24942,7 +25311,7 @@ - (void)testSendClusterTestCluster_000196_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000197_ReadAttribute +- (void)testSendClusterTestCluster_000199_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP64 unchanged Value"]; @@ -24967,7 +25336,7 @@ - (void)testSendClusterTestCluster_000197_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000198_WriteAttribute +- (void)testSendClusterTestCluster_000200_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_BITMAP64 null Value"]; @@ -24989,7 +25358,7 @@ - (void)testSendClusterTestCluster_000198_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000199_ReadAttribute +- (void)testSendClusterTestCluster_000201_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_BITMAP64 null Value"]; @@ -25013,7 +25382,54 @@ - (void)testSendClusterTestCluster_000199_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000200_WriteAttribute +- (void)testSendClusterTestCluster_000202_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableInt8uArgument; + nullableInt8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000203_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000204_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U Max Value"]; @@ -25035,7 +25451,7 @@ - (void)testSendClusterTestCluster_000200_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000201_ReadAttribute +- (void)testSendClusterTestCluster_000205_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U Max Value"]; @@ -25060,7 +25476,7 @@ - (void)testSendClusterTestCluster_000201_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000202_WriteAttribute +- (void)testSendClusterTestCluster_000206_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U Invalid Value"]; @@ -25081,7 +25497,7 @@ - (void)testSendClusterTestCluster_000202_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000203_ReadAttribute +- (void)testSendClusterTestCluster_000207_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U unchanged Value"]; @@ -25106,7 +25522,32 @@ - (void)testSendClusterTestCluster_000203_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000204_WriteAttribute +- (void)testSendClusterTestCluster_000208_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Read attribute NULLABLE_INT8U unchanged Value with constraint"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U unchanged Value with constraint Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000209_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U null Value"]; @@ -25128,7 +25569,7 @@ - (void)testSendClusterTestCluster_000204_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000205_ReadAttribute +- (void)testSendClusterTestCluster_000210_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U null Value"]; @@ -25152,7 +25593,180 @@ - (void)testSendClusterTestCluster_000205_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000206_WriteAttribute +- (void)testSendClusterTestCluster_000211_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U null Value & range"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U null Value & range Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000212_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U null Value & not"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U null Value & not Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], 254); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000213_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8U Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableInt8uArgument; + nullableInt8uArgument = [NSNumber numberWithUnsignedChar:128]; + [cluster writeAttributeNullableInt8uWithValue:nullableInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8U Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000214_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U Value in range"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U Value in range Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedCharValue], 254); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000215_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8U notValue OK"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8U notValue OK Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], 129); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000216_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableInt16uArgument; + nullableInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000217_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedShortValue], 0U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000218_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U Max Value"]; @@ -25174,7 +25788,7 @@ - (void)testSendClusterTestCluster_000206_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000207_ReadAttribute +- (void)testSendClusterTestCluster_000219_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U Max Value"]; @@ -25199,7 +25813,7 @@ - (void)testSendClusterTestCluster_000207_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000208_WriteAttribute +- (void)testSendClusterTestCluster_000220_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U Invalid Value"]; @@ -25221,7 +25835,7 @@ - (void)testSendClusterTestCluster_000208_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000209_ReadAttribute +- (void)testSendClusterTestCluster_000221_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U unchanged Value"]; @@ -25246,7 +25860,7 @@ - (void)testSendClusterTestCluster_000209_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000210_WriteAttribute +- (void)testSendClusterTestCluster_000222_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U null Value"]; @@ -25268,7 +25882,7 @@ - (void)testSendClusterTestCluster_000210_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000211_ReadAttribute +- (void)testSendClusterTestCluster_000223_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U null Value"]; @@ -25292,46 +25906,51 @@ - (void)testSendClusterTestCluster_000211_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000212_WriteAttribute +- (void)testSendClusterTestCluster_000224_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U null Value & range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967294UL]; - [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Max Value Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U null Value & range Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65534U); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000213_ReadAttribute +- (void)testSendClusterTestCluster_000225_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U null Value & not"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U Max Value Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U null Value & not Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], 65534U); + } } [expectation fulfill]; @@ -25339,46 +25958,47 @@ - (void)testSendClusterTestCluster_000213_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000214_WriteAttribute +- (void)testSendClusterTestCluster_000226_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Invalid Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16U Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt32uArgument; - nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; - [cluster - writeAttributeNullableInt32uWithValue:nullableInt32uArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U Invalid Value Error: %@", err); + id nullableInt16uArgument; + nullableInt16uArgument = [NSNumber numberWithUnsignedShort:32000U]; + [cluster writeAttributeNullableInt16uWithValue:nullableInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16U Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000215_ReadAttribute +- (void)testSendClusterTestCluster_000227_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U unchanged Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U Value in range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U unchanged Value Error: %@", err); + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U Value in range Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 65534U); + } } [expectation fulfill]; @@ -25386,9 +26006,35 @@ - (void)testSendClusterTestCluster_000215_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000216_WriteAttribute +- (void)testSendClusterTestCluster_000228_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16U notValue OK"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16U notValue OK Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], 32001U); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000229_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -25396,10 +26042,10 @@ - (void)testSendClusterTestCluster_000216_WriteAttribute XCTAssertNotNil(cluster); id nullableInt32uArgument; - nullableInt32uArgument = nil; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:0UL]; [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32U null Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32U Min Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -25408,9 +26054,9 @@ - (void)testSendClusterTestCluster_000216_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000217_ReadAttribute +- (void)testSendClusterTestCluster_000230_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -25418,13 +26064,14 @@ - (void)testSendClusterTestCluster_000217_ReadAttribute XCTAssertNotNil(cluster); [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32U null Value Error: %@", err); + NSLog(@"Read attribute NULLABLE_INT32U Min Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertTrue(actualValue == nil); + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedIntValue], 0UL); } [expectation fulfill]; @@ -25432,20 +26079,20 @@ - (void)testSendClusterTestCluster_000217_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000218_WriteAttribute +- (void)testSendClusterTestCluster_000231_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967294UL]; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Max Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32U Max Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -25454,24 +26101,24 @@ - (void)testSendClusterTestCluster_000218_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000219_ReadAttribute +- (void)testSendClusterTestCluster_000232_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U Max Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U Max Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); + XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL); } [expectation fulfill]; @@ -25479,21 +26126,21 @@ - (void)testSendClusterTestCluster_000219_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000220_WriteAttribute +- (void)testSendClusterTestCluster_000233_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Invalid Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Invalid Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt64uArgument; - nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:4294967295UL]; [cluster - writeAttributeNullableInt64uWithValue:nullableInt64uArgument + writeAttributeNullableInt32uWithValue:nullableInt32uArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32U Invalid Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); [expectation fulfill]; @@ -25501,24 +26148,24 @@ - (void)testSendClusterTestCluster_000220_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000221_ReadAttribute +- (void)testSendClusterTestCluster_000234_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U unchanged Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U unchanged Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U unchanged Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U unchanged Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); + XCTAssertEqual([actualValue unsignedIntValue], 4294967294UL); } [expectation fulfill]; @@ -25526,20 +26173,20 @@ - (void)testSendClusterTestCluster_000221_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000222_WriteAttribute +- (void)testSendClusterTestCluster_000235_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U null Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt64uArgument; - nullableInt64uArgument = nil; - [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + id nullableInt32uArgument; + nullableInt32uArgument = nil; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64U null Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT32U null Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -25548,17 +26195,17 @@ - (void)testSendClusterTestCluster_000222_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000223_ReadAttribute +- (void)testSendClusterTestCluster_000236_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U null Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64U null Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U null Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -25572,46 +26219,51 @@ - (void)testSendClusterTestCluster_000223_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000224_WriteAttribute +- (void)testSendClusterTestCluster_000237_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U null Value & range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-127]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Min Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U null Value & range Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 4294967294UL); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000225_ReadAttribute +- (void)testSendClusterTestCluster_000238_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U null Value & not"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S Min Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U null Value & not Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue charValue], -127); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedIntValue], 4294967294UL); + } } [expectation fulfill]; @@ -25619,45 +26271,47 @@ - (void)testSendClusterTestCluster_000225_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000226_WriteAttribute +- (void)testSendClusterTestCluster_000239_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S Invalid Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32U Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt8sArgument; - nullableInt8sArgument = [NSNumber numberWithChar:-128]; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S Invalid Value Error: %@", err); + id nullableInt32uArgument; + nullableInt32uArgument = [NSNumber numberWithUnsignedInt:2147483647UL]; + [cluster writeAttributeNullableInt32uWithValue:nullableInt32uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32U Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000227_ReadAttribute +- (void)testSendClusterTestCluster_000240_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S unchanged Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U Value in range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S unchanged Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U Value in range Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue charValue], -127); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 4294967294UL); + } } [expectation fulfill]; @@ -25665,45 +26319,72 @@ - (void)testSendClusterTestCluster_000227_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000228_WriteAttribute +- (void)testSendClusterTestCluster_000241_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32U notValue OK"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt8sArgument; - nullableInt8sArgument = nil; - [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT8S null Value Error: %@", err); + [cluster readAttributeNullableInt32uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32U notValue OK Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedIntValue], 2147483648UL); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000229_ReadAttribute +- (void)testSendClusterTestCluster_000242_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT8S null Value Error: %@", err); + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:0ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000243_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U Min Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertTrue(actualValue == nil); + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedLongLongValue], 0ULL); } [expectation fulfill]; @@ -25711,20 +26392,20 @@ - (void)testSendClusterTestCluster_000229_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000230_WriteAttribute +- (void)testSendClusterTestCluster_000244_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32767]; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551614ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Min Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT64U Max Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -25733,24 +26414,24 @@ - (void)testSendClusterTestCluster_000230_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000231_ReadAttribute +- (void)testSendClusterTestCluster_000245_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U Max Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S Min Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U Max Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], -32767); + XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); } [expectation fulfill]; @@ -25758,21 +26439,21 @@ - (void)testSendClusterTestCluster_000231_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000232_WriteAttribute +- (void)testSendClusterTestCluster_000246_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S Invalid Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Invalid Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt16sArgument; - nullableInt16sArgument = [NSNumber numberWithShort:-32768]; + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18446744073709551615ULL]; [cluster - writeAttributeNullableInt16sWithValue:nullableInt16sArgument + writeAttributeNullableInt64uWithValue:nullableInt64uArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S Invalid Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT64U Invalid Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); [expectation fulfill]; @@ -25780,24 +26461,24 @@ - (void)testSendClusterTestCluster_000232_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000233_ReadAttribute +- (void)testSendClusterTestCluster_000247_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S unchanged Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U unchanged Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S unchanged Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U unchanged Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue shortValue], -32767); + XCTAssertEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); } [expectation fulfill]; @@ -25805,20 +26486,20 @@ - (void)testSendClusterTestCluster_000233_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000234_WriteAttribute +- (void)testSendClusterTestCluster_000248_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U null Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt16sArgument; - nullableInt16sArgument = nil; - [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + id nullableInt64uArgument; + nullableInt64uArgument = nil; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT16S null Value Error: %@", err); + NSLog(@"Write attribute NULLABLE_INT64U null Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -25827,17 +26508,17 @@ - (void)testSendClusterTestCluster_000234_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000235_ReadAttribute +- (void)testSendClusterTestCluster_000249_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U null Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT16S null Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U null Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -25851,46 +26532,51 @@ - (void)testSendClusterTestCluster_000235_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000236_WriteAttribute +- (void)testSendClusterTestCluster_000250_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U null Value & range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Min Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U null Value & range Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000237_ReadAttribute +- (void)testSendClusterTestCluster_000251_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U null Value & not"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S Min Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U null Value & not Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue intValue], -2147483647L); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); + } } [expectation fulfill]; @@ -25898,46 +26584,47 @@ - (void)testSendClusterTestCluster_000237_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000238_WriteAttribute +- (void)testSendClusterTestCluster_000252_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S Invalid Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64U Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt32sArgument; - nullableInt32sArgument = [NSNumber numberWithInt:-2147483648L]; - [cluster - writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S Invalid Value Error: %@", err); + id nullableInt64uArgument; + nullableInt64uArgument = [NSNumber numberWithUnsignedLongLong:18000000000000000000ULL]; + [cluster writeAttributeNullableInt64uWithValue:nullableInt64uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64U Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000239_ReadAttribute +- (void)testSendClusterTestCluster_000253_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S unchanged Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U Value in range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S unchanged Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U Value in range Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue intValue], -2147483647L); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedLongLongValue], 18446744073709551614ULL); + } } [expectation fulfill]; @@ -25945,45 +26632,25 @@ - (void)testSendClusterTestCluster_000239_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000240_WriteAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S null Value"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - id nullableInt32sArgument; - nullableInt32sArgument = nil; - [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT32S null Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestCluster_000241_ReadAttribute +- (void)testSendClusterTestCluster_000254_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64U notValue OK"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT32S null Value Error: %@", err); + [cluster readAttributeNullableInt64uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64U notValue OK Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertTrue(actualValue == nil); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedLongLongValue], 18000000000000000001ULL); + } } [expectation fulfill]; @@ -25991,46 +26658,46 @@ - (void)testSendClusterTestCluster_000241_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000242_WriteAttribute +- (void)testSendClusterTestCluster_000255_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Min Value Error: %@", err); + id nullableInt8sArgument; + nullableInt8sArgument = [NSNumber numberWithChar:-127]; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8S Min Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000243_ReadAttribute +- (void)testSendClusterTestCluster_000256_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S Min Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S Min Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S Min Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue longLongValue], -9223372036854775807LL); + XCTAssertEqual([actualValue charValue], -127); } [expectation fulfill]; @@ -26038,46 +26705,45 @@ - (void)testSendClusterTestCluster_000243_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000244_WriteAttribute +- (void)testSendClusterTestCluster_000257_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S Invalid Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S Invalid Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt64sArgument; - nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL - 1]; - [cluster - writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S Invalid Value Error: %@", err); + id nullableInt8sArgument; + nullableInt8sArgument = [NSNumber numberWithChar:-128]; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8S Invalid Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000245_ReadAttribute +- (void)testSendClusterTestCluster_000258_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S unchanged Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S unchanged Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S unchanged Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S unchanged Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue longLongValue], -9223372036854775807LL); + XCTAssertEqual([actualValue charValue], -127); } [expectation fulfill]; @@ -26085,39 +26751,39 @@ - (void)testSendClusterTestCluster_000245_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000246_WriteAttribute +- (void)testSendClusterTestCluster_000259_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S null Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableInt64sArgument; - nullableInt64sArgument = nil; - [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_INT64S null Value Error: %@", err); + id nullableInt8sArgument; + nullableInt8sArgument = nil; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8S null Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000247_ReadAttribute +- (void)testSendClusterTestCluster_000260_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S null Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_INT64S null Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S null Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -26131,46 +26797,57 @@ - (void)testSendClusterTestCluster_000247_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000248_WriteAttribute +- (void)testSendClusterTestCluster_000261_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE medium Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S null Value & range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:0.1f]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE medium Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S null Value & range Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue charValue], -127); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue charValue], 127); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000249_ReadAttribute +- (void)testSendClusterTestCluster_000262_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE medium Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S null Value & not"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE medium Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S null Value & not Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue floatValue], 0.1f); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue charValue], -127); + } } [expectation fulfill]; @@ -26178,46 +26855,53 @@ - (void)testSendClusterTestCluster_000249_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000250_WriteAttribute +- (void)testSendClusterTestCluster_000263_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE largest Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT8S Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:INFINITY]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE largest Value Error: %@", err); + id nullableInt8sArgument; + nullableInt8sArgument = [NSNumber numberWithChar:-127]; + [cluster writeAttributeNullableInt8sWithValue:nullableInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT8S Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000251_ReadAttribute +- (void)testSendClusterTestCluster_000264_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE largest Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S Value in range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE largest Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S Value in range Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue floatValue], INFINITY); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue charValue], -127); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue charValue], 127); + } } [expectation fulfill]; @@ -26225,46 +26909,72 @@ - (void)testSendClusterTestCluster_000251_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000252_WriteAttribute +- (void)testSendClusterTestCluster_000265_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE smallest Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT8S notValue OK"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:-INFINITY]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE smallest Value Error: %@", err); + [cluster readAttributeNullableInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT8S notValue OK Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertNotEqual([actualValue charValue], -126); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000253_ReadAttribute +- (void)testSendClusterTestCluster_000266_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE smallest Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE smallest Value Error: %@", err); + id nullableInt16sArgument; + nullableInt16sArgument = [NSNumber numberWithShort:-32767]; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16S Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000267_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S Min Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue floatValue], -INFINITY); + XCTAssertEqual([actualValue shortValue], -32767); } [expectation fulfill]; @@ -26272,39 +26982,86 @@ - (void)testSendClusterTestCluster_000253_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000254_WriteAttribute +- (void)testSendClusterTestCluster_000268_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S Invalid Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = nil; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE null Value Error: %@", err); + id nullableInt16sArgument; + nullableInt16sArgument = [NSNumber numberWithShort:-32768]; + [cluster + writeAttributeNullableInt16sWithValue:nullableInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16S Invalid Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; - [expectation fulfill]; - }]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000269_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S unchanged Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S unchanged Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue shortValue], -32767); + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000255_ReadAttribute +- (void)testSendClusterTestCluster_000270_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S null Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE null Value Error: %@", err); + id nullableInt16sArgument; + nullableInt16sArgument = nil; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16S null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000271_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S null Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -26318,46 +27075,57 @@ - (void)testSendClusterTestCluster_000255_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000256_WriteAttribute +- (void)testSendClusterTestCluster_000272_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE 0 Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S null Value & range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableFloatSingleArgument; - nullableFloatSingleArgument = [NSNumber numberWithFloat:0.0f]; - [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_SINGLE 0 Value Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S null Value & range Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], -32767); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 32767); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000257_ReadAttribute +- (void)testSendClusterTestCluster_000273_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE 0 Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S null Value & not"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_SINGLE 0 Value Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S null Value & not Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue floatValue], 0.0f); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue shortValue], -32767); + } } [expectation fulfill]; @@ -26365,46 +27133,53 @@ - (void)testSendClusterTestCluster_000257_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000258_WriteAttribute +- (void)testSendClusterTestCluster_000274_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE medium Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT16S Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE medium Value Error: %@", err); + id nullableInt16sArgument; + nullableInt16sArgument = [NSNumber numberWithShort:-32767]; + [cluster writeAttributeNullableInt16sWithValue:nullableInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT16S Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000259_ReadAttribute +- (void)testSendClusterTestCluster_000275_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE medium Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S Value in range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE medium Value Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S Value in range Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue doubleValue], 0.1234567890123); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue shortValue], -32767); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue shortValue], 32767); + } } [expectation fulfill]; @@ -26412,46 +27187,72 @@ - (void)testSendClusterTestCluster_000259_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000260_WriteAttribute +- (void)testSendClusterTestCluster_000276_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE largest Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT16S notValue OK"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:INFINITY]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE largest Value Error: %@", err); + [cluster readAttributeNullableInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT16S notValue OK Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertNotEqual([actualValue shortValue], -32766); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000261_ReadAttribute +- (void)testSendClusterTestCluster_000277_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE largest Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S Min Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE largest Value Error: %@", err); + id nullableInt32sArgument; + nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32S Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000278_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S Min Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue doubleValue], INFINITY); + XCTAssertEqual([actualValue intValue], -2147483647L); } [expectation fulfill]; @@ -26459,46 +27260,46 @@ - (void)testSendClusterTestCluster_000261_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000262_WriteAttribute +- (void)testSendClusterTestCluster_000279_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE smallest Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S Invalid Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:-INFINITY]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE smallest Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + id nullableInt32sArgument; + nullableInt32sArgument = [NSNumber numberWithInt:-2147483648L]; + [cluster + writeAttributeNullableInt32sWithValue:nullableInt32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32S Invalid Value Error: %@", err); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000263_ReadAttribute +- (void)testSendClusterTestCluster_000280_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE smallest Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S unchanged Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE smallest Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S unchanged Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue doubleValue], -INFINITY); + XCTAssertEqual([actualValue intValue], -2147483647L); } [expectation fulfill]; @@ -26506,39 +27307,39 @@ - (void)testSendClusterTestCluster_000263_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000264_WriteAttribute +- (void)testSendClusterTestCluster_000281_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S null Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = nil; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE null Value Error: %@", err); + id nullableInt32sArgument; + nullableInt32sArgument = nil; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32S null Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000265_ReadAttribute +- (void)testSendClusterTestCluster_000282_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S null Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE null Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S null Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -26552,46 +27353,57 @@ - (void)testSendClusterTestCluster_000265_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000266_WriteAttribute +- (void)testSendClusterTestCluster_000283_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE 0 Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S null Value & range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableFloatDoubleArgument; - nullableFloatDoubleArgument = [NSNumber numberWithDouble:0]; - [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_DOUBLE 0 Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S null Value & range Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue intValue], -2147483647L); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue intValue], 2147483647L); + } + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000267_ReadAttribute +- (void)testSendClusterTestCluster_000284_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE 0 Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S null Value & not"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_DOUBLE 0 Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S null Value & not Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue doubleValue], 0); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue intValue], -2147483647L); + } } [expectation fulfill]; @@ -26599,46 +27411,173 @@ - (void)testSendClusterTestCluster_000267_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000268_WriteAttribute +- (void)testSendClusterTestCluster_000285_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT32S Value"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:254]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Max Value Error: %@", err); + id nullableInt32sArgument; + nullableInt32sArgument = [NSNumber numberWithInt:-2147483647L]; + [cluster writeAttributeNullableInt32sWithValue:nullableInt32sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT32S Value Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000269_ReadAttribute +- (void)testSendClusterTestCluster_000286_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 Max Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S Value in range"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 Max Value Error: %@", err); + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S Value in range Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue intValue], -2147483647L); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue intValue], 2147483647L); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000287_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT32S notValue OK"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt32sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT32S notValue OK Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertNotEqual([actualValue intValue], -2147483646L); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000288_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableInt64sArgument; + nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64S Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000289_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S Min Value Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); + XCTAssertEqual([actualValue longLongValue], -9223372036854775807LL); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000290_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S Invalid Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableInt64sArgument; + nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL - 1]; + [cluster + writeAttributeNullableInt64sWithValue:nullableInt64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64S Invalid Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000291_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S unchanged Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S unchanged Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue longLongValue], -9223372036854775807LL); } [expectation fulfill]; @@ -26646,91 +27585,3647 @@ - (void)testSendClusterTestCluster_000269_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000270_WriteAttribute +- (void)testSendClusterTestCluster_000292_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableInt64sArgument; + nullableInt64sArgument = nil; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64S null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000293_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000294_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S null Value & range"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S null Value & range Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue longLongValue], -9223372036854775807LL); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue longLongValue], 9223372036854775807LL); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000295_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S null Value & not"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S null Value & not Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertNotEqual([actualValue longLongValue], -9223372036854775807LL); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000296_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_INT64S Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableInt64sArgument; + nullableInt64sArgument = [NSNumber numberWithLongLong:-9223372036854775807LL]; + [cluster writeAttributeNullableInt64sWithValue:nullableInt64sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_INT64S Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000297_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S Value in range"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S Value in range Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue longLongValue], -9223372036854775807LL); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue longLongValue], 9223372036854775807LL); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000298_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_INT64S notValue OK"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableInt64sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_INT64S notValue OK Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertNotEqual([actualValue longLongValue], -9223372036854775806LL); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000299_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE medium Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:0.1f]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE medium Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000300_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE medium Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE medium Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue floatValue], 0.1f); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000301_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE largest Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:INFINITY]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE largest Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000302_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE largest Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE largest Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue floatValue], INFINITY); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000303_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE smallest Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:-INFINITY]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE smallest Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000304_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE smallest Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE smallest Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue floatValue], -INFINITY); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000305_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableFloatSingleArgument; + nullableFloatSingleArgument = nil; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000306_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000307_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SINGLE 0 Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableFloatSingleArgument; + nullableFloatSingleArgument = [NSNumber numberWithFloat:0.0f]; + [cluster writeAttributeNullableFloatSingleWithValue:nullableFloatSingleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SINGLE 0 Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000308_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SINGLE 0 Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableFloatSingleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SINGLE 0 Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue floatValue], 0.0f); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000309_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE medium Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:0.1234567890123]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE medium Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000310_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE medium Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE medium Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue doubleValue], 0.1234567890123); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000311_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE largest Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:INFINITY]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE largest Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000312_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE largest Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE largest Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue doubleValue], INFINITY); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000313_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE smallest Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:-INFINITY]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE smallest Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000314_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE smallest Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE smallest Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue doubleValue], -INFINITY); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000315_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = nil; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000316_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000317_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_DOUBLE 0 Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableFloatDoubleArgument; + nullableFloatDoubleArgument = [NSNumber numberWithDouble:0]; + [cluster writeAttributeNullableFloatDoubleWithValue:nullableFloatDoubleArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_DOUBLE 0 Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000318_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_DOUBLE 0 Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableFloatDoubleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_DOUBLE 0 Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue doubleValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000319_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnum8Argument; + nullableEnum8Argument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM8 Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000320_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000321_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 Max Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnum8Argument; + nullableEnum8Argument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM8 Max Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000322_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 Max Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 Max Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 254); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000323_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 Invalid Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnum8Argument; + nullableEnum8Argument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM8 Invalid Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000324_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 unchanged Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 unchanged Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 254); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000325_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnum8Argument; + nullableEnum8Argument = nil; + [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM8 null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000326_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM8 null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000327_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnum16Argument; + nullableEnum16Argument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM16 Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000328_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedShortValue], 0U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000329_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 Max Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnum16Argument; + nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65534U]; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM16 Max Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000330_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 Max Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 Max Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedShortValue], 65534U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000331_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 Invalid Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnum16Argument; + nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster + writeAttributeNullableEnum16WithValue:nullableEnum16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM16 Invalid Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000332_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 unchanged Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 unchanged Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedShortValue], 65534U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000333_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnum16Argument; + nullableEnum16Argument = nil; + [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_ENUM16 null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000334_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_ENUM16 null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000335_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnumAttrArgument; + nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000336_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM Min Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Min Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 0); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000337_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM Max Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnumAttrArgument; + nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000338_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM Max Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM Max Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 254); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000339_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM Invalid Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnumAttrArgument; + nullableEnumAttrArgument = [NSNumber numberWithUnsignedChar:255]; + [cluster + writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM Invalid Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000340_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM unchanged Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM unchanged Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 254); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000341_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_SIMPLE_ENUM null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableEnumAttrArgument; + nullableEnumAttrArgument = nil; + [cluster writeAttributeNullableEnumAttrWithValue:nullableEnumAttrArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000342_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_SIMPLE_ENUM null Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableEnumAttrWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_SIMPLE_ENUM null Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000343_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING Default Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Default Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000344_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableOctetStringArgument; + nullableOctetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; + [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000345_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"TestValue" length:9]]); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000346_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableOctetStringArgument; + nullableOctetStringArgument = nil; + [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000347_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000348_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableOctetStringArgument; + nullableOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; + [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000349_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000350_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING Default Value"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Default Value Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertTrue([actualValue isEqualToString:@""]); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000351_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableCharStringArgument; + nullableCharStringArgument = @"☉T☉"; + [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_CHAR_STRING Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000352_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertTrue([actualValue isEqualToString:@"☉T☉"]); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000353_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING - Value too long"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableCharStringArgument; + nullableCharStringArgument = nil; + [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_CHAR_STRING - Value too long Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000354_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000355_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING - Empty"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableCharStringArgument; + nullableCharStringArgument = @""; + [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write attribute NULLABLE_CHAR_STRING - Empty Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000356_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertTrue([actualValue isEqualToString:@""]); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000357_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute from nonexistent endpoint."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute from nonexistent endpoint. Error: %@", err); + + XCTAssertNotEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000358_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute from nonexistent cluster."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute from nonexistent cluster. Error: %@", err); + + XCTAssertNotEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000359_TestSimpleOptionalArgumentRequest +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Send a command that takes an optional parameter but do not set it."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; + [cluster + testSimpleOptionalArgumentRequestWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Send a command that takes an optional parameter but do not set it. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_VALUE); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000360_TestSimpleOptionalArgumentRequest +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Send a command that takes an optional parameter but do not set it."]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; + params.arg1 = [NSNumber numberWithBool:1]; + [cluster + testSimpleOptionalArgumentRequestWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Send a command that takes an optional parameter but do not set it. Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +bool testSendClusterTestCluster_000361_WaitForReport_Fulfilled = false; +ResponseHandler test_TestCluster_list_int8u_Reported = nil; +- (void)testSendClusterTestCluster_000361_WaitForReport +{ + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Report: Subscribe to list attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue count], 4); + XCTAssertEqual([actualValue[0] unsignedCharValue], 1); + XCTAssertEqual([actualValue[1] unsignedCharValue], 2); + XCTAssertEqual([actualValue[2] unsignedCharValue], 3); + XCTAssertEqual([actualValue[3] unsignedCharValue], 4); + } + + testSendClusterTestCluster_000361_WaitForReport_Fulfilled = true; + }; +} +- (void)testSendClusterTestCluster_000362_SubscribeAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Subscribe to list attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t minIntervalArgument = 2U; + uint16_t maxIntervalArgument = 10U; + [cluster subscribeAttributeListInt8uWithMinInterval:minIntervalArgument + maxInterval:maxIntervalArgument + subscriptionEstablished:^{ + XCTAssertEqual(testSendClusterTestCluster_000361_WaitForReport_Fulfilled, true); + [expectation fulfill]; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Subscribe to list attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + if (test_TestCluster_list_int8u_Reported != nil) { + ResponseHandler callback = test_TestCluster_list_int8u_Reported; + test_TestCluster_list_int8u_Reported = nil; + callback(value, err); + } + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000363_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write subscribed-to list attribute"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id listInt8uArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [NSNumber numberWithUnsignedChar:5]; + temp_0[1] = [NSNumber numberWithUnsignedChar:6]; + temp_0[2] = [NSNumber numberWithUnsignedChar:7]; + temp_0[3] = [NSNumber numberWithUnsignedChar:8]; + listInt8uArgument = temp_0; + } + [cluster writeAttributeListInt8uWithValue:listInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write subscribed-to list attribute Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000364_WaitForReport +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Check for list attribute report"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + test_TestCluster_list_int8u_Reported = ^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check for list attribute report Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue count], 4); + XCTAssertEqual([actualValue[0] unsignedCharValue], 5); + XCTAssertEqual([actualValue[1] unsignedCharValue], 6); + XCTAssertEqual([actualValue[2] unsignedCharValue], 7); + XCTAssertEqual([actualValue[3] unsignedCharValue], 8); + } + + [expectation fulfill]; + }; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000365_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted unsigned 8-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 70); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000366_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min value to a range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a range-restricted unsigned 8-bit integer Error: %@", err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000367_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-below-range value to a range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a range-restricted unsigned 8-bit integer Error: %@", + err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000368_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-above-range value to a range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a range-restricted unsigned 8-bit integer Error: %@", + err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000369_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max value to a range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:255]; + [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a range-restricted unsigned 8-bit integer Error: %@", err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000370_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value has not changed"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value has not changed Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 70); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000371_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min valid value to a range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a range-restricted unsigned 8-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000372_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value is at min valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 20); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000373_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max valid value to a range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; + [cluster + writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a range-restricted unsigned 8-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000374_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value is at max valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 100); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000375_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write middle valid value to a range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; + [cluster writeAttributeRangeRestrictedInt8uWithValue:rangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a range-restricted unsigned 8-bit integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000376_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted unsigned 8-bit integer value is at mid valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedCharValue], 50); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000377_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted unsigned 16-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 200U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000378_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min value to a range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a range-restricted unsigned 16-bit integer Error: %@", err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000379_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-below-range value to a range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write just-below-range value to a range-restricted unsigned 16-bit integer Error: %@", + err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000380_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-above-range value to a range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write just-above-range value to a range-restricted unsigned 16-bit integer Error: %@", + err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000381_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max value to a range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65535U]; + [cluster writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a range-restricted unsigned 16-bit integer Error: %@", err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000382_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value has not changed"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value has not changed Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 200U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000383_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min valid value to a range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a range-restricted unsigned 16-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000384_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value is at min valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 100U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000385_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max valid value to a range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a range-restricted unsigned 16-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000386_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value is at max valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1000U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000387_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write middle valid value to a range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; + [cluster + writeAttributeRangeRestrictedInt16uWithValue:rangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a range-restricted unsigned 16-bit integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000388_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted unsigned 16-bit integer value is at mid valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 500U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000389_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted signed 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted signed 8-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue charValue], -20); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000390_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min value to a range-restricted signed 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-128]; + [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a range-restricted signed 8-bit integer Error: %@", err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000391_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-below-range value to a range-restricted signed 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a range-restricted signed 8-bit integer Error: %@", + err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000392_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-above-range value to a range-restricted signed 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a range-restricted signed 8-bit integer Error: %@", + err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000393_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max value to a range-restricted signed 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; + [cluster writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a range-restricted signed 8-bit integer Error: %@", err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000394_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value has not changed"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value has not changed Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue charValue], -20); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000395_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min valid value to a range-restricted signed 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a range-restricted signed 8-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000396_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value is at min valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value is at min valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue charValue], -40); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000397_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max valid value to a range-restricted signed 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a range-restricted signed 8-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000398_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value is at max valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value is at max valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue charValue], 50); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000399_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write middle valid value to a range-restricted signed 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; + [cluster + writeAttributeRangeRestrictedInt8sWithValue:rangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a range-restricted signed 8-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000400_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted signed 8-bit integer value is at mid valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 8-bit integer value is at mid valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue charValue], 6); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000401_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read range-restricted signed 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read range-restricted signed 16-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue shortValue], -100); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000402_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min value to a range-restricted signed 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32768]; + [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a range-restricted signed 16-bit integer Error: %@", err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000403_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-below-range value to a range-restricted signed 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a range-restricted signed 16-bit integer Error: %@", + err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000404_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-above-range value to a range-restricted signed 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a range-restricted signed 16-bit integer Error: %@", + err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000405_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max value to a range-restricted signed 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; + [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a range-restricted signed 16-bit integer Error: %@", err); + + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000406_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value has not changed"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value has not changed Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue shortValue], -100); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000407_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min valid value to a range-restricted signed 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a range-restricted signed 16-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000408_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value is at min valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value is at min valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue shortValue], -150); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000409_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max valid value to a range-restricted signed 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; + [cluster + writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a range-restricted signed 16-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000410_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value is at max valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value is at max valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue shortValue], 200); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000411_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write middle valid value to a range-restricted signed 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; + [cluster writeAttributeRangeRestrictedInt16sWithValue:rangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a range-restricted signed 16-bit integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000412_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify range-restricted signed 16-bit integer value is at mid valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify range-restricted signed 16-bit integer value is at mid valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue shortValue], 7); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000413_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted unsigned 8-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 70); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000414_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min value to a nullable range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:0]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted unsigned 8-bit integer " + @"Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000415_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:19]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted unsigned " + @"8-bit integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000416_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:101]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted unsigned " + @"8-bit integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000417_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max value to a nullable range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:254]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted unsigned 8-bit integer " + @"Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000418_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value has not changed"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value has not changed Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 70); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000419_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min valid value to a nullable range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:20]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000420_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is at min valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at min valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 20); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000421_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max valid value to a nullable range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:100]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000422_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is at max valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at max valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 100); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000423_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write middle valid value to a nullable range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = [NSNumber numberWithUnsignedChar:50]; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted unsigned 8-bit " + @"integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000424_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is at mid valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is at mid valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedCharValue], 50); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000425_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write null value to a nullable range-restricted unsigned 8-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:nullableRangeRestrictedInt8uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted unsigned 8-bit integer " + @"Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000426_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted unsigned 8-bit integer value is null"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableRangeRestrictedInt8uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 8-bit integer value is null Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000427_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted unsigned 16-bit integer Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedShortValue], 200U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000428_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min value to a nullable range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:0U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted unsigned 16-bit integer " + @"Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000429_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:99U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000430_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1001U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000431_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max value to a nullable range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:65534U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted unsigned 16-bit integer " + @"Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000432_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value has not changed"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value has not changed Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedShortValue], 200U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000433_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min valid value to a nullable range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:100U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted unsigned 16-bit " + @"integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000434_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is at min valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at min valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedShortValue], 100U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000435_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max valid value to a nullable range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:1000U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted unsigned 16-bit " + @"integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000436_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is at max valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at max valid Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedShortValue], 1000U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000437_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write middle valid value to a nullable range-restricted unsigned 16-bit integer"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = [NSNumber numberWithUnsignedShort:500U]; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted unsigned " + @"16-bit integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000438_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 Invalid Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is at mid valid"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableEnum8Argument; - nullableEnum8Argument = [NSNumber numberWithUnsignedChar:255]; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 Invalid Value Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is at mid valid Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue unsignedShortValue], 500U); + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000271_ReadAttribute +- (void)testSendClusterTestCluster_000439_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 unchanged Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write null value to a nullable range-restricted unsigned 16-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 unchanged Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + id nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:nullableRangeRestrictedInt16uArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted unsigned 16-bit " + @"integer Error: %@", + err); - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedCharValue], 254); - } + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000272_WriteAttribute +- (void)testSendClusterTestCluster_000440_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM8 null Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted unsigned 16-bit integer value is null"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableEnum8Argument; - nullableEnum8Argument = nil; - [cluster writeAttributeNullableEnum8WithValue:nullableEnum8Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM8 null Value Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16uWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted unsigned 16-bit integer value is null Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000273_ReadAttribute +- (void)testSendClusterTestCluster_000441_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM8 null Value"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted signed 8-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableEnum8WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM8 null Value Error: %@", err); + [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted signed 8-bit integer Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertTrue(actualValue == nil); + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue charValue], -20); } [expectation fulfill]; @@ -26738,93 +31233,127 @@ - (void)testSendClusterTestCluster_000273_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000274_WriteAttribute +- (void)testSendClusterTestCluster_000442_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 Max Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min value to a nullable range-restricted signed 8-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65534U]; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Max Value Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-127]; + [cluster + writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write min value to a nullable range-restricted signed 8-bit integer Error: %@", + err); - [expectation fulfill]; - }]; + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000275_ReadAttribute +- (void)testSendClusterTestCluster_000443_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 Max Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted signed 8-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 Max Value Error: %@", err); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-41]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted signed " + @"8-bit integer Error: %@", + err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 65534U); - } + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000444_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted signed 8-bit integer"]; - [expectation fulfill]; - }]; + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:51]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted signed " + @"8-bit integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000276_WriteAttribute +- (void)testSendClusterTestCluster_000445_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 Invalid Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max value to a nullable range-restricted signed 8-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableEnum16Argument; - nullableEnum16Argument = [NSNumber numberWithUnsignedShort:65535U]; + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:127]; [cluster - writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 Invalid Value Error: %@", err); + writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write max value to a nullable range-restricted signed 8-bit integer Error: %@", + err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - [expectation fulfill]; - }]; + XCTAssertEqual( + [CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000277_ReadAttribute +- (void)testSendClusterTestCluster_000446_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 unchanged Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value has not changed"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 unchanged Value Error: %@", err); + [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value has not changed Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertEqual([actualValue unsignedShortValue], 65534U); + XCTAssertEqual([actualValue charValue], -20); } [expectation fulfill]; @@ -26832,45 +31361,50 @@ - (void)testSendClusterTestCluster_000277_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000278_WriteAttribute +- (void)testSendClusterTestCluster_000447_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_ENUM16 null Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min valid value to a nullable range-restricted signed 8-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableEnum16Argument; - nullableEnum16Argument = nil; - [cluster writeAttributeNullableEnum16WithValue:nullableEnum16Argument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_ENUM16 null Value Error: %@", err); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:-40]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted signed 8-bit " + @"integer Error: %@", + err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000279_ReadAttribute +- (void)testSendClusterTestCluster_000448_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_ENUM16 null Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at min valid"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableEnum16WithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_ENUM16 null Value Error: %@", err); + [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at min valid Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; - XCTAssertTrue(actualValue == nil); + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue charValue], -40); } [expectation fulfill]; @@ -26878,24 +31412,50 @@ - (void)testSendClusterTestCluster_000279_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000280_ReadAttribute +- (void)testSendClusterTestCluster_000449_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING Default Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max valid value to a nullable range-restricted signed 8-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Default Value Error: %@", err); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:50]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted signed 8-bit " + @"integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000450_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at max valid"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at max valid Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]); + XCTAssertEqual([actualValue charValue], 50); } [expectation fulfill]; @@ -26903,46 +31463,50 @@ - (void)testSendClusterTestCluster_000280_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000281_WriteAttribute +- (void)testSendClusterTestCluster_000451_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write middle valid value to a nullable range-restricted signed 8-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableOctetStringArgument; - nullableOctetStringArgument = [[NSData alloc] initWithBytes:"TestValue" length:9]; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = [NSNumber numberWithChar:6]; + [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted signed 8-bit " + @"integer Error: %@", + err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000282_ReadAttribute +- (void)testSendClusterTestCluster_000452_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at mid valid"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); + [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at mid valid Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); { id actualValue = value; XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"TestValue" length:9]]); + XCTAssertEqual([actualValue charValue], 6); } [expectation fulfill]; @@ -26950,39 +31514,44 @@ - (void)testSendClusterTestCluster_000282_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000283_WriteAttribute +- (void)testSendClusterTestCluster_000453_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write null value to a nullable range-restricted signed 8-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableOctetStringArgument; - nullableOctetStringArgument = nil; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); + id nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument = nil; + [cluster + writeAttributeNullableRangeRestrictedInt8sWithValue:nullableRangeRestrictedInt8sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write null value to a nullable range-restricted signed 8-bit integer Error: %@", + err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000284_ReadAttribute +- (void)testSendClusterTestCluster_000454_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted signed 8-bit integer value is at null"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); + [cluster readAttributeNullableRangeRestrictedInt8sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 8-bit integer value is at null Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -26996,297 +31565,363 @@ - (void)testSendClusterTestCluster_000284_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000285_WriteAttribute +- (void)testSendClusterTestCluster_000455_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_OCTET_STRING"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read nullable range-restricted signed 16-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableOctetStringArgument; - nullableOctetStringArgument = [[NSData alloc] initWithBytes:"" length:0]; - [cluster writeAttributeNullableOctetStringWithValue:nullableOctetStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_OCTET_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read nullable range-restricted signed 16-bit integer Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue shortValue], -100); + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000286_ReadAttribute +- (void)testSendClusterTestCluster_000456_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_OCTET_STRING"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min value to a nullable range-restricted signed 16-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableOctetStringWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_OCTET_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToData:[[NSData alloc] initWithBytes:"" length:0]]); - } + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-32767]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min value to a nullable range-restricted signed 16-bit integer " + @"Error: %@", + err); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000287_ReadAttribute +- (void)testSendClusterTestCluster_000457_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING Default Value"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-below-range value to a nullable range-restricted signed 16-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Default Value Error: %@", err); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-151]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-below-range value to a nullable range-restricted signed " + @"16-bit integer Error: %@", + err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToString:@""]); - } + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestCluster_000458_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write just-above-range value to a nullable range-restricted signed 16-bit integer"]; - [expectation fulfill]; - }]; + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:201]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write just-above-range value to a nullable range-restricted signed " + @"16-bit integer Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000288_WriteAttribute +- (void)testSendClusterTestCluster_000459_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max value to a nullable range-restricted signed 16-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableCharStringArgument; - nullableCharStringArgument = @"☉T☉"; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:32767]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max value to a nullable range-restricted signed 16-bit integer " + @"Error: %@", + err); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], + EMBER_ZCL_STATUS_CONSTRAINT_ERROR); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000289_ReadAttribute +- (void)testSendClusterTestCluster_000460_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value has not changed"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value has not changed Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToString:@"☉T☉"]); - } + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue shortValue], -100); + } - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000290_WriteAttribute +- (void)testSendClusterTestCluster_000461_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING - Value too long"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write min valid value to a nullable range-restricted signed 16-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableCharStringArgument; - nullableCharStringArgument = nil; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING - Value too long Error: %@", err); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:-150]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write min valid value to a nullable range-restricted signed 16-bit " + @"integer Error: %@", + err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000291_ReadAttribute +- (void)testSendClusterTestCluster_000462_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is at min valid"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at min valid Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertTrue(actualValue == nil); - } + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue shortValue], -150); + } - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000292_WriteAttribute +- (void)testSendClusterTestCluster_000463_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write attribute NULLABLE_CHAR_STRING - Empty"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write max valid value to a nullable range-restricted signed 16-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - id nullableCharStringArgument; - nullableCharStringArgument = @""; - [cluster writeAttributeNullableCharStringWithValue:nullableCharStringArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write attribute NULLABLE_CHAR_STRING - Empty Error: %@", err); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:200]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write max valid value to a nullable range-restricted signed 16-bit " + @"integer Error: %@", + err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000293_ReadAttribute +- (void)testSendClusterTestCluster_000464_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute NULLABLE_CHAR_STRING"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is at max valid"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNullableCharStringWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute NULLABLE_CHAR_STRING Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at max valid Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - { - id actualValue = value; - XCTAssertFalse(actualValue == nil); - XCTAssertTrue([actualValue isEqualToString:@""]); - } + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue shortValue], 200); + } - [expectation fulfill]; - }]; + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000294_ReadAttribute +- (void)testSendClusterTestCluster_000465_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute from nonexistent endpoint."]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write middle valid value to a nullable range-restricted signed 16-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:200 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute from nonexistent endpoint. Error: %@", err); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = [NSNumber numberWithShort:7]; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write middle valid value to a nullable range-restricted signed 16-bit " + @"integer Error: %@", + err); - XCTAssertNotEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000295_ReadAttribute +- (void)testSendClusterTestCluster_000466_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read attribute from nonexistent cluster."]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is at mid valid"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeListInt8uWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read attribute from nonexistent cluster. Error: %@", err); + [cluster + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is at mid valid Error: %@", err); - XCTAssertNotEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertFalse(actualValue == nil); + XCTAssertEqual([actualValue shortValue], 7); + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000296_TestSimpleOptionalArgumentRequest +- (void)testSendClusterTestCluster_000467_WriteAttribute { XCTestExpectation * expectation = - [self expectationWithDescription:@"Send a command that takes an optional parameter but do not set it."]; + [self expectationWithDescription:@"Write null value to a nullable range-restricted signed 16-bit integer"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; - [cluster - testSimpleOptionalArgumentRequestWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send a command that takes an optional parameter but do not set it. Error: %@", err); + id nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument = nil; + [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:nullableRangeRestrictedInt16sArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write null value to a nullable range-restricted signed 16-bit integer " + @"Error: %@", + err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], EMBER_ZCL_STATUS_INVALID_VALUE); - [expectation fulfill]; - }]; + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestCluster_000297_TestSimpleOptionalArgumentRequest +- (void)testSendClusterTestCluster_000468_ReadAttribute { XCTestExpectation * expectation = - [self expectationWithDescription:@"Send a command that takes an optional parameter but do not set it."]; + [self expectationWithDescription:@"Verify nullable range-restricted signed 16-bit integer value is null"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestTestCluster * cluster = [[CHIPTestTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - __auto_type * params = [[CHIPTestClusterClusterTestSimpleOptionalArgumentRequestParams alloc] init]; - params.arg1 = [NSNumber numberWithBool:1]; [cluster - testSimpleOptionalArgumentRequestWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send a command that takes an optional parameter but do not set it. Error: %@", err); + readAttributeNullableRangeRestrictedInt16sWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify nullable range-restricted signed 16-bit integer value is null Error: %@", err); - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - [expectation fulfill]; - }]; + { + id actualValue = value; + XCTAssertTrue(actualValue == nil); + } + + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } @@ -27380,7 +32015,9 @@ - (void)testSendClusterTestSaveAs_000003_TestAddArguments { id actualValue = values.returnValue; - XCTAssertNotEqual([actualValue unsignedCharValue], TestAddArgumentDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], TestAddArgumentDefaultValue); + } } [expectation fulfill]; @@ -27452,7 +32089,9 @@ - (void)testSendClusterTestSaveAs_000006_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue boolValue], readAttributeBooleanDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue boolValue], readAttributeBooleanDefaultValue); + } } [expectation fulfill]; @@ -27570,7 +32209,9 @@ - (void)testSendClusterTestSaveAs_000011_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedCharValue], readAttributeBitmap8DefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], readAttributeBitmap8DefaultValue); + } } [expectation fulfill]; @@ -27688,7 +32329,9 @@ - (void)testSendClusterTestSaveAs_000016_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeBitmap16DefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeBitmap16DefaultValue); + } } [expectation fulfill]; @@ -27806,7 +32449,9 @@ - (void)testSendClusterTestSaveAs_000021_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedIntValue], readAttributeBitmap32DefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedIntValue], readAttributeBitmap32DefaultValue); + } } [expectation fulfill]; @@ -27924,7 +32569,9 @@ - (void)testSendClusterTestSaveAs_000026_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedLongLongValue], readAttributeBitmap64DefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedLongLongValue], readAttributeBitmap64DefaultValue); + } } [expectation fulfill]; @@ -28042,7 +32689,9 @@ - (void)testSendClusterTestSaveAs_000031_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedCharValue], readAttributeInt8uDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], readAttributeInt8uDefaultValue); + } } [expectation fulfill]; @@ -28160,7 +32809,9 @@ - (void)testSendClusterTestSaveAs_000036_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeInt16uDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeInt16uDefaultValue); + } } [expectation fulfill]; @@ -28278,7 +32929,9 @@ - (void)testSendClusterTestSaveAs_000041_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedIntValue], readAttributeInt32uDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedIntValue], readAttributeInt32uDefaultValue); + } } [expectation fulfill]; @@ -28396,7 +33049,9 @@ - (void)testSendClusterTestSaveAs_000046_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedLongLongValue], readAttributeInt64uDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedLongLongValue], readAttributeInt64uDefaultValue); + } } [expectation fulfill]; @@ -28514,7 +33169,9 @@ - (void)testSendClusterTestSaveAs_000051_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue charValue], readAttributeInt8sDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue charValue], readAttributeInt8sDefaultValue); + } } [expectation fulfill]; @@ -28632,7 +33289,9 @@ - (void)testSendClusterTestSaveAs_000056_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue shortValue], readAttributeInt16sDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue shortValue], readAttributeInt16sDefaultValue); + } } [expectation fulfill]; @@ -28750,7 +33409,9 @@ - (void)testSendClusterTestSaveAs_000061_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue intValue], readAttributeInt32sDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue intValue], readAttributeInt32sDefaultValue); + } } [expectation fulfill]; @@ -28868,7 +33529,9 @@ - (void)testSendClusterTestSaveAs_000066_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue longLongValue], readAttributeInt64sDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue longLongValue], readAttributeInt64sDefaultValue); + } } [expectation fulfill]; @@ -28986,7 +33649,9 @@ - (void)testSendClusterTestSaveAs_000071_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedCharValue], readAttributeEnum8DefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedCharValue], readAttributeEnum8DefaultValue); + } } [expectation fulfill]; @@ -29104,7 +33769,9 @@ - (void)testSendClusterTestSaveAs_000076_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeEnum16DefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeEnum16DefaultValue); + } } [expectation fulfill]; @@ -29222,7 +33889,9 @@ - (void)testSendClusterTestSaveAs_000081_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedLongLongValue], readAttributeEpochUSDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedLongLongValue], readAttributeEpochUSDefaultValue); + } } [expectation fulfill]; @@ -29340,7 +34009,9 @@ - (void)testSendClusterTestSaveAs_000086_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedIntValue], readAttributeEpochSDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedIntValue], readAttributeEpochSDefaultValue); + } } [expectation fulfill]; @@ -29458,7 +34129,9 @@ - (void)testSendClusterTestSaveAs_000091_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeVendorIdDefaultValue); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedShortValue], readAttributeVendorIdDefaultValue); + } } [expectation fulfill]; @@ -29559,7 +34232,9 @@ - (void)testSendClusterTestConstraints_000002_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 5); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedIntValue], 5UL); + } } [expectation fulfill]; @@ -29583,7 +34258,9 @@ - (void)testSendClusterTestConstraints_000003_ReadAttribute { id actualValue = value; - XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 5); + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedIntValue], 5UL); + } } [expectation fulfill]; @@ -29607,7 +34284,9 @@ - (void)testSendClusterTestConstraints_000004_ReadAttribute { id actualValue = value; - XCTAssertNotEqual([actualValue unsignedIntValue], 6); + if (actualValue != nil) { + XCTAssertNotEqual([actualValue unsignedIntValue], 6UL); + } } [expectation fulfill]; @@ -29935,31 +34614,7 @@ - (void)testSendClusterTestBasicInformation_000000_WaitForCommissionee WaitForCommissionee(expectation, queue); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestBasicInformation_000001_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read location"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read location Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@"XX"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBasicInformation_000002_WriteAttribute +- (void)testSendClusterTestBasicInformation_000001_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Write location"]; @@ -29981,31 +34636,7 @@ - (void)testSendClusterTestBasicInformation_000002_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestBasicInformation_000003_ReadAttribute -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Read back location"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestBasic * cluster = [[CHIPTestBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster readAttributeLocationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read back location Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = value; - XCTAssertTrue([actualValue isEqualToString:@"us"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestBasicInformation_000004_WriteAttribute +- (void)testSendClusterTestBasicInformation_000002_WriteAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Restore initial location value"]; @@ -30027,7 +34658,7 @@ - (void)testSendClusterTestBasicInformation_000004_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestBasicInformation_000005_ReadAttribute +- (void)testSendClusterTestBasicInformation_000003_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read AttributeList value"]; @@ -30277,74 +34908,7 @@ - (void)testSendClusterTestGroupsCluster_000006_GetGroupMembership [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000007_AddGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 2 (new)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - params.groupName = @"Group #2"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 2 (new) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000008_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (new)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (new) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #2"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000009_ViewGroup +- (void)testSendClusterTestGroupsCluster_000007_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (not found)"]; @@ -30375,39 +34939,7 @@ - (void)testSendClusterTestGroupsCluster_000009_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000010_AddGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Add Group 3 (new)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterAddGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - params.groupName = @"Group #3"; - [cluster addGroupWithParams:params - completionHandler:^(CHIPGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Add Group 3 (new) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 32767U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000011_ViewGroup +- (void)testSendClusterTestGroupsCluster_000008_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (existing)"]; @@ -30442,116 +34974,7 @@ - (void)testSendClusterTestGroupsCluster_000011_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000012_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (existing)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 2 (existing) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #2"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000013_GetGroupMembership -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 2"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterGetGroupMembershipParams alloc] init]; - { - NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; - temp_0[0] = [NSNumber numberWithUnsignedShort:2U]; - temp_0[1] = [NSNumber numberWithUnsignedShort:3U]; - temp_0[2] = [NSNumber numberWithUnsignedShort:32767U]; - params.groupList = temp_0; - } - [cluster getGroupMembershipWithParams:params - completionHandler:^( - CHIPGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Get Group Membership 2 Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.capacity; - XCTAssertEqual([actualValue unsignedCharValue], 255); - } - { - id actualValue = values.groupList; - XCTAssertEqual([actualValue count], 1); - XCTAssertEqual([actualValue[0] unsignedShortValue], 32767U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000014_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (new)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 3 (new) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 32767U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #3"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000015_RemoveGroup +- (void)testSendClusterTestGroupsCluster_000009_RemoveGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 0 (invalid)"]; @@ -30582,7 +35005,7 @@ - (void)testSendClusterTestGroupsCluster_000015_RemoveGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000016_RemoveGroup +- (void)testSendClusterTestGroupsCluster_000010_RemoveGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 4 (not found)"]; @@ -30613,38 +35036,7 @@ - (void)testSendClusterTestGroupsCluster_000016_RemoveGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000017_RemoveGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"Remove Group 2 (existing)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterRemoveGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:4369U]; - [cluster removeGroupWithParams:params - completionHandler:^(CHIPGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Remove Group 2 (existing) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 4369U); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000018_ViewGroup +- (void)testSendClusterTestGroupsCluster_000011_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (not removed)"]; @@ -30679,7 +35071,7 @@ - (void)testSendClusterTestGroupsCluster_000018_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000019_ViewGroup +- (void)testSendClusterTestGroupsCluster_000012_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (removed)"]; @@ -30710,42 +35102,7 @@ - (void)testSendClusterTestGroupsCluster_000019_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000020_ViewGroup -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (not removed)"]; - - CHIPDevice * device = GetConnectedDevice(); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPTestGroups * cluster = [[CHIPTestGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - __auto_type * params = [[CHIPGroupsClusterViewGroupParams alloc] init]; - params.groupId = [NSNumber numberWithUnsignedShort:32767U]; - [cluster viewGroupWithParams:params - completionHandler:^(CHIPGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"View Group 3 (not removed) Error: %@", err); - - XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); - - { - id actualValue = values.status; - XCTAssertEqual([actualValue unsignedCharValue], 0); - } - { - id actualValue = values.groupId; - XCTAssertEqual([actualValue unsignedShortValue], 32767U); - } - { - id actualValue = values.groupName; - XCTAssertTrue([actualValue isEqualToString:@"Group #3"]); - } - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterTestGroupsCluster_000021_GetGroupMembership +- (void)testSendClusterTestGroupsCluster_000013_GetGroupMembership { XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 3"]; @@ -30785,7 +35142,7 @@ - (void)testSendClusterTestGroupsCluster_000021_GetGroupMembership [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000022_RemoveAllGroups +- (void)testSendClusterTestGroupsCluster_000014_RemoveAllGroups { XCTestExpectation * expectation = [self expectationWithDescription:@"Remove All"]; @@ -30804,7 +35161,7 @@ - (void)testSendClusterTestGroupsCluster_000022_RemoveAllGroups [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000023_ViewGroup +- (void)testSendClusterTestGroupsCluster_000015_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 1 (removed)"]; @@ -30835,7 +35192,7 @@ - (void)testSendClusterTestGroupsCluster_000023_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000024_ViewGroup +- (void)testSendClusterTestGroupsCluster_000016_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 2 (still removed)"]; @@ -30866,7 +35223,7 @@ - (void)testSendClusterTestGroupsCluster_000024_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000025_ViewGroup +- (void)testSendClusterTestGroupsCluster_000017_ViewGroup { XCTestExpectation * expectation = [self expectationWithDescription:@"View Group 3 (removed)"]; @@ -30897,7 +35254,7 @@ - (void)testSendClusterTestGroupsCluster_000025_ViewGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestGroupsCluster_000026_GetGroupMembership +- (void)testSendClusterTestGroupsCluster_000018_GetGroupMembership { XCTestExpectation * expectation = [self expectationWithDescription:@"Get Group Membership 4"]; @@ -30938,6 +35295,63 @@ - (void)testSendClusterTestGroupsCluster_000026_GetGroupMembership [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestGroupKeyManagementCluster_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read maxGroupsPerFabric"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read maxGroupsPerFabric Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestGroupKeyManagementCluster_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read maxGroupKeysPerFabric"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestGroupKeyManagement * cluster = [[CHIPTestGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read maxGroupKeysPerFabric Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue unsignedShortValue], 1U); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTestIdentifyCluster_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -30969,6 +35383,31 @@ - (void)testSendClusterTestIdentifyCluster_000001_Identify [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestLogCommands_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestLogCommands_000001_Log +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Log a simple message"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + Log(expectation, queue, @"This is a simple message"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestLogCommands_000002_UserPrompt +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Do a simple user prompt message"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + UserPrompt(expectation, queue, @"This is a simple message"); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTestOperationalCredentialsCluster_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; @@ -30995,7 +35434,9 @@ - (void)testSendClusterTestOperationalCredentialsCluster_000001_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 4); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 4); + } } [expectation fulfill]; @@ -31021,7 +35462,9 @@ - (void)testSendClusterTestOperationalCredentialsCluster_000002_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); + } } [expectation fulfill]; @@ -31047,7 +35490,9 @@ - (void)testSendClusterTestOperationalCredentialsCluster_000003_ReadAttribute { id actualValue = value; - XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedCharValue], 1); + } } [expectation fulfill]; @@ -31856,6 +36301,31 @@ - (void)testSendClusterApplicationBasicReadAttributeApplicationVersionWithComple [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterApplicationBasicReadAttributeAllowedVendorListWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationBasicReadAttributeAllowedVendorListWithCompletionHandler"]; + + [cluster readAttributeAllowedVendorListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"ApplicationBasic AllowedVendorList Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterApplicationBasicReadAttributeAttributeListWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -32702,6 +37172,78 @@ - (void)testSendClusterBridgedDeviceBasicReadAttributeClusterRevisionWithComplet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterChannelReadAttributeChannelListWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeChannelListWithCompletionHandler"]; + + [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Channel ChannelList Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterChannelReadAttributeAttributeListWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeAttributeListWithCompletionHandler"]; + + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Channel AttributeList Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterChannelReadAttributeClusterRevisionWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPChannel * cluster = [[CHIPChannel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = [self expectationWithDescription:@"ChannelReadAttributeClusterRevisionWithCompletionHandler"]; + + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Channel ClusterRevision Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterColorControlReadAttributeCurrentHueWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -34364,7 +38906,7 @@ - (void)testSendClusterColorControlReadAttributeClusterRevisionWithCompletionHan [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterContentLauncherReadAttributeAcceptsHeaderListWithCompletionHandler +- (void)testSendClusterContentLauncherReadAttributeAcceptHeaderListWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -34378,10 +38920,10 @@ - (void)testSendClusterContentLauncherReadAttributeAcceptsHeaderListWithCompleti XCTAssertNotNil(cluster); XCTestExpectation * expectation = - [self expectationWithDescription:@"ContentLauncherReadAttributeAcceptsHeaderListWithCompletionHandler"]; + [self expectationWithDescription:@"ContentLauncherReadAttributeAcceptHeaderListWithCompletionHandler"]; - [cluster readAttributeAcceptsHeaderListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"ContentLauncher AcceptsHeaderList Error: %@", err); + [cluster readAttributeAcceptHeaderListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"ContentLauncher AcceptHeaderList Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; @@ -36576,7 +41118,57 @@ - (void)testSendClusterGeneralDiagnosticsReadAttributeClusterRevisionWithComplet [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGroupKeyManagementReadAttributeGroupsWithCompletionHandler +- (void)testSendClusterGroupKeyManagementReadAttributeGroupKeyMapWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupKeyMapWithCompletionHandler"]; + + [cluster readAttributeGroupKeyMapWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"GroupKeyManagement GroupKeyMap Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterGroupKeyManagementReadAttributeGroupTableWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupTableWithCompletionHandler"]; + + [cluster readAttributeGroupTableWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"GroupKeyManagement GroupTable Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterGroupKeyManagementReadAttributeMaxGroupsPerFabricWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -36590,10 +41182,10 @@ - (void)testSendClusterGroupKeyManagementReadAttributeGroupsWithCompletionHandle XCTAssertNotNil(cluster); XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupsWithCompletionHandler"]; + [self expectationWithDescription:@"GroupKeyManagementReadAttributeMaxGroupsPerFabricWithCompletionHandler"]; - [cluster readAttributeGroupsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement Groups Error: %@", err); + [cluster readAttributeMaxGroupsPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"GroupKeyManagement MaxGroupsPerFabric Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; @@ -36601,7 +41193,7 @@ - (void)testSendClusterGroupKeyManagementReadAttributeGroupsWithCompletionHandle [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGroupKeyManagementReadAttributeGroupKeysWithCompletionHandler +- (void)testSendClusterGroupKeyManagementReadAttributeMaxGroupKeysPerFabricWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -36615,10 +41207,10 @@ - (void)testSendClusterGroupKeyManagementReadAttributeGroupKeysWithCompletionHan XCTAssertNotNil(cluster); XCTestExpectation * expectation = - [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupKeysWithCompletionHandler"]; + [self expectationWithDescription:@"GroupKeyManagementReadAttributeMaxGroupKeysPerFabricWithCompletionHandler"]; - [cluster readAttributeGroupKeysWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"GroupKeyManagement GroupKeys Error: %@", err); + [cluster readAttributeMaxGroupKeysPerFabricWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"GroupKeyManagement MaxGroupKeysPerFabric Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; @@ -38535,7 +43127,7 @@ - (void)testSendClusterOtaSoftwareUpdateProviderReadAttributeClusterRevisionWith [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeDefaultOtaProviderWithCompletionHandler +- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeDefaultOtaProvidersWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -38551,10 +43143,10 @@ - (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeDefaultOtaProvider XCTAssertNotNil(cluster); XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeDefaultOtaProviderWithCompletionHandler"]; + [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeDefaultOtaProvidersWithCompletionHandler"]; - [cluster readAttributeDefaultOtaProviderWithCompletionHandler:^(NSData * _Nullable value, NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor DefaultOtaProvider Error: %@", err); + [cluster readAttributeDefaultOtaProvidersWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"OtaSoftwareUpdateRequestor DefaultOtaProviders Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; @@ -38562,7 +43154,7 @@ - (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeDefaultOtaProvider [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterOtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProviderWithValue +- (void)testSendClusterOtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProvidersWithValue { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -38578,15 +43170,15 @@ - (void)testSendClusterOtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProvide XCTAssertNotNil(cluster); XCTestExpectation * expectation = - [self expectationWithDescription:@"OtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProviderWithValue"]; + [self expectationWithDescription:@"OtaSoftwareUpdateRequestorWriteAttributeDefaultOtaProvidersWithValue"]; - NSData * _Nonnull value = [@"Test" dataUsingEncoding:NSUTF8StringEncoding]; - [cluster writeAttributeDefaultOtaProviderWithValue:value - completionHandler:^(NSError * _Nullable err) { - NSLog(@"OtaSoftwareUpdateRequestor DefaultOtaProvider Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + NSArray * _Nonnull value = [NSArray array]; + [cluster writeAttributeDefaultOtaProvidersWithValue:value + completionHandler:^(NSError * _Nullable err) { + NSLog(@"OtaSoftwareUpdateRequestor DefaultOtaProviders Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } @@ -38617,6 +43209,60 @@ - (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeUpdatePossibleWith [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeUpdateStateWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeUpdateStateWithCompletionHandler"]; + + [cluster readAttributeUpdateStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"OtaSoftwareUpdateRequestor UpdateState Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeUpdateStateProgressWithCompletionHandler +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPOtaSoftwareUpdateRequestor * cluster = [[CHIPOtaSoftwareUpdateRequestor alloc] initWithDevice:device + endpoint:0 + queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = + [self expectationWithDescription:@"OtaSoftwareUpdateRequestorReadAttributeUpdateStateProgressWithCompletionHandler"]; + + [cluster readAttributeUpdateStateProgressWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"OtaSoftwareUpdateRequestor UpdateStateProgress Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterOtaSoftwareUpdateRequestorReadAttributeAttributeListWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -41352,79 +45998,6 @@ - (void)testSendClusterSwitchReadAttributeClusterRevisionWithCompletionHandler [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTvChannelReadAttributeChannelListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTvChannel * cluster = [[CHIPTvChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"TvChannelReadAttributeChannelListWithCompletionHandler"]; - - [cluster readAttributeChannelListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TvChannel ChannelList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTvChannelReadAttributeAttributeListWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTvChannel * cluster = [[CHIPTvChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = [self expectationWithDescription:@"TvChannelReadAttributeAttributeListWithCompletionHandler"]; - - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TvChannel AttributeList Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - -- (void)testSendClusterTvChannelReadAttributeClusterRevisionWithCompletionHandler -{ - dispatch_queue_t queue = dispatch_get_main_queue(); - - XCTestExpectation * connectedExpectation = - [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; - WaitForCommissionee(connectedExpectation, queue); - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; - - CHIPDevice * device = GetConnectedDevice(); - CHIPTvChannel * cluster = [[CHIPTvChannel alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - XCTestExpectation * expectation = - [self expectationWithDescription:@"TvChannelReadAttributeClusterRevisionWithCompletionHandler"]; - - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TvChannel ClusterRevision Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} - - (void)testSendClusterTargetNavigatorReadAttributeTargetNavigatorListWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -43575,6 +48148,31 @@ - (void)testSendClusterUserLabelReadAttributeLabelListWithCompletionHandler [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterUserLabelWriteAttributeLabelListWithValue +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + XCTestExpectation * connectedExpectation = + [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; + WaitForCommissionee(connectedExpectation, queue); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; + + CHIPDevice * device = GetConnectedDevice(); + CHIPUserLabel * cluster = [[CHIPUserLabel alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + XCTestExpectation * expectation = [self expectationWithDescription:@"UserLabelWriteAttributeLabelListWithValue"]; + + NSArray * _Nonnull value = [NSArray array]; + [cluster writeAttributeLabelListWithValue:value + completionHandler:^(NSError * _Nullable err) { + NSLog(@"UserLabel LabelList Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterUserLabelReadAttributeClusterRevisionWithCompletionHandler { dispatch_queue_t queue = dispatch_get_main_queue(); diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index f1324d78b8eb73..16dfaee83e0fcb 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -887,33 +887,13 @@ #endif /** - * @def CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY + * @def CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_GLOBAL_EIDC_KEY * * @brief - * The critical event id counter (eidc) persisted storage key. + * The Global event id counter (eidc) persisted storage key. */ -#ifndef CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY "crit-eidc" -#endif - -/** - * @def CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY - * - * @brief - * The info event id counter (eidc) persisted storage key. - */ -#ifndef CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY "info-eidc" -#endif - -/** - * @def CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY - * - * @brief - * The debug event id counter (eidc) persisted storage key. - */ -#ifndef CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY "debug-eidc" +#ifndef CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_GLOBAL_EIDC_KEY +#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_GLOBAL_EIDC_KEY "global-eidc" #endif // -------------------- Software Update Manager Configuration -------------------- diff --git a/src/include/platform/DeviceControlServer.h b/src/include/platform/DeviceControlServer.h new file mode 100644 index 00000000000000..b74a88794d3c37 --- /dev/null +++ b/src/include/platform/DeviceControlServer.h @@ -0,0 +1,129 @@ +/* + * + * 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. + */ + +/** + * @file + * Defines the Device Layer DeviceControlServer object. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace DeviceLayer { + +/** + * Defines the Swtich Device Control Delegate class to notify platform events. + */ +class SwitchDeviceControlDelegate +{ +public: + virtual ~SwitchDeviceControlDelegate() {} + + /** + * @brief + * Called when the latching switch is moved to a new position. + */ + virtual void OnSwitchLatched(uint8_t newPosition) {} + + /** + * @brief + * Called when the momentary switch starts to be pressed. + */ + virtual void OnInitialPressed(uint8_t newPosition) {} + + /** + * @brief + * Called when the momentary switch has been pressed for a "long" time. + */ + virtual void OnLongPressed(uint8_t newPosition) {} + + /** + * @brief + * Called when the momentary switch has been released. + */ + virtual void OnShortReleased(uint8_t previousPosition) {} + + /** + * @brief + * Called when the momentary switch has been released (after debouncing) + * and after having been pressed for a long time. + */ + virtual void OnLongReleased(uint8_t previousPosition) {} + + /** + * @brief + * Called to indicate how many times the momentary switch has been pressed + * in a multi-press sequence, during that sequence. + */ + virtual void OnMultiPressOngoing(uint8_t newPosition, uint8_t count) {} + + /** + * @brief + * Called to indicate how many times the momentary switch has been pressed + * in a multi-press sequence, after it has been detected that the sequence has ended. + */ + virtual void OnMultiPressComplete(uint8_t newPosition, uint8_t count) {} +}; + +class DeviceControlServer final +{ +public: + // ===== Members for internal use by other Device Layer components. + + CHIP_ERROR ArmFailSafe(System::Clock::Timeout expiryLength); + CHIP_ERROR DisarmFailSafe(); + CHIP_ERROR CommissioningComplete(); + CHIP_ERROR SetRegulatoryConfig(uint8_t location, const CharSpan & countryCode, uint64_t breadcrumb); + + CHIP_ERROR ConnectNetworkForOperational(ByteSpan networkID); + + inline FabricIndex GetFabricIndex() { return mFabric; } + inline void SetFabricIndex(FabricIndex fabricId) { mFabric = fabricId; } + inline NodeId GetPeerNodeId() { return mPeerNodeId; } + inline void SetPeerNodeId(NodeId peerNodeId) { mPeerNodeId = peerNodeId; } + void SetSwitchDelegate(SwitchDeviceControlDelegate * delegate) { mSwitchDelegate = delegate; } + SwitchDeviceControlDelegate * GetSwitchDelegate() const { return mSwitchDelegate; } + + static DeviceControlServer & DeviceControlSvr(); + +private: + // ===== Members for internal use by the following friends. + static DeviceControlServer sInstance; + SwitchDeviceControlDelegate * mSwitchDelegate = nullptr; + + friend void HandleArmFailSafe(System::Layer * layer, void * aAppState); + void CommissioningFailedTimerComplete(); + + // ===== Private members reserved for use by this class only. + + DeviceControlServer() = default; + ~DeviceControlServer() = default; + + // No copy, move or assignment. + DeviceControlServer(const DeviceControlServer &) = delete; + DeviceControlServer(const DeviceControlServer &&) = delete; + DeviceControlServer & operator=(const DeviceControlServer &) = delete; + + NodeId mPeerNodeId = 0; + FabricIndex mFabric = 0; +}; + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/include/platform/NFCManager.h b/src/include/platform/NFCManager.h index 7513c19add1e9a..6028f8677c74be 100644 --- a/src/include/platform/NFCManager.h +++ b/src/include/platform/NFCManager.h @@ -35,7 +35,7 @@ class NFCManagerImpl; * @brief Defines an abstract interface for programming an NFC Tag. * * NFC Tag can be used in Project CHIP to share commissioning information such - * as the device discriminator and PIN code with a comissioner. This class + * as the device discriminator and PIN code with a commissioner. This class * provides an interface to set contents of a programmable NFC Tag. */ class NFCManager diff --git a/src/include/platform/NetworkCommissioning.h b/src/include/platform/NetworkCommissioning.h new file mode 100644 index 00000000000000..9095ae3d6714df --- /dev/null +++ b/src/include/platform/NetworkCommissioning.h @@ -0,0 +1,297 @@ +/* + * + * 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. + */ + +/** + * @file + * This file defines the CHIP Device Network Provisioning object. + * + */ + +#pragma once + +#include +#include +#include +#include + +#include + +namespace chip { +namespace DeviceLayer { +/** + * We are using a namespace here, for most use cases, this namespace will be used by `using DeviceLayer::NetworkCommissioning`, but + * this still worth a dedicated namespace since: + * + * - The BaseDriver / WirelessDriver is not expected to be implemented directly by users, the only occurrence is in the network + * commissioning cluster. + * - We can safely name the drivers as WiFiDriver / ThreadDriver, it should not be ambiguous for most cases + * - We can safely name the Status enum to Status, and some other structs -- if we are using using, then we should in the context of + * writing something dedicated to network commissioning, then a single word Status should be clear enough. + */ +namespace NetworkCommissioning { + +constexpr size_t kMaxNetworkIDLen = 32; + +// TODO: This is exactly the same as the one in GroupDataProvider, this could be moved to src/lib/support +template +class Iterator +{ +public: + virtual ~Iterator() = default; + /** + * @retval The number of entries in total that will be iterated. + */ + virtual size_t Count() = 0; + /** + * @param[out] item Value associated with the next element in the iteration. + * @retval true if the next entry is successfully retrieved. + * @retval false if no more entries can be found. + */ + virtual bool Next(T & item) = 0; + /** + * Release the memory allocated by this iterator. + * Must be called before the pointer goes out of scope. + */ + virtual void Release() = 0; + +protected: + Iterator() = default; +}; + +/** + * The content should match the one in zap_generated/cluster-objects.h. + * Matching is validated by cluster code. + */ +enum class Status : uint8_t +{ + kSuccess = 0x00, + kOutOfRange = 0x01, + kBoundsExceeded = 0x02, + kNetworkIDNotFound = 0x03, + kDuplicateNetworkID = 0x04, + kNetworkNotFound = 0x05, + kRegulatoryError = 0x06, + kAuthFailure = 0x07, + kUnsupportedSecurity = 0x08, + kOtherConnectionFailure = 0x09, + kIPV6Failed = 0x0A, + kIPBindFailed = 0x0B, + kUnknownError = 0x0C, +}; + +enum class WiFiBand : uint8_t +{ + k2g4 = 0x00, + k3g65 = 0x01, + k5g = 0x02, + k6g = 0x03, + k60g = 0x04, +}; + +// The following structs follows the generated cluster object structs. +struct Network +{ + uint8_t networkID[kMaxNetworkIDLen]; + uint8_t networkIDLen; + bool connected; +}; + +static_assert(sizeof(Network::networkID) <= std::numeric_limits::max(), + "Max length of networkID ssid exceeds the limit of networkIDLen field"); + +struct WiFiScanResponse +{ +public: + uint8_t security; + uint8_t ssid[DeviceLayer::Internal::kMaxWiFiSSIDLength]; + uint8_t ssidLen; + uint8_t bssid[6]; + uint16_t channel; + WiFiBand wiFiBand; + int8_t rssi; +}; + +static_assert(sizeof(WiFiScanResponse::ssid) <= std::numeric_limits::max(), + "Max length of WiFi ssid exceeds the limit of ssidLen field"); + +struct ThreadScanResponse +{ + uint64_t panId; + uint64_t extendedPanId; + char networkName[16]; + uint8_t networkNameLen; + uint16_t channel; + uint8_t version; + uint64_t extendedAddress; + int8_t rssi; + uint8_t lqi; +}; + +static_assert(sizeof(ThreadScanResponse::networkName) <= std::numeric_limits::max(), + "Max length of WiFi credentials exceeds the limit of credentialsLen field"); + +using NetworkIterator = Iterator; +using WiFiScanResponseIterator = Iterator; +using ThreadScanResponseIterator = Iterator; + +// BaseDriver and WirelessDriver are the common interfaces for a network driver, platform drivers should not implement this +// directly, instead, users are expected to implement WiFiDriver, ThreadDriver and EthernetDriver. +namespace Internal { +class BaseDriver +{ +public: + /** + * @brief Initializes the driver, this function will be called when initializing the network commissioning cluster. + */ + virtual CHIP_ERROR Init() { return CHIP_NO_ERROR; } + + /** + * @brief Shuts down the driver, this function will be called when shutting down the network commissioning cluster. + */ + virtual CHIP_ERROR Shutdown() { return CHIP_NO_ERROR; } + + /** + * @brief Returns maximum number of network configs can be added to the driver. + */ + virtual uint8_t GetMaxNetworks() = 0; + + /** + * @brief Returns an iterator for reading the networks, the user will always call NetworkIterator::Release. The iterator should + * be consumed in the same context as calling GetNetworks(). Users must call Release() when the iterator goes out of scope. + */ + virtual NetworkIterator * GetNetworks() = 0; + + /** + * @brief Sets the status of the interface, this is an optional feature of a network driver. + */ + virtual CHIP_ERROR SetEnabled(bool enabled) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } + + /** + * @brief Returns the status of the interface, this is an optional feature of a network driver the driver will be enabled by + * default. + */ + virtual bool GetEnabled() { return true; }; + + virtual ~BaseDriver() = default; +}; + +class WirelessDriver : public Internal::BaseDriver +{ +public: + class ConnectCallback + { + public: + virtual void OnResult(Status commissioningError, CharSpan debugText, int32_t connectStatus) = 0; + + virtual ~ConnectCallback() = default; + }; + + /** + * @brief Persists the network configurations. This function is expected to be called when CommissioningComplete event is fired. + */ + virtual CHIP_ERROR CommitConfiguration() = 0; + + /** + * @brief Reverts the network configurations to the last committed one. This function is expected to be called when failsafe + * timeout reached. + */ + virtual CHIP_ERROR RevertConfiguration() = 0; + + virtual uint8_t GetScanNetworkTimeoutSeconds() = 0; + virtual uint8_t GetConnectNetworkTimeoutSeconds() = 0; + + virtual Status RemoveNetwork(ByteSpan networkId) = 0; + virtual Status ReorderNetwork(ByteSpan networkId, uint8_t index) = 0; + + /** + * @brief Initializes a network join. callback->OnResult must be called, on both success and error. Callback can be + * called inside ConnectNetwork. + */ + virtual void ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) = 0; +}; +} // namespace Internal + +class WiFiDriver : public Internal::WirelessDriver +{ +public: + class ScanCallback + { + public: + /** + * Indicates the scan is finished, and accepts a iterator of networks discovered. + * - networks can be nullptr when no networks discovered, or error occurred during scanning the networks. + * OnFinished() must be called in a thread-safe manner with CHIP stack. (e.g. using ScheduleWork or ScheduleLambda) + * - Users can assume the networks will always be used (and Release will be called) inside this function call. However, the + * iterator might be not fully consumed (i.e. There are too many networks scanned to fit in the buffer for scan response + * message.) + */ + virtual void OnFinished(Status status, CharSpan debugText, WiFiScanResponseIterator * networks) = 0; + + virtual ~ScanCallback() = default; + }; + + virtual Status AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials) = 0; + + /** + * @brief Initializes a WiFi network scan. callback->OnFinished must be called, on both success and error. Callback can + * be called inside ScanNetworks. + * + * @param ssid The interested SSID, the scanning MAY be restricted to to the given SSID. + */ + virtual void ScanNetworks(ByteSpan ssid, ScanCallback * callback) = 0; + + virtual ~WiFiDriver() = default; +}; + +class ThreadDriver : public Internal::WirelessDriver +{ +public: + class ScanCallback + { + public: + /** + * Indicates the scan is finished, and accepts a iterator of networks discovered. + * - networks can be nullptr when no networks discovered, or error occurred during scanning the networks. + * OnFinished() must be called in a thread-safe manner with CHIP stack. (e.g. using ScheduleWork or ScheduleLambda) + * - Users can assume the networks will always be used (and Release will be called) inside this function call. However, the + * iterator might be not fully consumed (i.e. There are too many networks scanned to fit in the buffer for scan response + * message.) + */ + virtual void OnFinished(Status err, CharSpan debugText, ThreadScanResponseIterator * networks) = 0; + + virtual ~ScanCallback() = default; + }; + + virtual Status AddOrUpdateNetwork(ByteSpan operationalDataset) = 0; + + /** + * @brief Initializes a Thread network scan. callback->OnFinished must be called, on both success and error. Callback can + * be called inside ScanNetworks. + */ + virtual void ScanNetworks(ScanCallback * callback) = 0; + + virtual ~ThreadDriver() = default; +}; + +class EthernetDriver : public Internal::BaseDriver +{ + // Ethernet driver does not have any special operations. +}; + +} // namespace NetworkCommissioning +} // namespace DeviceLayer +} // namespace chip diff --git a/src/include/platform/OTARequestorDriver.h b/src/include/platform/OTARequestorDriver.h index a1bcb6855801e5..dc6fe2de9bb99f 100644 --- a/src/include/platform/OTARequestorDriver.h +++ b/src/include/platform/OTARequestorDriver.h @@ -25,25 +25,29 @@ #pragma once #include +#include namespace chip { -/* Commented out until the API is supported // The set of parameters needed for starting a BDX download. -struct BdxDownloadParameters +struct UpdateDescription { - uint32_t delayedActionTime; // Might not be needed - chip::CharSpan imageURI; + CharSpan imageURI; uint32_t softwareVersion; - chip::CharSpan softwareVersionString; // Might not be needed - chip::ByteSpan updateToken; - bool userConsentNeeded; // Might not be needed - chip::ByteSpan metadataForRequestor; // Might not be needed + ByteSpan updateToken; + bool userConsentNeeded; + ByteSpan metadataForRequestor; +}; + +enum class UpdateNotFoundReason +{ + Busy, + NotAvailable, + UpToDate }; -*/ // Possible values for the UpdateState attribute -enum UpdateStateEnum +enum class UpdateStateEnum { Unknown = 0, Idle = 1, @@ -56,52 +60,39 @@ enum UpdateStateEnum DelayedOnUserConsent = 8, }; -// Return type for RequestUserConsent() -enum UserConsentAction -{ - ImmediateYes = 1, - ImmediateNo = 2, - Requested = 3, -}; - // Interface class to abstract the OTA-related business logic. Each application // must implement this interface. All calls must be non-blocking unless stated otherwise class OTARequestorDriver { public: - // Mandatory methods, applications are required to implement these + virtual ~OTARequestorDriver() = default; - // A call into the application logic to give it a chance to allow or stop the Requestor - // from proceeding with actual image download. Returning TRUE will allow the download - // to proceed, returning FALSE will abort the download process. - virtual bool CheckImageDownloadAllowed() = 0; + /// Return if the device provides UI for asking a user for consent before downloading a software image + virtual bool CanConsent() = 0; - // Application is directed to complete user consent: either return ImmediateYes/ImmediateNo - // without blocking or return Requested and call OTARequestor::OnUserConsent() later. - virtual UserConsentAction RequestUserConsent() = 0; + /// Return maximum supported download block size + virtual uint16_t GetMaxDownloadBlockSize() { return 1024; } - // Notify the application that the download is complete and the image can be applied - virtual void ImageDownloadComplete() = 0; + /// Called when an error occurs at any OTA requestor operation + virtual void HandleError(UpdateStateEnum state, CHIP_ERROR error) = 0; - // Optional methods, applications may choose to implement these + /// Called when the latest query found a software update + virtual void UpdateAvailable(const UpdateDescription & update, System::Clock::Seconds32 delay) = 0; - /* Commented out until the API is supported - // This method informs the application of the BDX download parameters. This info can be used - // later on for diecting the Requestor to resume an interrupted download - virtual void PostBdxDownloadParameters(const BdxDownloadParameters & bdxParameters){}; - */ + /// Called when the latest query did not find any software update + virtual void UpdateNotFound(UpdateNotFoundReason reason, System::Clock::Seconds32 delay) = 0; - // Return maximum supported download block size - virtual uint16_t GetMaxDownloadBlockSize() { return 1024; } + /// Called when the download of a new software image has finished + virtual void UpdateDownloaded() = 0; - // Get Version of the last downloaded image, return CHIP_ERROR_NOT_FOUND if none exists - virtual CHIP_ERROR GetLastDownloadedImageVersion(uint32_t & out_version) { return CHIP_ERROR_NOT_FOUND; } + /// Called when the current software update can be applied + virtual void UpdateConfirmed(System::Clock::Seconds32 delay) = 0; - // Notify application of a change in the UpdateState attribute - virtual void NotifyUpdateStateChange(chip::UpdateStateEnum state){}; + /// Called when the requestor shall ask again before applying the current software update + virtual void UpdateSuspended(System::Clock::Seconds32 delay) = 0; - // Destructor - virtual ~OTARequestorDriver() = default; + /// Called when the current software update should be discontinued + virtual void UpdateDiscontinued() = 0; }; } // namespace chip diff --git a/src/include/platform/OTARequestorInterface.h b/src/include/platform/OTARequestorInterface.h index 0af7452c51efe8..b629c67fc85916 100644 --- a/src/include/platform/OTARequestorInterface.h +++ b/src/include/platform/OTARequestorInterface.h @@ -23,8 +23,7 @@ #include #include - -#include +#include #pragma once @@ -35,6 +34,13 @@ namespace chip { class OTARequestorInterface { public: + // Return value for various trigger-type APIs + enum OTATriggerResult + { + kTriggerSuccessful = 0, + kNoProviderKnown = 1 + }; + // Handler for the AnnounceOTAProvider command virtual EmberAfStatus HandleAnnounceOTAProvider( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, @@ -48,6 +54,18 @@ class OTARequestorInterface // Destructor virtual ~OTARequestorInterface() = default; + + // Send QueryImage command + virtual OTATriggerResult TriggerImmediateQuery() = 0; + + // Download image + virtual void DownloadUpdate() = 0; + + // Send ApplyImage command + virtual void ApplyUpdate() = 0; + + // Manually set OTA Provider parameters + virtual void TestModeSetProviderParameters(NodeId nodeId, FabricIndex fabIndex, EndpointId endpointId) = 0; }; // The instance of the class implementing OTARequestorInterface must be managed through diff --git a/src/include/platform/PlatformManager.h b/src/include/platform/PlatformManager.h index b90a6098939bb3..429cad2f1a237f 100644 --- a/src/include/platform/PlatformManager.h +++ b/src/include/platform/PlatformManager.h @@ -40,14 +40,12 @@ namespace DeviceLayer { class PlatformManagerImpl; class ConnectivityManagerImpl; class ConfigurationManagerImpl; +class DeviceControlServer; class TraitManager; class ThreadStackManagerImpl; class TimeSyncManager; namespace Internal { -class DeviceControlServer; -class FabricProvisioningServer; -class ServiceProvisioningServer; class BLEManagerImpl; template class GenericConfigurationManagerImpl; @@ -182,6 +180,8 @@ class PlatformManager CHIP_ERROR GetFixedLabelList(EndpointId endpoint, LabelList & labelList); + CHIP_ERROR SetUserLabelList(EndpointId endpoint, + LabelList & labelList); CHIP_ERROR GetUserLabelList(EndpointId endpoint, LabelList & labelList); @@ -194,13 +194,11 @@ class PlatformManager friend class PlatformManagerImpl; friend class ConnectivityManagerImpl; friend class ConfigurationManagerImpl; + friend class DeviceControlServer; friend class Dnssd::DiscoveryImplPlatform; friend class TraitManager; friend class ThreadStackManagerImpl; friend class TimeSyncManager; - friend class Internal::DeviceControlServer; - friend class Internal::FabricProvisioningServer; - friend class Internal::ServiceProvisioningServer; friend class Internal::BLEManagerImpl; template friend class Internal::GenericPlatformManagerImpl; @@ -434,6 +432,13 @@ PlatformManager::GetFixedLabelList(EndpointId endpoint, return static_cast(this)->_GetFixedLabelList(endpoint, labelList); } +inline CHIP_ERROR +PlatformManager::SetUserLabelList(EndpointId endpoint, + LabelList & labelList) +{ + return static_cast(this)->_SetUserLabelList(endpoint, labelList); +} + inline CHIP_ERROR PlatformManager::GetUserLabelList(EndpointId endpoint, LabelList & labelList) diff --git a/src/include/platform/ThreadStackManager.h b/src/include/platform/ThreadStackManager.h index 75d6dfe58d5a8c..f9db5e3df3c6e7 100644 --- a/src/include/platform/ThreadStackManager.h +++ b/src/include/platform/ThreadStackManager.h @@ -40,9 +40,9 @@ namespace DeviceLayer { class PlatformManagerImpl; class ThreadStackManagerImpl; class ConfigurationManagerImpl; +class DeviceControlServer; namespace Internal { -class DeviceControlServer; class BLEManagerImpl; template class GenericPlatformManagerImpl; @@ -88,6 +88,7 @@ class ThreadStackManager bool TryLockThreadStack(); void UnlockThreadStack(); bool HaveRouteToAddress(const chip::Inet::IPAddress & destAddr); + CHIP_ERROR GetThreadProvision(ByteSpan & netInfo); CHIP_ERROR GetAndLogThreadStatsCounters(); CHIP_ERROR GetAndLogThreadTopologyMinimal(); CHIP_ERROR GetAndLogThreadTopologyFull(); @@ -124,10 +125,10 @@ class ThreadStackManager friend class PlatformManagerImpl; friend class ConfigurationManagerImpl; + friend class DeviceControlServer; #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE friend class Internal::BLEManagerImpl; #endif - friend class Internal::DeviceControlServer; template friend class Internal::GenericPlatformManagerImpl; template @@ -147,7 +148,6 @@ class ThreadStackManager bool IsThreadEnabled(); bool IsThreadProvisioned(); bool IsThreadAttached(); - CHIP_ERROR GetThreadProvision(ByteSpan & netInfo); void ErasePersistentInfo(); ConnectivityManager::ThreadDeviceType GetThreadDeviceType(); CHIP_ERROR SetThreadDeviceType(ConnectivityManager::ThreadDeviceType threadRole); diff --git a/src/include/platform/internal/DeviceControlServer.h b/src/include/platform/internal/DeviceControlServer.h deleted file mode 100644 index c5dee52839ba47..00000000000000 --- a/src/include/platform/internal/DeviceControlServer.h +++ /dev/null @@ -1,65 +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. - */ - -/** - * @file - * Defines the Device Layer DeviceControlServer object. - */ - -#pragma once - -#include -#include - -namespace chip { -namespace DeviceLayer { -namespace Internal { - -class DeviceControlServer final -{ -public: - // ===== Members for internal use by other Device Layer components. - - CHIP_ERROR ArmFailSafe(System::Clock::Timeout expiryLength); - CHIP_ERROR DisarmFailSafe(); - CHIP_ERROR CommissioningComplete(); - CHIP_ERROR SetRegulatoryConfig(uint8_t location, const CharSpan & countryCode, uint64_t breadcrumb); - - CHIP_ERROR ConnectNetworkForOperational(ByteSpan networkID); - - static DeviceControlServer & DeviceControlSvr(); - -private: - // ===== Members for internal use by the following friends. - static DeviceControlServer sInstance; - friend void HandleArmFailSafe(System::Layer * layer, void * aAppState); - void CommissioningFailedTimerComplete(); - - // ===== Private members reserved for use by this class only. - - DeviceControlServer() = default; - ~DeviceControlServer() = default; - - // No copy, move or assignment. - DeviceControlServer(const DeviceControlServer &) = delete; - DeviceControlServer(const DeviceControlServer &&) = delete; - DeviceControlServer & operator=(const DeviceControlServer &) = delete; -}; - -} // namespace Internal -} // namespace DeviceLayer -} // namespace chip diff --git a/src/include/platform/internal/DeviceNetworkInfo.h b/src/include/platform/internal/DeviceNetworkInfo.h index 6f47c19d4d113f..7e218914066e76 100644 --- a/src/include/platform/internal/DeviceNetworkInfo.h +++ b/src/include/platform/internal/DeviceNetworkInfo.h @@ -32,6 +32,7 @@ namespace Internal { // ---- WiFi-specific Limits ---- constexpr size_t kMaxWiFiSSIDLength = 32; constexpr size_t kMaxWiFiKeyLength = 64; +constexpr size_t kWiFiBSSIDLength = 6; /** * Ids for well-known network provision types. diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_NoThread.h b/src/include/platform/internal/GenericConnectivityManagerImpl_NoThread.h index 099be0988a9900..e25dcb4ff8aea4 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_NoThread.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_NoThread.h @@ -152,7 +152,7 @@ inline CHIP_ERROR GenericConnectivityManagerImpl_NoThread::_WriteThre case app::Clusters::ThreadNetworkDiagnostics::Attributes::SecurityPolicy::Id: case app::Clusters::ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::Id: case app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::Id: { - err = encoder.Encode(app::DataModel::List()); + err = encoder.EncodeEmptyList(); break; } default: { diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.h b/src/include/platform/internal/GenericPlatformManagerImpl.h index d4444dfa987430..eb738bf7887a11 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl.h +++ b/src/include/platform/internal/GenericPlatformManagerImpl.h @@ -60,6 +60,8 @@ class GenericPlatformManagerImpl CHIP_ERROR _GetFixedLabelList(EndpointId endpoint, LabelList & labelList); + CHIP_ERROR _SetUserLabelList(EndpointId endpoint, + LabelList & labelList); CHIP_ERROR _GetUserLabelList(EndpointId endpoint, LabelList & labelList); @@ -85,6 +87,13 @@ inline CHIP_ERROR GenericPlatformManagerImpl::_GetFixedLabelList( return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } +template +inline CHIP_ERROR GenericPlatformManagerImpl::_SetUserLabelList( + EndpointId endpoint, LabelList & labelList) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + template inline CHIP_ERROR GenericPlatformManagerImpl::_GetUserLabelList( EndpointId endpoint, LabelList & labelList) diff --git a/src/inet/IPAddress-StringFuncts.cpp b/src/inet/IPAddress-StringFuncts.cpp index 3db3f53fc31f2c..773034dbd289dc 100644 --- a/src/inet/IPAddress-StringFuncts.cpp +++ b/src/inet/IPAddress-StringFuncts.cpp @@ -46,13 +46,8 @@ char * IPAddress::ToString(char * buf, uint32_t bufSize) const #if INET_CONFIG_ENABLE_IPV4 if (IsIPv4()) { -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 ip4_addr_t ip4_addr = ToIPv4(); ip4addr_ntoa_r(&ip4_addr, buf, (int) bufSize); -#else // LWIP_VERSION_MAJOR <= 1 - ip_addr_t ip4_addr = ToIPv4(); - ipaddr_ntoa_r(&ip4_addr, buf, (int) bufSize); -#endif // LWIP_VERSION_MAJOR <= 1 } else #endif // INET_CONFIG_ENABLE_IPV4 @@ -93,15 +88,9 @@ bool IPAddress::FromString(const char * str, IPAddress & output) if (strchr(str, ':') == nullptr) { #if CHIP_SYSTEM_CONFIG_USE_LWIP -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 ip4_addr_t ipv4Addr; if (!ip4addr_aton(str, &ipv4Addr)) return false; -#else // LWIP_VERSION_MAJOR <= 1 - ip_addr_t ipv4Addr; - if (!ipaddr_aton(str, &ipv4Addr)) - return false; -#endif // LWIP_VERSION_MAJOR <= 1 #else // !CHIP_SYSTEM_CONFIG_USE_LWIP struct in_addr ipv4Addr; if (inet_pton(AF_INET, str, &ipv4Addr) < 1) diff --git a/src/inet/IPAddress.cpp b/src/inet/IPAddress.cpp index cbc1c8d4b08f74..ce65f7875e811f 100644 --- a/src/inet/IPAddress.cpp +++ b/src/inet/IPAddress.cpp @@ -119,7 +119,6 @@ ip4_addr_t IPAddress::ToIPv4() const #endif // INET_CONFIG_ENABLE_IPV4 -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 ip_addr_t IPAddress::ToLwIPAddr(void) const { ip_addr_t ret; @@ -173,7 +172,6 @@ lwip_ip_addr_type IPAddress::ToLwIPAddrType(IPAddressType typ) return ret; } -#endif // LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 ip6_addr_t IPAddress::ToIPv6() const { @@ -220,15 +218,21 @@ struct in6_addr IPAddress::ToIPv6() const return ipAddr; } -IPAddress IPAddress::FromSockAddr(const SockAddr & sockaddr) +CHIP_ERROR IPAddress::GetIPAddressFromSockAddr(const SockAddr & sockaddr, IPAddress & outIPAddress) { #if INET_CONFIG_ENABLE_IPV4 if (sockaddr.any.sa_family == AF_INET) - return FromSockAddr(sockaddr.in); + { + outIPAddress = FromSockAddr(sockaddr.in); + return CHIP_NO_ERROR; + } #endif // INET_CONFIG_ENABLE_IPV4 if (sockaddr.any.sa_family == AF_INET6) - return FromSockAddr(sockaddr.in6); - return Any; + { + outIPAddress = FromSockAddr(sockaddr.in6); + return CHIP_NO_ERROR; + } + return INET_ERROR_WRONG_ADDRESS_TYPE; } #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK diff --git a/src/inet/IPAddress.h b/src/inet/IPAddress.h index a688efb543ab29..3b502a8293a1fc 100644 --- a/src/inet/IPAddress.h +++ b/src/inet/IPAddress.h @@ -37,6 +37,7 @@ #include #include +#include #include "inet/IANAConstants.h" @@ -61,24 +62,6 @@ #define NL_INET_IPV6_ADDR_LEN_IN_BYTES (16) #define NL_INET_IPV6_MCAST_GROUP_LEN_IN_BYTES (14) -/** - * @brief Adaptation for LwIP ip4_addr_t type. - * - * @details - * Before LwIP 2.0.0, the \c ip_addr_t type alias referred to a structure comprising - * an IPv4 address. At LwIP 2.0.0 and thereafter, this type alias is renamed \c ip4_addr_t - * and \c ip_addr_t is replaced with an alias to a union of both. Here, the \c ip4_addr_t - * type alias is provided even when the LwIP version is earlier than 2.0.0 so as to prepare - * for the import of the new logic. - */ -#if CHIP_SYSTEM_CONFIG_USE_LWIP && INET_CONFIG_ENABLE_IPV4 && LWIP_VERSION_MAJOR < 2 && LWIP_VERSION_MINOR < 5 -typedef ip_addr_t ip4_addr_t; -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP && INET_CONFIG_ENABLE_IPV4 && LWIP_VERSION_MAJOR < 2 && LWIP_VERSION_MINOR < 5 - -#if CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_VERSION_MAJOR == 1 && LWIP_VERSION_MINOR >= 5 -typedef u8_t lwip_ip_addr_type; -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_VERSION_MAJOR == 1 && LWIP_VERSION_MINOR >= 5 - namespace chip { namespace Inet { @@ -489,7 +472,6 @@ class DLL_EXPORT IPAddress #if CHIP_SYSTEM_CONFIG_USE_LWIP -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 /** * @fn ToLwIPAddr() const * @@ -508,10 +490,9 @@ class DLL_EXPORT IPAddress * * @details * Use ToLwIPAddrType(IPAddressType) to convert the IP address type - * to its underlying LwIP address type code. (LWIP_VERSION_MAJOR > 1 only). + * to its underlying LwIP address type code. */ static lwip_ip_addr_type ToLwIPAddrType(IPAddressType); -#endif // LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 ip6_addr_t ToIPv6(void) const; @@ -532,8 +513,11 @@ class DLL_EXPORT IPAddress /** * Get the IP address from a SockAddr. */ - static IPAddress FromSockAddr(const SockAddr & sockaddr); - static IPAddress FromSockAddr(const sockaddr & sockaddr) { return FromSockAddr(reinterpret_cast(sockaddr)); } + static CHIP_ERROR GetIPAddressFromSockAddr(const SockAddr & sockaddr, IPAddress & outIPAddress); + static CHIP_ERROR GetIPAddressFromSockAddr(const sockaddr & sockaddr, IPAddress & outIPAddress) + { + return GetIPAddressFromSockAddr(reinterpret_cast(sockaddr), outIPAddress); + } static IPAddress FromSockAddr(const sockaddr_in6 & sockaddr) { return IPAddress(sockaddr.sin6_addr); } #if INET_CONFIG_ENABLE_IPV4 static IPAddress FromSockAddr(const sockaddr_in & sockaddr) { return IPAddress(sockaddr.sin_addr); } diff --git a/src/inet/IPPrefix.h b/src/inet/IPPrefix.h index 124cf0445ac6f4..ce58c1b3a700a3 100644 --- a/src/inet/IPPrefix.h +++ b/src/inet/IPPrefix.h @@ -46,6 +46,7 @@ class IPPrefix { public: IPPrefix() = default; + IPPrefix(const IPAddress & ipAddress, uint8_t length) : IPAddr(ipAddress), Length(length) {} /** * Copy constructor for the IPPrefix class. diff --git a/src/inet/InetConfig.h b/src/inet/InetConfig.h index 2e69398afbb8ef..d209328fde87a5 100644 --- a/src/inet/InetConfig.h +++ b/src/inet/InetConfig.h @@ -192,25 +192,6 @@ #define INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT 1 #endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT -/** - * @def INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - * - * @brief - * When this flag is set, the InetLayer enables - * callbacks to the upper layer notifying it when - * the send channel of the TCP connection changes - * between being idle or not idle. - * - * @note - * When enabled, the TCP send queue is actively - * polled to determine if sent data has been - * acknowledged. - * - */ -#ifndef INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS -#define INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS 0 -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - /** * @def INET_CONFIG_TCP_SEND_QUEUE_POLL_INTERVAL_MSEC * diff --git a/src/inet/InetInterface.cpp b/src/inet/InetInterface.cpp index 637ae2ee789e15..be344cbe43b983 100644 --- a/src/inet/InetInterface.cpp +++ b/src/inet/InetInterface.cpp @@ -96,7 +96,7 @@ CHIP_ERROR InterfaceId::InterfaceNameToId(const char * intfName, InterfaceId & i return INET_ERROR_UNKNOWN_INTERFACE; } struct netif * intf; -#if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 0 && defined(NETIF_FOREACH) +#if defined(NETIF_FOREACH) NETIF_FOREACH(intf) #else for (intf = netif_list; intf != NULL; intf = intf->next) @@ -120,7 +120,7 @@ bool InterfaceIterator::Next() // Verify the previous netif is still on the list if netifs. If so, // advance to the next nextif. struct netif * prevNetif = mCurNetif; -#if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 0 && defined(NETIF_FOREACH) +#if defined(NETIF_FOREACH) NETIF_FOREACH(mCurNetif) #else for (mCurNetif = netif_list; mCurNetif != NULL; mCurNetif = mCurNetif->next) @@ -152,12 +152,7 @@ bool InterfaceIterator::IsUp() bool InterfaceIterator::SupportsMulticast() { - return HasCurrent() && -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 - (mCurNetif->flags & (NETIF_FLAG_IGMP | NETIF_FLAG_MLD6 | NETIF_FLAG_BROADCAST)) != 0; -#else - (mCurNetif->flags & NETIF_FLAG_POINTTOPOINT) == 0; -#endif // LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 + return HasCurrent() && (mCurNetif->flags & (NETIF_FLAG_IGMP | NETIF_FLAG_MLD6 | NETIF_FLAG_BROADCAST)) != 0; } bool InterfaceIterator::HasBroadcastAddress() @@ -219,25 +214,28 @@ bool InterfaceAddressIterator::Next() return false; } -IPAddress InterfaceAddressIterator::GetAddress() +CHIP_ERROR InterfaceAddressIterator::GetAddress(IPAddress & outIPAddress) { - if (HasCurrent()) + if (!HasCurrent()) { - struct netif * curIntf = mIntfIter.GetInterfaceId().GetPlatformInterface(); + return CHIP_ERROR_SENTINEL; + } - if (mCurAddrIndex < LWIP_IPV6_NUM_ADDRESSES) - { - return IPAddress(*netif_ip6_addr(curIntf, mCurAddrIndex)); - } + struct netif * curIntf = mIntfIter.GetInterfaceId().GetPlatformInterface(); + + if (mCurAddrIndex < LWIP_IPV6_NUM_ADDRESSES) + { + outIPAddress = IPAddress(*netif_ip6_addr(curIntf, mCurAddrIndex)); + return CHIP_NO_ERROR; + } #if INET_CONFIG_ENABLE_IPV4 && LWIP_IPV4 - else - { - return IPAddress(*netif_ip4_addr(curIntf)); - } -#endif // INET_CONFIG_ENABLE_IPV4 && LWIP_IPV4 + else + { + outIPAddress = IPAddress(*netif_ip4_addr(curIntf)); + return CHIP_NO_ERROR; } - - return IPAddress::Any; +#endif // INET_CONFIG_ENABLE_IPV4 && LWIP_IPV4 + return CHIP_ERROR_INTERNAL; } uint8_t InterfaceAddressIterator::GetPrefixLength() @@ -699,9 +697,9 @@ bool InterfaceAddressIterator::Next() } } -IPAddress InterfaceAddressIterator::GetAddress() +CHIP_ERROR InterfaceAddressIterator::GetAddress(IPAddress & outIPAddress) { - return HasCurrent() ? IPAddress::FromSockAddr(*mCurAddr->ifa_addr) : IPAddress::Any; + return HasCurrent() ? IPAddress::GetIPAddressFromSockAddr(*mCurAddr->ifa_addr, outIPAddress) : CHIP_ERROR_SENTINEL; } uint8_t InterfaceAddressIterator::GetPrefixLength() @@ -950,9 +948,14 @@ bool InterfaceAddressIterator::Next() return false; } -IPAddress InterfaceAddressIterator::GetAddress() +CHIP_ERROR InterfaceAddressIterator::GetAddress(IPAddress & outIPAddress) { - return HasCurrent() ? IPAddress(mIpv6->unicast[mCurAddrIndex].address.in6_addr) : IPAddress::Any; + if (HasCurrent()) + { + outIPAddress = IPAddress(mIpv6->unicast[mCurAddrIndex].address.in6_addr); + return CHIP_NO_ERROR; + } + return CHIP_ERROR_SENTINEL; } uint8_t InterfaceAddressIterator::GetPrefixLength() @@ -1016,8 +1019,8 @@ InterfaceId InterfaceId::FromIPAddress(const IPAddress & addr) for (; addrIter.HasCurrent(); addrIter.Next()) { - IPAddress curAddr = addrIter.GetAddress(); - if (addr == curAddr) + IPAddress curAddr; + if ((addrIter.GetAddress(curAddr) == CHIP_NO_ERROR) && (addr == curAddr)) { return addrIter.GetInterfaceId(); } @@ -1036,7 +1039,8 @@ bool InterfaceId::MatchLocalIPv6Subnet(const IPAddress & addr) for (; ifAddrIter.HasCurrent(); ifAddrIter.Next()) { IPPrefix addrPrefix; - addrPrefix.IPAddr = ifAddrIter.GetAddress(); + if (ifAddrIter.GetAddress(addrPrefix.IPAddr) != CHIP_NO_ERROR) + continue; #if INET_CONFIG_ENABLE_IPV4 if (addrPrefix.IPAddr.IsIPv4()) continue; @@ -1051,19 +1055,6 @@ bool InterfaceId::MatchLocalIPv6Subnet(const IPAddress & addr) return false; } -void InterfaceAddressIterator::GetAddressWithPrefix(IPPrefix & addrWithPrefix) -{ - if (HasCurrent()) - { - addrWithPrefix.IPAddr = GetAddress(); - addrWithPrefix.Length = GetPrefixLength(); - } - else - { - addrWithPrefix = IPPrefix::Zero; - } -} - uint8_t NetmaskToPrefixLength(const uint8_t * netmask, uint16_t netmaskLen) { uint8_t prefixLen = 0; diff --git a/src/inet/InetInterface.h b/src/inet/InetInterface.h index 34638c3ea50e43..1189b0a9024e45 100644 --- a/src/inet/InetInterface.h +++ b/src/inet/InetInterface.h @@ -418,10 +418,13 @@ class DLL_EXPORT InterfaceAddressIterator * * @brief Get the current interface address. * - * @return the current interface address or \c IPAddress::Any if the iterator - * is positioned beyond the end of the address list. + * @param[out] outIPAddress The current interface address + * + * @return CHIP_NO_ERROR if the result IPAddress is valid. + * @return CHIP_ERROR_SENTINEL if the iterator is positioned beyond the end of the address list. + * @return other error from lower-level code */ - IPAddress GetAddress(); + CHIP_ERROR GetAddress(IPAddress & outIPAddress); /** * @fn uint8_t InterfaceAddressIterator::GetPrefixLength(void) @@ -442,14 +445,6 @@ class DLL_EXPORT InterfaceAddressIterator */ uint8_t GetPrefixLength(); - /** - * @fn void InterfaceAddressIterator::GetAddressWithPrefix(IPPrefix & addrWithPrefix) - * - * @brief Returns an IPPrefix containing the address and prefix length - * for the current address. - */ - void GetAddressWithPrefix(IPPrefix & addrWithPrefix); - /** * @fn InterfaceId InterfaceAddressIterator::GetInterfaceId(void) * diff --git a/src/inet/TCPEndPoint.cpp b/src/inet/TCPEndPoint.cpp index b60a735769b546..de54ece03f2a18 100644 --- a/src/inet/TCPEndPoint.cpp +++ b/src/inet/TCPEndPoint.cpp @@ -467,40 +467,9 @@ void TCPEndPoint::ScheduleNextTCPUserTimeoutPoll(uint32_t aTimeOut) GetSystemLayer().StartTimer(System::Clock::Milliseconds32(aTimeOut), TCPUserTimeoutHandler, this); } -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS -void TCPEndPoint::SetTCPSendIdleAndNotifyChange(bool aIsTCPSendIdle) -{ - if (mIsTCPSendIdle != aIsTCPSendIdle) - { - ChipLogDetail(Inet, "TCP con send channel idle state changed : %s", aIsTCPSendIdle ? "false->true" : "true->false"); - - // Set the current Idle state - mIsTCPSendIdle = aIsTCPSendIdle; - - if (OnTCPSendIdleChanged) - { - OnTCPSendIdleChanged(this, mIsTCPSendIdle); - } - } -} -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - void TCPEndPoint::StartTCPUserTimeoutTimer() { - uint32_t timeOut = mUserTimeoutMillis; - -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - // Set timeout to the poll interval - - timeOut = mTCPSendQueuePollPeriodMillis; - - // Reset the poll count - - mTCPSendQueueRemainingPollCount = MaxTCPSendQueuePolls(); -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - - ScheduleNextTCPUserTimeoutPoll(timeOut); - + ScheduleNextTCPUserTimeoutPoll(mUserTimeoutMillis); mUserTimeoutTimerRunning = true; } diff --git a/src/inet/TCPEndPoint.h b/src/inet/TCPEndPoint.h index 4f1b479a2760c8..7c17055f833f4d 100644 --- a/src/inet/TCPEndPoint.h +++ b/src/inet/TCPEndPoint.h @@ -533,28 +533,6 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis */ OnAcceptErrorFunct OnAcceptError; -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - /** - * @brief Type of TCP SendIdle changed signal handling function. - * - * @param[in] endPoint The TCP endpoint associated with the event. - * - * @param[in] isIdle True if the send channel of the TCP endpoint - * is Idle, otherwise false. - * @details - * Provide a function of this type to the \c OnTCPSendIdleChanged delegate - * member to process the event of the send channel of the TCPEndPoint - * changing state between being idle and not idle. - */ - typedef void (*OnTCPSendIdleChangedFunct)(TCPEndPoint * endPoint, bool isIdle); - - /** The event handling function delegate of the endpoint signaling when the - * idleness of the TCP connection's send channel changes. This is utilized - * by upper layers to take appropriate actions based on whether sent data - * has been reliably delivered to the peer. */ - OnTCPSendIdleChangedFunct OnTCPSendIdleChanged; -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - /** * Size of the largest TCP packet that can be received. */ @@ -571,13 +549,6 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis #if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT , mUserTimeoutMillis(INET_CONFIG_DEFAULT_TCP_USER_TIMEOUT_MSEC), mUserTimeoutTimerRunning(false) -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - , - mIsTCPSendIdle(true), mTCPSendQueuePollPeriodMillis(INET_CONFIG_TCP_SEND_QUEUE_POLL_INTERVAL_MSEC), - mTCPSendQueueRemainingPollCount( - MaxTCPSendQueuePolls(INET_CONFIG_DEFAULT_TCP_USER_TIMEOUT_MSEC, INET_CONFIG_TCP_SEND_QUEUE_POLL_INTERVAL_MSEC)), - OnTCPSendIdleChanged(nullptr) -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS #endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT {} @@ -619,44 +590,17 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis // return an error; zero means use system defaults. #if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT - uint32_t mUserTimeoutMillis; // The configured TCP user timeout value in milliseconds. - // If 0, assume not set. -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - bool mIsTCPSendIdle; // Indicates whether the send channel of the TCPEndPoint is Idle. - - uint16_t mTCPSendQueueRemainingPollCount; // The current remaining number of TCP SendQueue polls before - // the TCP User timeout period is reached. - - uint32_t mTCPSendQueuePollPeriodMillis; // The configured period of active polling of the TCP - // SendQueue. If 0, assume not set. - void SetTCPSendIdleAndNotifyChange(bool aIsSendIdle); - -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - + uint32_t mUserTimeoutMillis; // The configured TCP user timeout value in milliseconds. + // If 0, assume not set. bool mUserTimeoutTimerRunning; // Indicates whether the TCP UserTimeout timer has been started. static void TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState); virtual void TCPUserTimeoutHandler() = 0; void StartTCPUserTimeoutTimer(); - void StopTCPUserTimeoutTimer(); - void RestartTCPUserTimeoutTimer(); - void ScheduleNextTCPUserTimeoutPoll(uint32_t aTimeOut); - -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - static constexpr uint16_t MaxTCPSendQueuePolls(uint16_t userTimeout, uint16_t pollPeriod) - { - // If the UserTimeout is configured less than or equal to the poll interval, - // return 1 to poll at least once instead of returning zero and timing out - // immediately. - return (userTimeout > pollPeriod) ? (userTimeout / pollPeriod) : 1; - } - uint16_t MaxTCPSendQueuePolls(void) { return MaxTCPSendQueuePolls(mUserTimeoutMillis, mTCPSendQueuePollPeriodMillis); } -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - #endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT TCPEndPoint(const TCPEndPoint &) = delete; diff --git a/src/inet/TCPEndPointImplLwIP.cpp b/src/inet/TCPEndPointImplLwIP.cpp index 4be562848e17fb..6fb08a8ffd3d1a 100644 --- a/src/inet/TCPEndPointImplLwIP.cpp +++ b/src/inet/TCPEndPointImplLwIP.cpp @@ -74,8 +74,6 @@ CHIP_ERROR TCPEndPointImplLwIP::BindImpl(IPAddressType addrType, const IPAddress ip_set_option(mTCP, SOF_REUSEADDR); } -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 - ip_addr_t ipAddr; if (addr != IPAddress::Any) { @@ -94,25 +92,6 @@ CHIP_ERROR TCPEndPointImplLwIP::BindImpl(IPAddressType addrType, const IPAddress else res = INET_ERROR_WRONG_ADDRESS_TYPE; res = chip::System::MapErrorLwIP(tcp_bind(mTCP, &ipAddr, port)); - -#else // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 - - if (addrType == IPAddressType::kIPv6) - { - ip6_addr_t ipv6Addr = addr.ToIPv6(); - res = chip::System::MapErrorLwIP(tcp_bind_ip6(mTCP, &ipv6Addr, port)); - } -#if INET_CONFIG_ENABLE_IPV4 - else if (addrType == IPAddressType::kIPv4) - { - ip_addr_t ipv4Addr = addr.ToIPv4(); - res = chip::System::MapErrorLwIP(tcp_bind(mTCP, &ipv4Addr, port)); - } -#endif // INET_CONFIG_ENABLE_IPV4 - else - res = INET_ERROR_WRONG_ADDRESS_TYPE; - -#endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 } // Unlock LwIP stack @@ -168,25 +147,8 @@ CHIP_ERROR TCPEndPointImplLwIP::ConnectImpl(const IPAddress & addr, uint16_t por tcp_arg(mTCP, this); tcp_err(mTCP, LwIPHandleError); -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 ip_addr_t lwipAddr = addr.ToLwIPAddr(); res = chip::System::MapErrorLwIP(tcp_connect(mTCP, &lwipAddr, port, LwIPHandleConnectComplete)); -#else // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 - if (addrType == IPAddressType::kIPv6) - { - ip6_addr_t lwipAddr = addr.ToIPv6(); - res = chip::System::MapErrorLwIP(tcp_connect_ip6(mTCP, &lwipAddr, port, LwIPHandleConnectComplete)); - } -#if INET_CONFIG_ENABLE_IPV4 - else if (addrType == IPAddressType::kIPv4) - { - ip_addr_t lwipAddr = addr.ToIPv4(); - res = chip::System::MapErrorLwIP(tcp_connect(mTCP, &lwipAddr, port, LwIPHandleConnectComplete)); - } -#endif // INET_CONFIG_ENABLE_IPV4 - else - res = INET_ERROR_WRONG_ADDRESS_TYPE; -#endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 // Ensure that TCP timers are started if (res == CHIP_NO_ERROR) @@ -221,17 +183,8 @@ CHIP_ERROR TCPEndPointImplLwIP::GetPeerInfo(IPAddress * retAddr, uint16_t * retP if (mTCP != nullptr) { *retPort = mTCP->remote_port; - -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 *retAddr = IPAddress(mTCP->remote_ip); -#else // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 -#if INET_CONFIG_ENABLE_IPV4 - *retAddr = PCB_ISIPV6(mTCP) ? IPAddress(mTCP->remote_ip.ip6) : IPAddress(mTCP->remote_ip.ip4); -#else // !INET_CONFIG_ENABLE_IPV4 - *retAddr = IPAddress(mTCP->remote_ip.ip6); -#endif // !INET_CONFIG_ENABLE_IPV4 -#endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 - res = CHIP_NO_ERROR; + res = CHIP_NO_ERROR; } // Unlock LwIP stack @@ -251,17 +204,8 @@ CHIP_ERROR TCPEndPointImplLwIP::GetLocalInfo(IPAddress * retAddr, uint16_t * ret if (mTCP != nullptr) { *retPort = mTCP->local_port; - -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 *retAddr = IPAddress(mTCP->local_ip); -#else // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 -#if INET_CONFIG_ENABLE_IPV4 - *retAddr = PCB_ISIPV6(mTCP) ? IPAddress(mTCP->local_ip.ip6) : IPAddress(mTCP->local_ip.ip4); -#else // !INET_CONFIG_ENABLE_IPV4 - *retAddr = IPAddress(mTCP->local_ip.ip6); -#endif // !INET_CONFIG_ENABLE_IPV4 -#endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 - res = CHIP_NO_ERROR; + res = CHIP_NO_ERROR; } // Unlock LwIP stack @@ -656,8 +600,6 @@ TCPEndPointImplLwIP::BufferOffset TCPEndPointImplLwIP::FindStartOfUnsent() CHIP_ERROR TCPEndPointImplLwIP::GetPCB(IPAddressType addrType) { // IMMPORTANT: This method MUST be called with the LwIP stack LOCKED! - -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 if (mTCP == NULL) { switch (addrType) @@ -705,37 +647,6 @@ CHIP_ERROR TCPEndPointImplLwIP::GetPCB(IPAddressType addrType) break; } } -#else // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 - if (mTCP == NULL) - { - if (addrType == IPAddressType::kIPv6) - mTCP = tcp_new_ip6(); -#if INET_CONFIG_ENABLE_IPV4 - else if (addrType == IPAddressType::kIPv4) - mTCP = tcp_new(); -#endif // INET_CONFIG_ENABLE_IPV4 - else - return INET_ERROR_WRONG_ADDRESS_TYPE; - if (mTCP == NULL) - { - return CHIP_ERROR_NO_MEMORY; - } - else - { - mLwIPEndPointType = LwIPEndPointType::TCP; - } - } - else - { -#if INET_CONFIG_ENABLE_IPV4 - const IPAddressType pcbType = PCB_ISIPV6(mTCP) ? IPAddressType::kIPv6 : IPAddressType::kIPv4; -#else // !INET_CONFIG_ENABLE_IPV4 - const IPAddressType pcbType = IPAddressType::kIPv6; -#endif // !INET_CONFIG_ENABLE_IPV4 - if (addrType != pcbType) - return INET_ERROR_WRONG_ADDRESS_TYPE; - } -#endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 return CHIP_NO_ERROR; } @@ -772,14 +683,7 @@ void TCPEndPointImplLwIP::HandleDataSent(uint16_t lenSent) if (RemainingToSend() == 0) { // If the output queue has been flushed then stop the timer. - StopTCPUserTimeoutTimer(); - -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - // Notify up if all outstanding data has been acknowledged - - SetTCPSendIdleAndNotifyChange(true); -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS } else { diff --git a/src/inet/TCPEndPointImplSockets.cpp b/src/inet/TCPEndPointImplSockets.cpp index 1f6bd368b1e948..d5d41fcc98afa1 100644 --- a/src/inet/TCPEndPointImplSockets.cpp +++ b/src/inet/TCPEndPointImplSockets.cpp @@ -80,12 +80,12 @@ CHIP_ERROR TCPEndPointImplSockets::BindImpl(IPAddressType addrType, const IPAddr // Enable SO_REUSEPORT. This permits coexistence between an // untargetted CHIP client and other services that listen on // a CHIP port on a specific address (such as a CHIP client - // with TARGETTED_LISTEN or TCP proxying services). Note that + // with TARGETED_LISTEN or TCP proxying services). Note that // one of the costs of this implementation is the // non-deterministic connection dispatch when multple clients - // listen on the address wih the same degreee of selectivity, + // listen on the address with the same degreee of selectivity, // e.g. two untargetted-listen CHIP clients, or two - // targetted-listen CHIP clients with the same node id. + // targeted-listen CHIP clients with the same node id. if (setsockopt(mSocket, SOL_SOCKET, SO_REUSEPORT, &n, sizeof(n)) != 0) { @@ -556,12 +556,6 @@ CHIP_ERROR TCPEndPointImplSockets::DriveSendingImpl() OnDataSent(this, lenSent); } -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - // TCP Send is not Idle; Set state and notify if needed - - SetTCPSendIdleAndNotifyChange(false); -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - #if INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT mBytesWrittenSinceLastProbe += lenSent; @@ -675,27 +669,12 @@ void TCPEndPointImplSockets::TCPUserTimeoutHandler() // Set the timer running flag to false mUserTimeoutTimerRunning = false; - CHIP_ERROR err = CHIP_NO_ERROR; bool isProgressing = false; - err = CheckConnectionProgress(isProgressing); - SuccessOrExit(err); + CHIP_ERROR err = CheckConnectionProgress(isProgressing); - if (mLastTCPKernelSendQueueLen == 0) - { -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - // If the kernel TCP send queue as well as the TCPEndPoint - // send queue have been flushed then notify application - // that all data has been acknowledged. - - if (mSendQueue.IsNull()) - { - SetTCPSendIdleAndNotifyChange(true); - } -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - } - else - // There is data in the TCP Send Queue + if (err == CHIP_NO_ERROR && mLastTCPKernelSendQueueLen != 0) { + // There is data in the TCP Send Queue if (isProgressing) { // Data is flowing, so restart the UserTimeout timer @@ -706,31 +685,14 @@ void TCPEndPointImplSockets::TCPUserTimeoutHandler() } else { -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - // Data flow is not progressing. - // Decrement the remaining max TCP send queue polls. - - mTCPSendQueueRemainingPollCount--; - - VerifyOrExit(mTCPSendQueueRemainingPollCount != 0, err = INET_ERROR_TCP_USER_TIMEOUT); - - // Restart timer to poll again - - ScheduleNextTCPUserTimeoutPoll(mTCPSendQueuePollPeriodMillis); -#else // Close the connection as the TCP UserTimeout has expired - - ExitNow(err = INET_ERROR_TCP_USER_TIMEOUT); -#endif // !INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS + err = INET_ERROR_TCP_USER_TIMEOUT; } } -exit: - if (err != CHIP_NO_ERROR) { // Close the connection as the TCP UserTimeout has expired - DoClose(err, false); } } @@ -748,10 +710,8 @@ CHIP_ERROR TCPEndPointImplSockets::BindSrcAddrFromIntf(IPAddressType addrType, I bool ipAddrFound = false; for (InterfaceAddressIterator addrIter; addrIter.HasCurrent(); addrIter.Next()) { - const IPAddress curAddr = addrIter.GetAddress(); - const InterfaceId curIntfId = addrIter.GetInterfaceId(); - - if (curIntfId == intfId) + IPAddress curAddr; + if ((addrIter.GetInterfaceId() == intfId) && (addrIter.GetAddress(curAddr) == CHIP_NO_ERROR)) { // Search for an IPv4 address on the TargetInterface @@ -965,15 +925,6 @@ void TCPEndPointImplSockets::ReceiveData() // If the output queue has been flushed then stop the timer. StopTCPUserTimeoutTimer(); - -#if INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS - // Notify up if all outstanding data has been acknowledged - - if (mSendQueue.IsNull()) - { - SetTCPSendIdleAndNotifyChange(true); - } -#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS } else if (isProgressing && mUserTimeoutTimerRunning) { diff --git a/src/inet/UDPEndPointImplLwIP.cpp b/src/inet/UDPEndPointImplLwIP.cpp index 6231f9248c6c34..e5f74911bbd0a1 100644 --- a/src/inet/UDPEndPointImplLwIP.cpp +++ b/src/inet/UDPEndPointImplLwIP.cpp @@ -39,6 +39,8 @@ #include #include +static_assert(LWIP_VERSION_MAJOR > 1, "CHIP requires LwIP 2.0 or later"); + #if !defined(RAW_FLAGS_MULTICAST_LOOP) || !defined(UDP_FLAGS_MULTICAST_LOOP) || !defined(raw_clear_flags) || \ !defined(raw_set_flags) || !defined(udp_clear_flags) || !defined(udp_set_flags) #define HAVE_LWIP_MULTICAST_LOOP 0 @@ -72,7 +74,6 @@ CHIP_ERROR UDPEndPointImplLwIP::BindImpl(IPAddressType addressType, const IPAddr // Bind the PCB to the specified address/port. if (res == CHIP_NO_ERROR) { -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 ip_addr_t ipAddr = address.ToLwIPAddr(); // TODO: IPAddress ANY has only one constant state, however addressType @@ -88,22 +89,6 @@ CHIP_ERROR UDPEndPointImplLwIP::BindImpl(IPAddressType addressType, const IPAddr } res = chip::System::MapErrorLwIP(udp_bind(mUDP, &ipAddr, port)); -#else // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5 - if (addressType == IPAddressType::kIPv6) - { - ip6_addr_t ipv6Addr = address.ToIPv6(); - res = chip::System::MapErrorLwIP(udp_bind_ip6(mUDP, &ipv6Addr, port)); - } -#if INET_CONFIG_ENABLE_IPV4 - else if (addressType == IPAddressType::kIPv4) - { - ip4_addr_t ipv4Addr = address.ToIPv4(); - res = chip::System::MapErrorLwIP(udp_bind(mUDP, &ipv4Addr, port)); - } -#endif // INET_CONFIG_ENABLE_IPV4 - else - res = INET_ERROR_WRONG_ADDRESS_TYPE; -#endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 } if (res == CHIP_NO_ERROR) @@ -172,18 +157,7 @@ CHIP_ERROR UDPEndPointImplLwIP::ListenImpl() // Lock LwIP stack LOCK_TCPIP_CORE(); -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 udp_recv(mUDP, LwIPReceiveUDPMessage, this); -#else // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5 - if (PCB_ISIPV6(mUDP)) - { - udp_recv_ip6(mUDP, LwIPReceiveUDPMessage, this); - } - else - { - udp_recv(mUDP, LwIPReceiveUDPMessage, this); - } -#endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 // Unlock LwIP stack UNLOCK_TCPIP_CORE(); @@ -228,8 +202,6 @@ CHIP_ERROR UDPEndPointImplLwIP::SendMsgImpl(const IPPacketInfo * pktInfo, System const uint16_t & destPort = pktInfo->DestPort; const InterfaceId & intfId = pktInfo->Interface; -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 - ip_addr_t lwipSrcAddr = srcAddr.ToLwIPAddr(); ip_addr_t lwipDestAddr = destAddr.ToLwIPAddr(); @@ -253,60 +225,6 @@ CHIP_ERROR UDPEndPointImplLwIP::SendMsgImpl(const IPPacketInfo * pktInfo, System ip_addr_copy(mUDP->local_ip, boundAddr); -#else // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5 - - ipX_addr_t boundAddr; - ipX_addr_copy(boundAddr, mUDP->local_ip); - - if (PCB_ISIPV6(mUDP)) - { - ip6_addr_t lwipSrcAddr = srcAddr.ToIPv6(); - ip6_addr_t lwipDestAddr = destAddr.ToIPv6(); - - if (!ip6_addr_isany(&lwipSrcAddr)) - { - ipX_addr_copy(mUDP->local_ip, *ip6_2_ipX(&lwipSrcAddr)); - } - - if (intfId.IsPresent()) - { - lwipErr = - udp_sendto_if_ip6(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort, intfId); - } - else - { - lwipErr = udp_sendto_ip6(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort); - } - } - -#if INET_CONFIG_ENABLE_IPV4 - - else - { - ip4_addr_t lwipSrcAddr = srcAddr.ToIPv4(); - ip4_addr_t lwipDestAddr = destAddr.ToIPv4(); - ipX_addr_t boundAddr; - - if (!ip_addr_isany(&lwipSrcAddr)) - { - ipX_addr_copy(mUDP->local_ip, *ip_2_ipX(&lwipSrcAddr)); - } - - if (intfId.IsPresent()) - { - lwipErr = udp_sendto_if(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort, intfId); - } - else - { - lwipErr = udp_sendto(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort); - } - } - - ipX_addr_copy(mUDP->local_ip, boundAddr); - -#endif // INET_CONFIG_ENABLE_IPV4 -#endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 - // Unlock LwIP stack UNLOCK_TCPIP_CORE(); @@ -375,20 +293,12 @@ CHIP_ERROR UDPEndPointImplLwIP::GetPCB(IPAddressType addrType) // Allocate a PCB of the appropriate type. if (addrType == IPAddressType::kIPv6) { -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 mUDP = udp_new_ip_type(IPADDR_TYPE_V6); -#else // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5 - mUDP = udp_new_ip6(); -#endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 } #if INET_CONFIG_ENABLE_IPV4 else if (addrType == IPAddressType::kIPv4) { -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 mUDP = udp_new_ip_type(IPADDR_TYPE_V4); -#else // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5 - mUDP = udp_new(); -#endif // LWIP_VERSION_MAJOR <= 1 || LWIP_VERSION_MINOR >= 5 } #endif // INET_CONFIG_ENABLE_IPV4 else @@ -413,7 +323,6 @@ CHIP_ERROR UDPEndPointImplLwIP::GetPCB(IPAddressType addrType) IPAddressType pcbAddrType; // Get the address type of the existing PCB. -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 switch (static_cast(IP_GET_TYPE(&mUDP->local_ip))) { case IPADDR_TYPE_V6: @@ -427,13 +336,6 @@ CHIP_ERROR UDPEndPointImplLwIP::GetPCB(IPAddressType addrType) default: return INET_ERROR_WRONG_ADDRESS_TYPE; } -#else // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5 -#if INET_CONFIG_ENABLE_IPV4 - pcbAddrType = PCB_ISIPV6(mUDP) ? IPAddressType::kIPv6 : IPAddressType::kIPv4; -#else // !INET_CONFIG_ENABLE_IPV4 - pcbAddrType = IPAddressType::kIPv6; -#endif // !INET_CONFIG_ENABLE_IPV4 -#endif // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5 // Fail if the existing PCB is not the correct type. VerifyOrReturnError(addrType == pcbAddrType, INET_ERROR_WRONG_ADDRESS_TYPE); @@ -442,12 +344,8 @@ CHIP_ERROR UDPEndPointImplLwIP::GetPCB(IPAddressType addrType) return CHIP_NO_ERROR; } -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 void UDPEndPointImplLwIP::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct pbuf * p, const ip_addr_t * addr, u16_t port) -#else // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5 -void UDPEndPointImplLwIP::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct pbuf * p, ip_addr_t * addr, u16_t port) -#endif // LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 { UDPEndPointImplLwIP * ep = static_cast(arg); IPPacketInfo * pktInfo = nullptr; @@ -474,27 +372,11 @@ void UDPEndPointImplLwIP::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb pktInfo = GetPacketInfo(buf); if (pktInfo != nullptr) { -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 pktInfo->SrcAddress = IPAddress(*addr); pktInfo->DestAddress = IPAddress(*ip_current_dest_addr()); -#else // LWIP_VERSION_MAJOR <= 1 - if (PCB_ISIPV6(pcb)) - { - pktInfo->SrcAddress = IPAddress(*(ip6_addr_t *) addr); - pktInfo->DestAddress = IPAddress(*ip6_current_dest_addr()); - } -#if INET_CONFIG_ENABLE_IPV4 - else - { - pktInfo->SrcAddress = IPAddress(*addr); - pktInfo->DestAddress = IPAddress(*ip_current_dest_addr()); - } -#endif // INET_CONFIG_ENABLE_IPV4 -#endif // LWIP_VERSION_MAJOR <= 1 - - pktInfo->Interface = InterfaceId(ip_current_netif()); - pktInfo->SrcPort = port; - pktInfo->DestPort = pcb->local_port; + pktInfo->Interface = InterfaceId(ip_current_netif()); + pktInfo->SrcPort = port; + pktInfo->DestPort = pcb->local_port; } ep->Retain(); @@ -579,7 +461,7 @@ struct netif * UDPEndPointImplLwIP::FindNetifFromInterfaceId(InterfaceId aInterf { struct netif * lRetval = nullptr; -#if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 0 && defined(NETIF_FOREACH) +#if defined(NETIF_FOREACH) NETIF_FOREACH(lRetval) { if (lRetval == aInterfaceId.GetPlatformInterface()) @@ -587,10 +469,10 @@ struct netif * UDPEndPointImplLwIP::FindNetifFromInterfaceId(InterfaceId aInterf break; } } -#else // LWIP_VERSION_MAJOR < 2 || !defined(NETIF_FOREACH) +#else // defined(NETIF_FOREACH) for (lRetval = netif_list; lRetval != nullptr && lRetval != aInterfaceId.GetPlatformInterface(); lRetval = lRetval->next) ; -#endif // LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 0 && defined(NETIF_FOREACH) +#endif // defined(NETIF_FOREACH) return (lRetval); } diff --git a/src/inet/UDPEndPointImplLwIP.h b/src/inet/UDPEndPointImplLwIP.h index 473c5fa2180ab2..accb18bfcb7dbc 100644 --- a/src/inet/UDPEndPointImplLwIP.h +++ b/src/inet/UDPEndPointImplLwIP.h @@ -79,11 +79,7 @@ class UDPEndPointImplLwIP : public UDPEndPoint, public EndPointStateLwIP static IPPacketInfo * GetPacketInfo(const chip::System::PacketBufferHandle & aBuffer); CHIP_ERROR GetPCB(IPAddressType addrType4); -#if LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 static void LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct pbuf * p, const ip_addr_t * addr, u16_t port); -#else // LWIP_VERSION_MAJOR <= 1 && LWIP_VERSION_MINOR < 5 - static void LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct pbuf * p, ip_addr_t * addr, u16_t port); -#endif // LWIP_VERSION_MAJOR > 1 || LWIP_VERSION_MINOR >= 5 udp_pcb * mUDP; // LwIP User datagram protocol (UDP) control block. }; diff --git a/src/inet/UDPEndPointImplSockets.cpp b/src/inet/UDPEndPointImplSockets.cpp index 23428fa49c4a63..93b0828f5a1e21 100644 --- a/src/inet/UDPEndPointImplSockets.cpp +++ b/src/inet/UDPEndPointImplSockets.cpp @@ -758,9 +758,8 @@ CHIP_ERROR UDPEndPointImplSockets::IPv4JoinLeaveMulticastGroupImpl(InterfaceId a for (InterfaceAddressIterator lAddressIterator; lAddressIterator.HasCurrent(); lAddressIterator.Next()) { - const IPAddress lCurrentAddress = lAddressIterator.GetAddress(); - - if (lAddressIterator.GetInterfaceId() == aInterfaceId) + IPAddress lCurrentAddress; + if ((lAddressIterator.GetInterfaceId() == aInterfaceId) && (lAddressIterator.GetAddress(lCurrentAddress) == CHIP_NO_ERROR)) { if (lCurrentAddress.IsIPv4()) { diff --git a/src/inet/arpa-inet-compatibility.h b/src/inet/arpa-inet-compatibility.h index bd7cb1e7b4fb78..b5da1843f1b00c 100644 --- a/src/inet/arpa-inet-compatibility.h +++ b/src/inet/arpa-inet-compatibility.h @@ -25,18 +25,17 @@ #else // !CHIP_SYSTEM_CONFIG_USE_SOCKETS -// NOTE WELL: when LWIP_VERSION_MAJOR == 1, LWIP_PREFIX_BYTEORDER_FUNCS instead of LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS #if CHIP_SYSTEM_CONFIG_USE_LWIP #include #include -#if (defined(LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS) || defined(LWIP_PREFIX_BYTEORDER_FUNCS)) +#if defined(LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS) #define htons(x) lwip_htons(x) #define ntohs(x) lwip_ntohs(x) #define htonl(x) lwip_htonl(x) #define ntohl(x) lwip_ntohl(x) -#endif // (defined(LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS) || defined(LWIP_PREFIX_BYTEORDER_FUNCS)) +#endif // defined(LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS) #endif // CHIP_SYSTEM_CONFIG_USE_LWIP #endif // !CHIP_SYSTEM_CONFIG_USE_SOCKETS diff --git a/src/inet/tests/TestInetCommonPosix.cpp b/src/inet/tests/TestInetCommonPosix.cpp index 5da8e44d7253ee..86120482e8e55d 100644 --- a/src/inet/tests/TestInetCommonPosix.cpp +++ b/src/inet/tests/TestInetCommonPosix.cpp @@ -55,9 +55,9 @@ #if CHIP_SYSTEM_CONFIG_USE_LWIP #include -#if !(LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1) +#if (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) #include -#endif // !(LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1) +#endif // (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) #include #include #include @@ -97,7 +97,7 @@ static void AcquireLwIP(void) static void ReleaseLwIP(void) { -#if !(LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1) +#if (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) if (sLwIPAcquireCount > 0 && --sLwIPAcquireCount == 0) { #if defined(INCLUDE_vTaskDelete) && INCLUDE_vTaskDelete @@ -107,7 +107,7 @@ static void ReleaseLwIP(void) tcpip_finish(NULL, NULL); #endif // defined(INCLUDE_vTaskDelete) && INCLUDE_vTaskDelete } -#endif +#endif // (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) } #if CHIP_TARGET_STYLE_UNIX @@ -325,11 +325,7 @@ void InitNetwork() IPAddress ip4Gateway = (j < gNetworkOptions.IPv4GatewayAddr.size()) ? gNetworkOptions.IPv4GatewayAddr[j] : IPAddress::Any; { -#if LWIP_VERSION_MAJOR > 1 ip4_addr_t ip4AddrLwIP, ip4NetmaskLwIP, ip4GatewayLwIP; -#else // LWIP_VERSION_MAJOR <= 1 - ip_addr_t ip4AddrLwIP, ip4NetmaskLwIP, ip4GatewayLwIP; -#endif // LWIP_VERSION_MAJOR <= 1 ip4AddrLwIP = ip4Addr.ToIPv4(); IP4_ADDR(&ip4NetmaskLwIP, 255, 255, 255, 0); @@ -343,7 +339,7 @@ void InitNetwork() netif_create_ip6_linklocal_address(&(sNetIFs[j]), 1); -#if !(LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1) +#if (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) if (j < gNetworkOptions.LocalIPv6Addr.size()) { ip6_addr_t ip6addr = gNetworkOptions.LocalIPv6Addr[j].ToIPv6(); @@ -381,7 +377,7 @@ void InitNetwork() } } } -#endif +#endif // (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) netif_set_up(&(sNetIFs[j])); netif_set_link_up(&(sNetIFs[j])); diff --git a/src/inet/tests/TestInetEndPoint.cpp b/src/inet/tests/TestInetEndPoint.cpp index 34fc95267f2666..1e4ef41b8997d3 100644 --- a/src/inet/tests/TestInetEndPoint.cpp +++ b/src/inet/tests/TestInetEndPoint.cpp @@ -130,7 +130,6 @@ static void TestInetInterface(nlTestSuite * inSuite, void * inContext) char intName[chip::Inet::InterfaceId::kMaxIfNameLength]; InterfaceId intId; IPAddress addr; - IPPrefix addrWithPrefix; InterfaceType intType; // 64 bit IEEE MAC address const uint8_t kMaxHardwareAddressSize = 8; @@ -209,8 +208,9 @@ static void TestInetInterface(nlTestSuite * inSuite, void * inContext) printf(" Addresses:\n"); for (; addrIterator.HasCurrent(); addrIterator.Next()) { - addr = addrIterator.GetAddress(); - addrIterator.GetAddressWithPrefix(addrWithPrefix); + err = addrIterator.GetAddress(addr); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + IPPrefix addrWithPrefix(addr, addrIterator.GetPrefixLength()); char addrStr[80]; addrWithPrefix.IPAddr.ToString(addrStr); intId = addrIterator.GetInterfaceId(); @@ -231,8 +231,7 @@ static void TestInetInterface(nlTestSuite * inSuite, void * inContext) addrIterator.HasBroadcastAddress() ? "has" : "no"); } NL_TEST_ASSERT(inSuite, !addrIterator.Next()); - addrIterator.GetAddressWithPrefix(addrWithPrefix); - NL_TEST_ASSERT(inSuite, addrWithPrefix.IsZero()); + NL_TEST_ASSERT(inSuite, addrIterator.GetAddress(addr) == CHIP_ERROR_SENTINEL); NL_TEST_ASSERT(inSuite, addrIterator.GetInterfaceId() == InterfaceId::Null()); NL_TEST_ASSERT(inSuite, addrIterator.GetInterfaceName(intName, sizeof(intName)) == CHIP_ERROR_INCORRECT_STATE); NL_TEST_ASSERT(inSuite, !addrIterator.SupportsMulticast()); diff --git a/src/inet/tests/qemu_inet_tests.sh b/src/inet/tests/qemu_inet_tests.sh deleted file mode 120000 index 8fbe617c97a267..00000000000000 --- a/src/inet/tests/qemu_inet_tests.sh +++ /dev/null @@ -1 +0,0 @@ -../../../scripts/tools/qemu_run_test.sh \ No newline at end of file diff --git a/src/lib/asn1/tests/TestASN1.cpp b/src/lib/asn1/tests/TestASN1.cpp index 0a01088281352a..4f2b540aa44d76 100644 --- a/src/lib/asn1/tests/TestASN1.cpp +++ b/src/lib/asn1/tests/TestASN1.cpp @@ -384,7 +384,7 @@ static void TestASN1_FromTLVReader(nlTestSuite * inSuite, void * inContext) { tlvWriter.Init(tlvEncodedData); - err = tlvWriter.StartContainer(AnonymousTag, kTLVType_Structure, outerContainerType); + err = tlvWriter.StartContainer(AnonymousTag(), kTLVType_Structure, outerContainerType); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = tlvWriter.PutBytes(TLV::ContextTag(1), kTestVal_20_OctetString, sizeof(kTestVal_20_OctetString)); @@ -424,7 +424,7 @@ static void TestASN1_FromTLVReader(nlTestSuite * inSuite, void * inContext) writer.Init(asn1EncodedData2); ASN1_START_SEQUENCE { - err = tlvReader.Next(kTLVType_Structure, AnonymousTag); + err = tlvReader.Next(kTLVType_Structure, AnonymousTag()); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = tlvReader.EnterContainer(outerContainerType); diff --git a/src/lib/core/CHIPCallback.h b/src/lib/core/CHIPCallback.h index 69d26481ca2f55..dd010eaa04abc3 100644 --- a/src/lib/core/CHIPCallback.h +++ b/src/lib/core/CHIPCallback.h @@ -118,7 +118,7 @@ class Callback : private Cancelable void * mContext; /** - * where to call when the event of interest has occured + * where to call when the event of interest has occurred */ T mCall; diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index 2b55c9b3a48641..40d7f48fae977e 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1330,7 +1330,7 @@ * 1 -- Message Type * 2 -- Exchange Id * 4 -- Profile Id - * 4 -- Acknowleged Message Id + * 4 -- Acknowledged Message Id * * @note A number of these fields are optional or not presently used. * So most headers will be considerably smaller than this. @@ -2515,15 +2515,6 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; #define CONFIG_IM_BUILD_FOR_UNIT_TEST 0 #endif -/** - * @def CHIP_DEVICE_CONTROLLER_SUBSCRIPTION_ATTRIBUTE_PATH_POOL_SIZE - * - * @brief Defines the object pool for allocating attribute path for subscription in device controller. - */ -#ifndef CHIP_DEVICE_CONTROLLER_SUBSCRIPTION_ATTRIBUTE_PATH_POOL_SIZE -#define CHIP_DEVICE_CONTROLLER_SUBSCRIPTION_ATTRIBUTE_PATH_POOL_SIZE CHIP_IM_MAX_NUM_READ_CLIENT -#endif - /** * @def CHIP_CONFIG_LAMBDA_EVENT_SIZE * @@ -2731,22 +2722,13 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; "Please enable at least one of CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_FAST_COPY_SUPPORT or CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_FLEXIBLE_COPY_SUPPORT" #endif -/** - * @def CHIP_CONFIG_MAX_SESSION_CREATION_DELEGATES - * - * @brief Defines the max number of SessionCreationDelegates - */ -#ifndef CHIP_CONFIG_MAX_SESSION_CREATION_DELEGATES -#define CHIP_CONFIG_MAX_SESSION_CREATION_DELEGATES 2 -#endif - /** * @def CHIP_CONFIG_MAX_SESSION_RELEASE_DELEGATES * * @brief Defines the max number of SessionReleaseDelegate */ #ifndef CHIP_CONFIG_MAX_SESSION_RELEASE_DELEGATES -#define CHIP_CONFIG_MAX_SESSION_RELEASE_DELEGATES 2 +#define CHIP_CONFIG_MAX_SESSION_RELEASE_DELEGATES 4 #endif /** @@ -2755,7 +2737,7 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; * @brief Defines the max number of SessionRecoveryDelegate */ #ifndef CHIP_CONFIG_MAX_SESSION_RECOVERY_DELEGATES -#define CHIP_CONFIG_MAX_SESSION_RECOVERY_DELEGATES 3 +#define CHIP_CONFIG_MAX_SESSION_RECOVERY_DELEGATES 4 #endif /** @@ -2768,6 +2750,26 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; #define CHIP_CONFIG_CASE_SESSION_RESUME_CACHE_SIZE 4 #endif +/** + * @def CHIP_CONFIG_EVENT_LOGGING_BYTE_THRESHOLD + * + * @brief The number of bytes written to the event logging system that + * will trigger Report Delivery. + * + * The configuration captures the number of bytes written to the event + * logging subsystem needed to trigger a report. For example, if an application wants to offload all DEBUG events + * reliably, the threshold should be set to less than the size of the + * DEBUG buffer (plus a slop factor to account for events generated + * during the scheduling and event offload). Similarly, if the + * application does not want to drop INFO events, the threshold should + * be set to the sum of DEBUG and INFO buffers (with the same + * correction). + * + */ +#ifndef CHIP_CONFIG_EVENT_LOGGING_BYTE_THRESHOLD +#define CHIP_CONFIG_EVENT_LOGGING_BYTE_THRESHOLD 512 +#endif /* CHIP_CONFIG_EVENT_LOGGING_BYTE_THRESHOLD */ + /** * @def CHIP_CONFIG_ENABLE_SERVER_IM_EVENT * diff --git a/src/lib/core/CHIPEncoding.h b/src/lib/core/CHIPEncoding.h index dd4f67de797f00..6419e7e78891c9 100644 --- a/src/lib/core/CHIPEncoding.h +++ b/src/lib/core/CHIPEncoding.h @@ -192,7 +192,7 @@ inline void Write8(uint8_t *& p, uint8_t v) * * * On little endian host systems no actual byte reordering will - * occur. On other systems, byte reordering is peformed as + * occur. On other systems, byte reordering is performed as * appropriate. * */ @@ -562,7 +562,7 @@ inline void Write64(uint8_t *& p, uint64_t v) * * * On big endian host systems no actual byte reordering will - * occur. On other systems, byte reordering is peformed as + * occur. On other systems, byte reordering is performed as * appropriate. * */ diff --git a/src/lib/core/CHIPError.cpp b/src/lib/core/CHIPError.cpp index cfe76b2492d568..285cdb379aa70e 100644 --- a/src/lib/core/CHIPError.cpp +++ b/src/lib/core/CHIPError.cpp @@ -593,8 +593,8 @@ bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) case CHIP_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION.AsInteger(): desc = "Unsupported wireless operating location"; break; - case CHIP_ERROR_MDNS_COLLISSION.AsInteger(): - desc = "mDNS collission"; + case CHIP_ERROR_MDNS_COLLISION.AsInteger(): + desc = "mDNS collision"; break; case CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH.AsInteger(): desc = "Malformed Interacton Model Attribute Path"; diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index 99f50100f5a243..f1039996298ca8 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -1512,7 +1512,7 @@ using CHIP_ERROR = ::chip::ChipError; * @def CHIP_ERROR_INVALID_TAKE_PARAMETER * * @brief - * Received an invalid TAKE paramter. + * Received an invalid TAKE parameter. * */ #define CHIP_ERROR_INVALID_TAKE_PARAMETER CHIP_CORE_ERROR(0x7c) @@ -2011,13 +2011,13 @@ using CHIP_ERROR = ::chip::ChipError; #define CHIP_ERROR_UNSUPPORTED_WIRELESS_OPERATING_LOCATION CHIP_CORE_ERROR(0xb3) /** - * @def CHIP_ERROR_MDNS_COLLISSION + * @def CHIP_ERROR_MDNS_COLLISION * * @brief * The registered service name has collision on the LAN. * */ -#define CHIP_ERROR_MDNS_COLLISSION CHIP_CORE_ERROR(0xb4) +#define CHIP_ERROR_MDNS_COLLISION CHIP_CORE_ERROR(0xb4) /** * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH diff --git a/src/lib/core/CHIPTLV.h b/src/lib/core/CHIPTLV.h index f9907d39461199..141049372b0e5f 100644 --- a/src/lib/core/CHIPTLV.h +++ b/src/lib/core/CHIPTLV.h @@ -1159,7 +1159,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV signed integer value. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1187,7 +1187,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV signed integer value. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1249,7 +1249,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV unsigned integer value. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1277,7 +1277,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV unsigned integer value. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1339,7 +1339,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV floating point value. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1372,7 +1372,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV byte string value using ByteSpan class. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1419,7 +1419,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV boolean value. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1450,7 +1450,7 @@ class DLL_EXPORT TLVWriter CHIP_ERROR Put(Tag tag, bool v) { /* - * In TLV, boolean values are encoded as standalone tags without actual values, so we have a seperate + * In TLV, boolean values are encoded as standalone tags without actual values, so we have a separate * PutBoolean method. */ return PutBoolean(tag, v); @@ -1459,7 +1459,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV byte string value. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1488,7 +1488,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV UTF8 string value. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1516,7 +1516,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV UTF8 string value. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1545,7 +1545,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV UTF8 string value that's passed in as a Span. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1596,7 +1596,7 @@ class DLL_EXPORT TLVWriter * temporary buffer to hold the output, using Platform::MemoryAlloc(). * * @param[in] tag The TLV tag to be encoded with the value, or @p - * AnonymousTag if the value should be encoded without + * AnonymousTag() if the value should be encoded without * a tag. Tag values should be constructed with one of * the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1642,7 +1642,7 @@ class DLL_EXPORT TLVWriter * temporary buffer to hold the output, using Platform::MemoryAlloc(). * * @param[in] tag The TLV tag to be encoded with the value, or @p - * AnonymousTag if the value should be encoded without + * AnonymousTag() if the value should be encoded without * a tag. Tag values should be constructed with one of * the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1665,7 +1665,7 @@ class DLL_EXPORT TLVWriter /** * Encodes a TLV null value. * - * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag if the + * @param[in] tag The TLV tag to be encoded with the value, or @p AnonymousTag() if the * value should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1747,7 +1747,7 @@ class DLL_EXPORT TLVWriter * input buffer that contains the entirety of the underlying TLV encoding. Supplying a reader in any * other mode has undefined behavior. * - * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag if + * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag() if * the container should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1795,7 +1795,7 @@ class DLL_EXPORT TLVWriter * write the elements of the container. When finish, the application must call the EndContainer() * method to finish the encoding of the container. * - * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag if + * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag() if * the container should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1883,7 +1883,7 @@ class DLL_EXPORT TLVWriter * @note The StartContainer() method can be used as an alternative to OpenContainer() to write a * container element without initializing a new writer object. * - * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag if + * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag() if * the container should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -1959,7 +1959,7 @@ class DLL_EXPORT TLVWriter * The method encodes the entirety of the container element in one call. When PutPreEncodedContainer() * returns, the writer object can be used to write additional TLV elements following the container element. * - * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag if + * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag() if * the container should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -2050,7 +2050,7 @@ class DLL_EXPORT TLVWriter * @note This method requires the supplied TVLReader object to be reading from a single, contiguous * input buffer that contains the entirety of the underlying TLV encoding. * - * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag if + * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag() if * the container should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). @@ -2099,7 +2099,7 @@ class DLL_EXPORT TLVWriter * When the method returns, the writer object can be used to write additional TLV elements following * the container element. * - * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag if + * @param[in] tag The TLV tag to be encoded with the container, or @p AnonymousTag() if * the container should be encoded without a tag. Tag values should be * constructed with one of the tag definition functions ProfileTag(), * ContextTag() or CommonTag(). diff --git a/src/lib/core/CHIPTLVReader.cpp b/src/lib/core/CHIPTLVReader.cpp index 31f67bf7d494e9..4af5d8d9b3d84b 100644 --- a/src/lib/core/CHIPTLVReader.cpp +++ b/src/lib/core/CHIPTLVReader.cpp @@ -576,7 +576,7 @@ CHIP_ERROR TLVReader::Skip() */ void TLVReader::ClearElementState() { - mElemTag = AnonymousTag; + mElemTag = AnonymousTag(); mControlByte = kTLVControlByte_NotSpecified; mElemLenOrVal = 0; } @@ -737,7 +737,7 @@ CHIP_ERROR TLVReader::VerifyElement() { if (mContainerType == kTLVType_NotSpecified) return CHIP_ERROR_INVALID_TLV_ELEMENT; - if (mElemTag != AnonymousTag) + if (mElemTag != AnonymousTag()) return CHIP_ERROR_INVALID_TLV_TAG; } else @@ -751,11 +751,11 @@ CHIP_ERROR TLVReader::VerifyElement() return CHIP_ERROR_INVALID_TLV_TAG; break; case kTLVType_Structure: - if (mElemTag == AnonymousTag) + if (mElemTag == AnonymousTag()) return CHIP_ERROR_INVALID_TLV_TAG; break; case kTLVType_Array: - if (mElemTag != AnonymousTag) + if (mElemTag != AnonymousTag()) return CHIP_ERROR_INVALID_TLV_TAG; break; case kTLVType_UnknownContainer: @@ -815,7 +815,7 @@ Tag TLVReader::ReadTag(TLVTagControl tagControl, const uint8_t *& p) return ProfileTag(vendorId, profileNum, LittleEndian::Read32(p)); case TLVTagControl::Anonymous: default: - return AnonymousTag; + return AnonymousTag(); } } diff --git a/src/lib/core/CHIPTLVTags.h b/src/lib/core/CHIPTLVTags.h index 1923dd526096b9..12de1d9e3ef2e1 100644 --- a/src/lib/core/CHIPTLVTags.h +++ b/src/lib/core/CHIPTLVTags.h @@ -29,7 +29,14 @@ namespace chip { namespace TLV { -typedef uint64_t Tag; +struct Tag +{ + explicit constexpr Tag(uint64_t val) : mVal(val) {} + Tag() {} + constexpr bool operator==(const Tag & other) const { return mVal == other.mVal; } + constexpr bool operator!=(const Tag & other) const { return mVal != other.mVal; } + uint64_t mVal; +}; enum TLVCommonProfiles { @@ -94,7 +101,7 @@ enum */ inline constexpr Tag ProfileTag(uint32_t profileId, uint32_t tagNum) { - return ((static_cast(profileId)) << kProfileIdShift) | tagNum; + return Tag(((static_cast(profileId)) << kProfileIdShift) | tagNum); } /** @@ -105,10 +112,10 @@ inline constexpr Tag ProfileTag(uint32_t profileId, uint32_t tagNum) * @param[in] tagNum The profile-specific tag number assigned to the tag. * @return A 64-bit integer representing the tag. */ -inline Tag ProfileTag(uint16_t vendorId, uint16_t profileNum, uint32_t tagNum) +inline constexpr Tag ProfileTag(uint16_t vendorId, uint16_t profileNum, uint32_t tagNum) { - return ((static_cast(vendorId)) << kVendorIdShift) | ((static_cast(profileNum)) << kProfileNumShift) | - tagNum; + return Tag(((static_cast(vendorId)) << kVendorIdShift) | ((static_cast(profileNum)) << kProfileNumShift) | + tagNum); } /** @@ -119,7 +126,7 @@ inline Tag ProfileTag(uint16_t vendorId, uint16_t profileNum, uint32_t tagNum) */ inline constexpr Tag ContextTag(uint8_t tagNum) { - return kSpecialTagMarker | tagNum; + return Tag(kSpecialTagMarker | tagNum); } /** @@ -128,21 +135,20 @@ inline constexpr Tag ContextTag(uint8_t tagNum) * @param[in] tagNum The common profile tag number assigned to the tag. * @return A 64-bit integer representing the tag. */ -inline Tag CommonTag(uint32_t tagNum) +inline constexpr Tag CommonTag(uint32_t tagNum) { return ProfileTag(kCommonProfileId, tagNum); } -enum +/** + * A value signifying a TLV element that has no tag (i.e. an anonymous element). + */ +inline constexpr Tag AnonymousTag() { - /** - * A value signifying a TLV element that has no tag (i.e. an anonymous element). - */ - AnonymousTag = kSpecialTagMarker | 0x00000000FFFFFFFFULL, - - // TODO: Move to private namespace - UnknownImplicitTag = kSpecialTagMarker | 0x00000000FFFFFFFEULL -}; + return Tag(kSpecialTagMarker | 0x00000000FFFFFFFFULL); +} +// TODO: Move to private namespace +static constexpr Tag UnknownImplicitTag(kSpecialTagMarker | 0x00000000FFFFFFFEULL); /** * Returns the profile id from a TLV tag @@ -152,9 +158,9 @@ enum * @param[in] tag The API representation of a profile-specific TLV tag. * @return The profile id. */ -inline uint32_t ProfileIdFromTag(Tag tag) +inline constexpr uint32_t ProfileIdFromTag(Tag tag) { - return static_cast((tag & kProfileIdMask) >> kProfileIdShift); + return static_cast((tag.mVal & kProfileIdMask) >> kProfileIdShift); } /** @@ -165,9 +171,9 @@ inline uint32_t ProfileIdFromTag(Tag tag) * @param[in] tag The API representation of a profile-specific TLV tag. * @return The associated profile number. */ -inline uint16_t ProfileNumFromTag(Tag tag) +inline constexpr uint16_t ProfileNumFromTag(Tag tag) { - return static_cast((tag & kProfileNumMask) >> kProfileNumShift); + return static_cast((tag.mVal & kProfileNumMask) >> kProfileNumShift); } /** @@ -181,9 +187,9 @@ inline uint16_t ProfileNumFromTag(Tag tag) * @param[in] tag The API representation of a profile-specific or context-specific TLV tag. * @return The associated tag number. */ -inline uint32_t TagNumFromTag(Tag tag) +inline constexpr uint32_t TagNumFromTag(Tag tag) { - return static_cast(tag & kTagNumMask); + return static_cast(tag.mVal & kTagNumMask); } /** @@ -194,34 +200,32 @@ inline uint32_t TagNumFromTag(Tag tag) * @param[in] tag The API representation of a profile-specific TLV tag. * @return The associated vendor id. */ -inline uint16_t VendorIdFromTag(Tag tag) +inline constexpr uint16_t VendorIdFromTag(Tag tag) { - return static_cast((tag & kVendorIdMask) >> kVendorIdShift); + return static_cast((tag.mVal & kVendorIdMask) >> kVendorIdShift); } /** * Returns true of the supplied tag is a profile-specific tag. */ -inline bool IsProfileTag(Tag tag) +inline constexpr bool IsProfileTag(Tag tag) { - return (tag & kProfileIdMask) != kSpecialTagMarker; + return (tag.mVal & kProfileIdMask) != kSpecialTagMarker; } /** * Returns true if the supplied tag is a context-specific tag. */ -inline bool IsContextTag(Tag tag) +inline constexpr bool IsContextTag(Tag tag) { - return (tag & kProfileIdMask) == kSpecialTagMarker && TagNumFromTag(tag) <= kContextTagMaxNum; + return (tag.mVal & kProfileIdMask) == kSpecialTagMarker && TagNumFromTag(tag) <= kContextTagMaxNum; } // TODO: move to private namespace -inline bool IsSpecialTag(Tag tag) +inline constexpr bool IsSpecialTag(Tag tag) { - return (tag & kProfileIdMask) == kSpecialTagMarker; + return (tag.mVal & kProfileIdMask) == kSpecialTagMarker; } -constexpr uint8_t kMaxTLVTagLength = 8; - } // namespace TLV } // namespace chip diff --git a/src/lib/core/CHIPTLVUpdater.cpp b/src/lib/core/CHIPTLVUpdater.cpp index 824d78c5ed9573..c9d489072cb5d5 100644 --- a/src/lib/core/CHIPTLVUpdater.cpp +++ b/src/lib/core/CHIPTLVUpdater.cpp @@ -90,7 +90,7 @@ CHIP_ERROR TLVUpdater::Init(TLVReader & aReader, uint32_t freeLen) mUpdaterReader.mLenRead = readDataLen; mUpdaterReader.mMaxLen = aReader.mMaxLen; mUpdaterReader.mControlByte = kTLVControlByte_NotSpecified; - mUpdaterReader.mElemTag = AnonymousTag; + mUpdaterReader.mElemTag = AnonymousTag(); mUpdaterReader.mElemLenOrVal = 0; mUpdaterReader.mContainerType = aReader.mContainerType; mUpdaterReader.SetContainerOpen(false); @@ -189,7 +189,7 @@ void TLVUpdater::MoveUntilEnd() mUpdaterReader.mReadPoint += copyLen; mUpdaterReader.mLenRead += copyLen; mUpdaterReader.mControlByte = kTLVControlByte_NotSpecified; - mUpdaterReader.mElemTag = AnonymousTag; + mUpdaterReader.mElemTag = AnonymousTag(); mUpdaterReader.mElemLenOrVal = 0; mUpdaterReader.mContainerType = kTLVType_NotSpecified; mUpdaterReader.SetContainerOpen(false); diff --git a/src/lib/core/CHIPTLVWriter.cpp b/src/lib/core/CHIPTLVWriter.cpp index 919f4a5199d5f2..8e479170dafdb1 100644 --- a/src/lib/core/CHIPTLVWriter.cpp +++ b/src/lib/core/CHIPTLVWriter.cpp @@ -512,7 +512,7 @@ CHIP_ERROR TLVWriter::CloseContainer(TLVWriter & containerWriter) // Reset the container writer so that it can't accidentally be used again. containerWriter.Init(static_cast(nullptr), 0); - return WriteElementHead(TLVElementType::EndOfContainer, AnonymousTag, 0); + return WriteElementHead(TLVElementType::EndOfContainer, AnonymousTag(), 0); } CHIP_ERROR TLVWriter::StartContainer(Tag tag, TLVType containerType, TLVType & outerContainerType) @@ -554,7 +554,7 @@ CHIP_ERROR TLVWriter::EndContainer(TLVType outerContainerType) if (IsCloseContainerReserved()) mMaxLen += kEndOfContainerMarkerSize; - return WriteElementHead(TLVElementType::EndOfContainer, AnonymousTag, 0); + return WriteElementHead(TLVElementType::EndOfContainer, AnonymousTag(), 0); } CHIP_ERROR TLVWriter::PutPreEncodedContainer(Tag tag, TLVType containerType, const uint8_t * data, uint32_t dataLen) diff --git a/src/lib/core/NodeId.h b/src/lib/core/NodeId.h index e2ce4eb6db21d1..e6d064e17cede4 100644 --- a/src/lib/core/NodeId.h +++ b/src/lib/core/NodeId.h @@ -17,6 +17,8 @@ #pragma once +#include + #include namespace chip { @@ -71,4 +73,9 @@ constexpr bool IsPAKEKeyId(NodeId aNodeId) return (aNodeId >= kMinPAKEKeyId) && (aNodeId <= kMaxPAKEKeyId); } +constexpr NodeId NodeIdFromGroupId(GroupId aGroupId) +{ + return kMinGroupNodeId | aGroupId; +} + } // namespace chip diff --git a/src/lib/core/tests/TestCHIPTLV.cpp b/src/lib/core/tests/TestCHIPTLV.cpp index 8dd23609a4c9f9..112a721c85678b 100644 --- a/src/lib/core/tests/TestCHIPTLV.cpp +++ b/src/lib/core/tests/TestCHIPTLV.cpp @@ -364,40 +364,40 @@ static CHIP_ERROR WriteIntMinMax(nlTestSuite * inSuite, TLVWriter & writer) { CHIP_ERROR err; - err = writer.Put(AnonymousTag, static_cast(INT8_MIN)); + err = writer.Put(AnonymousTag(), static_cast(INT8_MIN)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(INT8_MAX)); + err = writer.Put(AnonymousTag(), static_cast(INT8_MAX)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(INT16_MIN)); + err = writer.Put(AnonymousTag(), static_cast(INT16_MIN)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(INT16_MAX)); + err = writer.Put(AnonymousTag(), static_cast(INT16_MAX)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(INT32_MIN)); + err = writer.Put(AnonymousTag(), static_cast(INT32_MIN)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(INT32_MAX)); + err = writer.Put(AnonymousTag(), static_cast(INT32_MAX)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(INT64_MIN)); + err = writer.Put(AnonymousTag(), static_cast(INT64_MIN)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(INT64_MAX)); + err = writer.Put(AnonymousTag(), static_cast(INT64_MAX)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(UINT8_MAX)); + err = writer.Put(AnonymousTag(), static_cast(UINT8_MAX)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(UINT16_MAX)); + err = writer.Put(AnonymousTag(), static_cast(UINT16_MAX)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(UINT32_MAX)); + err = writer.Put(AnonymousTag(), static_cast(UINT32_MAX)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.Put(AnonymousTag, static_cast(UINT64_MAX)); + err = writer.Put(AnonymousTag(), static_cast(UINT64_MAX)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); return err; @@ -405,159 +405,159 @@ static CHIP_ERROR WriteIntMinMax(nlTestSuite * inSuite, TLVWriter & writer) static void CheckIntMinMax(nlTestSuite * inSuite, TLVReader & reader) { - // Writer did Put(AnonymousTag, static_cast(INT8_MIN)) - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT8_MIN)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT8_MIN)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT8_MIN)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT8_MIN)); + // Writer did Put(AnonymousTag(), static_cast(INT8_MIN)) + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT8_MIN)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT8_MIN)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT8_MIN)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT8_MIN)); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(INT8_MAX)) - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT8_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT8_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT8_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT8_MAX)); + // Writer did Put(AnonymousTag(), static_cast(INT8_MAX)) + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT8_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT8_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT8_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT8_MAX)); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(INT16_MIN)) - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT16_MIN)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT16_MIN)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT16_MIN)); + // Writer did Put(AnonymousTag(), static_cast(INT16_MIN)) + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT16_MIN)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT16_MIN)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT16_MIN)); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(INT16_MAX)) - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT16_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT16_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT16_MAX)); + // Writer did Put(AnonymousTag(), static_cast(INT16_MAX)) + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT16_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT16_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT16_MAX)); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(INT32_MIN)) - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT32_MIN)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT32_MIN)); + // Writer did Put(AnonymousTag(), static_cast(INT32_MIN)) + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT32_MIN)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT32_MIN)); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(INT32_MAX)) - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT32_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT32_MAX)); + // Writer did Put(AnonymousTag(), static_cast(INT32_MAX)) + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT32_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT32_MAX)); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(INT64_MIN)) - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT64_MIN)); + // Writer did Put(AnonymousTag(), static_cast(INT64_MIN)) + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT64_MIN)); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(INT64_MAX)) - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(INT64_MAX)); + // Writer did Put(AnonymousTag(), static_cast(INT64_MAX)) + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET_NOERROR(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(INT64_MAX)); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_SignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(UINT8_MAX)) - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + // Writer did Put(AnonymousTag(), static_cast(UINT8_MAX)) + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(UINT8_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(UINT8_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(UINT8_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(UINT8_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(UINT8_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(UINT8_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(UINT8_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(UINT8_MAX)); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(UINT16_MAX)) - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + // Writer did Put(AnonymousTag(), static_cast(UINT16_MAX)) + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(UINT16_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(UINT16_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(UINT16_MAX)); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(UINT16_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(UINT16_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(UINT16_MAX)); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(UINT32_MAX)) - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + // Writer did Put(AnonymousTag(), static_cast(UINT32_MAX)) + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(UINT32_MAX)); - TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(UINT32_MAX)); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(UINT32_MAX)); + TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(UINT32_MAX)); TestNext(inSuite, reader); - // Writer did Put(AnonymousTag, static_cast(UINT64_MAX)) - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + // Writer did Put(AnonymousTag(), static_cast(UINT64_MAX)) + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); - TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag, static_cast(UINT64_MAX)); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(0), CHIP_ERROR_INVALID_INTEGER_VALUE); + TEST_GET_NOERROR(inSuite, reader, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(UINT64_MAX)); } void WriteEncoding1(nlTestSuite * inSuite, TLVWriter & writer) @@ -581,22 +581,22 @@ void WriteEncoding1(nlTestSuite * inSuite, TLVWriter & writer) NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); // TODO(#1306): expand coverage of inttype encoding tests. - err = writer3.Put(AnonymousTag, static_cast(42)); + err = writer3.Put(AnonymousTag(), static_cast(42)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(-17)); + err = writer3.Put(AnonymousTag(), static_cast(-17)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(-170000)); + err = writer3.Put(AnonymousTag(), static_cast(-170000)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(40000000000ULL)); + err = writer3.Put(AnonymousTag(), static_cast(40000000000ULL)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); { TLVWriter writer4; - err = writer3.OpenContainer(AnonymousTag, kTLVType_Structure, writer4); + err = writer3.OpenContainer(AnonymousTag(), kTLVType_Structure, writer4); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = writer3.CloseContainer(writer4); @@ -606,7 +606,7 @@ void WriteEncoding1(nlTestSuite * inSuite, TLVWriter & writer) { TLVWriter writer5; - err = writer3.OpenContainer(AnonymousTag, kTLVType_List, writer5); + err = writer3.OpenContainer(AnonymousTag(), kTLVType_List, writer5); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = writer5.PutNull(ProfileTag(TestProfile_1, 17)); @@ -615,7 +615,7 @@ void WriteEncoding1(nlTestSuite * inSuite, TLVWriter & writer) err = writer5.PutNull(ProfileTag(TestProfile_2, 900000)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer5.PutNull(AnonymousTag); + err = writer5.PutNull(AnonymousTag()); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); { @@ -706,40 +706,44 @@ void ReadEncoding1(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader3); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); - TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42)); + TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42), + CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42), + CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42), + CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader3); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); - TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-17)); + TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-17), + CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader3); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-170000)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-170000)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-170000)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-170000)); TestNext(inSuite, reader3); - TEST_GET(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, static_cast(40000000000ULL), + TEST_GET(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(40000000000ULL), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, static_cast(40000000000ULL)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(40000000000ULL)); TestNext(inSuite, reader3); { TLVReader reader4; - TestAndOpenContainer(inSuite, reader3, kTLVType_Structure, AnonymousTag, reader4); + TestAndOpenContainer(inSuite, reader3, kTLVType_Structure, AnonymousTag(), reader4); TestEndAndCloseContainer(inSuite, reader3, reader4); } @@ -749,7 +753,7 @@ void ReadEncoding1(nlTestSuite * inSuite, TLVReader & reader) { TLVReader reader5; - TestAndOpenContainer(inSuite, reader3, kTLVType_List, AnonymousTag, reader5); + TestAndOpenContainer(inSuite, reader3, kTLVType_List, AnonymousTag(), reader5); TestNext(inSuite, reader5); @@ -761,7 +765,7 @@ void ReadEncoding1(nlTestSuite * inSuite, TLVReader & reader) TestNext(inSuite, reader5); - TestNull(inSuite, reader5, AnonymousTag); + TestNull(inSuite, reader5, AnonymousTag()); TestNext(inSuite, reader5); @@ -2738,16 +2742,16 @@ void CheckCHIPTLVSkipCircular(nlTestSuite * inSuite, void * inContext) writer.Init(buffer); - err = writer.PutString(AnonymousTag, testString); + err = writer.PutString(AnonymousTag(), testString); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.PutString(AnonymousTag, testString); + err = writer.PutString(AnonymousTag(), testString); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.PutString(AnonymousTag, testString); // This event straddles the boundary + err = writer.PutString(AnonymousTag(), testString); // This event straddles the boundary NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.PutString(AnonymousTag, testString); // This one does not. + err = writer.PutString(AnonymousTag(), testString); // This one does not. NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = writer.Finalize(); @@ -2909,7 +2913,7 @@ void TestCHIPTLVWriterCopyElement(nlTestSuite * inSuite) writer.Init(expectedBuf); writer.ImplicitProfileId = TestProfile_2; - err = writer.StartContainer(AnonymousTag, kTLVType_Structure, outerContainerType); + err = writer.StartContainer(AnonymousTag(), kTLVType_Structure, outerContainerType); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); for (int i = 0; i < kRepeatCount; i++) @@ -2928,7 +2932,7 @@ void TestCHIPTLVWriterCopyElement(nlTestSuite * inSuite) writer.Init(testBuf); writer.ImplicitProfileId = TestProfile_2; - err = writer.StartContainer(AnonymousTag, kTLVType_Structure, outerContainerType); + err = writer.StartContainer(AnonymousTag(), kTLVType_Structure, outerContainerType); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); for (int i = 0; i < kRepeatCount; i++) @@ -2982,38 +2986,38 @@ void PreserveSizeWrite(nlTestSuite * inSuite, TLVWriter & writer, bool preserveS err = writer2.OpenContainer(ContextTag(0), kTLVType_Array, writer3); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(42), preserveSize); + err = writer3.Put(AnonymousTag(), static_cast(42), preserveSize); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(42), preserveSize); + err = writer3.Put(AnonymousTag(), static_cast(42), preserveSize); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(42), preserveSize); + err = writer3.Put(AnonymousTag(), static_cast(42), preserveSize); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(40000000000ULL), preserveSize); + err = writer3.Put(AnonymousTag(), static_cast(40000000000ULL), preserveSize); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(-17), preserveSize); + err = writer3.Put(AnonymousTag(), static_cast(-17), preserveSize); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(-17), preserveSize); + err = writer3.Put(AnonymousTag(), static_cast(-17), preserveSize); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(-170000), preserveSize); + err = writer3.Put(AnonymousTag(), static_cast(-170000), preserveSize); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(-170000), preserveSize); + err = writer3.Put(AnonymousTag(), static_cast(-170000), preserveSize); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); // the below cases are for full coverage of PUTs - err = writer3.Put(AnonymousTag, static_cast(65535), false); + err = writer3.Put(AnonymousTag(), static_cast(65535), false); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(32767), false); + err = writer3.Put(AnonymousTag(), static_cast(32767), false); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer3.Put(AnonymousTag, static_cast(40000000000ULL), false); + err = writer3.Put(AnonymousTag(), static_cast(40000000000ULL), false); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = writer2.CloseContainer(writer3); @@ -3213,37 +3217,39 @@ void TestCHIPTLVReaderDup(nlTestSuite * inSuite) TestNext(inSuite, reader3); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42)); - TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(42), CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42)); + TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42), + CHIP_ERROR_WRONG_TLV_TYPE); + TEST_GET(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(42), + CHIP_ERROR_WRONG_TLV_TYPE); TestNext(inSuite, reader3); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-17)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-17)); TestNext(inSuite, reader3); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-170000)); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag, static_cast(-170000)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-170000)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_SignedInteger, AnonymousTag(), static_cast(-170000)); TestNext(inSuite, reader3); - TEST_GET(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, static_cast(40000000000ULL), + TEST_GET(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(40000000000ULL), CHIP_ERROR_WRONG_TLV_TYPE); - TEST_GET_NOERROR(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag, static_cast(40000000000ULL)); + TEST_GET_NOERROR(inSuite, reader3, kTLVType_UnsignedInteger, AnonymousTag(), static_cast(40000000000ULL)); TestNext(inSuite, reader3); { TLVReader reader4; - TestAndOpenContainer(inSuite, reader3, kTLVType_Structure, AnonymousTag, reader4); + TestAndOpenContainer(inSuite, reader3, kTLVType_Structure, AnonymousTag(), reader4); TestEndAndCloseContainer(inSuite, reader3, reader4); } @@ -3253,7 +3259,7 @@ void TestCHIPTLVReaderDup(nlTestSuite * inSuite) { TLVReader reader5; - TestAndOpenContainer(inSuite, reader3, kTLVType_List, AnonymousTag, reader5); + TestAndOpenContainer(inSuite, reader3, kTLVType_List, AnonymousTag(), reader5); TestNext(inSuite, reader5); @@ -3265,7 +3271,7 @@ void TestCHIPTLVReaderDup(nlTestSuite * inSuite) TestNext(inSuite, reader5); - TestNull(inSuite, reader5, AnonymousTag); + TestNull(inSuite, reader5, AnonymousTag()); TestNext(inSuite, reader5); @@ -3393,7 +3399,7 @@ void TestCHIPTLVReaderTruncatedReads(nlTestSuite * inSuite) writer.Init(buf); writer.ImplicitProfileId = TestProfile_2; - err = writer.Put(AnonymousTag, double{ 12.5 }); + err = writer.Put(AnonymousTag(), double{ 12.5 }); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); // Test reading values from the buffer @@ -3401,7 +3407,7 @@ void TestCHIPTLVReaderTruncatedReads(nlTestSuite * inSuite) TestNext(inSuite, reader); - TEST_GET_NOERROR(inSuite, reader, kTLVType_FloatingPointNumber, AnonymousTag, 12.5); + TEST_GET_NOERROR(inSuite, reader, kTLVType_FloatingPointNumber, AnonymousTag(), 12.5); err = reader.Get(outF); NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_WRONG_TLV_TYPE); @@ -3559,70 +3565,70 @@ static void TestItems(nlTestSuite * inSuite, void * inContext) writer.Init(sBuffer); TLVWriter writer2; - err = writer.OpenContainer(AnonymousTag, kTLVType_Array, writer2); + err = writer.OpenContainer(AnonymousTag(), kTLVType_Array, writer2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); { - err = writer2.PutBoolean(AnonymousTag, true); + err = writer2.PutBoolean(AnonymousTag(), true); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(-1)); + err = writer2.Put(AnonymousTag(), static_cast(-1)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(-2)); + err = writer2.Put(AnonymousTag(), static_cast(-2)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(-3)); + err = writer2.Put(AnonymousTag(), static_cast(-3)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(-4)); + err = writer2.Put(AnonymousTag(), static_cast(-4)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(-5.5)); + err = writer2.Put(AnonymousTag(), static_cast(-5.5)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(-3.14159265358979323846)); + err = writer2.Put(AnonymousTag(), static_cast(-3.14159265358979323846)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); } err = writer.CloseContainer(writer2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.OpenContainer(AnonymousTag, kTLVType_Array, writer2); + err = writer.OpenContainer(AnonymousTag(), kTLVType_Array, writer2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); { - err = writer2.PutBoolean(AnonymousTag, false); + err = writer2.PutBoolean(AnonymousTag(), false); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(1)); + err = writer2.Put(AnonymousTag(), static_cast(1)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(2)); + err = writer2.Put(AnonymousTag(), static_cast(2)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(3)); + err = writer2.Put(AnonymousTag(), static_cast(3)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(4)); + err = writer2.Put(AnonymousTag(), static_cast(4)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(5)); + err = writer2.Put(AnonymousTag(), static_cast(5)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(6)); + err = writer2.Put(AnonymousTag(), static_cast(6)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(7)); + err = writer2.Put(AnonymousTag(), static_cast(7)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(8)); + err = writer2.Put(AnonymousTag(), static_cast(8)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(9.9)); + err = writer2.Put(AnonymousTag(), static_cast(9.9)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.Put(AnonymousTag, static_cast(3.14159265358979323846)); + err = writer2.Put(AnonymousTag(), static_cast(3.14159265358979323846)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); } @@ -3645,7 +3651,7 @@ static void TestContainers(nlTestSuite * inSuite, void * inContext) writer.Init(sBuffer); TLVWriter writer2; - err = writer.OpenContainer(AnonymousTag, kTLVType_Array, writer2); + err = writer.OpenContainer(AnonymousTag(), kTLVType_Array, writer2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); TLVType type = writer2.GetContainerType(); @@ -3654,7 +3660,7 @@ static void TestContainers(nlTestSuite * inSuite, void * inContext) err = writer.CloseContainer(writer2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer.OpenContainer(AnonymousTag, kTLVType_Structure, writer2); + err = writer.OpenContainer(AnonymousTag(), kTLVType_Structure, writer2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); type = writer2.GetContainerType(); @@ -3738,10 +3744,10 @@ static void CheckCloseContainerReserve(nlTestSuite * inSuite, void * inContext) writer1.Init(buf); - err = writer1.OpenContainer(AnonymousTag, kTLVType_Array, innerWriter1); + err = writer1.OpenContainer(AnonymousTag(), kTLVType_Array, innerWriter1); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = innerWriter1.OpenContainer(AnonymousTag, kTLVType_Structure, innerWriter2); + err = innerWriter1.OpenContainer(AnonymousTag(), kTLVType_Structure, innerWriter2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = innerWriter2.PutBoolean(ProfileTag(TestProfile_1, 2), true); @@ -3755,10 +3761,10 @@ static void CheckCloseContainerReserve(nlTestSuite * inSuite, void * inContext) writer2.Init(buf, sizeof(buf)); - err = writer2.OpenContainer(AnonymousTag, kTLVType_Array, innerWriter1); + err = writer2.OpenContainer(AnonymousTag(), kTLVType_Array, innerWriter1); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = innerWriter1.OpenContainer(AnonymousTag, kTLVType_Structure, innerWriter2); + err = innerWriter1.OpenContainer(AnonymousTag(), kTLVType_Structure, innerWriter2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = innerWriter2.PutBoolean(ProfileTag(TestProfile_1, 2), true); @@ -3774,10 +3780,10 @@ static void CheckCloseContainerReserve(nlTestSuite * inSuite, void * inContext) writer1.Init(buf); - err = writer1.StartContainer(AnonymousTag, kTLVType_Array, container1); + err = writer1.StartContainer(AnonymousTag(), kTLVType_Array, container1); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer1.StartContainer(AnonymousTag, kTLVType_Structure, container2); + err = writer1.StartContainer(AnonymousTag(), kTLVType_Structure, container2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = writer1.PutBoolean(ProfileTag(TestProfile_1, 2), true); @@ -3791,10 +3797,10 @@ static void CheckCloseContainerReserve(nlTestSuite * inSuite, void * inContext) writer2.Init(buf, sizeof(buf)); - err = writer2.StartContainer(AnonymousTag, kTLVType_Array, container1); + err = writer2.StartContainer(AnonymousTag(), kTLVType_Array, container1); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = writer2.StartContainer(AnonymousTag, kTLVType_Structure, container2); + err = writer2.StartContainer(AnonymousTag(), kTLVType_Structure, container2); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = writer2.PutBoolean(ProfileTag(TestProfile_1, 2), true); @@ -3845,7 +3851,7 @@ static void CheckCloseContainerReserve(nlTestSuite * inSuite, void * inContext) err = writer1.OpenContainer(ProfileTag(TestProfile_1, 2), kTLVType_Structure, innerWriter1); NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_BUFFER_TOO_SMALL); - err = writer1.StartContainer(AnonymousTag, kTLVType_Array, container1); + err = writer1.StartContainer(AnonymousTag(), kTLVType_Array, container1); NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_BUFFER_TOO_SMALL); // Test again all cases from 0 to the length of buf1 @@ -3856,10 +3862,10 @@ static void CheckCloseContainerReserve(nlTestSuite * inSuite, void * inContext) writer1.Init(buf, maxLen); - err = writer1.OpenContainer(AnonymousTag, kTLVType_Array, innerWriter1); + err = writer1.OpenContainer(AnonymousTag(), kTLVType_Array, innerWriter1); if (err == CHIP_NO_ERROR) - err = innerWriter1.OpenContainer(AnonymousTag, kTLVType_Structure, innerWriter2); + err = innerWriter1.OpenContainer(AnonymousTag(), kTLVType_Structure, innerWriter2); if (err == CHIP_NO_ERROR) err = innerWriter2.PutBoolean(ProfileTag(TestProfile_1, 2), true); @@ -3877,10 +3883,10 @@ static void CheckCloseContainerReserve(nlTestSuite * inSuite, void * inContext) writer1.Init(buf, maxLen); if (err == CHIP_NO_ERROR) - err = writer1.StartContainer(AnonymousTag, kTLVType_Array, container1); + err = writer1.StartContainer(AnonymousTag(), kTLVType_Array, container1); if (err == CHIP_NO_ERROR) - err = writer1.StartContainer(AnonymousTag, kTLVType_Structure, container2); + err = writer1.StartContainer(AnonymousTag(), kTLVType_Structure, container2); if (err == CHIP_NO_ERROR) err = writer1.PutBoolean(ProfileTag(TestProfile_1, 2), true); @@ -3936,7 +3942,7 @@ static CHIP_ERROR ReadFuzzedEncoding1(nlTestSuite * inSuite, TLVReader & reader) TLVType outerContainer2Type; ReturnErrorOnFailure(reader.EnterContainer(outerContainer2Type)); - ReturnErrorOnFailure(reader.Next(kTLVType_SignedInteger, AnonymousTag)); + ReturnErrorOnFailure(reader.Next(kTLVType_SignedInteger, AnonymousTag())); FUZZ_CHECK_VAL(int8_t, 42); FUZZ_CHECK_VAL(int16_t, 42); @@ -3947,24 +3953,24 @@ static CHIP_ERROR ReadFuzzedEncoding1(nlTestSuite * inSuite, TLVReader & reader) FUZZ_CHECK_VAL(uint32_t, 42); FUZZ_CHECK_VAL(uint64_t, 42); - ReturnErrorOnFailure(reader.Next(kTLVType_SignedInteger, AnonymousTag)); + ReturnErrorOnFailure(reader.Next(kTLVType_SignedInteger, AnonymousTag())); FUZZ_CHECK_VAL(int8_t, -17); FUZZ_CHECK_VAL(int16_t, -17); FUZZ_CHECK_VAL(int32_t, -17); FUZZ_CHECK_VAL(int64_t, -17); - ReturnErrorOnFailure(reader.Next(kTLVType_SignedInteger, AnonymousTag)); + ReturnErrorOnFailure(reader.Next(kTLVType_SignedInteger, AnonymousTag())); FUZZ_CHECK_VAL(int32_t, -170000); FUZZ_CHECK_VAL(int64_t, -170000); - ReturnErrorOnFailure(reader.Next(kTLVType_UnsignedInteger, AnonymousTag)); + ReturnErrorOnFailure(reader.Next(kTLVType_UnsignedInteger, AnonymousTag())); FUZZ_CHECK_VAL(int64_t, 40000000000ULL); FUZZ_CHECK_VAL(uint64_t, 40000000000ULL); - ReturnErrorOnFailure(reader.Next(kTLVType_Structure, AnonymousTag)); + ReturnErrorOnFailure(reader.Next(kTLVType_Structure, AnonymousTag())); { TLVType outerContainer3Type; @@ -3973,7 +3979,7 @@ static CHIP_ERROR ReadFuzzedEncoding1(nlTestSuite * inSuite, TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outerContainer3Type)); } - ReturnErrorOnFailure(reader.Next(kTLVType_List, AnonymousTag)); + ReturnErrorOnFailure(reader.Next(kTLVType_List, AnonymousTag())); { TLVType outerContainer3Type; @@ -3981,7 +3987,7 @@ static CHIP_ERROR ReadFuzzedEncoding1(nlTestSuite * inSuite, TLVReader & reader) ReturnErrorOnFailure(reader.EnterContainer(outerContainer3Type)); ReturnErrorOnFailure(reader.Next(kTLVType_Null, ProfileTag(TestProfile_1, 17))); ReturnErrorOnFailure(reader.Next(kTLVType_Null, ProfileTag(TestProfile_2, 900000))); - ReturnErrorOnFailure(reader.Next(kTLVType_Null, AnonymousTag)); + ReturnErrorOnFailure(reader.Next(kTLVType_Null, AnonymousTag())); ReturnErrorOnFailure(reader.Next(kTLVType_Structure, ProfileTag(TestProfile_2, 4000000000ULL))); { @@ -4307,14 +4313,14 @@ static void CheckCHIPTLVScopedBuffer(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, buf.Get() == nullptr); - err = writer.Put(TLV::AnonymousTag, (uint8_t) 33); + err = writer.Put(TLV::AnonymousTag(), (uint8_t) 33); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = writer.Finalize(buf); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, buf.Get() != nullptr); - err = writer.Put(TLV::AnonymousTag, (uint8_t) 33); + err = writer.Put(TLV::AnonymousTag(), (uint8_t) 33); NL_TEST_ASSERT(inSuite, err != CHIP_NO_ERROR); } diff --git a/src/lib/dnssd/Advertiser.h b/src/lib/dnssd/Advertiser.h index 9cc067d5a94fcc..2e25e6d05f498c 100644 --- a/src/lib/dnssd/Advertiser.h +++ b/src/lib/dnssd/Advertiser.h @@ -121,6 +121,8 @@ class OperationalAdvertisingParameters : public BaseAdvertisingParams::Value(mDeviceName) : Optional::Missing(); } - CommissionAdvertisingParameters & SetRotatingId(Optional rotatingId) + CommissionAdvertisingParameters & SetRotatingDeviceId(Optional rotatingId) { if (rotatingId.HasValue()) { @@ -207,12 +209,12 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams GetRotatingId() const + Optional GetRotatingDeviceId() const { return mRotatingIdHasValue ? Optional::Value(mRotatingId) : Optional::Missing(); } - CommissionAdvertisingParameters & SetPairingInstr(Optional pairingInstr) + CommissionAdvertisingParameters & SetPairingInstruction(Optional pairingInstr) { if (pairingInstr.HasValue()) { @@ -225,7 +227,7 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams GetPairingInstr() const + Optional GetPairingInstruction() const { return mPairingInstrHasValue ? Optional::Value(mPairingInstr) : Optional::Missing(); } @@ -257,7 +259,7 @@ class CommissionAdvertisingParameters : public BaseAdvertisingParams CHIP_ERROR AddCommonTxtEntries(const BaseAdvertisingParams & params, CommonTxtEntryStorage & storage, @@ -437,7 +437,7 @@ CHIP_ERROR AdvertiserMinMdns::Advertise(const OperationalAdvertisingParameters & CHIP_ERROR AdvertiserMinMdns::GetCommissionableInstanceName(char * instanceName, size_t maxLength) { - if (maxLength < (Commissionable::kInstanceNameMaxLength + 1)) + if (maxLength < (Commission::kInstanceNameMaxLength + 1)) { return CHIP_ERROR_NO_MEMORY; } @@ -514,7 +514,7 @@ CHIP_ERROR AdvertiserMinMdns::Advertise(const CommissionAdvertisingParameters & if (params.GetVendorId().HasValue()) { MakeServiceSubtype(nameBuffer, sizeof(nameBuffer), - DiscoveryFilter(DiscoveryFilterType::kVendor, params.GetVendorId().Value())); + DiscoveryFilter(DiscoveryFilterType::kVendorId, params.GetVendorId().Value())); FullQName vendorServiceName = allocator->AllocateQName(nameBuffer, kSubtypeServiceNamePart, serviceType, kCommissionProtocol, kLocalDomain); ReturnErrorCodeIf(vendorServiceName.nameCount == 0, CHIP_ERROR_NO_MEMORY); @@ -552,7 +552,7 @@ CHIP_ERROR AdvertiserMinMdns::Advertise(const CommissionAdvertisingParameters & { { MakeServiceSubtype(nameBuffer, sizeof(nameBuffer), - DiscoveryFilter(DiscoveryFilterType::kShort, params.GetShortDiscriminator())); + DiscoveryFilter(DiscoveryFilterType::kShortDiscriminator, params.GetShortDiscriminator())); FullQName shortServiceName = allocator->AllocateQName(nameBuffer, kSubtypeServiceNamePart, serviceType, kCommissionProtocol, kLocalDomain); ReturnErrorCodeIf(shortServiceName.nameCount == 0, CHIP_ERROR_NO_MEMORY); @@ -569,7 +569,7 @@ CHIP_ERROR AdvertiserMinMdns::Advertise(const CommissionAdvertisingParameters & { MakeServiceSubtype(nameBuffer, sizeof(nameBuffer), - DiscoveryFilter(DiscoveryFilterType::kLong, params.GetLongDiscriminator())); + DiscoveryFilter(DiscoveryFilterType::kLongDiscriminator, params.GetLongDiscriminator())); FullQName longServiceName = allocator->AllocateQName(nameBuffer, kSubtypeServiceNamePart, serviceType, kCommissionProtocol, kLocalDomain); ReturnErrorCodeIf(longServiceName.nameCount == 0, CHIP_ERROR_NO_MEMORY); @@ -682,7 +682,7 @@ FullQName AdvertiserMinMdns::GetCommissioningTxtEntries(const CommissionAdvertis if (params.GetCommissionAdvertiseMode() == CommssionAdvertiseMode::kCommissionableNode) { // a discriminator always exists - char txtDiscriminator[chip::Dnssd::kKeyDiscriminatorMaxLength + 3]; + char txtDiscriminator[chip::Dnssd::kKeyLongDiscriminatorMaxLength + 3]; snprintf(txtDiscriminator, sizeof(txtDiscriminator), "D=%d", params.GetLongDiscriminator()); txtFields[numTxtFields++] = txtDiscriminator; @@ -690,10 +690,10 @@ FullQName AdvertiserMinMdns::GetCommissioningTxtEntries(const CommissionAdvertis snprintf(txtCommissioningMode, sizeof(txtCommissioningMode), "CM=%d", static_cast(params.GetCommissioningMode())); txtFields[numTxtFields++] = txtCommissioningMode; - char txtRotatingDeviceId[chip::Dnssd::kKeyRotatingIdMaxLength + 4]; - if (params.GetRotatingId().HasValue()) + char txtRotatingDeviceId[chip::Dnssd::kKeyRotatingDeviceIdMaxLength + 4]; + if (params.GetRotatingDeviceId().HasValue()) { - snprintf(txtRotatingDeviceId, sizeof(txtRotatingDeviceId), "RI=%s", params.GetRotatingId().Value()); + snprintf(txtRotatingDeviceId, sizeof(txtRotatingDeviceId), "RI=%s", params.GetRotatingDeviceId().Value()); txtFields[numTxtFields++] = txtRotatingDeviceId; } @@ -705,9 +705,9 @@ FullQName AdvertiserMinMdns::GetCommissioningTxtEntries(const CommissionAdvertis } char txtPairingInstr[chip::Dnssd::kKeyPairingInstructionMaxLength + 4]; - if (params.GetPairingInstr().HasValue()) + if (params.GetPairingInstruction().HasValue()) { - snprintf(txtPairingInstr, sizeof(txtPairingInstr), "PI=%s", params.GetPairingInstr().Value()); + snprintf(txtPairingInstr, sizeof(txtPairingInstr), "PI=%s", params.GetPairingInstruction().Value()); txtFields[numTxtFields++] = txtPairingInstr; } } @@ -766,7 +766,12 @@ void AdvertiserMinMdns::AdvertiseRecords() continue; } - if (!ShouldAdvertiseOn(interfaceAddress.GetInterfaceId(), interfaceAddress.GetAddress())) + Inet::IPAddress ipAddress; + if (interfaceAddress.GetAddress(ipAddress) != CHIP_NO_ERROR) + { + continue; + } + if (!ShouldAdvertiseOn(interfaceAddress.GetInterfaceId(), ipAddress)) { continue; } @@ -774,8 +779,8 @@ void AdvertiserMinMdns::AdvertiseRecords() chip::Inet::IPPacketInfo packetInfo; packetInfo.Clear(); - packetInfo.SrcAddress = interfaceAddress.GetAddress(); - if (interfaceAddress.GetAddress().IsIPv4()) + packetInfo.SrcAddress = ipAddress; + if (ipAddress.IsIPv4()) { BroadcastIpAddresses::GetIpv4Into(packetInfo.DestAddress); } diff --git a/src/lib/dnssd/Advertiser_ImplNone.cpp b/src/lib/dnssd/Advertiser_ImplNone.cpp index 503366ab033d7e..a3cc54ab2bd3af 100644 --- a/src/lib/dnssd/Advertiser_ImplNone.cpp +++ b/src/lib/dnssd/Advertiser_ImplNone.cpp @@ -48,7 +48,7 @@ class NoneAdvertiser : public ServiceAdvertiser CHIP_ERROR Advertise(const CommissionAdvertisingParameters & params) override { - ChipLogError(Discovery, "DNS-SD advertising not available. Commisioning Advertisement failed."); + ChipLogError(Discovery, "DNS-SD advertising not available. Commissioning Advertisement failed."); return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/src/lib/dnssd/Constants.h b/src/lib/dnssd/Constants.h index 2bca806587b5d1..b3aeaae7379e4e 100644 --- a/src/lib/dnssd/Constants.h +++ b/src/lib/dnssd/Constants.h @@ -37,7 +37,7 @@ constexpr size_t kHostNameMaxLength = 16; // MAC or 802.15.4 Extended Address in constexpr size_t kSubTypeShortDiscriminatorMaxLength = 4; // _S
constexpr size_t kSubTypeLongDiscriminatorMaxLength = 6; // _L -constexpr size_t kSubTypeVendorMaxLength = 7; // _V +constexpr size_t kSubTypeVendorIdMaxLength = 7; // _V constexpr size_t kSubTypeDeviceTypeMaxLength = 5; // _T constexpr size_t kSubTypeCommissioningModeMaxLength = 3; // _C constexpr size_t kSubTypeAdditionalCommissioningMaxLength = 3; // _A @@ -64,11 +64,11 @@ constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES); * Matter commissionable/commissioner node service constants. */ -namespace Commissionable { +namespace Commission { #define SUBTYPES \ (std::initializer_list{ kSubTypeShortDiscriminatorMaxLength, kSubTypeLongDiscriminatorMaxLength, \ - kSubTypeVendorMaxLength, kSubTypeDeviceTypeMaxLength, kSubTypeCommissioningModeMaxLength, \ + kSubTypeVendorIdMaxLength, kSubTypeDeviceTypeMaxLength, kSubTypeCommissioningModeMaxLength, \ kSubTypeAdditionalCommissioningMaxLength }) constexpr size_t kInstanceNameMaxLength = 16; // 64-bit random number in hex @@ -78,7 +78,7 @@ constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES); #undef SUBTYPES -} // namespace Commissionable +} // namespace Commission /* * Constants for any Matter service. @@ -86,10 +86,10 @@ constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES); namespace Common { -constexpr size_t kInstanceNameMaxLength = std::max(Operational::kInstanceNameMaxLength, Commissionable::kInstanceNameMaxLength); -constexpr size_t kSubTypeMaxNumber = std::max(Operational::kSubTypeMaxNumber, Commissionable::kSubTypeMaxNumber); -constexpr size_t kSubTypeMaxLength = std::max(Operational::kSubTypeMaxLength, Commissionable::kSubTypeMaxLength); -constexpr size_t kSubTypeTotalLength = std::max(Operational::kSubTypeTotalLength, Commissionable::kSubTypeTotalLength); +constexpr size_t kInstanceNameMaxLength = std::max(Operational::kInstanceNameMaxLength, Commission::kInstanceNameMaxLength); +constexpr size_t kSubTypeMaxNumber = std::max(Operational::kSubTypeMaxNumber, Commission::kSubTypeMaxNumber); +constexpr size_t kSubTypeMaxLength = std::max(Operational::kSubTypeMaxLength, Commission::kSubTypeMaxLength); +constexpr size_t kSubTypeTotalLength = std::max(Operational::kSubTypeTotalLength, Commission::kSubTypeTotalLength); } // namespace Common diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp index 38701b0b6c0445..8822774648407c 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.cpp +++ b/src/lib/dnssd/Discovery_ImplPlatform.cpp @@ -145,6 +145,171 @@ static void HandleNodeBrowse(void * context, DnssdService * services, size_t ser } } } + +CHIP_ERROR AddPtrRecord(DiscoveryFilter filter, const char ** entries, size_t & entriesCount, char * buffer, size_t bufferLen) +{ + ReturnErrorOnFailure(MakeServiceSubtype(buffer, bufferLen, filter)); + entries[entriesCount++] = buffer; + return CHIP_NO_ERROR; +} + +CHIP_ERROR AddPtrRecord(DiscoveryFilterType type, const char ** entries, size_t & entriesCount, char * buffer, size_t bufferLen, + CommissioningMode value) +{ + VerifyOrReturnError(value != CommissioningMode::kDisabled, CHIP_NO_ERROR); + return AddPtrRecord(DiscoveryFilter(type), entries, entriesCount, buffer, bufferLen); +} + +CHIP_ERROR AddPtrRecord(DiscoveryFilterType type, const char ** entries, size_t & entriesCount, char * buffer, size_t bufferLen, + uint64_t value) +{ + return AddPtrRecord(DiscoveryFilter(type, value), entries, entriesCount, buffer, bufferLen); +} + +template +CHIP_ERROR AddPtrRecord(DiscoveryFilterType type, const char ** entries, size_t & entriesCount, char * buffer, size_t bufferLen, + chip::Optional value) +{ + VerifyOrReturnError(value.HasValue(), CHIP_NO_ERROR); + return AddPtrRecord(type, entries, entriesCount, buffer, bufferLen, value.Value()); +} + +CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, int minCharactersWritten, const char * format, ...) +{ + va_list args; + va_start(args, format); + int charactersWritten = vsnprintf(buffer, bufferLen, format, args); + va_end(args); + + return charactersWritten >= minCharactersWritten ? CHIP_NO_ERROR : CHIP_ERROR_INVALID_STRING_LENGTH; +} + +CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, bool value) +{ + return CopyTextRecordValue(buffer, bufferLen, 1, "%d", value); +} + +CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, uint16_t value) +{ + return CopyTextRecordValue(buffer, bufferLen, 1, "%u", value); +} + +CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, uint32_t value) +{ + return CopyTextRecordValue(buffer, bufferLen, 1, "%" PRIu32, value); +} + +CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, uint16_t value1, uint16_t value2) +{ + return CopyTextRecordValue(buffer, bufferLen, 3, "%u+%u", value1, value2); +} + +CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, const char * value) +{ + return CopyTextRecordValue(buffer, bufferLen, 0, "%s", value); +} + +CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, CommissioningMode value) +{ + return CopyTextRecordValue(buffer, bufferLen, static_cast(value)); +} + +template +CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, chip::Optional value) +{ + VerifyOrReturnError(value.HasValue(), CHIP_ERROR_WELL_UNINITIALIZED); + return CopyTextRecordValue(buffer, bufferLen, value.Value()); +} + +CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, chip::Optional value1, chip::Optional value2) +{ + VerifyOrReturnError(value1.HasValue(), CHIP_ERROR_WELL_UNINITIALIZED); + return value2.HasValue() ? CopyTextRecordValue(buffer, bufferLen, value1.Value(), value2.Value()) + : CopyTextRecordValue(buffer, bufferLen, value1.Value()); +} + +CHIP_ERROR CopyTextRecordValue(char * buffer, size_t bufferLen, const chip::Optional optional, + bool isIdle) +{ + VerifyOrReturnError(optional.HasValue(), CHIP_ERROR_WELL_UNINITIALIZED); + + auto retryInterval = isIdle ? optional.Value().mIdleRetransTimeout : optional.Value().mActiveRetransTimeout; + + // TODO: Issue #5833 - MRP retry intervals should be updated on the poll period value + // change or device type change. + // TODO: Is this really the best place to set these? Seems like it should be passed + // in with the correct values and set one level up from here. +#if CHIP_DEVICE_CONFIG_ENABLE_SED + chip::DeviceLayer::ConnectivityManager::SEDPollingConfig sedPollingConfig; + ReturnErrorOnFailure(chip::DeviceLayer::ConnectivityMgr().GetSEDPollingConfig(sedPollingConfig)); + // Increment default MRP retry intervals by SED poll period to be on the safe side + // and avoid unnecessary retransmissions. + retryInterval += isIdle ? sedPollingConfig.SlowPollingIntervalMS : sedPollingConfig.FastPollingIntervalMS; +#endif + + if (retryInterval > kMaxRetryInterval) + { + ChipLogProgress(Discovery, "MRP retry interval %s value exceeds allowed range of 1 hour, using maximum available", + isIdle ? "idle" : "active"); + retryInterval = kMaxRetryInterval; + } + + return CopyTextRecordValue(buffer, bufferLen, retryInterval.count()); +} + +template +CHIP_ERROR CopyTxtRecord(TxtFieldKey key, char * buffer, size_t bufferLen, const T & params) +{ + switch (key) + { + case TxtFieldKey::kTcpSupported: + return CopyTextRecordValue(buffer, bufferLen, params.GetTcpSupported()); + case TxtFieldKey::kMrpRetryIntervalIdle: + case TxtFieldKey::kMrpRetryIntervalActive: + return CopyTextRecordValue(buffer, bufferLen, params.GetMRPConfig(), key == TxtFieldKey::kMrpRetryIntervalIdle); + default: + return CHIP_ERROR_INVALID_ARGUMENT; + } +} + +CHIP_ERROR CopyTxtRecord(TxtFieldKey key, char * buffer, size_t bufferLen, const CommissionAdvertisingParameters & params) +{ + switch (key) + { + case TxtFieldKey::kVendorProduct: + return CopyTextRecordValue(buffer, bufferLen, params.GetVendorId(), params.GetProductId()); + case TxtFieldKey::kDeviceType: + return CopyTextRecordValue(buffer, bufferLen, params.GetDeviceType()); + case TxtFieldKey::kDeviceName: + return CopyTextRecordValue(buffer, bufferLen, params.GetDeviceName()); + case TxtFieldKey::kLongDiscriminator: + return CopyTextRecordValue(buffer, bufferLen, params.GetLongDiscriminator()); + case TxtFieldKey::kRotatingDeviceId: + return CopyTextRecordValue(buffer, bufferLen, params.GetRotatingDeviceId()); + case TxtFieldKey::kPairingInstruction: + return CopyTextRecordValue(buffer, bufferLen, params.GetPairingInstruction()); + case TxtFieldKey::kPairingHint: + return CopyTextRecordValue(buffer, bufferLen, params.GetPairingHint()); + case TxtFieldKey::kCommissioningMode: + return CopyTextRecordValue(buffer, bufferLen, params.GetCommissioningMode()); + default: + return CopyTxtRecord(key, buffer, bufferLen, static_cast>(params)); + } +} + +template +CHIP_ERROR AddTxtRecord(TxtFieldKey key, TextEntry * entries, size_t & entriesCount, char * buffer, size_t bufferLen, + const T & params) +{ + CHIP_ERROR error = CopyTxtRecord(key, buffer, bufferLen, params); + VerifyOrReturnError(CHIP_ERROR_WELL_UNINITIALIZED != error, CHIP_NO_ERROR); + VerifyOrReturnError(CHIP_NO_ERROR == error, error); + + entries[entriesCount++] = { Internal::txtFieldInfo[static_cast(key)].keyStr, reinterpret_cast(buffer), + strnlen(buffer, bufferLen) }; + return CHIP_NO_ERROR; +} + } // namespace DiscoveryImplPlatform DiscoveryImplPlatform::sManager; @@ -200,18 +365,21 @@ void DiscoveryImplPlatform::HandleDnssdError(void * context, CHIP_ERROR error) DiscoveryImplPlatform * publisher = static_cast(context); if (error == CHIP_ERROR_FORCED_RESET) { - if (publisher->mIsOperationalPublishing) + if (publisher->mIsOperationalNodePublishing) { - publisher->Advertise(publisher->mOperationalAdvertisingParams); + publisher->Advertise(publisher->mOperationalNodeAdvertisingParams); } + if (publisher->mIsCommissionableNodePublishing) { publisher->Advertise(publisher->mCommissionableNodeAdvertisingParams); } - if (publisher->mIsCommissionerPublishing) + + if (publisher->mIsCommissionerNodePublishing) { - publisher->Advertise(publisher->mCommissionerAdvertisingParams); + publisher->Advertise(publisher->mCommissionerNodeAdvertisingParams); } + publisher->FinalizeServiceUpdate(); } else @@ -222,7 +390,7 @@ void DiscoveryImplPlatform::HandleDnssdError(void * context, CHIP_ERROR error) CHIP_ERROR DiscoveryImplPlatform::GetCommissionableInstanceName(char * instanceName, size_t maxLength) { - if (maxLength < (chip::Dnssd::Commissionable::kInstanceNameMaxLength + 1)) + if (maxLength < (chip::Dnssd::Commission::kInstanceNameMaxLength + 1)) { return CHIP_ERROR_NO_MEMORY; } @@ -231,330 +399,137 @@ CHIP_ERROR DiscoveryImplPlatform::GetCommissionableInstanceName(char * instanceN instanceName, maxLength); } -template -CHIP_ERROR AddCommonTxtElements(const BaseAdvertisingParams & params, char (&mrpRetryIdleStorage)[N_idle], - char (&mrpRetryActiveStorage)[N_active], char (&tcpSupportedStorage)[N_tcp], - TextEntry txtEntryStorage[], size_t & txtEntryIdx) +CHIP_ERROR DiscoveryImplPlatform::PublishService(const char * serviceType, TextEntry * textEntries, size_t textEntrySize, + const char ** subTypes, size_t subTypeSize, + const OperationalAdvertisingParameters & params) { - auto optionalMrp = params.GetMRPConfig(); - - // TODO: Issue #5833 - MRP retry intervals should be updated on the poll period value - // change or device type change. - // TODO: Is this really the best place to set these? Seems like it should be passed - // in with the correct values and set one level up from here. -#if CHIP_DEVICE_CONFIG_ENABLE_SED - chip::DeviceLayer::ConnectivityManager::SEDPollingConfig sedPollingConfig; - ReturnErrorOnFailure(chip::DeviceLayer::ConnectivityMgr().GetSEDPollingConfig(sedPollingConfig)); - // Increment default MRP retry intervals by SED poll period to be on the safe side - // and avoid unnecessary retransmissions. - if (optionalMrp.HasValue()) - { - auto mrp = optionalMrp.Value(); - optionalMrp.SetValue(ReliableMessageProtocolConfig(mrp.mIdleRetransTimeout + sedPollingConfig.SlowPollingIntervalMS, - mrp.mActiveRetransTimeout + sedPollingConfig.FastPollingIntervalMS)); - } -#endif - if (optionalMrp.HasValue()) - { - auto mrp = optionalMrp.Value(); - { - if (mrp.mIdleRetransTimeout > kMaxRetryInterval) - { - ChipLogProgress(Discovery, - "MRP retry interval idle value exceeds allowed range of 1 hour, using maximum available"); - mrp.mIdleRetransTimeout = kMaxRetryInterval; - } - size_t writtenCharactersNumber = - snprintf(mrpRetryIdleStorage, sizeof(mrpRetryIdleStorage), "%" PRIu32, mrp.mIdleRetransTimeout.count()); - VerifyOrReturnError((writtenCharactersNumber > 0) && (writtenCharactersNumber <= kTxtRetryIntervalIdleMaxLength), - CHIP_ERROR_INVALID_STRING_LENGTH); - txtEntryStorage[txtEntryIdx++] = { "CRI", Uint8::from_const_char(mrpRetryIdleStorage), strlen(mrpRetryIdleStorage) }; - } - - { - if (mrp.mActiveRetransTimeout > kMaxRetryInterval) - { - ChipLogProgress(Discovery, - "MRP retry interval active value exceeds allowed range of 1 hour, using maximum available"); - mrp.mActiveRetransTimeout = kMaxRetryInterval; - } - size_t writtenCharactersNumber = - snprintf(mrpRetryActiveStorage, sizeof(mrpRetryActiveStorage), "%" PRIu32, mrp.mActiveRetransTimeout.count()); - VerifyOrReturnError((writtenCharactersNumber > 0) && (writtenCharactersNumber <= kTxtRetryIntervalActiveMaxLength), - CHIP_ERROR_INVALID_STRING_LENGTH); - txtEntryStorage[txtEntryIdx++] = { "CRA", Uint8::from_const_char(mrpRetryActiveStorage), - strlen(mrpRetryActiveStorage) }; - } - } - if (params.GetTcpSupported().HasValue()) - { - size_t writtenCharactersNumber = - snprintf(tcpSupportedStorage, sizeof(tcpSupportedStorage), "%d", params.GetTcpSupported().Value()); - VerifyOrReturnError((writtenCharactersNumber > 0) && (writtenCharactersNumber <= kKeyTcpSupportMaxLength), - CHIP_ERROR_INVALID_STRING_LENGTH); - txtEntryStorage[txtEntryIdx++] = { "T", reinterpret_cast(tcpSupportedStorage), - strlen(tcpSupportedStorage) }; - } - return CHIP_NO_ERROR; + return PublishService(serviceType, textEntries, textEntrySize, subTypes, subTypeSize, params.GetPort(), params.GetMac(), + DnssdServiceProtocol::kDnssdProtocolTcp, params.GetPeerId()); } -CHIP_ERROR DiscoveryImplPlatform::Advertise(const CommissionAdvertisingParameters & params) +CHIP_ERROR DiscoveryImplPlatform::PublishService(const char * serviceType, TextEntry * textEntries, size_t textEntrySize, + const char ** subTypes, size_t subTypeSize, + const CommissionAdvertisingParameters & params) { - CHIP_ERROR error = CHIP_NO_ERROR; - DnssdService service; - // add newline to lengths for TXT entries - char discriminatorBuf[kKeyDiscriminatorMaxLength + 1]; - char vendorProductBuf[kKeyVendorProductMaxLength + 1]; - char commissioningModeBuf[kKeyCommissioningModeMaxLength + 1]; - char deviceTypeBuf[kKeyDeviceTypeMaxLength + 1]; - char deviceNameBuf[kKeyDeviceNameMaxLength + 1]; - char rotatingIdBuf[kKeyRotatingIdMaxLength + 1]; - char pairingHintBuf[kKeyPairingHintMaxLength + 1]; - char pairingInstrBuf[kKeyPairingInstructionMaxLength + 1]; - char mrpRetryIntervalIdleBuf[kTxtRetryIntervalIdleMaxLength + 1]; - char mrpRetryIntervalActiveBuf[kTxtRetryIntervalActiveMaxLength + 1]; - char tcpSupportedBuf[kKeyTcpSupportMaxLength + 1]; - // size of textEntries array should be count of Bufs above - TextEntry textEntries[CommissionAdvertisingParameters::kTxtMaxNumber]; - size_t textEntrySize = 0; - // add null-character to the subtypes - char shortDiscriminatorSubtype[kSubTypeShortDiscriminatorMaxLength + 1]; - char longDiscriminatorSubtype[kSubTypeLongDiscriminatorMaxLength + 1]; - char vendorSubType[kSubTypeVendorMaxLength + 1]; - char commissioningModeSubType[kSubTypeCommissioningModeMaxLength + 1]; - char deviceTypeSubType[kSubTypeDeviceTypeMaxLength + 1]; - // size of subTypes array should be count of SubTypes above - const char * subTypes[Commissionable::kSubTypeMaxNumber]; - size_t subTypeSize = 0; - - if (!mDnssdInitialized) - { - return CHIP_ERROR_INCORRECT_STATE; - } + return PublishService(serviceType, textEntries, textEntrySize, subTypes, subTypeSize, params.GetPort(), params.GetMac(), + DnssdServiceProtocol::kDnssdProtocolUdp, PeerId()); +} - error = MakeHostName(service.mHostName, sizeof(service.mHostName), params.GetMac()); - if (error != CHIP_NO_ERROR) - { - ChipLogError(Discovery, "Failed to create dnssd hostname: %s", ErrorStr(error)); - return error; - } +CHIP_ERROR DiscoveryImplPlatform::PublishService(const char * serviceType, TextEntry * textEntries, size_t textEntrySize, + const char ** subTypes, size_t subTypeSize, uint16_t port, + const chip::ByteSpan & mac, DnssdServiceProtocol protocol, PeerId peerId) +{ + ReturnErrorCodeIf(mDnssdInitialized == false, CHIP_ERROR_INCORRECT_STATE); - ReturnErrorOnFailure(GetCommissionableInstanceName(service.mName, sizeof(service.mName))); + DnssdService service; + ReturnErrorOnFailure(MakeHostName(service.mHostName, sizeof(service.mHostName), mac)); + ReturnErrorOnFailure(protocol == DnssdServiceProtocol::kDnssdProtocolTcp + ? MakeInstanceName(service.mName, sizeof(service.mName), peerId) + : GetCommissionableInstanceName(service.mName, sizeof(service.mName))); + strncpy(service.mType, serviceType, sizeof(service.mType)); + service.mAddressType = Inet::IPAddressType::kAny; + service.mInterface = Inet::InterfaceId::Null(); + service.mProtocol = protocol; + service.mPort = port; + service.mTextEntries = textEntries; + service.mTextEntrySize = textEntrySize; + service.mSubTypes = subTypes; + service.mSubTypeSize = subTypeSize; - if (params.GetCommissionAdvertiseMode() == CommssionAdvertiseMode::kCommissionableNode) - { - strncpy(service.mType, kCommissionableServiceName, sizeof(service.mType)); - } - else - { - strncpy(service.mType, kCommissionerServiceName, sizeof(service.mType)); - } - service.mProtocol = DnssdServiceProtocol::kDnssdProtocolUdp; + ReturnErrorOnFailure(ChipDnssdPublishService(&service)); - if (params.GetVendorId().HasValue()) - { - if (params.GetProductId().HasValue()) - { - snprintf(vendorProductBuf, sizeof(vendorProductBuf), "%u+%u", params.GetVendorId().Value(), - params.GetProductId().Value()); - } - else - { - snprintf(vendorProductBuf, sizeof(vendorProductBuf), "%u", params.GetVendorId().Value()); - } - textEntries[textEntrySize++] = { "VP", reinterpret_cast(vendorProductBuf), - strnlen(vendorProductBuf, sizeof(vendorProductBuf)) }; - } +#ifdef DETAIL_LOGGING + printf("printEntries port=%u, mTextEntrySize=%zu, mSubTypeSize=%zu\n", port, textEntrySize, subTypeSize); - if (params.GetDeviceType().HasValue()) + for (size_t i = 0; i < textEntrySize; i++) { - snprintf(deviceTypeBuf, sizeof(deviceTypeBuf), "%u", params.GetDeviceType().Value()); - textEntries[textEntrySize++] = { "DT", reinterpret_cast(deviceTypeBuf), - strnlen(deviceTypeBuf, sizeof(deviceTypeBuf)) }; + printf(" entry [%zu] : %s %s\n", i, textEntries[i].mKey, (char *) (textEntries[i].mData)); } - if (params.GetDeviceName().HasValue()) + for (size_t i = 0; i < subTypeSize; i++) { - snprintf(deviceNameBuf, sizeof(deviceNameBuf), "%s", params.GetDeviceName().Value()); - textEntries[textEntrySize++] = { "DN", reinterpret_cast(deviceNameBuf), - strnlen(deviceNameBuf, sizeof(deviceNameBuf)) }; + printf(" type [%zu] : %s\n", i, subTypes[i]); } - AddCommonTxtElements(params, mrpRetryIntervalIdleBuf, mrpRetryIntervalActiveBuf, - tcpSupportedBuf, textEntries, textEntrySize); - - // Following fields are for nodes and not for commissioners - if (params.GetCommissionAdvertiseMode() == CommssionAdvertiseMode::kCommissionableNode) - { - snprintf(discriminatorBuf, sizeof(discriminatorBuf), "%u", params.GetLongDiscriminator()); - textEntries[textEntrySize++] = { "D", reinterpret_cast(discriminatorBuf), - strnlen(discriminatorBuf, sizeof(discriminatorBuf)) }; - - snprintf(commissioningModeBuf, sizeof(commissioningModeBuf), "%u", static_cast(params.GetCommissioningMode())); - textEntries[textEntrySize++] = { "CM", reinterpret_cast(commissioningModeBuf), - strnlen(commissioningModeBuf, sizeof(commissioningModeBuf)) }; +#endif - if (params.GetRotatingId().HasValue()) - { - snprintf(rotatingIdBuf, sizeof(rotatingIdBuf), "%s", params.GetRotatingId().Value()); - textEntries[textEntrySize++] = { "RI", reinterpret_cast(rotatingIdBuf), - strnlen(rotatingIdBuf, sizeof(rotatingIdBuf)) }; - } + return CHIP_NO_ERROR; +} - if (params.GetPairingHint().HasValue()) - { - snprintf(pairingHintBuf, sizeof(pairingHintBuf), "%u", params.GetPairingHint().Value()); - textEntries[textEntrySize++] = { "PH", reinterpret_cast(pairingHintBuf), - strnlen(pairingHintBuf, sizeof(pairingHintBuf)) }; - } +#define PREPARE_RECORDS(Type) \ + TextEntry textEntries[Type##AdvertisingParameters::kTxtMaxNumber]; \ + size_t textEntrySize = 0; \ + const char * subTypes[Type::kSubTypeMaxNumber]; \ + size_t subTypeSize = 0; - if (params.GetPairingInstr().HasValue()) - { - snprintf(pairingInstrBuf, sizeof(pairingInstrBuf), "%s", params.GetPairingInstr().Value()); - textEntries[textEntrySize++] = { "PI", reinterpret_cast(pairingInstrBuf), - strnlen(pairingInstrBuf, sizeof(pairingInstrBuf)) }; - } +#define ADD_TXT_RECORD(Name) \ + char Name##Buf[kKey##Name##MaxLength + 1]; \ + ReturnErrorOnFailure(AddTxtRecord(TxtFieldKey::k##Name, textEntries, textEntrySize, Name##Buf, sizeof(Name##Buf), params)); - if (MakeServiceSubtype(shortDiscriminatorSubtype, sizeof(shortDiscriminatorSubtype), - DiscoveryFilter(DiscoveryFilterType::kShort, params.GetShortDiscriminator())) == CHIP_NO_ERROR) - { - subTypes[subTypeSize++] = shortDiscriminatorSubtype; - } - if (MakeServiceSubtype(longDiscriminatorSubtype, sizeof(longDiscriminatorSubtype), - DiscoveryFilter(DiscoveryFilterType::kLong, params.GetLongDiscriminator())) == CHIP_NO_ERROR) - { - subTypes[subTypeSize++] = longDiscriminatorSubtype; - } - if ((params.GetCommissioningMode() != CommissioningMode::kDisabled) && - (MakeServiceSubtype(commissioningModeSubType, sizeof(commissioningModeSubType), - DiscoveryFilter(DiscoveryFilterType::kCommissioningMode)) == CHIP_NO_ERROR)) - { - subTypes[subTypeSize++] = commissioningModeSubType; - } - } +#define ADD_PTR_RECORD(Name) \ + char Name##SubTypeBuf[kSubType##Name##MaxLength + 1]; \ + ReturnErrorOnFailure(AddPtrRecord(DiscoveryFilterType::k##Name, subTypes, subTypeSize, Name##SubTypeBuf, \ + sizeof(Name##SubTypeBuf), params.Get##Name())); - if (params.GetVendorId().HasValue()) - { - if (MakeServiceSubtype(vendorSubType, sizeof(vendorSubType), - DiscoveryFilter(DiscoveryFilterType::kVendor, params.GetVendorId().Value())) == CHIP_NO_ERROR) - { - subTypes[subTypeSize++] = vendorSubType; - } - } - if (params.GetDeviceType().HasValue()) - { - if (MakeServiceSubtype(deviceTypeSubType, sizeof(deviceTypeSubType), - DiscoveryFilter(DiscoveryFilterType::kDeviceType, params.GetDeviceType().Value())) == CHIP_NO_ERROR) - { - subTypes[subTypeSize++] = deviceTypeSubType; - } - } - - service.mTextEntries = textEntries; - service.mTextEntrySize = textEntrySize; - service.mPort = params.GetPort(); - service.mInterface = Inet::InterfaceId::Null(); - service.mSubTypes = subTypes; - service.mSubTypeSize = subTypeSize; - service.mAddressType = Inet::IPAddressType::kAny; - error = ChipDnssdPublishService(&service); +#define PUBLISH_RECORDS(Type) \ + ReturnErrorOnFailure(PublishService(k##Type##ServiceName, textEntries, textEntrySize, subTypes, subTypeSize, params)); \ + m##Type##NodeAdvertisingParams = params; \ + mIs##Type##NodePublishing = true; \ + return CHIP_NO_ERROR; - if (error == CHIP_NO_ERROR) - { - if (params.GetCommissionAdvertiseMode() == CommssionAdvertiseMode::kCommissionableNode) - { - mCommissionableNodeAdvertisingParams = params; - mIsCommissionableNodePublishing = true; - } - else - { - mCommissionerAdvertisingParams = params; - mIsCommissionerPublishing = true; - } - } +CHIP_ERROR DiscoveryImplPlatform::Advertise(const OperationalAdvertisingParameters & params) +{ + PREPARE_RECORDS(Operational); -#ifdef DETAIL_LOGGING - PrintEntries(&service); -#endif - return error; -} + ADD_TXT_RECORD(MrpRetryIntervalIdle); + ADD_TXT_RECORD(MrpRetryIntervalActive); + ADD_TXT_RECORD(TcpSupported); -#ifdef DETAIL_LOGGING -void DiscoveryImplPlatform::PrintEntries(const DnssdService * service) -{ - printf("printEntries port=%d, mTextEntrySize=%d, mSubTypeSize=%d\n", (int) (service->mPort), (int) (service->mTextEntrySize), - (int) (service->mSubTypeSize)); - for (int i = 0; i < (int) service->mTextEntrySize; i++) - { - printf(" entry [%d] : %s %s\n", i, service->mTextEntries[i].mKey, (char *) (service->mTextEntries[i].mData)); - } + ADD_PTR_RECORD(CompressedFabricId); - for (int i = 0; i < (int) service->mSubTypeSize; i++) - { - printf(" type [%d] : %s\n", i, service->mSubTypes[i]); - } + PUBLISH_RECORDS(Operational); } -#endif -CHIP_ERROR DiscoveryImplPlatform::Advertise(const OperationalAdvertisingParameters & params) +CHIP_ERROR DiscoveryImplPlatform::Advertise(const CommissionAdvertisingParameters & params) { - DnssdService service; - CHIP_ERROR error = CHIP_NO_ERROR; - - char compressedFabricIdSub[kSubTypeCompressedFabricIdMaxLength + 1]; - const char * subTypes[Operational::kSubTypeMaxNumber]; - size_t subTypeSize = 0; + PREPARE_RECORDS(Commission); - mOperationalAdvertisingParams = params; - // TODO: There may be multilple device/fabric ids after multi-admin. + ADD_TXT_RECORD(VendorProduct); + ADD_TXT_RECORD(DeviceType); + ADD_TXT_RECORD(DeviceName); + ADD_TXT_RECORD(MrpRetryIntervalIdle); + ADD_TXT_RECORD(MrpRetryIntervalActive); + ADD_TXT_RECORD(TcpSupported); - char mrpRetryIntervalIdleBuf[kTxtRetryIntervalIdleMaxLength + 1]; - char mrpRetryIntervalActiveBuf[kTxtRetryIntervalActiveMaxLength + 1]; - char tcpSupportedBuf[kKeyTcpSupportMaxLength + 1]; - TextEntry txtEntries[OperationalAdvertisingParameters::kTxtMaxNumber]; - size_t textEntrySize = 0; + ADD_PTR_RECORD(VendorId); + ADD_PTR_RECORD(DeviceType); - ReturnLogErrorOnFailure(AddCommonTxtElements(params, mrpRetryIntervalIdleBuf, mrpRetryIntervalActiveBuf, tcpSupportedBuf, - txtEntries, textEntrySize)); - - if (MakeServiceSubtype(compressedFabricIdSub, sizeof(compressedFabricIdSub), - DiscoveryFilter(DiscoveryFilterType::kCompressedFabricId, params.GetPeerId().GetCompressedFabricId())) == - CHIP_NO_ERROR) + if (params.GetCommissionAdvertiseMode() == CommssionAdvertiseMode::kCommissioner) { - subTypes[subTypeSize++] = compressedFabricIdSub; + PUBLISH_RECORDS(Commissioner); } - error = MakeHostName(service.mHostName, sizeof(service.mHostName), params.GetMac()); - if (error != CHIP_NO_ERROR) + else { - ChipLogError(Discovery, "Failed to create dnssd hostname: %s", ErrorStr(error)); - return error; - } - ReturnErrorOnFailure(MakeInstanceName(service.mName, sizeof(service.mName), params.GetPeerId())); - strncpy(service.mType, kOperationalServiceName, sizeof(service.mType)); - service.mProtocol = DnssdServiceProtocol::kDnssdProtocolTcp; - service.mPort = params.GetPort(); - service.mTextEntries = txtEntries; - service.mTextEntrySize = textEntrySize; - service.mInterface = Inet::InterfaceId::Null(); - service.mAddressType = Inet::IPAddressType::kAny; - service.mSubTypes = subTypes; - service.mSubTypeSize = subTypeSize; - error = ChipDnssdPublishService(&service); + ADD_TXT_RECORD(LongDiscriminator); + ADD_TXT_RECORD(CommissioningMode); + ADD_TXT_RECORD(RotatingDeviceId); + ADD_TXT_RECORD(PairingHint); + ADD_TXT_RECORD(PairingInstruction); - if (error == CHIP_NO_ERROR) - { - mIsOperationalPublishing = true; - } + ADD_PTR_RECORD(ShortDiscriminator); + ADD_PTR_RECORD(LongDiscriminator); + ADD_PTR_RECORD(CommissioningMode); - return error; + PUBLISH_RECORDS(Commissionable); + } } CHIP_ERROR DiscoveryImplPlatform::RemoveServices() { ReturnErrorOnFailure(ChipDnssdRemoveServices()); - mIsOperationalPublishing = false; + mIsOperationalNodePublishing = false; mIsCommissionableNodePublishing = false; - mIsCommissionerPublishing = false; + mIsCommissionerNodePublishing = false; return CHIP_NO_ERROR; } diff --git a/src/lib/dnssd/Discovery_ImplPlatform.h b/src/lib/dnssd/Discovery_ImplPlatform.h index a914b537fe5297..2aa8246c6e5251 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.h +++ b/src/lib/dnssd/Discovery_ImplPlatform.h @@ -69,16 +69,20 @@ class DiscoveryImplPlatform : public ServiceAdvertiser, public Resolver static void HandleDnssdInit(void * context, CHIP_ERROR initError); static void HandleDnssdError(void * context, CHIP_ERROR initError); static CHIP_ERROR GenerateRotatingDeviceId(char rotatingDeviceIdHexBuffer[], size_t & rotatingDeviceIdHexBufferSize); -#ifdef DETAIL_LOGGING - static void PrintEntries(const DnssdService * service); -#endif - - OperationalAdvertisingParameters mOperationalAdvertisingParams; + CHIP_ERROR PublishService(const char * serviceType, TextEntry * textEntries, size_t textEntrySize, const char ** subTypes, + size_t subTypeSize, const OperationalAdvertisingParameters & params); + CHIP_ERROR PublishService(const char * serviceType, TextEntry * textEntries, size_t textEntrySize, const char ** subTypes, + size_t subTypeSize, const CommissionAdvertisingParameters & params); + CHIP_ERROR PublishService(const char * serviceType, TextEntry * textEntries, size_t textEntrySize, const char ** subTypes, + size_t subTypeSize, uint16_t port, const chip::ByteSpan & mac, DnssdServiceProtocol procotol, + PeerId peerId); + + OperationalAdvertisingParameters mOperationalNodeAdvertisingParams; CommissionAdvertisingParameters mCommissionableNodeAdvertisingParams; - CommissionAdvertisingParameters mCommissionerAdvertisingParams; - bool mIsOperationalPublishing = false; + CommissionAdvertisingParameters mCommissionerNodeAdvertisingParams; + bool mIsOperationalNodePublishing = false; bool mIsCommissionableNodePublishing = false; - bool mIsCommissionerPublishing = false; + bool mIsCommissionerNodePublishing = false; uint8_t mCommissionableInstanceName[sizeof(uint64_t)]; bool mDnssdInitialized = false; diff --git a/src/lib/dnssd/Resolver.h b/src/lib/dnssd/Resolver.h index 81161bf0b17b74..86020e551b0264 100644 --- a/src/lib/dnssd/Resolver.h +++ b/src/lib/dnssd/Resolver.h @@ -96,7 +96,7 @@ struct DiscoveredNodeData // TODO(cecille): is 4 OK? IPv6 LL, GUA, ULA, IPv4? static constexpr int kMaxIPAddresses = 5; char hostName[kHostNameMaxLength + 1]; - char instanceName[Commissionable::kInstanceNameMaxLength + 1]; + char instanceName[Commission::kInstanceNameMaxLength + 1]; uint16_t longDiscriminator; uint16_t vendorId; uint16_t productId; @@ -163,14 +163,12 @@ struct DiscoveredNodeData void LogDetail() const { -#if CHIP_ENABLE_ROTATING_DEVICE_ID if (rotatingIdLen > 0) { char rotatingIdString[chip::Dnssd::kMaxRotatingIdLen * 2 + 1] = ""; Encoding::BytesToUppercaseHexString(rotatingId, rotatingIdLen, rotatingIdString, sizeof(rotatingIdString)); - ChipLogDetail(Discovery, "Rotating ID: %s", rotatingIdString); + ChipLogDetail(Discovery, "\tRotating ID: %s", rotatingIdString); } -#endif // CHIP_ENABLE_ROTATING_DEVICE_ID if (strlen(deviceName) != 0) { ChipLogDetail(Discovery, "\tDevice Name: %s", deviceName); @@ -227,9 +225,9 @@ struct DiscoveredNodeData enum class DiscoveryFilterType : uint8_t { kNone, - kShort, - kLong, - kVendor, + kShortDiscriminator, + kLongDiscriminator, + kVendorId, kDeviceType, kCommissioningMode, kInstanceName, diff --git a/src/lib/dnssd/ResolverProxy.h b/src/lib/dnssd/ResolverProxy.h index e7ce4fa10c408f..43c7184218559e 100644 --- a/src/lib/dnssd/ResolverProxy.h +++ b/src/lib/dnssd/ResolverProxy.h @@ -68,7 +68,7 @@ class ResolverProxy : public Resolver ReturnErrorOnFailure(chip::Dnssd::Resolver::Instance().Init(udpEndPoint)); VerifyOrReturnError(mDelegate == nullptr, CHIP_ERROR_INCORRECT_STATE); mDelegate = chip::Platform::New(); - return CHIP_NO_ERROR; + return mDelegate != nullptr ? CHIP_NO_ERROR : CHIP_ERROR_NO_MEMORY; } void SetResolverDelegate(ResolverDelegate * delegate) override diff --git a/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp b/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp index 3def05103ffeee..75fcc2720fc23f 100644 --- a/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp +++ b/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp @@ -599,7 +599,7 @@ Resolver & chip::Dnssd::Resolver::Instance() } // Minimal implementation does not support associating a context to a request (while platforms implementations do). So keep -// updating the delegate that ends up beeing used by the server by calling 'SetResolverDelegate'. +// updating the delegate that ends up being used by the server by calling 'SetResolverDelegate'. // This effectively allow minimal to have multiple controllers issuing requests as long the requests are serialized, but // it won't work well if requests are issued in parallel. CHIP_ERROR ResolverProxy::ResolveNodeId(const PeerId & peerId, Inet::IPAddressType type, Resolver::CacheBypass dnssdCacheBypass) diff --git a/src/lib/dnssd/ServiceNaming.cpp b/src/lib/dnssd/ServiceNaming.cpp index 11aa46c0aa0d35..f0c43e77e6c487 100644 --- a/src/lib/dnssd/ServiceNaming.cpp +++ b/src/lib/dnssd/ServiceNaming.cpp @@ -97,7 +97,7 @@ CHIP_ERROR MakeServiceSubtype(char * buffer, size_t bufferLen, DiscoveryFilter s size_t requiredSize; switch (subtype.type) { - case DiscoveryFilterType::kShort: + case DiscoveryFilterType::kShortDiscriminator: // 4-bit number if (subtype.code >= 1 << 4) { @@ -105,7 +105,7 @@ CHIP_ERROR MakeServiceSubtype(char * buffer, size_t bufferLen, DiscoveryFilter s } requiredSize = snprintf(buffer, bufferLen, "_S%" PRIu16, static_cast(subtype.code)); break; - case DiscoveryFilterType::kLong: + case DiscoveryFilterType::kLongDiscriminator: // 12-bit number if (subtype.code >= 1 << 12) { @@ -113,7 +113,7 @@ CHIP_ERROR MakeServiceSubtype(char * buffer, size_t bufferLen, DiscoveryFilter s } requiredSize = snprintf(buffer, bufferLen, "_L%" PRIu16, static_cast(subtype.code)); break; - case DiscoveryFilterType::kVendor: + case DiscoveryFilterType::kVendorId: if (subtype.code >= 1 << 16) { return CHIP_ERROR_INVALID_ARGUMENT; diff --git a/src/lib/dnssd/TxtFields.cpp b/src/lib/dnssd/TxtFields.cpp index 0e13ff92ab606b..6c8087c4361899 100644 --- a/src/lib/dnssd/TxtFields.cpp +++ b/src/lib/dnssd/TxtFields.cpp @@ -232,7 +232,7 @@ void FillNodeDataFromTxt(const ByteSpan & key, const ByteSpan & val, DiscoveredN case TxtFieldKey::kMrpRetryIntervalActive: nodeData.mrpRetryIntervalActive = Internal::GetRetryInterval(val); break; - case TxtFieldKey::kTcpSupport: + case TxtFieldKey::kTcpSupported: nodeData.supportsTcp = Internal::MakeBoolFromAsciiDecimal(val); break; default: @@ -250,7 +250,7 @@ void FillNodeDataFromTxt(const ByteSpan & key, const ByteSpan & value, ResolvedN case TxtFieldKey::kMrpRetryIntervalActive: nodeData.mMrpRetryIntervalActive = Internal::GetRetryInterval(value); break; - case TxtFieldKey::kTcpSupport: + case TxtFieldKey::kTcpSupported: nodeData.mSupportsTcp = Internal::MakeBoolFromAsciiDecimal(value); break; default: diff --git a/src/lib/dnssd/TxtFields.h b/src/lib/dnssd/TxtFields.h index 18accfcfff0dce..14d4e41622961c 100644 --- a/src/lib/dnssd/TxtFields.h +++ b/src/lib/dnssd/TxtFields.h @@ -31,19 +31,19 @@ namespace Dnssd { using namespace System::Clock::Literals; // Operational node TXT entries -static constexpr size_t kTxtRetryIntervalIdleMaxLength = 7; // [CRI] 0-3600000 -static constexpr size_t kTxtRetryIntervalActiveMaxLength = 7; // [CRA] 0-3600000 +static constexpr size_t kKeyMrpRetryIntervalIdleMaxLength = 7; // [CRI] 0-3600000 +static constexpr size_t kKeyMrpRetryIntervalActiveMaxLength = 7; // [CRA] 0-3600000 static constexpr System::Clock::Milliseconds32 kMaxRetryInterval = 3600000_ms32; -static constexpr size_t kKeyTcpSupportMaxLength = 1; +static constexpr size_t kKeyTcpSupportedMaxLength = 1; // Commissionable/commissioner node TXT entries -static constexpr size_t kKeyDiscriminatorMaxLength = 5; +static constexpr size_t kKeyLongDiscriminatorMaxLength = 5; static constexpr size_t kKeyVendorProductMaxLength = 11; static constexpr size_t kKeyAdditionalCommissioningMaxLength = 1; static constexpr size_t kKeyCommissioningModeMaxLength = 1; static constexpr size_t kKeyDeviceTypeMaxLength = 5; static constexpr size_t kKeyDeviceNameMaxLength = 32; -static constexpr size_t kKeyRotatingIdMaxLength = 100; +static constexpr size_t kKeyRotatingDeviceIdMaxLength = 100; static constexpr size_t kKeyPairingInstructionMaxLength = 128; static constexpr size_t kKeyPairingHintMaxLength = 10; @@ -68,7 +68,7 @@ enum class TxtFieldKey : uint8_t kPairingHint, kMrpRetryIntervalIdle, kMrpRetryIntervalActive, - kTcpSupport, + kTcpSupported, kCount, }; @@ -83,18 +83,18 @@ struct TxtFieldInfo constexpr const TxtFieldInfo txtFieldInfo[static_cast(TxtFieldKey::kCount)] = { { TxtFieldKey::kUnknown, 0, "", TxtKeyUse::kNone }, - { TxtFieldKey::kLongDiscriminator, kKeyDiscriminatorMaxLength, "D", TxtKeyUse::kCommission }, + { TxtFieldKey::kLongDiscriminator, kKeyLongDiscriminatorMaxLength, "D", TxtKeyUse::kCommission }, { TxtFieldKey::kVendorProduct, kKeyVendorProductMaxLength, "VP", TxtKeyUse::kCommission }, { TxtFieldKey::kAdditionalPairing, kKeyAdditionalCommissioningMaxLength, "AP", TxtKeyUse::kCommission }, { TxtFieldKey::kCommissioningMode, kKeyCommissioningModeMaxLength, "CM", TxtKeyUse::kCommission }, { TxtFieldKey::kDeviceType, kKeyDeviceTypeMaxLength, "DT", TxtKeyUse::kCommission }, { TxtFieldKey::kDeviceName, kKeyDeviceNameMaxLength, "DN", TxtKeyUse::kCommission }, - { TxtFieldKey::kRotatingDeviceId, kKeyRotatingIdMaxLength, "RI", TxtKeyUse::kCommission }, + { TxtFieldKey::kRotatingDeviceId, kKeyRotatingDeviceIdMaxLength, "RI", TxtKeyUse::kCommission }, { TxtFieldKey::kPairingInstruction, kKeyPairingInstructionMaxLength, "PI", TxtKeyUse::kCommission }, { TxtFieldKey::kPairingHint, kKeyPairingHintMaxLength, "PH", TxtKeyUse::kCommission }, - { TxtFieldKey::kMrpRetryIntervalIdle, kTxtRetryIntervalIdleMaxLength, "CRI", TxtKeyUse::kCommon }, - { TxtFieldKey::kMrpRetryIntervalActive, kTxtRetryIntervalActiveMaxLength, "CRA", TxtKeyUse::kCommon }, - { TxtFieldKey::kTcpSupport, kKeyTcpSupportMaxLength, "T", TxtKeyUse::kCommon }, + { TxtFieldKey::kMrpRetryIntervalIdle, kKeyMrpRetryIntervalIdleMaxLength, "CRI", TxtKeyUse::kCommon }, + { TxtFieldKey::kMrpRetryIntervalActive, kKeyMrpRetryIntervalActiveMaxLength, "CRA", TxtKeyUse::kCommon }, + { TxtFieldKey::kTcpSupported, kKeyTcpSupportedMaxLength, "T", TxtKeyUse::kCommon }, }; #ifdef CHIP_CONFIG_TEST @@ -123,7 +123,7 @@ constexpr size_t MaxKeyLen(TxtKeyUse use) max = sizeof(info.keyStr) > max ? sizeof(info.keyStr) : max; } } - // minus 1 becuase sizeof includes the null terminator. + // minus 1 because sizeof includes the null terminator. return max - 1; } constexpr size_t TotalKeyLen(TxtKeyUse use) @@ -149,7 +149,7 @@ constexpr size_t MaxValueLen(TxtKeyUse use) max = info.valMaxSize > max ? info.valMaxSize : max; } } - // minus 1 becuase sizeof includes the null terminator. + // minus 1 because sizeof includes the null terminator. return max - 1; } constexpr size_t TotalValueLen(TxtKeyUse use) diff --git a/src/lib/dnssd/minimal_mdns/Parser.h b/src/lib/dnssd/minimal_mdns/Parser.h index 1b2b208c7dcc89..8150f0770925a9 100644 --- a/src/lib/dnssd/minimal_mdns/Parser.h +++ b/src/lib/dnssd/minimal_mdns/Parser.h @@ -116,7 +116,7 @@ class ParserDelegate /// /// Calls appropriate delegate callbacks while parsing /// -/// returns true if packet was succesfully parsed, false otherwise +/// returns true if packet was successfully parsed, false otherwise bool ParsePacket(const BytesRange & packetData, ParserDelegate * delegate); } // namespace Minimal diff --git a/src/lib/dnssd/minimal_mdns/ResponseSender.cpp b/src/lib/dnssd/minimal_mdns/ResponseSender.cpp index 2a7378e294889e..0209ff8ca926c1 100644 --- a/src/lib/dnssd/minimal_mdns/ResponseSender.cpp +++ b/src/lib/dnssd/minimal_mdns/ResponseSender.cpp @@ -228,7 +228,7 @@ void ResponseSender::AddResponse(const ResourceRecord & record) mResponseBuilder.AddRecord(mSendState.GetResourceType(), record); if (!mResponseBuilder.Ok()) { - // Very much unexpected: single record addtion should fit (our records should not be that big). + // Very much unexpected: single record addition should fit (our records should not be that big). ChipLogError(Discovery, "Failed to add single record to mDNS response."); mSendState.SetError(CHIP_ERROR_INTERNAL); } diff --git a/src/lib/dnssd/minimal_mdns/Server.cpp b/src/lib/dnssd/minimal_mdns/Server.cpp index 5cd0dd7db59a47..b58c60cb3e463f 100644 --- a/src/lib/dnssd/minimal_mdns/Server.cpp +++ b/src/lib/dnssd/minimal_mdns/Server.cpp @@ -243,6 +243,8 @@ CHIP_ERROR ServerBase::Listen(chip::Inet::EndPointManager -class Server : private chip::PoolImpl, +class Server : private chip::PoolImpl, public ServerBase { public: diff --git a/src/lib/dnssd/minimal_mdns/responders/IP.cpp b/src/lib/dnssd/minimal_mdns/responders/IP.cpp index 8d354b2a164ff0..c235c8f57d3ed9 100644 --- a/src/lib/dnssd/minimal_mdns/responders/IP.cpp +++ b/src/lib/dnssd/minimal_mdns/responders/IP.cpp @@ -23,19 +23,13 @@ namespace Minimal { void IPv4Responder::AddAllResponses(const chip::Inet::IPPacketInfo * source, ResponderDelegate * delegate) { + chip::Inet::IPAddress addr; for (chip::Inet::InterfaceAddressIterator it; it.HasCurrent(); it.Next()) { - if (it.GetInterfaceId() != source->Interface) - { - continue; - } - - chip::Inet::IPAddress addr = it.GetAddress(); - if (!addr.IsIPv4()) + if ((it.GetInterfaceId() == source->Interface) && (it.GetAddress(addr) == CHIP_NO_ERROR) && addr.IsIPv4()) { - continue; + delegate->AddResponse(IPResourceRecord(GetQName(), addr)); } - delegate->AddResponse(IPResourceRecord(GetQName(), addr)); } } @@ -48,13 +42,11 @@ void IPv6Responder::AddAllResponses(const chip::Inet::IPPacketInfo * source, Res continue; } - chip::Inet::IPAddress addr = it.GetAddress(); - if (!addr.IsIPv6()) + chip::Inet::IPAddress addr; + if ((it.GetInterfaceId() == source->Interface) && (it.GetAddress(addr) == CHIP_NO_ERROR) && addr.IsIPv6()) { - continue; + delegate->AddResponse(IPResourceRecord(GetQName(), addr)); } - - delegate->AddResponse(IPResourceRecord(GetQName(), addr)); } } diff --git a/src/lib/dnssd/minimal_mdns/responders/QueryResponder.cpp b/src/lib/dnssd/minimal_mdns/responders/QueryResponder.cpp index 904e664528c896..5f14659dac50db 100644 --- a/src/lib/dnssd/minimal_mdns/responders/QueryResponder.cpp +++ b/src/lib/dnssd/minimal_mdns/responders/QueryResponder.cpp @@ -45,7 +45,7 @@ void QueryResponderBase::Init() if (mResponderInfoSize < 2) { - // Nothing usefull really + // Nothing useful really ChipLogError(Discovery, "Query responder storage size too small"); } } diff --git a/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h b/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h index 6af8a16227fa4f..3e468f3e6238a3 100644 --- a/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h +++ b/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h @@ -71,7 +71,8 @@ void MakePrintableName(char (&location)[N], FullQName name) } // namespace -class CheckOnlyServer : private chip::PoolImpl, +class CheckOnlyServer : private chip::PoolImpl, public ServerBase, public ParserDelegate, public TxtRecordDelegate diff --git a/src/lib/dnssd/minimal_mdns/tests/TestAdvertiser.cpp b/src/lib/dnssd/minimal_mdns/tests/TestAdvertiser.cpp index e9bc9fd1ea4661..12691431b98208 100644 --- a/src/lib/dnssd/minimal_mdns/tests/TestAdvertiser.cpp +++ b/src/lib/dnssd/minimal_mdns/tests/TestAdvertiser.cpp @@ -154,9 +154,9 @@ CommissionAdvertisingParameters commissionableNodeParamsLargeBasic = .SetCommissioningMode(CommissioningMode::kEnabledBasic) .SetDeviceName(chip::Optional("testy-test")) .SetPairingHint(chip::Optional(3)) - .SetPairingInstr(chip::Optional("Pair me")) + .SetPairingInstruction(chip::Optional("Pair me")) .SetProductId(chip::Optional(897)) - .SetRotatingId(chip::Optional("id_that_spins")); + .SetRotatingDeviceId(chip::Optional("id_that_spins")); QNamePart txtCommissionableNodeParamsLargeBasicParts[] = { "D=22", "VP=555+897", "CM=1", "DT=25", "DN=testy-test", "RI=id_that_spins", "PI=Pair me", "PH=3" }; FullQName txtCommissionableNodeParamsLargeBasicName = FullQName(txtCommissionableNodeParamsLargeBasicParts); @@ -174,9 +174,9 @@ CommissionAdvertisingParameters commissionableNodeParamsLargeEnhanced = .SetCommissioningMode(CommissioningMode::kEnabledEnhanced) .SetDeviceName(chip::Optional("testy-test")) .SetPairingHint(chip::Optional(3)) - .SetPairingInstr(chip::Optional("Pair me")) + .SetPairingInstruction(chip::Optional("Pair me")) .SetProductId(chip::Optional(897)) - .SetRotatingId(chip::Optional("id_that_spins")) + .SetRotatingDeviceId(chip::Optional("id_that_spins")) .SetTcpSupported(chip::Optional(true)) // 3600005 is more than the max so should be adjusted down .SetMRPConfig(ReliableMessageProtocolConfig(3600000_ms32, 3600005_ms32)); diff --git a/src/lib/dnssd/minimal_mdns/tests/TestResponseSender.cpp b/src/lib/dnssd/minimal_mdns/tests/TestResponseSender.cpp index 0eb40ad8e04eb6..2fdab46220a2ee 100644 --- a/src/lib/dnssd/minimal_mdns/tests/TestResponseSender.cpp +++ b/src/lib/dnssd/minimal_mdns/tests/TestResponseSender.cpp @@ -140,7 +140,7 @@ void PtrSrvTxtAnyResponseToServiceName(nlTestSuite * inSuite, void * inContext) QueryData queryData = QueryData(QType::ANY, QClass::IN, false, common.requestNameStart, common.requestBytesRange); - // We should get all because we request to report all instance names when teh PTR is sent. + // We should get all because we request to report all instance names when the PTR is sent. common.server.AddExpectedRecord(&common.ptrRecord); common.server.AddExpectedRecord(&common.srvRecord); common.server.AddExpectedRecord(&common.txtRecord); diff --git a/src/lib/dnssd/platform/tests/TestPlatform.cpp b/src/lib/dnssd/platform/tests/TestPlatform.cpp index e77c58799976b0..ef76d88b30e09a 100644 --- a/src/lib/dnssd/platform/tests/TestPlatform.cpp +++ b/src/lib/dnssd/platform/tests/TestPlatform.cpp @@ -90,9 +90,9 @@ CommissionAdvertisingParameters commissionableNodeParamsLargeBasic = .SetCommissioningMode(CommissioningMode::kEnabledBasic) .SetDeviceName(chip::Optional("testy-test")) .SetPairingHint(chip::Optional(3)) - .SetPairingInstr(chip::Optional("Pair me")) + .SetPairingInstruction(chip::Optional("Pair me")) .SetProductId(chip::Optional(897)) - .SetRotatingId(chip::Optional("id_that_spins")) + .SetRotatingDeviceId(chip::Optional("id_that_spins")) .SetTcpSupported(chip::Optional(true)) // 3600005 is over the max, so this should be adjusted by the platform .SetMRPConfig({ 3600000_ms32, 3600005_ms32 }); @@ -128,9 +128,9 @@ CommissionAdvertisingParameters commissionableNodeParamsLargeEnhanced = .SetCommissioningMode(CommissioningMode::kEnabledEnhanced) .SetDeviceName(chip::Optional("testy-test")) .SetPairingHint(chip::Optional(3)) - .SetPairingInstr(chip::Optional("Pair me")) + .SetPairingInstruction(chip::Optional("Pair me")) .SetProductId(chip::Optional(897)) - .SetRotatingId(chip::Optional("id_that_spins")); + .SetRotatingDeviceId(chip::Optional("id_that_spins")); test::ExpectedCall commissionableLargeEnhanced = test::ExpectedCall() .SetProtocol(DnssdServiceProtocol::kDnssdProtocolUdp) diff --git a/src/lib/dnssd/tests/TestDnssdCache.cpp b/src/lib/dnssd/tests/TestDnssdCache.cpp index 34759eb4d9ffe8..05334a8d5da884 100644 --- a/src/lib/dnssd/tests/TestDnssdCache.cpp +++ b/src/lib/dnssd/tests/TestDnssdCache.cpp @@ -38,14 +38,7 @@ using namespace chip; using namespace chip::Dnssd; namespace { -class FakeClock : public System::Clock::ClockImpl -{ -public: - System::Clock::Microseconds64 GetMonotonicMicroseconds64() override { return mTime; } - System::Clock::Milliseconds64 GetMonotonicMilliseconds64() override { return mTime; } - System::Clock::Milliseconds64 mTime = System::Clock::kZero; -}; -FakeClock fakeClock; +System::Clock::Internal::MockClock fakeClock; System::Clock::ClockBase * realClock; } // namespace @@ -70,7 +63,7 @@ void TestInsert(nlTestSuite * inSuite, void * inContext) Inet::IPAddress::FromString("1.0.0.1", nodeData.mAddress[nodeData.mNumIPs++]); nodeData.mInterfaceId = Inet::InterfaceId::Null(); - nodeData.mExpiryTime = fakeClock.mTime + ttl; + nodeData.mExpiryTime = fakeClock.GetMonotonicTimestamp() + ttl; peerId.SetCompressedFabricId(KNOWN_FABRIC); nodeData.mPeerId.SetCompressedFabricId(KNOWN_FABRIC); @@ -93,8 +86,8 @@ void TestInsert(nlTestSuite * inSuite, void * inContext) } tDnssdCache.DumpCache(); - fakeClock.mTime = nodeData.mExpiryTime + ttl + System::Clock::Seconds16(1); - nodeData.mExpiryTime = fakeClock.mTime + ttl; + fakeClock.SetMonotonic(nodeData.mExpiryTime + ttl + System::Clock::Seconds16(1)); + nodeData.mExpiryTime = fakeClock.GetMonotonicTimestamp() + ttl; id = 0x200; port = 3000; diff --git a/src/lib/dnssd/tests/TestServiceNaming.cpp b/src/lib/dnssd/tests/TestServiceNaming.cpp index c65b758c4418c8..bbf1989fa418de 100644 --- a/src/lib/dnssd/tests/TestServiceNaming.cpp +++ b/src/lib/dnssd/tests/TestServiceNaming.cpp @@ -104,7 +104,7 @@ void TestMakeServiceNameSubtype(nlTestSuite * inSuite, void * inContext) DiscoveryFilter filter; // Long tests - filter.type = DiscoveryFilterType::kLong; + filter.type = DiscoveryFilterType::kLongDiscriminator; filter.code = 3; NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, strcmp(buffer, "_L3") == 0); @@ -117,7 +117,7 @@ void TestMakeServiceNameSubtype(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) != CHIP_NO_ERROR); // Short tests - filter.type = DiscoveryFilterType::kShort; + filter.type = DiscoveryFilterType::kShortDiscriminator; filter.code = 3; NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, strcmp(buffer, "_S3") == 0); @@ -130,7 +130,7 @@ void TestMakeServiceNameSubtype(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) != CHIP_NO_ERROR); // Vendor tests - filter.type = DiscoveryFilterType::kVendor; + filter.type = DiscoveryFilterType::kVendorId; filter.code = 3; NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, strcmp(buffer, "_V3") == 0); @@ -147,7 +147,7 @@ void TestMakeServiceNameSubtype(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, strcmp(buffer, "_T3") == 0); // TODO: Add tests for longer device types once spec issue #3226 is closed. - // Commisioning mode tests + // Commissioning mode tests filter.type = DiscoveryFilterType::kCommissioningMode; NL_TEST_ASSERT(inSuite, MakeServiceSubtype(buffer, sizeof(buffer), filter) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, strcmp(buffer, "_CM") == 0); @@ -178,7 +178,7 @@ void TestMakeServiceTypeName(nlTestSuite * inSuite, void * inContext) DiscoveryFilter filter; // Long tests - filter.type = DiscoveryFilterType::kLong; + filter.type = DiscoveryFilterType::kLongDiscriminator; filter.code = 3; NL_TEST_ASSERT(inSuite, MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR); @@ -194,7 +194,7 @@ void TestMakeServiceTypeName(nlTestSuite * inSuite, void * inContext) MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) != CHIP_NO_ERROR); // Short tests - filter.type = DiscoveryFilterType::kShort; + filter.type = DiscoveryFilterType::kShortDiscriminator; filter.code = 3; NL_TEST_ASSERT(inSuite, MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR); @@ -210,7 +210,7 @@ void TestMakeServiceTypeName(nlTestSuite * inSuite, void * inContext) MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) != CHIP_NO_ERROR); // Vendor tests - filter.type = DiscoveryFilterType::kVendor; + filter.type = DiscoveryFilterType::kVendorId; filter.code = 3; NL_TEST_ASSERT(inSuite, MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR); @@ -232,7 +232,7 @@ void TestMakeServiceTypeName(nlTestSuite * inSuite, void * inContext) MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, strcmp(buffer, "_T3._sub._matterc") == 0); - // Commisioning mode tests + // Commissioning mode tests filter.type = DiscoveryFilterType::kCommissioningMode; NL_TEST_ASSERT(inSuite, MakeServiceTypeName(buffer, sizeof(buffer), filter, DiscoveryType::kCommissionableNode) == CHIP_NO_ERROR); diff --git a/src/lib/dnssd/tests/TestTxtFields.cpp b/src/lib/dnssd/tests/TestTxtFields.cpp index fcc5025013cb5f..91949c9f81d194 100644 --- a/src/lib/dnssd/tests/TestTxtFields.cpp +++ b/src/lib/dnssd/tests/TestTxtFields.cpp @@ -75,7 +75,7 @@ void TestGetTxtFieldKey(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, GetTxtFieldKey(GetSpan(key)) == TxtFieldKey::kMrpRetryIntervalActive); strcpy(key, "T"); - NL_TEST_ASSERT(inSuite, GetTxtFieldKey(GetSpan(key)) == TxtFieldKey::kTcpSupport); + NL_TEST_ASSERT(inSuite, GetTxtFieldKey(GetSpan(key)) == TxtFieldKey::kTcpSupported); strcpy(key, "XX"); NL_TEST_ASSERT(inSuite, GetTxtFieldKey(GetSpan(key)) == TxtFieldKey::kUnknown); diff --git a/src/lib/shell/commands/BUILD.gn b/src/lib/shell/commands/BUILD.gn index 85766987f32a3f..3ae6b5b7626650 100644 --- a/src/lib/shell/commands/BUILD.gn +++ b/src/lib/shell/commands/BUILD.gn @@ -51,19 +51,11 @@ source_set("commands") { sources += [ "Dns.cpp" ] } - if (chip_enable_ota_requestor && chip_device_platform != "none") { + if (chip_enable_ota_requestor && chip_device_platform != "none" && + chip_device_platform != "linux" && chip_device_platform != "darwin") { + #TODO: the ota commands in shell should use the interfaces in /src/app/clusters/ota-requestor sources += [ "Ota.cpp" ] configs += [ "${chip_root}/src/controller:config" ] - - if (chip_device_platform == "nrfconnect") { - sources += [ "DFUManager_nrfconnect.h" ] - } - if (chip_device_platform == "esp32") { - sources += [ - "DFUManager_esp32.h", - "OTAUpdater_esp32.h", - ] - } } if (chip_device_platform != "none") { diff --git a/src/lib/shell/commands/DFUManager_esp32.h b/src/lib/shell/commands/DFUManager_esp32.h deleted file mode 100644 index e18c4e04cfe3d2..00000000000000 --- a/src/lib/shell/commands/DFUManager_esp32.h +++ /dev/null @@ -1,147 +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. - */ - -#pragma once - -#include "OTAUpdater_esp32.h" -#include "platform/ESP32/ESP32Utils.h" -#include -#include -#include -#include -#include -#include -#include - -namespace chip { -namespace Shell { - -class DFUManager : public bdx::Initiator -{ -public: - void SetInitialExchange(Messaging::ExchangeContext * ec) { mExchangeCtx = ec; } - CHIP_ERROR ApplyUpdate(); - CHIP_ERROR DiscardUpdate(); - -private: - void HandleTransferSessionOutput(bdx::TransferSession::OutputEvent & event) override; - - uint8_t mDfuBuffer[1024]; - bool mIsTransferComplete = false; -}; - -inline CHIP_ERROR DFUManager::ApplyUpdate() -{ - return DeviceLayer::Internal::ESP32Utils::MapError(OTAUpdater::GetInstance().Apply()); -} - -inline CHIP_ERROR DFUManager::DiscardUpdate() -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} - -inline void DFUManager::HandleTransferSessionOutput(bdx::TransferSession::OutputEvent & event) -{ - using OutputEventType = bdx::TransferSession::OutputEventType; - using MessageType = bdx::MessageType; - using SendMessageFlags = Messaging::SendMessageFlags; - - CHIP_ERROR err = CHIP_NO_ERROR; - - if (event.EventType != OutputEventType::kNone) - { - ChipLogDetail(BDX, "OutputEvent type: %s", event.ToString(event.EventType)); - } - - switch (event.EventType) - { - case OutputEventType::kNone: - if (mIsTransferComplete) - { - ChipLogProgress(BDX, "Transfer complete!"); - OTAUpdater::GetInstance().End(); - mTransfer.Reset(); - mIsTransferComplete = false; - } - break; - case OutputEventType::kMsgToSend: { - Messaging::SendFlags sendFlags; - VerifyOrReturn(mExchangeCtx != nullptr, ChipLogError(BDX, "mExchangeContext is null, cannot proceed")); - sendFlags.Set(SendMessageFlags::kFromInitiator, event.msgTypeData.MessageType == to_underlying(MessageType::ReceiveInit)); - sendFlags.Set(SendMessageFlags::kExpectResponse, event.msgTypeData.MessageType != to_underlying(MessageType::BlockAckEOF)); - err = mExchangeCtx->SendMessage(event.msgTypeData.ProtocolId, event.msgTypeData.MessageType, std::move(event.MsgData), - sendFlags); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(BDX, "SendMessage() failed: %" CHIP_ERROR_FORMAT, err.Format())); - break; - } - case OutputEventType::kAcceptReceived: { - VerifyOrReturn(CHIP_NO_ERROR == mTransfer.PrepareBlockQuery(), ChipLogError(BDX, "PrepareBlockQuery failed")); - break; - } - case OutputEventType::kBlockReceived: { - ChipLogDetail(BDX, "Got block length %zu", event.blockdata.Length); - if (OTAUpdater::GetInstance().IsInProgress() == false) - { - OTAUpdater::GetInstance().Begin(); - } - // TODO: Process/skip the Matter OTA header - OTAUpdater::GetInstance().Write(reinterpret_cast(event.blockdata.Data), event.blockdata.Length); - if (event.blockdata.IsEof) - { - err = mTransfer.PrepareBlockAck(); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(BDX, "PrepareBlockAck failed: %" CHIP_ERROR_FORMAT, err.Format())); - mIsTransferComplete = true; - } - else - { - err = mTransfer.PrepareBlockQuery(); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(BDX, "PrepareBlockQuery failed: %" CHIP_ERROR_FORMAT, err.Format())); - } - break; - } - case OutputEventType::kStatusReceived: { - ChipLogError(BDX, "Got StatusReport %x", static_cast(event.statusData.statusCode)); - OTAUpdater::GetInstance().Abort(); - mTransfer.Reset(); - mExchangeCtx->Close(); - break; - } - case OutputEventType::kInternalError: { - ChipLogError(BDX, "Transfer stopped due to internal error"); - OTAUpdater::GetInstance().Abort(); - mTransfer.Reset(); - mExchangeCtx->Close(); - break; - } - case OutputEventType::kTransferTimeout: { - ChipLogError(BDX, "Transfer timed out"); - OTAUpdater::GetInstance().Abort(); - mTransfer.Reset(); - mExchangeCtx->Close(); - break; - } - case OutputEventType::kInitReceived: - case OutputEventType::kAckReceived: - case OutputEventType::kQueryReceived: - case OutputEventType::kAckEOFReceived: - default: - ChipLogError(BDX, "Unexpected BDX event type: %" PRIu16, static_cast(event.EventType)); - } -} - -} // namespace Shell -} // namespace chip diff --git a/src/lib/shell/commands/DFUManager_nrfconnect.h b/src/lib/shell/commands/DFUManager_nrfconnect.h deleted file mode 100644 index 7a1f49e90a2a71..00000000000000 --- a/src/lib/shell/commands/DFUManager_nrfconnect.h +++ /dev/null @@ -1,142 +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. - */ - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace chip { -namespace Shell { - -class DFUManager : public bdx::Initiator -{ -public: - void SetInitialExchange(Messaging::ExchangeContext * ec) { mExchangeCtx = ec; } - CHIP_ERROR ApplyUpdate(); - CHIP_ERROR DiscardUpdate(); - -private: - void HandleTransferSessionOutput(bdx::TransferSession::OutputEvent & event) override; - - uint8_t mDfuBuffer[1024]; - bool mIsTransferComplete = false; -}; - -inline CHIP_ERROR DFUManager::ApplyUpdate() -{ - return System::MapErrorZephyr(dfu_target_done(true)); -} - -inline CHIP_ERROR DFUManager::DiscardUpdate() -{ - return System::MapErrorZephyr(dfu_target_reset()); -} - -inline void DFUManager::HandleTransferSessionOutput(bdx::TransferSession::OutputEvent & event) -{ - using OutputEventType = bdx::TransferSession::OutputEventType; - using MessageType = bdx::MessageType; - using SendMessageFlags = Messaging::SendMessageFlags; - - CHIP_ERROR error = CHIP_NO_ERROR; - int status = 0; - - switch (event.EventType) - { - case OutputEventType::kNone: - if (mIsTransferComplete) - { - ChipLogProgress(BDX, "Transfer complete!"); - mTransfer.Reset(); - mIsTransferComplete = false; - } - break; - case OutputEventType::kMsgToSend: { - Messaging::SendFlags flags; - flags.Set(SendMessageFlags::kFromInitiator, event.msgTypeData.MessageType == to_underlying(MessageType::ReceiveInit)); - flags.Set(SendMessageFlags::kExpectResponse, event.msgTypeData.MessageType != to_underlying(MessageType::BlockAckEOF)); - - VerifyOrReturn(mExchangeCtx != nullptr, ChipLogError(BDX, "Exchange context is null")); - error = - mExchangeCtx->SendMessage(event.msgTypeData.ProtocolId, event.msgTypeData.MessageType, std::move(event.MsgData), flags); - VerifyOrReturn(error == CHIP_NO_ERROR, ChipLogError(BDX, "SendMessage() failed: %" CHIP_ERROR_FORMAT, error.Format())); - break; - } - case OutputEventType::kAcceptReceived: - ChipLogProgress(BDX, "Starting transfer of %uB", static_cast(event.transferAcceptData.Length)); - - dfu_target_mcuboot_set_buf(mDfuBuffer, sizeof(mDfuBuffer)); - dfu_target_reset(); - status = dfu_target_init(DFU_TARGET_IMAGE_TYPE_MCUBOOT, event.transferAcceptData.Length, nullptr); - VerifyOrReturn(status == 0, ChipLogError(BDX, "dfu_target_init() failed: %d", status)); - - error = mTransfer.PrepareBlockQuery(); - VerifyOrReturn(error == CHIP_NO_ERROR, - ChipLogError(BDX, "PrepareBlockQuery() failed: %" CHIP_ERROR_FORMAT, error.Format())); - break; - case OutputEventType::kBlockReceived: - ChipLogProgress(BDX, "Received %uB (total: %ukB)", static_cast(event.blockdata.Length), - static_cast(mTransfer.GetNumBytesProcessed()) / 1024u); - - status = dfu_target_write(event.blockdata.Data, event.blockdata.Length); - VerifyOrReturn(status == 0, ChipLogError(BDX, "dfu_target_write() failed: %d", status)); - - if (event.blockdata.IsEof) - { - error = mTransfer.PrepareBlockAck(); - VerifyOrReturn(error == CHIP_NO_ERROR, - ChipLogError(BDX, "PrepareBlockAck() failed: %" CHIP_ERROR_FORMAT, error.Format())); - mIsTransferComplete = true; - } - else - { - error = mTransfer.PrepareBlockQuery(); - VerifyOrReturn(error == CHIP_NO_ERROR, - ChipLogError(BDX, "PrepareBlockQuery() failed: %" CHIP_ERROR_FORMAT, error.Format())); - } - break; - case OutputEventType::kStatusReceived: - ChipLogError(BDX, "Received status %" PRIu16, to_underlying(event.statusData.statusCode)); - mTransfer.Reset(); - dfu_target_reset(); - break; - case OutputEventType::kInternalError: - ChipLogError(BDX, "Transfer stopped due to internal error"); - mTransfer.Reset(); - dfu_target_reset(); - break; - case OutputEventType::kTransferTimeout: - ChipLogError(BDX, "Transfer timed out"); - mTransfer.Reset(); - dfu_target_reset(); - break; - default: - ChipLogError(BDX, "Unexpected event type: %" PRIu16, to_underlying(event.EventType)); - break; - } -} - -} // namespace Shell -} // namespace chip diff --git a/src/lib/shell/commands/Dns.cpp b/src/lib/shell/commands/Dns.cpp index 06886462c4ba50..4ab4cd2c26f5f1 100644 --- a/src/lib/shell/commands/Dns.cpp +++ b/src/lib/shell/commands/Dns.cpp @@ -147,13 +147,13 @@ bool ParseSubType(int argc, char ** argv, Dnssd::DiscoveryFilter & filter) switch (subtype[1]) { case 'S': - filterType = Dnssd::DiscoveryFilterType::kShort; + filterType = Dnssd::DiscoveryFilterType::kShortDiscriminator; break; case 'L': - filterType = Dnssd::DiscoveryFilterType::kLong; + filterType = Dnssd::DiscoveryFilterType::kLongDiscriminator; break; case 'V': - filterType = Dnssd::DiscoveryFilterType::kVendor; + filterType = Dnssd::DiscoveryFilterType::kVendorId; break; case 'T': filterType = Dnssd::DiscoveryFilterType::kDeviceType; diff --git a/src/lib/shell/commands/OTAUpdater_esp32.h b/src/lib/shell/commands/OTAUpdater_esp32.h deleted file mode 100644 index 53e10e951ff3b5..00000000000000 --- a/src/lib/shell/commands/OTAUpdater_esp32.h +++ /dev/null @@ -1,148 +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. - */ -#pragma once - -#include "esp_err.h" -#include "esp_log.h" -#include "esp_ota_ops.h" -#include "esp_system.h" - -static const char * TAG = "OTAUpdater"; - -class OTAUpdater -{ -public: - static OTAUpdater & GetInstance(void) - { - static OTAUpdater instance; - return instance; - } - bool IsInProgress(void) { return otaUpdateInProgress; } - esp_err_t Begin(void); - esp_err_t End(void); - esp_err_t Write(const void * data, size_t length); - esp_err_t Abort(void); - esp_err_t Apply(); - -private: - bool otaUpdateInProgress = false; - const esp_partition_t * otaUpdatePartition = nullptr; - esp_ota_handle_t otaUpdateHandle; - uint32_t otaUpdateImageLen = 0; - - OTAUpdater(void) {} - ~OTAUpdater() {} -}; - -inline esp_err_t OTAUpdater::Begin(void) -{ - if (otaUpdateInProgress) - { - ESP_LOGW(TAG, "Already in progress"); - return ESP_ERR_INVALID_STATE; - } - - ESP_LOGI(TAG, "Begin OTA"); - otaUpdatePartition = esp_ota_get_next_update_partition(NULL); - if (otaUpdatePartition == NULL) - { - ESP_LOGE(TAG, "Partition not found"); - return ESP_ERR_NOT_FOUND; - } - ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%x", otaUpdatePartition->subtype, otaUpdatePartition->address); - - esp_err_t err = esp_ota_begin(otaUpdatePartition, OTA_WITH_SEQUENTIAL_WRITES, &otaUpdateHandle); - if (err != ESP_OK) - { - ESP_LOGE(TAG, "esp_ota_begin failed (%s)", esp_err_to_name(err)); - return err; - } - otaUpdateImageLen = 0; - otaUpdateInProgress = true; - return ESP_OK; -} - -inline esp_err_t OTAUpdater::Write(const void * data, size_t length) -{ - if (otaUpdateInProgress == false) - { - return ESP_ERR_INVALID_STATE; - } - esp_err_t err = esp_ota_write(otaUpdateHandle, data, length); - if (err != ESP_OK) - { - ESP_LOGE(TAG, "esp_ota_write failed (%s)", esp_err_to_name(err)); - Abort(); - return err; - } - otaUpdateImageLen += length; - ESP_LOGI(TAG, "Written image length %d", otaUpdateImageLen); - return ESP_OK; -} - -inline esp_err_t OTAUpdater::Abort(void) -{ - if (otaUpdateInProgress == false) - { - return ESP_ERR_INVALID_STATE; - } - - ESP_LOGI(TAG, "OTA Abort"); - otaUpdateInProgress = false; - otaUpdateImageLen = 0; - return esp_ota_abort(otaUpdateHandle); -} - -inline esp_err_t OTAUpdater::End(void) -{ - if (otaUpdateInProgress == false) - { - return ESP_ERR_INVALID_STATE; - } - ESP_LOGI(TAG, "OTA image length %d bytes", otaUpdateImageLen); - esp_err_t err = esp_ota_end(otaUpdateHandle); - if (err != ESP_OK) - { - if (err == ESP_ERR_OTA_VALIDATE_FAILED) - { - ESP_LOGE(TAG, "Image validation failed, image is corrupted"); - } - else - { - ESP_LOGE(TAG, "esp_ota_end failed (%s)!", esp_err_to_name(err)); - } - } - otaUpdateInProgress = false; - return err; -} - -inline esp_err_t OTAUpdater::Apply() -{ - if (otaUpdateInProgress == true) - { - return ESP_ERR_INVALID_STATE; - } - - esp_err_t err = esp_ota_set_boot_partition(otaUpdatePartition); - if (err != ESP_OK) - { - ESP_LOGE(TAG, "esp_ota_set_boot_partition failed (%s)!", esp_err_to_name(err)); - return err; - } - ESP_LOGI(TAG, "Applying, Boot partition set offset:0x%x", otaUpdatePartition->address); - return ESP_OK; -} diff --git a/src/lib/shell/commands/Ota.cpp b/src/lib/shell/commands/Ota.cpp index 512a8b29888bed..93dee547918bc9 100644 --- a/src/lib/shell/commands/Ota.cpp +++ b/src/lib/shell/commands/Ota.cpp @@ -15,377 +15,58 @@ * limitations under the License. */ -#include - -#include -#include -#include -#include -#include -#include #include #include #include -#include -#include #include -#include -#include -#include - -// TODO: Use common software update layer to store the image -#if CHIP_DEVICE_LAYER_TARGET_NRFCONNECT -#include "DFUManager_nrfconnect.h" -#endif - -#if CHIP_DEVICE_LAYER_TARGET_ESP32 -#include "DFUManager_esp32.h" -#endif -#include +#include +#include +#include -using namespace chip; -using namespace chip::app; -using namespace chip::app::Clusters::OtaSoftwareUpdateProvider::Commands; -using namespace chip::bdx; -using namespace chip::Callback; +using namespace chip::DeviceLayer; namespace chip { -namespace Shell { -namespace { - -constexpr const char kRequestorLocation[] = { 'U', 'S' }; -constexpr EmberAfOTADownloadProtocol kRequestorProtocols[] = { EMBER_ZCL_OTA_DOWNLOAD_PROTOCOL_BDX_SYNCHRONOUS }; -constexpr bool kRequestorCanConsent = false; -constexpr uint16_t kBlockSize = 1024; -constexpr uint8_t kMaxUpdateTokenLen = 32; - -struct OTAContext -{ - OperationalDeviceProxy * deviceProxy = nullptr; - Transport::PeerAddress providerAddress = {}; - EndpointId providerEndpointId = 0; - uint8_t updateToken[kMaxUpdateTokenLen] = {}; - uint8_t updateTokenLen = 0; - uint32_t updateVersion = 0; - - void Clear(); -}; - -Shell::Engine sSubShell; -Controller::DeviceControllerInteractionModelDelegate sIMDelegate; -DFUManager sDfuManager; -OTAContext sOtaContext; - -inline void OTAContext::Clear() -{ - if (deviceProxy != nullptr) - { - deviceProxy->Disconnect(); - delete deviceProxy; - } - - *this = {}; -} - -CharSpan ExtractResourceName(CharSpan imageURI) -{ - // TODO: Implement a correct URI parser - constexpr char protocol[] = "bdx://"; - constexpr size_t protocolLen = sizeof(protocol) - 1; - - if (imageURI.size() >= protocolLen && strncmp(protocol, imageURI.data(), imageURI.size()) == 0) - { - imageURI = imageURI.SubSpan(protocolLen, imageURI.size() - protocolLen); - } - - for (size_t i = 0; i < imageURI.size(); ++i) - { - if (imageURI.data()[i] == '/') - { - return imageURI.SubSpan(i + 1, imageURI.size() - i - 1); - } - } - - return imageURI; -} - -void OnQueryImageResponse(void * context, const QueryImageResponse::DecodableType & response) -{ - CharSpan imageURI = response.imageURI.ValueOr({}); - ByteSpan updateToken = response.updateToken.ValueOr({}); - CharSpan resourceName = ExtractResourceName(imageURI); - uint32_t version = response.softwareVersion.ValueOr(0u); - ChipLogProgress(SoftwareUpdate, "Received QueryImage response: %" PRIu16, static_cast(response.status)); - ChipLogProgress(SoftwareUpdate, " Image URI: %.*s", static_cast(imageURI.size()), imageURI.data()); - ChipLogProgress(SoftwareUpdate, " Resource: %.*s", static_cast(resourceName.size()), resourceName.data()); - ChipLogProgress(SoftwareUpdate, " Version: %" PRIu32, version); - - if (updateToken.size() > kMaxUpdateTokenLen) - { - ChipLogError(SoftwareUpdate, "Update token too long"); - return; - } - - memcpy(sOtaContext.updateToken, updateToken.data(), updateToken.size()); - sOtaContext.updateTokenLen = static_cast(updateToken.size()); - sOtaContext.updateVersion = version; - - OperationalDeviceProxy * deviceProxy = sOtaContext.deviceProxy; - VerifyOrReturn(deviceProxy != nullptr); - - Messaging::ExchangeManager * exchangeMgr = deviceProxy->GetExchangeManager(); - Optional session = deviceProxy->GetSecureSession(); - Messaging::ExchangeContext * exchangeCtx = nullptr; - - if (exchangeMgr != nullptr && session.HasValue()) - { - exchangeCtx = exchangeMgr->NewContext(session.Value(), &sDfuManager); - } - - if (exchangeCtx == nullptr) - { - ChipLogError(SoftwareUpdate, "Failed to allocate exchange"); - return; - } - - TransferSession::TransferInitData initOptions; - initOptions.TransferCtlFlags = TransferControlFlags::kReceiverDrive; - initOptions.MaxBlockSize = kBlockSize; - initOptions.FileDesLength = resourceName.size(); - initOptions.FileDesignator = reinterpret_cast(resourceName.data()); - - sDfuManager.SetInitialExchange(exchangeCtx); - CHIP_ERROR error = sDfuManager.InitiateTransfer(&DeviceLayer::SystemLayer(), TransferRole::kReceiver, initOptions, - System::Clock::Seconds16(20)); - - if (error != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "Failed to initiate BDX transfer: %" CHIP_ERROR_FORMAT, error.Format()); - } -} - -void OnQueryImageFailure(void * /* context */, EmberAfStatus status) +// TODO: Remove weak functions when ESP32 all-clusters-app includes code from src/app/clusters/ota-requestor +// The code requires OTA Provider client cluster which interferes with OTA Provider server cluster, +// already enabled in the all-clusters-app. +__attribute__((weak)) void SetRequestorInstance(OTARequestorInterface * instance) {} +__attribute__((weak)) OTARequestorInterface * GetRequestorInstance() { - ChipLogError(SoftwareUpdate, "QueryImage failed: %" PRIu16, static_cast(status)); + return nullptr; } -} // namespace -} // namespace Shell -} // namespace chip - -#include -namespace chip { namespace Shell { namespace { -void OnQueryImageConnection(void * /* context */, OperationalDeviceProxy * deviceProxy) -{ - // Initialize cluster object - Controller::OtaSoftwareUpdateProviderCluster cluster; - CHIP_ERROR error = cluster.Associate(deviceProxy, sOtaContext.providerEndpointId); - - if (error != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "Associate failed: %" CHIP_ERROR_FORMAT, error.Format()); - return; - } - - // Send QueryImage command - uint16_t vendorId = 0; - uint16_t productId = 0; - uint16_t hardwareVersion = 0; - uint16_t softwareVersion = 0; - - DeviceLayer::ConfigurationMgr().GetVendorId(vendorId); - DeviceLayer::ConfigurationMgr().GetProductId(productId); - DeviceLayer::ConfigurationMgr().GetHardwareVersion(hardwareVersion); - DeviceLayer::ConfigurationMgr().GetSoftwareVersion(softwareVersion); - - QueryImage::Type request; - request.vendorId = static_cast(vendorId); - request.productId = productId; - request.softwareVersion = softwareVersion; - request.protocolsSupported = kRequestorProtocols; - request.hardwareVersion.SetValue(hardwareVersion); - request.location.Emplace(kRequestorLocation); - request.requestorCanConsent.SetValue(kRequestorCanConsent); - error = cluster.InvokeCommand(request, /* context */ nullptr, OnQueryImageResponse, OnQueryImageFailure); - - if (error != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "QueryImage failed: %" CHIP_ERROR_FORMAT, error.Format()); - } -} - -void OnApplyUpdateResponse(void * context, const ApplyUpdateResponse::DecodableType & response) -{ - ChipLogProgress(SoftwareUpdate, "Received ApplyUpdate response: %" PRIu16, static_cast(response.action)); - - switch (response.action) - { - case EMBER_ZCL_OTA_APPLY_UPDATE_ACTION_PROCEED: { - CHIP_ERROR error = sDfuManager.ApplyUpdate(); - if (error != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "Failed to apply update: %" CHIP_ERROR_FORMAT, error.Format()); - } - break; - } - case EMBER_ZCL_OTA_APPLY_UPDATE_ACTION_DISCONTINUE: { - CHIP_ERROR error = sDfuManager.DiscardUpdate(); - if (error != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "Failed to discard update: %" CHIP_ERROR_FORMAT, error.Format()); - } - break; - } - default: - break; - } -} - -void OnApplyUpdateFailure(void * /* context */, EmberAfStatus status) -{ - ChipLogError(SoftwareUpdate, "ApplyUpdate failed: %" PRIu16, static_cast(status)); -} - -void OnApplyUpdateConnection(void * /* context */, OperationalDeviceProxy * deviceProxy) -{ - // Initialize cluster object - Controller::OtaSoftwareUpdateProviderCluster cluster; - CHIP_ERROR error = cluster.Associate(deviceProxy, sOtaContext.providerEndpointId); - - if (error != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "Associate failed: %" CHIP_ERROR_FORMAT, error.Format()); - return; - } - - // Send QueryImage command - uint16_t vendorId = 0; - uint16_t productId = 0; - uint16_t hardwareVersion = 0; - uint16_t softwareVersion = 0; - - DeviceLayer::ConfigurationMgr().GetVendorId(vendorId); - DeviceLayer::ConfigurationMgr().GetProductId(productId); - DeviceLayer::ConfigurationMgr().GetHardwareVersion(hardwareVersion); - DeviceLayer::ConfigurationMgr().GetSoftwareVersion(softwareVersion); - - ApplyUpdateRequest::Type request; - request.updateToken = ByteSpan(sOtaContext.updateToken, sOtaContext.updateTokenLen); - request.newVersion = sOtaContext.updateVersion; - - error = cluster.InvokeCommand(request, /* context */ nullptr, OnApplyUpdateResponse, OnApplyUpdateFailure); - - if (error != CHIP_NO_ERROR) - { - ChipLogError(SoftwareUpdate, "ApplyUpdate failed: %" CHIP_ERROR_FORMAT, error.Format()); - } -} - -void OnConnectionFailure(void * /* context */, NodeId nodeId, CHIP_ERROR error) -{ - ChipLogError(SoftwareUpdate, "Connection failed: %" CHIP_ERROR_FORMAT, error.Format()); -} - -template -void ConnectDeviceAsync(intptr_t) -{ - static Callback::Callback successCallback(OnConnected, nullptr); - static Callback::Callback failureCallback(OnConnectionFailure, nullptr); - - OperationalDeviceProxy * deviceProxy = sOtaContext.deviceProxy; - VerifyOrReturn(deviceProxy != nullptr); - - deviceProxy->UpdateDeviceData(sOtaContext.providerAddress, deviceProxy->GetMRPConfig()); - deviceProxy->Connect(&successCallback, &failureCallback, nullptr); -} - -template -CHIP_ERROR ConnectProvider(FabricIndex fabricIndex, NodeId nodeId, const Transport::PeerAddress & address) -{ - // Allocate new device proxy - FabricInfo * fabric = Server::GetInstance().GetFabricTable().FindFabricWithIndex(fabricIndex); - VerifyOrReturnError(fabric != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - - DeviceProxyInitParams initParams = { .sessionManager = &Server::GetInstance().GetSecureSessionManager(), - .exchangeMgr = &Server::GetInstance().GetExchangeManager(), - .idAllocator = &Server::GetInstance().GetSessionIDAllocator(), - .fabricTable = &Server::GetInstance().GetFabricTable(), - .imDelegate = &sIMDelegate }; - - auto deviceProxy = Platform::New(initParams, fabric->GetPeerIdForNode(nodeId)); - VerifyOrReturnError(deviceProxy != nullptr, CHIP_ERROR_NO_MEMORY); - - // Initiate the connection and send QueryImage command using CHIP thread - streamer_printf(streamer_get(), "Connecting...\r\n"); - - sOtaContext.deviceProxy = deviceProxy; - sOtaContext.providerAddress = address; - DeviceLayer::PlatformMgr().ScheduleWork(ConnectDeviceAsync); - return CHIP_NO_ERROR; -} +Shell::Engine sSubShell; CHIP_ERROR QueryImageHandler(int argc, char ** argv) { - VerifyOrReturnError(argc == 5, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(GetRequestorInstance() != nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT); const FabricIndex fabricIndex = static_cast(strtoul(argv[0], nullptr, 10)); const NodeId providerNodeId = static_cast(strtoull(argv[1], nullptr, 10)); const EndpointId providerEndpointId = static_cast(strtoul(argv[2], nullptr, 10)); - const char * ipAddressStr = argv[3]; - const uint16_t udpPort = static_cast(strtoul(argv[4], nullptr, 10)); - - Inet::IPAddress ipAddress; - VerifyOrReturnError(Inet::IPAddress::FromString(ipAddressStr, ipAddress), CHIP_ERROR_INVALID_ARGUMENT); - - sOtaContext.Clear(); - sOtaContext.providerEndpointId = providerEndpointId; - - return ConnectProvider(fabricIndex, providerNodeId, Transport::PeerAddress::UDP(ipAddress, udpPort)); -} -CHIP_ERROR ShowUpdateHandler(int argc, char ** argv) -{ - VerifyOrReturnError(argc == 0, CHIP_ERROR_INVALID_ARGUMENT); - - char token[kMaxUpdateTokenLen * 2 + 1]; - ReturnErrorOnFailure( - Encoding::BytesToUppercaseHexString(sOtaContext.updateToken, sOtaContext.updateTokenLen, token, sizeof(token))); - - streamer_printf(streamer_get(), "Token: %s\r\n", token); - streamer_printf(streamer_get(), "Version: %" PRIu32 "\r\n", sOtaContext.updateVersion); + GetRequestorInstance()->TestModeSetProviderParameters(providerNodeId, fabricIndex, providerEndpointId); + PlatformMgr().ScheduleWork([](intptr_t) { GetRequestorInstance()->TriggerImmediateQuery(); }); return CHIP_NO_ERROR; } CHIP_ERROR ApplyImageHandler(int argc, char ** argv) { - VerifyOrReturnError(argc == 7, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(GetRequestorInstance() != nullptr, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT); const FabricIndex fabricIndex = static_cast(strtoul(argv[0], nullptr, 10)); const NodeId providerNodeId = static_cast(strtoull(argv[1], nullptr, 10)); const EndpointId providerEndpointId = static_cast(strtoul(argv[2], nullptr, 10)); - const char * ipAddressStr = argv[3]; - const uint16_t udpPort = static_cast(strtoul(argv[4], nullptr, 10)); - const char * updateTokenStr = argv[5]; - const uint32_t updateVersion = static_cast(strtoul(argv[6], nullptr, 10)); - - Inet::IPAddress ipAddress; - VerifyOrReturnError(Inet::IPAddress::FromString(ipAddressStr, ipAddress), CHIP_ERROR_INVALID_ARGUMENT); - uint8_t updateToken[kMaxUpdateTokenLen]; - size_t updateTokenLen = Encoding::HexToBytes(updateTokenStr, strlen(updateTokenStr), updateToken, sizeof(updateToken)); - VerifyOrReturnError(updateTokenLen > 0, CHIP_ERROR_INVALID_ARGUMENT); - - sOtaContext.Clear(); - sOtaContext.providerEndpointId = providerEndpointId; - sOtaContext.updateTokenLen = updateTokenLen; - sOtaContext.updateVersion = updateVersion; - memcpy(sOtaContext.updateToken, updateToken, updateTokenLen); - - return ConnectProvider(fabricIndex, providerNodeId, Transport::PeerAddress::UDP(ipAddress, udpPort)); + GetRequestorInstance()->TestModeSetProviderParameters(providerNodeId, fabricIndex, providerEndpointId); + PlatformMgr().ScheduleWork([](intptr_t) { GetRequestorInstance()->ApplyUpdate(); }); + return CHIP_NO_ERROR; } CHIP_ERROR OtaHandler(int argc, char ** argv) @@ -411,12 +92,9 @@ void RegisterOtaCommands() { // Register subcommands of the `ota` commands. static const shell_command_t subCommands[] = { - { &QueryImageHandler, "query", - "Query for a new image. Usage: ota query " }, - { &ShowUpdateHandler, "show-update", "Print the current update information" }, + { &QueryImageHandler, "query", "Query for a new image. Usage: ota query " }, { &ApplyImageHandler, "apply", - "Apply the current update. Usage ota apply " - " " }, + "Apply the current update. Usage ota apply " }, }; sSubShell.RegisterCommands(subCommands, ArraySize(subCommands)); diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index 5247f1b4f3ac00..f713d291ec0bbd 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -275,4 +275,20 @@ jdouble JniReferences::DoubleToPrimitive(jobject boxedDouble) return env->CallDoubleMethod(boxedDouble, valueMethod); } +CHIP_ERROR JniReferences::CallSubscriptionEstablished(jobject javaCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + + jmethodID subscriptionEstablishedMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallback, "onSubscriptionEstablished", "()V", + &subscriptionEstablishedMethod); + VerifyOrReturnError(err == CHIP_NO_ERROR, CHIP_JNI_ERROR_METHOD_NOT_FOUND); + + env->CallVoidMethod(javaCallback, subscriptionEstablishedMethod); + VerifyOrReturnError(!env->ExceptionCheck(), CHIP_JNI_ERROR_EXCEPTION_THROWN); + + return err; +} + } // namespace chip diff --git a/src/lib/support/JniReferences.h b/src/lib/support/JniReferences.h index 52c23a95175085..2c4eb5613b9490 100644 --- a/src/lib/support/JniReferences.h +++ b/src/lib/support/JniReferences.h @@ -112,6 +112,11 @@ class JniReferences */ jdouble DoubleToPrimitive(jobject boxedObject); + /** + * Call a void method with no arguments named "OnSubscriptionEstablished" on the provided jobject. + */ + CHIP_ERROR CallSubscriptionEstablished(jobject javaCallback); + /** * Creates a boxed type (e.g. java.lang.Integer) based on the the class name ("java/lang/Integer"), constructor JNI signature * ("(I)V"), and value. diff --git a/src/lib/support/PersistentStorageMacros.h b/src/lib/support/PersistentStorageMacros.h index 4c9be7ef5778ad..1e3af538fb3bc8 100644 --- a/src/lib/support/PersistentStorageMacros.h +++ b/src/lib/support/PersistentStorageMacros.h @@ -38,7 +38,7 @@ constexpr const char kNextAvailableKeyID[] = "StartKeyID"; { \ constexpr size_t len = std::extent::value; \ nlSTATIC_ASSERT_PRINT(len > 0, "keyPrefix length must be known at compile time"); \ - /* 2 * sizeof(chip::NodeId) to accomodate 2 character for each byte in Node Id */ \ + /* 2 * sizeof(chip::NodeId) to accommodate 2 character for each byte in Node Id */ \ char key[len + 2 * sizeof(chip::NodeId) + 1]; \ nlSTATIC_ASSERT_PRINT(sizeof(node) <= sizeof(uint64_t), "Node ID size is greater than expected"); \ snprintf(key, sizeof(key), "%s%" PRIx64, keyPrefix, node); \ diff --git a/src/lib/support/Pool.cpp b/src/lib/support/Pool.cpp index e1e64f3d3f8170..77454ef052bff7 100644 --- a/src/lib/support/Pool.cpp +++ b/src/lib/support/Pool.cpp @@ -84,7 +84,6 @@ size_t StaticAllocatorBitmap::IndexOf(void * element) return index; } -using Lambda = Loop (*)(void *, void *); Loop StaticAllocatorBitmap::ForEachActiveObjectInner(void * context, Lambda lambda) { for (size_t word = 0; word * kBitChunkSize < Capacity(); ++word) @@ -117,7 +116,6 @@ HeapObjectListNode * HeapObjectList::FindNode(void * object) const return nullptr; } -using Lambda = Loop (*)(void *, void *); Loop HeapObjectList::ForEachNode(void * context, Lambda lambda) { ++mIterationDepth; @@ -151,7 +149,7 @@ Loop HeapObjectList::ForEachNode(void * context, Lambda lambda) if (p->mObject == nullptr) { p->Remove(); - delete p; + Platform::Delete(p); } p = next; } diff --git a/src/lib/support/Pool.h b/src/lib/support/Pool.h index 4a36fa28202856..cc1cca426007b0 100644 --- a/src/lib/support/Pool.h +++ b/src/lib/support/Pool.h @@ -22,6 +22,7 @@ #pragma once +#include #include #include @@ -90,7 +91,12 @@ class StaticAllocatorBitmap : public internal::StaticAllocatorBase void * At(size_t index) { return static_cast(mElements) + mElementSize * index; } size_t IndexOf(void * element); - Loop ForEachActiveObjectInner(void * context, Loop lambda(void * context, void * object)); + using Lambda = Loop (*)(void * context, void * object); + Loop ForEachActiveObjectInner(void * context, Lambda lambda); + Loop ForEachActiveObjectInner(void * context, Loop lambda(void * context, const void * object)) const + { + return const_cast(this)->ForEachActiveObjectInner(context, reinterpret_cast(lambda)); + } private: void * mElements; @@ -119,6 +125,10 @@ class LambdaProxy { return static_cast(context)->mFunction(static_cast(target)); } + static Loop ConstCall(void * context, const void * target) + { + return static_cast(context)->mFunction(static_cast(target)); + } private: Function mFunction; @@ -153,7 +163,12 @@ struct HeapObjectList : HeapObjectListNode HeapObjectListNode * FindNode(void * object) const; - Loop ForEachNode(void * context, Loop lambda(void * context, void * object)); + using Lambda = Loop (*)(void *, void *); + Loop ForEachNode(void * context, Lambda lambda); + Loop ForEachNode(void * context, Loop lambda(void * context, const void * object)) const + { + return const_cast(this)->ForEachNode(context, reinterpret_cast(lambda)); + } size_t mIterationDepth; }; @@ -241,6 +256,14 @@ class BitMapObjectPool : public internal::StaticAllocatorBitmap, public internal internal::LambdaProxy proxy(std::forward(function)); return ForEachActiveObjectInner(&proxy, &internal::LambdaProxy::Call); } + template + Loop ForEachActiveObject(Function && function) const + { + static_assert(std::is_same()))>::value, + "The function must take const T* and return Loop"); + internal::LambdaProxy proxy(std::forward(function)); + return ForEachActiveObjectInner(&proxy, &internal::LambdaProxy::ConstCall); + } private: static Loop ReleaseObject(void * context, void * object) @@ -276,10 +299,10 @@ class HeapObjectPool : public internal::Statistics, public internal::PoolCommon< template T * CreateObject(Args &&... args) { - T * object = new T(std::forward(args)...); + T * object = Platform::New(std::forward(args)...); if (object != nullptr) { - auto node = new internal::HeapObjectListNode(); + auto node = Platform::New(); if (node != nullptr) { node->mObject = object; @@ -300,7 +323,7 @@ class HeapObjectPool : public internal::Statistics, public internal::PoolCommon< { // Note that the node is not removed here; that is deferred until the end of the next pool iteration. node->mObject = nullptr; - delete object; + Platform::Delete(object); DecreaseUsage(); } } @@ -323,6 +346,14 @@ class HeapObjectPool : public internal::Statistics, public internal::PoolCommon< internal::LambdaProxy proxy(std::forward(function)); return mObjects.ForEachNode(&proxy, &internal::LambdaProxy::Call); } + template + Loop ForEachActiveObject(Function && function) const + { + static_assert(std::is_same()))>::value, + "The function must take const T* and return Loop"); + internal::LambdaProxy proxy(std::forward(function)); + return mObjects.ForEachNode(&proxy, &internal::LambdaProxy::ConstCall); + } private: static Loop ReleaseObject(void * context, void * object) @@ -336,33 +367,39 @@ class HeapObjectPool : public internal::Statistics, public internal::PoolCommon< #endif // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP -#if CHIP_SYSTEM_CONFIG_POOL_USE_HEAP -template -using ObjectPool = HeapObjectPool; -#else // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP -template -using ObjectPool = BitMapObjectPool; -#endif // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP - +/** + * Specify ObjectPool storage allocation. + */ enum class ObjectPoolMem { - kStatic, + /** + * Use storage inside the containing scope for both objects and pool management state. + */ + kInline, #if CHIP_SYSTEM_CONFIG_POOL_USE_HEAP - kDynamic + /** + * Allocate objects from the heap, with only pool management state in the containing scope. + * + * For this case, the ObjectPool size parameter is ignored. + */ + kHeap, + kDefault = kHeap +#else // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP + kDefault = kInline #endif // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP }; -template -class MemTypeObjectPool; +template +class ObjectPool; template -class MemTypeObjectPool : public BitMapObjectPool +class ObjectPool : public BitMapObjectPool { }; #if CHIP_SYSTEM_CONFIG_POOL_USE_HEAP template -class MemTypeObjectPool : public HeapObjectPool +class ObjectPool : public HeapObjectPool { }; #endif // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP diff --git a/src/lib/support/PoolWrapper.h b/src/lib/support/PoolWrapper.h index 13195ca70310df..e5025640179cf6 100644 --- a/src/lib/support/PoolWrapper.h +++ b/src/lib/support/PoolWrapper.h @@ -47,17 +47,28 @@ class PoolInterface return ForEachActiveObjectInner( &proxy, [](void * context, U * target) -> Loop { return (*static_cast(context))(target); }); } + template + Loop ForEachActiveObject(Function && function) const + { + static_assert(std::is_same()))>::value, + "The function must take const T* and return Loop"); + auto proxy = [&](const U * target) -> Loop { return function(target); }; + return ForEachActiveObjectInner( + &proxy, [](void * context, const U * target) -> Loop { return (*static_cast(context))(target); }); + } protected: - using Lambda = Loop (*)(void *, U *); - virtual Loop ForEachActiveObjectInner(void * context, Lambda lambda) = 0; + using Lambda = Loop (*)(void *, U *); + using LambdaConst = Loop (*)(void *, const U *); + virtual Loop ForEachActiveObjectInner(void * context, Lambda lambda) = 0; + virtual Loop ForEachActiveObjectInner(void * context, LambdaConst lambda) const = 0; }; -template +template class PoolProxy; -template -class PoolProxy> : public PoolInterface +template +class PoolProxy> : public PoolInterface { public: static_assert(std::is_base_of::value, "Interface type is not derived from Pool type"); @@ -82,8 +93,14 @@ class PoolProxy> : public PoolInter { return Impl().ForEachActiveObject([&](T * target) { return lambda(context, static_cast(target)); }); } + virtual Loop ForEachActiveObjectInner(void * context, + typename PoolInterface::LambdaConst lambda) const override + { + return Impl().ForEachActiveObject([&](const T * target) { return lambda(context, static_cast(target)); }); + } - virtual BitMapObjectPool & Impl() = 0; + virtual ObjectPool & Impl() = 0; + virtual const ObjectPool & Impl() const = 0; }; /* @@ -92,23 +109,25 @@ class PoolProxy> : public PoolInter * * @tparam T a subclass of element to be allocated. * @tparam N a positive integer max number of elements the pool provides. + * @tparam M an ObjectPoolMem constant selecting static vs heap allocation. * @tparam Interfaces a list of parameters which defines PoolInterface's. each interface is defined by a * std::tuple. The PoolImpl is derived from every * PoolInterface, the PoolImpl can be converted to the interface type * and passed around */ -template -class PoolImpl : public PoolProxy... +template +class PoolImpl : public PoolProxy... { public: PoolImpl() {} virtual ~PoolImpl() override {} protected: - virtual BitMapObjectPool & Impl() override { return mImpl; } + virtual ObjectPool & Impl() override { return mImpl; } + virtual const ObjectPool & Impl() const override { return mImpl; } private: - BitMapObjectPool mImpl; + ObjectPool mImpl; }; } // namespace chip diff --git a/src/lib/support/StateMachine.h b/src/lib/support/StateMachine.h index 329dd27eab062a..b9b5152512e032 100644 --- a/src/lib/support/StateMachine.h +++ b/src/lib/support/StateMachine.h @@ -221,7 +221,7 @@ class StateMachine : public Context mCurrentState.LogTransition(oldState.GetName()); // It is impermissible to dispatch events from Exit() or // LogTransition(), or from the transitions table when a transition - // has also been returned. Verify that this hasn't occured. + // has also been returned. Verify that this hasn't occurred. VerifyOrDie(prev == mSequence); mCurrentState.Enter(); } diff --git a/src/lib/support/tests/TestFixedBufferAllocator.cpp b/src/lib/support/tests/TestFixedBufferAllocator.cpp index 3c8ebf4e99c771..8bd42fc4755205 100644 --- a/src/lib/support/tests/TestFixedBufferAllocator.cpp +++ b/src/lib/support/tests/TestFixedBufferAllocator.cpp @@ -62,7 +62,7 @@ void TestOutOfMemory(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, alloc.AnyAllocFailed()); } -const nlTest sTests[] = { NL_TEST_DEF("Test successfull clone", TestClone), NL_TEST_DEF("Test out of memory", TestOutOfMemory), +const nlTest sTests[] = { NL_TEST_DEF("Test successful clone", TestClone), NL_TEST_DEF("Test out of memory", TestOutOfMemory), NL_TEST_SENTINEL() }; } // namespace diff --git a/src/lib/support/tests/TestPool.cpp b/src/lib/support/tests/TestPool.cpp index b78e684abf8866..0a23aa71363691 100644 --- a/src/lib/support/tests/TestPool.cpp +++ b/src/lib/support/tests/TestPool.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -34,10 +35,10 @@ namespace chip { template -size_t GetNumObjectsInUse(POOL & pool) +size_t GetNumObjectsInUse(const POOL & pool) { size_t count = 0; - pool.ForEachActiveObject([&count](void *) { + pool.ForEachActiveObject([&count](const void *) { ++count; return Loop::Continue; }); @@ -53,7 +54,7 @@ using namespace chip; template void TestReleaseNull(nlTestSuite * inSuite, void * inContext) { - MemTypeObjectPool pool; + ObjectPool pool; pool.ReleaseObject(nullptr); NL_TEST_ASSERT(inSuite, GetNumObjectsInUse(pool) == 0); NL_TEST_ASSERT(inSuite, pool.Allocated() == 0); @@ -61,20 +62,20 @@ void TestReleaseNull(nlTestSuite * inSuite, void * inContext) void TestReleaseNullStatic(nlTestSuite * inSuite, void * inContext) { - TestReleaseNull(inSuite, inContext); + TestReleaseNull(inSuite, inContext); } #if CHIP_SYSTEM_CONFIG_POOL_USE_HEAP void TestReleaseNullDynamic(nlTestSuite * inSuite, void * inContext) { - TestReleaseNull(inSuite, inContext); + TestReleaseNull(inSuite, inContext); } #endif // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP template void TestCreateReleaseObject(nlTestSuite * inSuite, void * inContext) { - MemTypeObjectPool pool; + ObjectPool pool; uint32_t * obj[N]; NL_TEST_ASSERT(inSuite, pool.Allocated() == 0); @@ -103,9 +104,9 @@ void TestCreateReleaseObject(nlTestSuite * inSuite, void * inContext) void TestCreateReleaseObjectStatic(nlTestSuite * inSuite, void * inContext) { constexpr const size_t kSize = 100; - TestCreateReleaseObject(inSuite, inContext); + TestCreateReleaseObject(inSuite, inContext); - MemTypeObjectPool pool; + ObjectPool pool; uint32_t * obj[kSize]; for (size_t i = 0; i < kSize; ++i) @@ -143,7 +144,7 @@ void TestCreateReleaseObjectStatic(nlTestSuite * inSuite, void * inContext) #if CHIP_SYSTEM_CONFIG_POOL_USE_HEAP void TestCreateReleaseObjectDynamic(nlTestSuite * inSuite, void * inContext) { - TestCreateReleaseObject(inSuite, inContext); + TestCreateReleaseObject(inSuite, inContext); } #endif // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP @@ -159,7 +160,7 @@ void TestCreateReleaseStruct(nlTestSuite * inSuite, void * inContext) std::set objs1; constexpr const size_t kSize = 100; - MemTypeObjectPool pool; + ObjectPool pool; S * objs2[kSize]; for (size_t i = 0; i < kSize; ++i) @@ -200,13 +201,13 @@ void TestCreateReleaseStruct(nlTestSuite * inSuite, void * inContext) void TestCreateReleaseStructStatic(nlTestSuite * inSuite, void * inContext) { - TestCreateReleaseStruct(inSuite, inContext); + TestCreateReleaseStruct(inSuite, inContext); } #if CHIP_SYSTEM_CONFIG_POOL_USE_HEAP void TestCreateReleaseStructDynamic(nlTestSuite * inSuite, void * inContext) { - TestCreateReleaseStruct(inSuite, inContext); + TestCreateReleaseStruct(inSuite, inContext); } #endif // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP @@ -223,7 +224,7 @@ void TestForEachActiveObject(nlTestSuite * inSuite, void * inContext) S * objArray[kSize]; std::set objIds; - MemTypeObjectPool pool; + ObjectPool pool; for (size_t i = 0; i < kSize; ++i) { @@ -333,23 +334,87 @@ void TestForEachActiveObject(nlTestSuite * inSuite, void * inContext) void TestForEachActiveObjectStatic(nlTestSuite * inSuite, void * inContext) { - TestForEachActiveObject(inSuite, inContext); + TestForEachActiveObject(inSuite, inContext); } #if CHIP_SYSTEM_CONFIG_POOL_USE_HEAP void TestForEachActiveObjectDynamic(nlTestSuite * inSuite, void * inContext) { - TestForEachActiveObject(inSuite, inContext); + TestForEachActiveObject(inSuite, inContext); +} +#endif // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP + +template +void TestPoolInterface(nlTestSuite * inSuite, void * inContext) +{ + struct TestObject + { + TestObject(uint32_t * set, size_t id) : mSet(set), mId(id) { *mSet |= (1 << mId); } + ~TestObject() { *mSet &= ~(1 << mId); } + uint32_t * mSet; + size_t mId; + }; + using TestObjectPoolType = PoolInterface; + + struct PoolHolder + { + PoolHolder(TestObjectPoolType & testObjectPool) : mTestObjectPoolInterface(testObjectPool) {} + TestObjectPoolType & mTestObjectPoolInterface; + }; + + constexpr size_t kSize = 10; + PoolImpl testObjectPool; + PoolHolder poolHolder(testObjectPool); + uint32_t bits = 0; + + TestObject * objs2[kSize]; + for (size_t i = 0; i < kSize; ++i) + { + objs2[i] = poolHolder.mTestObjectPoolInterface.CreateObject(&bits, i); + NL_TEST_ASSERT(inSuite, objs2[i] != nullptr); + NL_TEST_ASSERT(inSuite, GetNumObjectsInUse(poolHolder.mTestObjectPoolInterface) == i + 1); + NL_TEST_ASSERT(inSuite, bits == (1ul << (i + 1)) - 1); + } + for (size_t i = 0; i < kSize; ++i) + { + poolHolder.mTestObjectPoolInterface.ReleaseObject(objs2[i]); + NL_TEST_ASSERT(inSuite, GetNumObjectsInUse(poolHolder.mTestObjectPoolInterface) == kSize - i - 1); + } + NL_TEST_ASSERT(inSuite, bits == 0); + + // Verify that ReleaseAll() calls the destructors. + for (size_t i = 0; i < kSize; ++i) + { + objs2[i] = poolHolder.mTestObjectPoolInterface.CreateObject(&bits, i); + } + NL_TEST_ASSERT(inSuite, bits == (1ul << kSize) - 1); + NL_TEST_ASSERT(inSuite, GetNumObjectsInUse(poolHolder.mTestObjectPoolInterface) == kSize); + + poolHolder.mTestObjectPoolInterface.ReleaseAll(); + NL_TEST_ASSERT(inSuite, bits == 0); + NL_TEST_ASSERT(inSuite, GetNumObjectsInUse(poolHolder.mTestObjectPoolInterface) == 0); +} + +void TestPoolInterfaceStatic(nlTestSuite * inSuite, void * inContext) +{ + TestPoolInterface(inSuite, inContext); +} + +#if CHIP_SYSTEM_CONFIG_POOL_USE_HEAP +void TestPoolInterfaceDynamic(nlTestSuite * inSuite, void * inContext) +{ + TestPoolInterface(inSuite, inContext); } #endif // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP int Setup(void * inContext) { - return SUCCESS; + return ::chip::Platform::MemoryInit() == CHIP_NO_ERROR ? SUCCESS : FAILURE; } int Teardown(void * inContext) { + ::chip::Platform::MemoryShutdown(); return SUCCESS; } @@ -365,11 +430,13 @@ static const nlTest sTests[] = { NL_TEST_DEF_FN(TestCreateReleaseObjectStatic), NL_TEST_DEF_FN(TestCreateReleaseStructStatic), NL_TEST_DEF_FN(TestForEachActiveObjectStatic), + NL_TEST_DEF_FN(TestPoolInterfaceStatic), #if CHIP_SYSTEM_CONFIG_POOL_USE_HEAP NL_TEST_DEF_FN(TestReleaseNullDynamic), NL_TEST_DEF_FN(TestCreateReleaseObjectDynamic), NL_TEST_DEF_FN(TestCreateReleaseStructDynamic), NL_TEST_DEF_FN(TestForEachActiveObjectDynamic), + NL_TEST_DEF_FN(TestPoolInterfaceDynamic), #endif // CHIP_SYSTEM_CONFIG_POOL_USE_HEAP NL_TEST_SENTINEL() // clang-format on diff --git a/src/lib/support/tests/TestPrivateHeap.cpp b/src/lib/support/tests/TestPrivateHeap.cpp index 54e33090eecad5..85bdd9109290b3 100644 --- a/src/lib/support/tests/TestPrivateHeap.cpp +++ b/src/lib/support/tests/TestPrivateHeap.cpp @@ -313,7 +313,7 @@ void Realloc(nlTestSuite * inSuite, void * inContext) FillKnownPattern(p1, 16, 33); p2 = allocator.HeapRealloc(p1, 32); // resize, does not fit. This frees p1 NL_TEST_ASSERT(inSuite, p2 != nullptr); - NL_TEST_ASSERT(inSuite, p2 != p1); // new reallocation occured + NL_TEST_ASSERT(inSuite, p2 != p1); // new reallocation occurred NL_TEST_ASSERT(inSuite, IsKnownPattern(p2, 16, 33)); void * p3 = allocator.HeapAlloc(48); // insufficient heap for this diff --git a/src/lwip/standalone/lwipopts.h b/src/lwip/standalone/lwipopts.h index c3243adbc1d01a..84aa44e1c5c62a 100644 --- a/src/lwip/standalone/lwipopts.h +++ b/src/lwip/standalone/lwipopts.h @@ -87,7 +87,7 @@ /** * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. * - * This is just a default designed to be overriden by the FreeRTOS.mk makefile + * This is just a default designed to be overridden by the FreeRTOS.mk makefile * To perform this override, define the makefile variable LWIP_NUM_PACKET_BUFFERS_IN_POOL */ #ifndef PBUF_POOL_SIZE @@ -135,7 +135,7 @@ /** * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is - * designed to accomodate single full size link-layer frame in one pbuf, including + * designed to accommodate single full size link-layer frame in one pbuf, including * the link-layer header and any link-layer encapsulation header, and the pbuf * structure itself. */ @@ -151,7 +151,7 @@ /** * ETH_PAD_SIZE: the header space required preceeding the of each pbuf in the pbuf pool. The default is - * designed to accomodate single full size TCP frame in one pbuf, including + * designed to accommodate single full size TCP frame in one pbuf, including * TCP_MSS, IP header, and link header. * * This is zero since the role has been taken over by SUB_ETHERNET_HEADER_SPACE as ETH_PAD_SIZE was not always obeyed @@ -356,7 +356,7 @@ #endif /** - * LWIP_IPV6_ROUTE_TABLE_SUPPORT==1: Enable support for a routing table and refering these during forwarding. + * LWIP_IPV6_ROUTE_TABLE_SUPPORT==1: Enable support for a routing table and referring these during forwarding. */ #ifndef LWIP_IPV6_ROUTE_TABLE_SUPPORT #define LWIP_IPV6_ROUTE_TABLE_SUPPORT 1 diff --git a/src/messaging/ApplicationExchangeDispatch.cpp b/src/messaging/ApplicationExchangeDispatch.cpp index b38f6f389102c0..3e2ad293b7d34b 100644 --- a/src/messaging/ApplicationExchangeDispatch.cpp +++ b/src/messaging/ApplicationExchangeDispatch.cpp @@ -26,19 +26,6 @@ namespace chip { namespace Messaging { -CHIP_ERROR ApplicationExchangeDispatch::PrepareMessage(SessionHandle session, PayloadHeader & payloadHeader, - System::PacketBufferHandle && message, - EncryptedPacketBufferHandle & preparedMessage) -{ - return mSessionManager->PrepareMessage(session, payloadHeader, std::move(message), preparedMessage); -} - -CHIP_ERROR ApplicationExchangeDispatch::SendPreparedMessage(SessionHandle session, - const EncryptedPacketBufferHandle & preparedMessage) const -{ - return mSessionManager->SendPreparedMessage(session, preparedMessage); -} - bool ApplicationExchangeDispatch::MessagePermitted(uint16_t protocol, uint8_t type) { // TODO: Change this check to only include the protocol and message types that are allowed diff --git a/src/messaging/ApplicationExchangeDispatch.h b/src/messaging/ApplicationExchangeDispatch.h index 39c09c8b9ecd6d..d1fb76aa019ec6 100644 --- a/src/messaging/ApplicationExchangeDispatch.h +++ b/src/messaging/ApplicationExchangeDispatch.h @@ -26,7 +26,6 @@ #include #include -#include namespace chip { namespace Messaging { @@ -34,28 +33,17 @@ namespace Messaging { class ApplicationExchangeDispatch : public ExchangeMessageDispatch { public: - ApplicationExchangeDispatch() {} - - virtual ~ApplicationExchangeDispatch() {} - - CHIP_ERROR Init(SessionManager * sessionManager) + static ExchangeMessageDispatch & Instance() { - ReturnErrorCodeIf(sessionManager == nullptr, CHIP_ERROR_INVALID_ARGUMENT); - mSessionManager = sessionManager; - return ExchangeMessageDispatch::Init(); + static ApplicationExchangeDispatch instance; + return instance; } - CHIP_ERROR PrepareMessage(SessionHandle session, PayloadHeader & payloadHeader, System::PacketBufferHandle && message, - EncryptedPacketBufferHandle & preparedMessage) override; - CHIP_ERROR SendPreparedMessage(SessionHandle session, const EncryptedPacketBufferHandle & message) const override; - - SessionManager * GetSessionManager() const { return mSessionManager; } + ApplicationExchangeDispatch() {} + virtual ~ApplicationExchangeDispatch() {} protected: bool MessagePermitted(uint16_t protocol, uint8_t type) override; - -private: - SessionManager * mSessionManager = nullptr; }; } // namespace Messaging diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index 424faba139e45d..5dc287c1438aa5 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -161,8 +162,9 @@ CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgTyp } // Create a new scope for `err`, to avoid shadowing warning previous `err`. - CHIP_ERROR err = mDispatch->SendMessage(mSession.Get(), mExchangeId, IsInitiator(), GetReliableMessageContext(), - reliableTransmissionRequested, protocolId, msgType, std::move(msgBuf)); + CHIP_ERROR err = mDispatch.SendMessage(GetExchangeMgr()->GetSessionManager(), mSession.Get(), mExchangeId, IsInitiator(), + GetReliableMessageContext(), reliableTransmissionRequested, protocolId, msgType, + std::move(msgBuf)); if (err != CHIP_NO_ERROR && IsResponseExpected()) { CancelResponseTimer(); @@ -248,8 +250,9 @@ void ExchangeContextDeletor::Release(ExchangeContext * ec) ec->mExchangeMgr->ReleaseContext(ec); } -ExchangeContext::ExchangeContext(ExchangeManager * em, uint16_t ExchangeId, SessionHandle session, bool Initiator, - ExchangeDelegate * delegate) +ExchangeContext::ExchangeContext(ExchangeManager * em, uint16_t ExchangeId, const SessionHandle & session, bool Initiator, + ExchangeDelegate * delegate) : + mDispatch((delegate != nullptr) ? delegate->GetMessageDispatch() : ApplicationExchangeDispatch::Instance()) { VerifyOrDie(mExchangeMgr == nullptr); @@ -259,22 +262,6 @@ ExchangeContext::ExchangeContext(ExchangeManager * em, uint16_t ExchangeId, Sess mFlags.Set(Flags::kFlagInitiator, Initiator); mDelegate = delegate; - ExchangeMessageDispatch * dispatch = nullptr; - if (delegate != nullptr) - { - dispatch = delegate->GetMessageDispatch(em->GetReliableMessageMgr(), em->GetSessionManager()); - if (dispatch == nullptr) - { - dispatch = &em->mDefaultExchangeDispatch; - } - } - else - { - dispatch = &em->mDefaultExchangeDispatch; - } - VerifyOrDie(dispatch != nullptr); - mDispatch = dispatch->Retain(); - SetDropAckDebug(false); SetAckPending(false); SetMsgRcvdFromPeer(false); @@ -300,19 +287,14 @@ ExchangeContext::~ExchangeContext() DoClose(false); mExchangeMgr = nullptr; - if (mDispatch != nullptr) - { - mDispatch->Release(); - mDispatch = nullptr; - } - #if defined(CHIP_EXCHANGE_CONTEXT_DETAIL_LOGGING) ChipLogDetail(ExchangeManager, "ec-- id: " ChipLogFormatExchange, ChipLogValueExchange(this)); #endif SYSTEM_STATS_DECREMENT(chip::System::Stats::kExchangeMgr_NumContexts); } -bool ExchangeContext::MatchExchange(SessionHandle session, const PacketHeader & packetHeader, const PayloadHeader & payloadHeader) +bool ExchangeContext::MatchExchange(const SessionHandle & session, const PacketHeader & packetHeader, + const PayloadHeader & payloadHeader) { // A given message is part of a particular exchange if... return @@ -450,7 +432,7 @@ CHIP_ERROR ExchangeContext::HandleMessage(uint32_t messageCounter, const Payload if (!IsGroupExchangeContext()) { ReturnErrorOnFailure( - mDispatch->OnMessageReceived(messageCounter, payloadHeader, peerAddress, msgFlags, GetReliableMessageContext())); + mDispatch.OnMessageReceived(messageCounter, payloadHeader, peerAddress, msgFlags, GetReliableMessageContext())); } if (IsAckPending() && !mDelegate) diff --git a/src/messaging/ExchangeContext.h b/src/messaging/ExchangeContext.h index 5c1fba080c2cb9..57c704ce12185e 100644 --- a/src/messaging/ExchangeContext.h +++ b/src/messaging/ExchangeContext.h @@ -63,7 +63,8 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, public Referen public: typedef System::Clock::Timeout Timeout; // Type used to express the timeout in this ExchangeContext - ExchangeContext(ExchangeManager * em, uint16_t ExchangeId, SessionHandle session, bool Initiator, ExchangeDelegate * delegate); + ExchangeContext(ExchangeManager * em, uint16_t ExchangeId, const SessionHandle & session, bool Initiator, + ExchangeDelegate * delegate); ~ExchangeContext(); @@ -74,7 +75,7 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, public Referen */ bool IsInitiator() const; - bool IsEncryptionRequired() const { return mDispatch->IsEncryptionRequired(); } + bool IsEncryptionRequired() const { return mDispatch.IsEncryptionRequired(); } bool IsGroupExchangeContext() const { return (mSession && mSession.Get().IsGroupSession()); } @@ -149,7 +150,7 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, public Referen ReliableMessageContext * GetReliableMessageContext() { return static_cast(this); }; - ExchangeMessageDispatch * GetMessageDispatch() { return mDispatch; } + ExchangeMessageDispatch & GetMessageDispatch() { return mDispatch; } SessionHandle GetSessionHandle() const { return mSession.Get(); } bool HasSessionHandle() const { return mSession; } @@ -183,7 +184,7 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, public Referen ExchangeDelegate * mDelegate = nullptr; ExchangeManager * mExchangeMgr = nullptr; - ExchangeMessageDispatch * mDispatch = nullptr; + ExchangeMessageDispatch & mDispatch; SessionHolder mSession; // The connection state uint16_t mExchangeId; // Assigned exchange ID. @@ -226,7 +227,7 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, public Referen * @retval true If a match is found. * @retval false If a match is not found. */ - bool MatchExchange(SessionHandle session, const PacketHeader & packetHeader, const PayloadHeader & payloadHeader); + bool MatchExchange(const SessionHandle & session, const PacketHeader & packetHeader, const PayloadHeader & payloadHeader); /** * Notify the exchange that its connection has expired. diff --git a/src/messaging/ExchangeDelegate.h b/src/messaging/ExchangeDelegate.h index 80566d850770ec..3e578ef48032a0 100644 --- a/src/messaging/ExchangeDelegate.h +++ b/src/messaging/ExchangeDelegate.h @@ -97,10 +97,7 @@ class DLL_EXPORT ExchangeDelegate */ virtual void OnExchangeClosing(ExchangeContext * ec) {} - virtual ExchangeMessageDispatch * GetMessageDispatch(ReliableMessageMgr * reliableMessageMgr, SessionManager * sessionManager) - { - return nullptr; - } + virtual ExchangeMessageDispatch & GetMessageDispatch() { return ApplicationExchangeDispatch::Instance(); } }; } // namespace Messaging diff --git a/src/messaging/ExchangeMessageDispatch.cpp b/src/messaging/ExchangeMessageDispatch.cpp index 8b5a26d8898245..7eb4bc7ad4076a 100644 --- a/src/messaging/ExchangeMessageDispatch.cpp +++ b/src/messaging/ExchangeMessageDispatch.cpp @@ -41,9 +41,10 @@ namespace chip { namespace Messaging { -CHIP_ERROR ExchangeMessageDispatch::SendMessage(SessionHandle session, uint16_t exchangeId, bool isInitiator, - ReliableMessageContext * reliableMessageContext, bool isReliableTransmission, - Protocols::Id protocol, uint8_t type, System::PacketBufferHandle && message) +CHIP_ERROR ExchangeMessageDispatch::SendMessage(SessionManager * sessionManager, const SessionHandle & session, uint16_t exchangeId, + bool isInitiator, ReliableMessageContext * reliableMessageContext, + bool isReliableTransmission, Protocols::Id protocol, uint8_t type, + System::PacketBufferHandle && message) { ReturnErrorCodeIf(!MessagePermitted(protocol.GetProtocolId(), type), CHIP_ERROR_INVALID_ARGUMENT); @@ -82,8 +83,8 @@ CHIP_ERROR ExchangeMessageDispatch::SendMessage(SessionHandle session, uint16_t }; std::unique_ptr entryOwner(entry, deleter); - ReturnErrorOnFailure(PrepareMessage(session, payloadHeader, std::move(message), entryOwner->retainedBuf)); - CHIP_ERROR err = SendPreparedMessage(session, entryOwner->retainedBuf); + ReturnErrorOnFailure(sessionManager->PrepareMessage(session, payloadHeader, std::move(message), entryOwner->retainedBuf)); + CHIP_ERROR err = sessionManager->SendPreparedMessage(session, entryOwner->retainedBuf); if (err == CHIP_ERROR_POSIX(ENOBUFS)) { // sendmsg on BSD-based systems never blocks, no matter how the @@ -105,8 +106,8 @@ CHIP_ERROR ExchangeMessageDispatch::SendMessage(SessionHandle session, uint16_t // If the channel itself is providing reliability, let's not request MRP acks payloadHeader.SetNeedsAck(false); EncryptedPacketBufferHandle preparedMessage; - ReturnErrorOnFailure(PrepareMessage(session, payloadHeader, std::move(message), preparedMessage)); - ReturnErrorOnFailure(SendPreparedMessage(session, preparedMessage)); + ReturnErrorOnFailure(sessionManager->PrepareMessage(session, payloadHeader, std::move(message), preparedMessage)); + ReturnErrorOnFailure(sessionManager->SendPreparedMessage(session, preparedMessage)); } return CHIP_NO_ERROR; diff --git a/src/messaging/ExchangeMessageDispatch.h b/src/messaging/ExchangeMessageDispatch.h index bac8bbbe4d52d9..464387f4e05ff9 100644 --- a/src/messaging/ExchangeMessageDispatch.h +++ b/src/messaging/ExchangeMessageDispatch.h @@ -23,46 +23,28 @@ #pragma once -#include #include #include namespace chip { namespace Messaging { -class ReliableMessageMgr; class ReliableMessageContext; -class ExchangeMessageDispatch : public ReferenceCounted +class ExchangeMessageDispatch { public: ExchangeMessageDispatch() {} virtual ~ExchangeMessageDispatch() {} - CHIP_ERROR Init() { return CHIP_NO_ERROR; } - virtual bool IsEncryptionRequired() const { return true; } - CHIP_ERROR SendMessage(SessionHandle session, uint16_t exchangeId, bool isInitiator, + CHIP_ERROR SendMessage(SessionManager * sessionManager, const SessionHandle & session, uint16_t exchangeId, bool isInitiator, ReliableMessageContext * reliableMessageContext, bool isReliableTransmission, Protocols::Id protocol, uint8_t type, System::PacketBufferHandle && message); - - /** - * @brief - * This interface takes the payload and returns the prepared message which can be send multiple times. - * - * @param session Peer node to which the payload to be sent - * @param payloadHeader The payloadHeader to be encoded into the packet - * @param message The payload to be sent - * @param preparedMessage The handle to hold the prepared message - */ - virtual CHIP_ERROR PrepareMessage(SessionHandle session, PayloadHeader & payloadHeader, System::PacketBufferHandle && message, - EncryptedPacketBufferHandle & preparedMessage) = 0; - virtual CHIP_ERROR SendPreparedMessage(SessionHandle session, const EncryptedPacketBufferHandle & preparedMessage) const = 0; - - virtual CHIP_ERROR OnMessageReceived(uint32_t messageCounter, const PayloadHeader & payloadHeader, - const Transport::PeerAddress & peerAddress, MessageFlags msgFlags, - ReliableMessageContext * reliableMessageContext); + CHIP_ERROR OnMessageReceived(uint32_t messageCounter, const PayloadHeader & payloadHeader, + const Transport::PeerAddress & peerAddress, MessageFlags msgFlags, + ReliableMessageContext * reliableMessageContext); protected: virtual bool MessagePermitted(uint16_t protocol, uint8_t type) = 0; diff --git a/src/messaging/ExchangeMgr.cpp b/src/messaging/ExchangeMgr.cpp index 7f34801770db94..41963fe6c1512d 100644 --- a/src/messaging/ExchangeMgr.cpp +++ b/src/messaging/ExchangeMgr.cpp @@ -87,7 +87,6 @@ CHIP_ERROR ExchangeManager::Init(SessionManager * sessionManager) sessionManager->SetMessageDelegate(this); mReliableMessageMgr.Init(sessionManager->SystemLayer()); - ReturnErrorOnFailure(mDefaultExchangeDispatch.Init(mSessionManager)); mState = State::kState_Initialized; @@ -116,7 +115,7 @@ CHIP_ERROR ExchangeManager::Shutdown() return CHIP_NO_ERROR; } -ExchangeContext * ExchangeManager::NewContext(SessionHandle session, ExchangeDelegate * delegate) +ExchangeContext * ExchangeManager::NewContext(const SessionHandle & session, ExchangeDelegate * delegate) { return mContextPool.CreateObject(this, mNextExchangeId++, session, true, delegate); } @@ -188,8 +187,8 @@ CHIP_ERROR ExchangeManager::UnregisterUMH(Protocols::Id protocolId, int16_t msgT } void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const PayloadHeader & payloadHeader, - SessionHandle session, const Transport::PeerAddress & source, DuplicateMessage isDuplicate, - System::PacketBufferHandle && msgBuf) + const SessionHandle & session, const Transport::PeerAddress & source, + DuplicateMessage isDuplicate, System::PacketBufferHandle && msgBuf) { UnsolicitedMessageHandler * matchingUMH = nullptr; @@ -314,12 +313,12 @@ void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const } } -void ExchangeManager::OnSessionReleased(SessionHandle session) +void ExchangeManager::OnSessionReleased(const SessionHandle & session) { ExpireExchangesForSession(session); } -void ExchangeManager::ExpireExchangesForSession(SessionHandle session) +void ExchangeManager::ExpireExchangesForSession(const SessionHandle & session) { mContextPool.ForEachActiveObject([&](auto * ec) { if (ec->mSession.Contains(session)) diff --git a/src/messaging/ExchangeMgr.h b/src/messaging/ExchangeMgr.h index 7981b150daeeb5..5cd2939e7d7b24 100644 --- a/src/messaging/ExchangeMgr.h +++ b/src/messaging/ExchangeMgr.h @@ -99,7 +99,7 @@ class DLL_EXPORT ExchangeManager : public SessionMessageDelegate, public Session * @return A pointer to the created ExchangeContext object On success. Otherwise NULL if no object * can be allocated or is available. */ - ExchangeContext * NewContext(SessionHandle session, ExchangeDelegate * delegate); + ExchangeContext * NewContext(const SessionHandle & session, ExchangeDelegate * delegate); void ReleaseContext(ExchangeContext * ec) { mContextPool.ReleaseObject(ec); } @@ -195,7 +195,7 @@ class DLL_EXPORT ExchangeManager : public SessionMessageDelegate, public Session // TODO: this should be test only, after OnSessionReleased is move to SessionHandle within the exchange context // Expire all exchanges associated with the given session - void ExpireExchangesForSession(SessionHandle session); + void ExpireExchangesForSession(const SessionHandle & session); private: enum class State @@ -232,8 +232,6 @@ class DLL_EXPORT ExchangeManager : public SessionMessageDelegate, public Session SessionManager * mSessionManager; ReliableMessageMgr mReliableMessageMgr; - ApplicationExchangeDispatch mDefaultExchangeDispatch; - FabricIndex mFabricIndex = 0; BitMapObjectPool mContextPool; @@ -243,11 +241,11 @@ class DLL_EXPORT ExchangeManager : public SessionMessageDelegate, public Session CHIP_ERROR RegisterUMH(Protocols::Id protocolId, int16_t msgType, ExchangeDelegate * delegate); CHIP_ERROR UnregisterUMH(Protocols::Id protocolId, int16_t msgType); - void OnMessageReceived(const PacketHeader & packetHeader, const PayloadHeader & payloadHeader, SessionHandle session, + void OnMessageReceived(const PacketHeader & packetHeader, const PayloadHeader & payloadHeader, const SessionHandle & session, const Transport::PeerAddress & source, DuplicateMessage isDuplicate, System::PacketBufferHandle && msgBuf) override; - void OnSessionReleased(SessionHandle session) override; + void OnSessionReleased(const SessionHandle & session) override; }; } // namespace Messaging diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index 81f0007a6611d4..bc92ac837abd3e 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -213,8 +213,7 @@ bool ReliableMessageMgr::CheckAndRemRetransTable(ReliableMessageContext * rc, ui CHIP_ERROR ReliableMessageMgr::SendFromRetransTable(RetransTableEntry * entry) { - const ExchangeMessageDispatch * dispatcher = entry->ec->GetMessageDispatch(); - if (dispatcher == nullptr || !entry->ec->HasSessionHandle()) + if (!entry->ec->HasSessionHandle()) { // Using same error message for all errors to reduce code size. ChipLogError(ExchangeManager, @@ -226,7 +225,8 @@ CHIP_ERROR ReliableMessageMgr::SendFromRetransTable(RetransTableEntry * entry) return CHIP_ERROR_INCORRECT_STATE; } - CHIP_ERROR err = dispatcher->SendPreparedMessage(entry->ec->GetSessionHandle(), entry->retainedBuf); + auto * sessionManager = entry->ec->GetExchangeMgr()->GetSessionManager(); + CHIP_ERROR err = sessionManager->SendPreparedMessage(entry->ec->GetSessionHandle(), entry->retainedBuf); if (err == CHIP_NO_ERROR) { diff --git a/src/messaging/tests/MessagingContext.cpp b/src/messaging/tests/MessagingContext.cpp index e891147e52ab77..267cc9359750d8 100644 --- a/src/messaging/tests/MessagingContext.cpp +++ b/src/messaging/tests/MessagingContext.cpp @@ -29,6 +29,7 @@ CHIP_ERROR MessagingContext::Init(TransportMgrBase * transport, IOContext * ioCo mInitialized = true; mIOContext = ioContext; + mTransport = transport; ReturnErrorOnFailure(mSessionManager.Init(&GetSystemLayer(), transport, &mMessageCounterManager)); @@ -56,6 +57,20 @@ CHIP_ERROR MessagingContext::Shutdown() return CHIP_NO_ERROR; } +CHIP_ERROR MessagingContext::InitFromExisting(const MessagingContext & existing) +{ + return Init(existing.mTransport, existing.mIOContext); +} + +CHIP_ERROR MessagingContext::ShutdownAndRestoreExisting(MessagingContext & existing) +{ + CHIP_ERROR err = Shutdown(); + // Point the transport back to the original session manager, since we had + // pointed it to ours. + existing.mTransport->SetSessionManager(&existing.GetSecureSessionManager()); + return err; +} + SessionHandle MessagingContext::GetSessionBobToAlice() { return mSessionBobToAlice.Get(); @@ -85,13 +100,13 @@ Messaging::ExchangeContext * MessagingContext::NewUnauthenticatedExchangeToBob(M Messaging::ExchangeContext * MessagingContext::NewExchangeToAlice(Messaging::ExchangeDelegate * delegate) { - // TODO: temprary create a SessionHandle from node id, will be fix in PR 3602 + // TODO: temporary create a SessionHandle from node id, will be fix in PR 3602 return mExchangeManager.NewContext(GetSessionBobToAlice(), delegate); } Messaging::ExchangeContext * MessagingContext::NewExchangeToBob(Messaging::ExchangeDelegate * delegate) { - // TODO: temprary create a SessionHandle from node id, will be fix in PR 3602 + // TODO: temporary create a SessionHandle from node id, will be fix in PR 3602 return mExchangeManager.NewContext(GetSessionAliceToBob(), delegate); } diff --git a/src/messaging/tests/MessagingContext.h b/src/messaging/tests/MessagingContext.h index 5ade386fde2134..ef3a261b47a067 100644 --- a/src/messaging/tests/MessagingContext.h +++ b/src/messaging/tests/MessagingContext.h @@ -50,6 +50,14 @@ class MessagingContext // Shutdown all layers, finalize operations CHIP_ERROR Shutdown(); + // Initialize from an existing messaging context. Useful if we want to + // share some state (like the transport). + CHIP_ERROR InitFromExisting(const MessagingContext & existing); + + // The shutdown method to use if using InitFromExisting. Must pass in the + // same existing context as was passed to InitFromExisting. + CHIP_ERROR ShutdownAndRestoreExisting(MessagingContext & existing); + static Inet::IPAddress GetAddress() { Inet::IPAddress addr; @@ -98,6 +106,7 @@ class MessagingContext Messaging::ExchangeManager mExchangeManager; secure_channel::MessageCounterManager mMessageCounterManager; IOContext * mIOContext; + TransportMgrBase * mTransport; // Only needed for InitFromExisting. NodeId mBobNodeId = 123654; NodeId mAliceNodeId = 111222333; @@ -115,7 +124,7 @@ class MessagingContext FabricIndex mDestFabricIndex = 0; }; -template +template class LoopbackMessagingContext : public MessagingContext { public: @@ -166,6 +175,8 @@ class LoopbackMessagingContext : public MessagingContext Transport & GetLoopback() { return mTransportManager.GetTransport().template GetImplAtIndex<0>(); } + TransportMgrBase & GetTransportMgr() { return mTransportManager; } + /* * For unit-tests that simulate end-to-end transmission and reception of messages in loopback mode, * this mode better replicates a real-functioning stack that correctly handles the processing diff --git a/src/messaging/tests/TestExchangeMgr.cpp b/src/messaging/tests/TestExchangeMgr.cpp index 1ac634be96353b..965cd8fbd15073 100644 --- a/src/messaging/tests/TestExchangeMgr.cpp +++ b/src/messaging/tests/TestExchangeMgr.cpp @@ -49,7 +49,7 @@ using namespace chip::Inet; using namespace chip::Transport; using namespace chip::Messaging; -using TestContext = chip::Test::LoopbackMessagingContext; +using TestContext = Test::LoopbackMessagingContext<>; enum : uint8_t { diff --git a/src/messaging/tests/TestReliableMessageProtocol.cpp b/src/messaging/tests/TestReliableMessageProtocol.cpp index 279be96b67b3ac..d78d38fe750521 100644 --- a/src/messaging/tests/TestReliableMessageProtocol.cpp +++ b/src/messaging/tests/TestReliableMessageProtocol.cpp @@ -55,15 +55,13 @@ using namespace chip::Messaging; using namespace chip::Protocols; using namespace chip::System::Clock::Literals; -using TestContext = chip::Test::MessagingContext; +using TestContext = Test::LoopbackMessagingContext<>; TestContext sContext; const char PAYLOAD[] = "Hello!"; -TransportMgrBase gTransportMgr; -Test::LoopbackTransport gLoopback; -chip::Test::IOContext gIOContext; +auto & gLoopback = sContext.GetLoopback(); class MockAppDelegate : public ExchangeDelegate { @@ -158,10 +156,7 @@ class MockSessionEstablishmentDelegate : public ExchangeDelegate void OnResponseTimeout(ExchangeContext * ec) override {} - virtual ExchangeMessageDispatch * GetMessageDispatch(ReliableMessageMgr * rmMgr, SessionManager * sessionManager) override - { - return &mMessageDispatch; - } + virtual ExchangeMessageDispatch & GetMessageDispatch() override { return mMessageDispatch; } bool IsOnMessageReceivedCalled = false; MockSessionEstablishmentExchangeDispatch mMessageDispatch; @@ -226,6 +221,7 @@ void CheckResendApplicationMessage(nlTestSuite * inSuite, void * inContext) // expect a response. err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer), SendMessageFlags::kExpectResponse); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was dropped, and was added to retransmit table NL_TEST_ASSERT(inSuite, gLoopback.mNumMessagesToDrop == 1); @@ -235,6 +231,7 @@ void CheckResendApplicationMessage(nlTestSuite * inSuite, void * inContext) // sleep 65 ms to trigger first re-transmit chip::test_utils::SleepMillis(65); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + ctx.DrainAndServiceIO(); // Ensure the retransmit message was dropped, and is still there in the retransmit table NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 2); @@ -245,6 +242,7 @@ void CheckResendApplicationMessage(nlTestSuite * inSuite, void * inContext) // sleep another 65 ms to trigger second re-transmit chip::test_utils::SleepMillis(65); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + ctx.DrainAndServiceIO(); // Ensure the retransmit message was NOT dropped, and the retransmit table is empty, as we should have gotten an ack NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount >= 3); @@ -287,6 +285,7 @@ void CheckCloseExchangeAndResendApplicationMessage(nlTestSuite * inSuite, void * err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was dropped, and was added to retransmit table NL_TEST_ASSERT(inSuite, gLoopback.mNumMessagesToDrop == 1); @@ -296,6 +295,7 @@ void CheckCloseExchangeAndResendApplicationMessage(nlTestSuite * inSuite, void * // sleep 65 ms to trigger first re-transmit chip::test_utils::SleepMillis(65); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + ctx.DrainAndServiceIO(); // Ensure the retransmit message was dropped, and is still there in the retransmit table NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 2); @@ -306,6 +306,7 @@ void CheckCloseExchangeAndResendApplicationMessage(nlTestSuite * inSuite, void * // sleep another 65 ms to trigger second re-transmit chip::test_utils::SleepMillis(65); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + ctx.DrainAndServiceIO(); // Ensure the retransmit message was NOT dropped, and the retransmit table is empty, as we should have gotten an ack NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount >= 3); @@ -323,9 +324,6 @@ void CheckFailedMessageRetainOnSend(nlTestSuite * inSuite, void * inContext) CHIP_ERROR err = CHIP_NO_ERROR; MockSessionEstablishmentDelegate mockSender; - err = mockSender.mMessageDispatch.Init(&ctx.GetSecureSessionManager()); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - ExchangeContext * exchange = ctx.NewExchangeToAlice(&mockSender); NL_TEST_ASSERT(inSuite, exchange != nullptr); @@ -349,6 +347,7 @@ void CheckFailedMessageRetainOnSend(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, rm->TestGetCountRetransTable() == 0); err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was dropped NL_TEST_ASSERT(inSuite, gLoopback.mDroppedMessageCount == 1); @@ -356,6 +355,7 @@ void CheckFailedMessageRetainOnSend(nlTestSuite * inSuite, void * inContext) // sleep 65 ms to trigger first re-transmit chip::test_utils::SleepMillis(65); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + ctx.DrainAndServiceIO(); // Ensure the retransmit table is empty, as we did not provide a message to retain NL_TEST_ASSERT(inSuite, rm->TestGetCountRetransTable() == 0); @@ -369,19 +369,13 @@ void CheckUnencryptedMessageReceiveFailure(nlTestSuite * inSuite, void * inConte NL_TEST_ASSERT(inSuite, !buffer.IsNull()); MockSessionEstablishmentDelegate mockReceiver; - CHIP_ERROR err = mockReceiver.mMessageDispatch.Init(&ctx.GetSecureSessionManager()); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - err = ctx.GetExchangeManager().RegisterUnsolicitedMessageHandlerForType(Echo::MsgType::EchoRequest, &mockReceiver); + CHIP_ERROR err = ctx.GetExchangeManager().RegisterUnsolicitedMessageHandlerForType(Echo::MsgType::EchoRequest, &mockReceiver); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); // Expect the received messages to be encrypted mockReceiver.mMessageDispatch.mRequireEncryption = true; MockSessionEstablishmentDelegate mockSender; - err = mockSender.mMessageDispatch.Init(&ctx.GetSecureSessionManager()); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - ExchangeContext * exchange = ctx.NewUnauthenticatedExchangeToAlice(&mockSender); NL_TEST_ASSERT(inSuite, exchange != nullptr); @@ -395,6 +389,8 @@ void CheckUnencryptedMessageReceiveFailure(nlTestSuite * inSuite, void * inConte // We are sending a malicious packet, doesn't expect an ack err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer), SendFlags(SendMessageFlags::kNoAutoRequestAck)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); + // Test that the message was actually sent (and not dropped) NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 1); NL_TEST_ASSERT(inSuite, gLoopback.mDroppedMessageCount == 0); @@ -441,6 +437,7 @@ void CheckResendApplicationMessageWithPeerExchange(nlTestSuite * inSuite, void * err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was dropped, and was added to retransmit table NL_TEST_ASSERT(inSuite, gLoopback.mNumMessagesToDrop == 0); @@ -451,6 +448,7 @@ void CheckResendApplicationMessageWithPeerExchange(nlTestSuite * inSuite, void * // sleep 65 ms to trigger first re-transmit chip::test_utils::SleepMillis(65); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + ctx.DrainAndServiceIO(); // Ensure the retransmit message was not dropped, and is no longer in the retransmit table NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount >= 2); @@ -506,6 +504,7 @@ void CheckDuplicateMessageClosedExchange(nlTestSuite * inSuite, void * inContext err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was sent // The ack was dropped, and message was added to the retransmit table @@ -522,6 +521,7 @@ void CheckDuplicateMessageClosedExchange(nlTestSuite * inSuite, void * inContext // sleep 65 ms to trigger first re-transmit chip::test_utils::SleepMillis(65); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + ctx.DrainAndServiceIO(); // Ensure the retransmit message was sent and the ack was sent // and retransmit table was cleared @@ -533,27 +533,23 @@ void CheckDuplicateMessageClosedExchange(nlTestSuite * inSuite, void * inContext void CheckResendSessionEstablishmentMessageWithPeerExchange(nlTestSuite * inSuite, void * inContext) { // Making this static to reduce stack usage, as some platforms have limits on stack size. - static TestContext ctx; + static Test::MessagingContext ctx; - CHIP_ERROR err = ctx.Init(&gTransportMgr, &gIOContext); + TestContext & inctx = *static_cast(inContext); + + CHIP_ERROR err = ctx.InitFromExisting(inctx); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); chip::System::PacketBufferHandle buffer = chip::MessagePacketBuffer::NewWithData(PAYLOAD, sizeof(PAYLOAD)); NL_TEST_ASSERT(inSuite, !buffer.IsNull()); MockSessionEstablishmentDelegate mockReceiver; - err = mockReceiver.mMessageDispatch.Init(&ctx.GetSecureSessionManager()); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = ctx.GetExchangeManager().RegisterUnsolicitedMessageHandlerForType(Echo::MsgType::EchoRequest, &mockReceiver); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); mockReceiver.mTestSuite = inSuite; MockSessionEstablishmentDelegate mockSender; - err = mockSender.mMessageDispatch.Init(&ctx.GetSecureSessionManager()); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - ExchangeContext * exchange = ctx.NewUnauthenticatedExchangeToAlice(&mockSender); NL_TEST_ASSERT(inSuite, exchange != nullptr); @@ -576,6 +572,7 @@ void CheckResendSessionEstablishmentMessageWithPeerExchange(nlTestSuite * inSuit err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + inctx.DrainAndServiceIO(); // Ensure the message was dropped, and was added to retransmit table NL_TEST_ASSERT(inSuite, gLoopback.mNumMessagesToDrop == 0); @@ -586,6 +583,7 @@ void CheckResendSessionEstablishmentMessageWithPeerExchange(nlTestSuite * inSuit // sleep 65 ms to trigger first re-transmit chip::test_utils::SleepMillis(65); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + inctx.DrainAndServiceIO(); // Ensure the retransmit message was not dropped, and is no longer in the retransmit table NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount >= 2); @@ -598,16 +596,7 @@ void CheckResendSessionEstablishmentMessageWithPeerExchange(nlTestSuite * inSuit err = ctx.GetExchangeManager().UnregisterUnsolicitedMessageHandlerForType(Echo::MsgType::EchoRequest); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - ctx.Shutdown(); - - // This test didn't use the global test context because the session establishment messages - // do not carry encryption key IDs (as the messages are not encrypted), or node IDs (as these - // are not assigned yet). A temporary context is created with default values for these - // parameters. - // Let's reset the state of transport manager so that other tests are not impacted - // as those could be using the global test context. - TestContext & inctx = *static_cast(inContext); - gTransportMgr.SetSessionManager(&inctx.GetSecureSessionManager()); + ctx.ShutdownAndRestoreExisting(inctx); } void CheckDuplicateMessage(nlTestSuite * inSuite, void * inContext) @@ -652,6 +641,7 @@ void CheckDuplicateMessage(nlTestSuite * inSuite, void * inContext) err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was sent // The ack was dropped, and message was added to the retransmit table @@ -669,6 +659,7 @@ void CheckDuplicateMessage(nlTestSuite * inSuite, void * inContext) // sleep 65 ms to trigger first re-transmit chip::test_utils::SleepMillis(65); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + ctx.DrainAndServiceIO(); // Ensure the retransmit message was sent and the ack was sent // and retransmit table was cleared @@ -718,6 +709,7 @@ void CheckReceiveAfterStandaloneAck(nlTestSuite * inSuite, void * inContext) err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer), SendFlags(SendMessageFlags::kExpectResponse)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 1); @@ -734,6 +726,7 @@ void CheckReceiveAfterStandaloneAck(nlTestSuite * inSuite, void * inContext) // Send the standalone ack. receiverRc->SendStandaloneAckMessage(); + ctx.DrainAndServiceIO(); // Ensure the ack was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 2); @@ -749,7 +742,9 @@ void CheckReceiveAfterStandaloneAck(nlTestSuite * inSuite, void * inContext) buffer = chip::MessagePacketBuffer::NewWithData(PAYLOAD, sizeof(PAYLOAD)); NL_TEST_ASSERT(inSuite, !buffer.IsNull()); - mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer)); + err = mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer)); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the response and its ack was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 4); @@ -805,6 +800,7 @@ void CheckPiggybackAfterPiggyback(nlTestSuite * inSuite, void * inContext) err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer), SendFlags(SendMessageFlags::kExpectResponse)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 1); @@ -828,8 +824,11 @@ void CheckPiggybackAfterPiggyback(nlTestSuite * inSuite, void * inContext) buffer = chip::MessagePacketBuffer::NewWithData(PAYLOAD, sizeof(PAYLOAD)); NL_TEST_ASSERT(inSuite, !buffer.IsNull()); - mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer), - SendFlags(SendMessageFlags::kExpectResponse).Set(SendMessageFlags::kNoAutoRequestAck)); + err = + mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer), + SendFlags(SendMessageFlags::kExpectResponse).Set(SendMessageFlags::kNoAutoRequestAck)); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the response was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 2); @@ -852,6 +851,7 @@ void CheckPiggybackAfterPiggyback(nlTestSuite * inSuite, void * inContext) err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer), SendFlags(SendMessageFlags::kExpectResponse).Set(SendMessageFlags::kNoAutoRequestAck)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 3); @@ -873,6 +873,7 @@ void CheckPiggybackAfterPiggyback(nlTestSuite * inSuite, void * inContext) err = mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the response and its ack was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 5); @@ -928,6 +929,7 @@ void CheckSendUnsolicitedStandaloneAckMessage(nlTestSuite * inSuite, void * inCo NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); // Needs a manual close, because SendMessage does not close for standalone acks. exchange->Close(); + ctx.DrainAndServiceIO(); // Ensure the message and its ack were sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 2); @@ -951,6 +953,7 @@ void CheckSendStandaloneAckMessage(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, rc != nullptr); NL_TEST_ASSERT(inSuite, rc->SendStandaloneAckMessage() == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Need manual close because standalone acks don't close exchanges. exchange->Close(); @@ -1009,6 +1012,7 @@ void CheckMessageAfterClosed(nlTestSuite * inSuite, void * inContext) err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer), SendFlags(SendMessageFlags::kExpectResponse)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 1); @@ -1033,7 +1037,9 @@ void CheckMessageAfterClosed(nlTestSuite * inSuite, void * inContext) buffer = chip::MessagePacketBuffer::NewWithData(PAYLOAD, sizeof(PAYLOAD)); NL_TEST_ASSERT(inSuite, !buffer.IsNull()); - mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer)); + err = mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer)); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the response was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 2); @@ -1057,6 +1063,7 @@ void CheckMessageAfterClosed(nlTestSuite * inSuite, void * inContext) err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was sent (and the ack for it was also sent). NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 4); @@ -1132,6 +1139,7 @@ void CheckLostResponseWithPiggyback(nlTestSuite * inSuite, void * inContext) err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer), SendFlags(SendMessageFlags::kExpectResponse)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 1); @@ -1165,7 +1173,9 @@ void CheckLostResponseWithPiggyback(nlTestSuite * inSuite, void * inContext) // Stop keeping receiver exchange alive. mockReceiver.mRetainExchange = true; - mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer)); + err = mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer)); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the response was sent but dropped. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 2); @@ -1188,6 +1198,7 @@ void CheckLostResponseWithPiggyback(nlTestSuite * inSuite, void * inContext) // sleep 65 ms to trigger re-transmit from sender chip::test_utils::SleepMillis(65); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + ctx.DrainAndServiceIO(); // We resent our first message, which did not make it to the app-level // listener on the receiver (because it's a duplicate) but did trigger a @@ -1217,6 +1228,7 @@ void CheckLostResponseWithPiggyback(nlTestSuite * inSuite, void * inContext) // sleep 65*3 ms to trigger re-transmit from receiver chip::test_utils::SleepMillis(65 * 3); ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), rm); + ctx.DrainAndServiceIO(); // And now we've definitely resent our response message, which should show // up as an app-level message and trigger a standalone ack. @@ -1281,6 +1293,7 @@ void CheckLostStandaloneAck(nlTestSuite * inSuite, void * inContext) err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer), SendFlags(SendMessageFlags::kExpectResponse)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 1); @@ -1304,8 +1317,10 @@ void CheckLostStandaloneAck(nlTestSuite * inSuite, void * inContext) buffer = chip::MessagePacketBuffer::NewWithData(PAYLOAD, sizeof(PAYLOAD)); NL_TEST_ASSERT(inSuite, !buffer.IsNull()); - mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer), - SendFlags(SendMessageFlags::kExpectResponse)); + err = mockReceiver.mExchange->SendMessage(Echo::MsgType::EchoResponse, std::move(buffer), + SendFlags(SendMessageFlags::kExpectResponse)); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the response was sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 2); @@ -1332,6 +1347,7 @@ void CheckLostStandaloneAck(nlTestSuite * inSuite, void * inContext) err = exchange->SendMessage(Echo::MsgType::EchoRequest, std::move(buffer)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); // Ensure the message and the standalone ack to it were sent. NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 4); @@ -1390,49 +1406,16 @@ const nlTest sTests[] = NL_TEST_SENTINEL() }; -// clang-format on - -int Initialize(void * aContext); -int Finalize(void * aContext); -// clang-format off nlTestSuite sSuite = { "Test-CHIP-ReliableMessageProtocol", &sTests[0], - Initialize, - Finalize + TestContext::InitializeAsync, + TestContext::Finalize }; // clang-format on -/** - * Initialize the test suite. - */ -int Initialize(void * aContext) -{ - // Initialize System memory and resources - VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gIOContext.Init() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gTransportMgr.Init(&gLoopback) == CHIP_NO_ERROR, FAILURE); - - auto * ctx = static_cast(aContext); - VerifyOrReturnError(ctx->Init(&gTransportMgr, &gIOContext) == CHIP_NO_ERROR, FAILURE); - - gTransportMgr.SetSessionManager(&ctx->GetSecureSessionManager()); - return SUCCESS; -} - -/** - * Finalize the test suite. - */ -int Finalize(void * aContext) -{ - CHIP_ERROR err = reinterpret_cast(aContext)->Shutdown(); - gIOContext.Shutdown(); - chip::Platform::MemoryShutdown(); - return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE; -} - } // namespace /** diff --git a/src/messaging/tests/echo/echo_requester.cpp b/src/messaging/tests/echo/echo_requester.cpp index 570b182f4e7f7e..c94c43ffd42669 100644 --- a/src/messaging/tests/echo/echo_requester.cpp +++ b/src/messaging/tests/echo/echo_requester.cpp @@ -180,6 +180,10 @@ CHIP_ERROR EstablishSecureSession() { printf("Establish secure session succeeded\n"); } + if (testSecurePairingSecret) + { + chip::Platform::Delete(testSecurePairingSecret); + } return err; } diff --git a/src/platform/Ameba/ConnectivityManagerImpl.cpp b/src/platform/Ameba/ConnectivityManagerImpl.cpp index 4a96a893a0ad65..e70938d1f09f76 100644 --- a/src/platform/Ameba/ConnectivityManagerImpl.cpp +++ b/src/platform/Ameba/ConnectivityManagerImpl.cpp @@ -733,15 +733,15 @@ void ConnectivityManagerImpl::OnStationIPv4AddressLost(void) void ConnectivityManagerImpl::OnIPv6AddressAvailable(void) { -#if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1 +#if LWIP_VERSION_MAJOR > 2 || LWIP_VERSION_MINOR > 0 #if LWIP_IPV6 uint8_t * ipv6_0 = LwIP_GetIPv6_linklocal(&xnetif[0]); uint8_t * ipv6_1 = LwIP_GetIPv6_global(&xnetif[0]); #endif -#endif +#endif // LWIP_VERSION_MAJOR > 2 || LWIP_VERSION_MINOR > 0 #if CHIP_PROGRESS_LOGGING { -#if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1 +#if LWIP_VERSION_MAJOR > 2 || LWIP_VERSION_MINOR > 0 #if LWIP_IPV6 ChipLogProgress(DeviceLayer, "\n\r\tLink-local IPV6 => %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", @@ -752,7 +752,7 @@ void ConnectivityManagerImpl::OnIPv6AddressAvailable(void) ipv6_1[0], ipv6_1[1], ipv6_1[2], ipv6_1[3], ipv6_1[4], ipv6_1[5], ipv6_1[6], ipv6_1[7], ipv6_1[8], ipv6_1[9], ipv6_1[10], ipv6_1[11], ipv6_1[12], ipv6_1[13], ipv6_1[14], ipv6_1[15]); #endif -#endif +#endif // LWIP_VERSION_MAJOR > 2 || LWIP_VERSION_MINOR > 0 } #endif // CHIP_PROGRESS_LOGGING @@ -782,14 +782,14 @@ void ConnectivityManagerImpl::DHCPProcessThread(void * param) PlatformMgr().LockChipStack(); sInstance.OnStationIPv4AddressAvailable(); PlatformMgr().UnlockChipStack(); -#if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1 +#if LWIP_VERSION_MAJOR > 2 || LWIP_VERSION_MINOR > 0 #if LWIP_IPV6 LwIP_DHCP6(0, DHCP6_START); PlatformMgr().LockChipStack(); sInstance.OnIPv6AddressAvailable(); PlatformMgr().UnlockChipStack(); #endif -#endif +#endif // LWIP_VERSION_MAJOR > 2 || LWIP_VERSION_MINOR > 0 vTaskDelete(NULL); } diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 1dd684ec06e330..c154565b8ab042 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -263,6 +263,7 @@ if (chip_device_platform != "none") { "../include/platform/CHIPDeviceLayer.h", "../include/platform/ConfigurationManager.h", "../include/platform/ConnectivityManager.h", + "../include/platform/DeviceControlServer.h", "../include/platform/GeneralUtils.h", "../include/platform/KeyValueStoreManager.h", "../include/platform/PersistedStorage.h", @@ -270,7 +271,6 @@ if (chip_device_platform != "none") { "../include/platform/ThreadStackManager.h", "../include/platform/internal/BLEManager.h", "../include/platform/internal/CHIPDeviceLayerInternal.h", - "../include/platform/internal/DeviceControlServer.h", "../include/platform/internal/DeviceNetworkInfo.h", "../include/platform/internal/DeviceNetworkProvisioning.h", "../include/platform/internal/EventLogging.h", @@ -296,6 +296,13 @@ if (chip_device_platform != "none") { "PlatformEventSupport.cpp", ] + if (chip_enable_ota_requestor) { + sources += [ + "GenericOTARequestorDriver.cpp", + "GenericOTARequestorDriver.h", + ] + } + cflags = [ "-Wconversion" ] public_deps = [ diff --git a/src/platform/Darwin/BUILD.gn b/src/platform/Darwin/BUILD.gn index 49286449375002..707f7f79183db9 100644 --- a/src/platform/Darwin/BUILD.gn +++ b/src/platform/Darwin/BUILD.gn @@ -76,6 +76,14 @@ static_library("Darwin") { public_configs = [ ":darwin_config" ] + if (chip_enable_ota_requestor) { + sources += [ + # using the implements from Linux platform + "../Linux/OTAImageProcessorImpl.cpp", + "../Linux/OTAImageProcessorImpl.h", + ] + } + if (chip_enable_ble) { sources += [ "BleApplicationDelegate.h", diff --git a/src/platform/Darwin/DnssdImpl.cpp b/src/platform/Darwin/DnssdImpl.cpp index dede9652732e51..931631307b3cd0 100644 --- a/src/platform/Darwin/DnssdImpl.cpp +++ b/src/platform/Darwin/DnssdImpl.cpp @@ -402,12 +402,14 @@ static void OnGetAddrInfo(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t i service.mPort = sdCtx->port; service.mTextEntries = sdCtx->textEntries.empty() ? nullptr : sdCtx->textEntries.data(); service.mTextEntrySize = sdCtx->textEntries.empty() ? 0 : sdCtx->textEntries.size(); - service.mAddress.SetValue(chip::Inet::IPAddress::FromSockAddr(*address)); + chip::Inet::IPAddress ip; + CHIP_ERROR status = chip::Inet::IPAddress::GetIPAddressFromSockAddr(*address, ip); + service.mAddress.SetValue(ip); Platform::CopyString(service.mName, sdCtx->name); Platform::CopyString(service.mHostName, hostname); service.mInterface = Inet::InterfaceId(sdCtx->interfaceId); - sdCtx->callback(sdCtx->context, &service, CHIP_NO_ERROR); + sdCtx->callback(sdCtx->context, &service, status); MdnsContexts::GetInstance().Remove(sdCtx); } diff --git a/src/platform/Darwin/PlatformManagerImpl.cpp b/src/platform/Darwin/PlatformManagerImpl.cpp index 7fc0905158b733..28454d4bf2f902 100644 --- a/src/platform/Darwin/PlatformManagerImpl.cpp +++ b/src/platform/Darwin/PlatformManagerImpl.cpp @@ -126,5 +126,12 @@ CHIP_ERROR PlatformManagerImpl::_PostEvent(const ChipDeviceEvent * event) return CHIP_NO_ERROR; } +CHIP_ERROR +PlatformManagerImpl::_SetUserLabelList(EndpointId endpoint, + LabelList & labelList) +{ + return CHIP_NO_ERROR; +} + } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/Darwin/PlatformManagerImpl.h b/src/platform/Darwin/PlatformManagerImpl.h index 40eab2aa749b44..b7dd12fae2bb17 100644 --- a/src/platform/Darwin/PlatformManagerImpl.h +++ b/src/platform/Darwin/PlatformManagerImpl.h @@ -61,6 +61,10 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener CHIP_ERROR _StartChipTimer(System::Clock::Timeout delay) { return CHIP_ERROR_NOT_IMPLEMENTED; }; CHIP_ERROR _StartEventLoopTask(); CHIP_ERROR _StopEventLoopTask(); + + CHIP_ERROR _SetUserLabelList(EndpointId endpoint, + LabelList & labelList); + void _RunEventLoop(); void _LockChipStack(){}; bool _TryLockChipStack() { return false; }; diff --git a/src/platform/DeviceControlServer.cpp b/src/platform/DeviceControlServer.cpp index e14069fde5e0d1..9509a3edfdc590 100644 --- a/src/platform/DeviceControlServer.cpp +++ b/src/platform/DeviceControlServer.cpp @@ -20,13 +20,12 @@ * Provides the implementation of the DeviceControlServer object. */ -#include +#include #include namespace chip { namespace DeviceLayer { -namespace Internal { void HandleArmFailSafe(System::Layer * layer, void * aAppState) { @@ -108,6 +107,5 @@ CHIP_ERROR DeviceControlServer::ConnectNetworkForOperational(ByteSpan networkID) return CHIP_NO_ERROR; } -} // namespace Internal } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/EFR32/BUILD.gn b/src/platform/EFR32/BUILD.gn index 94d18ef9d83ba6..5efbf9e4c733e7 100644 --- a/src/platform/EFR32/BUILD.gn +++ b/src/platform/EFR32/BUILD.gn @@ -57,6 +57,13 @@ static_library("EFR32") { "gatt_db.h", ] + if (chip_enable_ota_requestor) { + sources += [ + "OTAImageProcessorImpl.cpp", + "OTAImageProcessorImpl.h", + ] + } + public_deps = [ "${chip_root}/src/platform:platform_base" ] # Add pigweed KVS diff --git a/src/platform/EFR32/CHIPDevicePlatformConfig.h b/src/platform/EFR32/CHIPDevicePlatformConfig.h index a32bb6a651db78..36ea40f8ebe700 100644 --- a/src/platform/EFR32/CHIPDevicePlatformConfig.h +++ b/src/platform/EFR32/CHIPDevicePlatformConfig.h @@ -47,10 +47,7 @@ #define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 #define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 - -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY 2 -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY 3 -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY 4 +#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_GLOBAL_EIDC_KEY 2 // ========== Platform-specific Configuration ========= diff --git a/src/platform/EFR32/KeyValueStoreManagerImpl.h b/src/platform/EFR32/KeyValueStoreManagerImpl.h index bd504a34ab0116..32650db28215b7 100644 --- a/src/platform/EFR32/KeyValueStoreManagerImpl.h +++ b/src/platform/EFR32/KeyValueStoreManagerImpl.h @@ -67,7 +67,7 @@ class KeyValueStoreManagerImpl final : public KeyValueStoreManager /** * @brief - * Erases all data in the KVS partition, KVS needs to be initalized after + * Erases all data in the KVS partition, KVS needs to be initialized after * this operation. * * @return CHIP_NO_ERROR the partiton was erased. diff --git a/examples/ota-requestor-app/linux/LinuxOTAImageProcessor.cpp b/src/platform/EFR32/OTAImageProcessorImpl.cpp similarity index 83% rename from examples/ota-requestor-app/linux/LinuxOTAImageProcessor.cpp rename to src/platform/EFR32/OTAImageProcessorImpl.cpp index 0465a271409930..14a061484b680e 100644 --- a/examples/ota-requestor-app/linux/LinuxOTAImageProcessor.cpp +++ b/src/platform/EFR32/OTAImageProcessorImpl.cpp @@ -18,11 +18,11 @@ #include -#include "LinuxOTAImageProcessor.h" +#include "OTAImageProcessorImpl.h" namespace chip { -CHIP_ERROR LinuxOTAImageProcessor::PrepareDownload() +CHIP_ERROR OTAImageProcessorImpl::PrepareDownload() { if (mParams.imageFile.empty()) { @@ -34,18 +34,18 @@ CHIP_ERROR LinuxOTAImageProcessor::PrepareDownload() return CHIP_NO_ERROR; } -CHIP_ERROR LinuxOTAImageProcessor::Finalize() +CHIP_ERROR OTAImageProcessorImpl::Finalize() { DeviceLayer::PlatformMgr().ScheduleWork(HandleFinalize, reinterpret_cast(this)); return CHIP_NO_ERROR; } -CHIP_ERROR LinuxOTAImageProcessor::Apply() +CHIP_ERROR OTAImageProcessorImpl::Apply() { return CHIP_NO_ERROR; } -CHIP_ERROR LinuxOTAImageProcessor::Abort() +CHIP_ERROR OTAImageProcessorImpl::Abort() { if (mParams.imageFile.empty()) { @@ -57,7 +57,7 @@ CHIP_ERROR LinuxOTAImageProcessor::Abort() return CHIP_NO_ERROR; } -CHIP_ERROR LinuxOTAImageProcessor::ProcessBlock(ByteSpan & block) +CHIP_ERROR OTAImageProcessorImpl::ProcessBlock(ByteSpan & block) { if (!mOfs.is_open() || !mOfs.good()) { @@ -80,9 +80,9 @@ CHIP_ERROR LinuxOTAImageProcessor::ProcessBlock(ByteSpan & block) return CHIP_NO_ERROR; } -void LinuxOTAImageProcessor::HandlePrepareDownload(intptr_t context) +void OTAImageProcessorImpl::HandlePrepareDownload(intptr_t context) { - auto * imageProcessor = reinterpret_cast(context); + auto * imageProcessor = reinterpret_cast(context); if (imageProcessor == nullptr) { ChipLogError(SoftwareUpdate, "ImageProcessor context is null"); @@ -107,9 +107,9 @@ void LinuxOTAImageProcessor::HandlePrepareDownload(intptr_t context) imageProcessor->mDownloader->OnPreparedForDownload(CHIP_NO_ERROR); } -void LinuxOTAImageProcessor::HandleFinalize(intptr_t context) +void OTAImageProcessorImpl::HandleFinalize(intptr_t context) { - auto * imageProcessor = reinterpret_cast(context); + auto * imageProcessor = reinterpret_cast(context); if (imageProcessor == nullptr) { return; @@ -121,9 +121,9 @@ void LinuxOTAImageProcessor::HandleFinalize(intptr_t context) ChipLogProgress(SoftwareUpdate, "OTA image downloaded to %s", imageProcessor->mParams.imageFile.data()); } -void LinuxOTAImageProcessor::HandleAbort(intptr_t context) +void OTAImageProcessorImpl::HandleAbort(intptr_t context) { - auto * imageProcessor = reinterpret_cast(context); + auto * imageProcessor = reinterpret_cast(context); if (imageProcessor == nullptr) { return; @@ -134,9 +134,9 @@ void LinuxOTAImageProcessor::HandleAbort(intptr_t context) imageProcessor->ReleaseBlock(); } -void LinuxOTAImageProcessor::HandleProcessBlock(intptr_t context) +void OTAImageProcessorImpl::HandleProcessBlock(intptr_t context) { - auto * imageProcessor = reinterpret_cast(context); + auto * imageProcessor = reinterpret_cast(context); if (imageProcessor == nullptr) { ChipLogError(SoftwareUpdate, "ImageProcessor context is null"); @@ -161,7 +161,7 @@ void LinuxOTAImageProcessor::HandleProcessBlock(intptr_t context) imageProcessor->mDownloader->FetchNextData(); } -CHIP_ERROR LinuxOTAImageProcessor::SetBlock(ByteSpan & block) +CHIP_ERROR OTAImageProcessorImpl::SetBlock(ByteSpan & block) { if ((block.data() == nullptr) || block.empty()) { @@ -189,7 +189,7 @@ CHIP_ERROR LinuxOTAImageProcessor::SetBlock(ByteSpan & block) return CHIP_NO_ERROR; } -CHIP_ERROR LinuxOTAImageProcessor::ReleaseBlock() +CHIP_ERROR OTAImageProcessorImpl::ReleaseBlock() { if (mBlock.data() != nullptr) { diff --git a/examples/ota-requestor-app/linux/LinuxOTAImageProcessor.h b/src/platform/EFR32/OTAImageProcessorImpl.h similarity index 96% rename from examples/ota-requestor-app/linux/LinuxOTAImageProcessor.h rename to src/platform/EFR32/OTAImageProcessorImpl.h index ed66a4c091700f..77a13ca36e890c 100644 --- a/examples/ota-requestor-app/linux/LinuxOTAImageProcessor.h +++ b/src/platform/EFR32/OTAImageProcessorImpl.h @@ -26,7 +26,7 @@ namespace chip { -class LinuxOTAImageProcessor : public OTAImageProcessorInterface +class OTAImageProcessorImpl : public OTAImageProcessorInterface { public: //////////// OTAImageProcessorInterface Implementation /////////////// diff --git a/src/platform/ESP32/BUILD.gn b/src/platform/ESP32/BUILD.gn index 8173f9bddd80b6..7d70d6bec7f839 100644 --- a/src/platform/ESP32/BUILD.gn +++ b/src/platform/ESP32/BUILD.gn @@ -54,6 +54,12 @@ static_library("ESP32") { "${chip_root}/src/crypto", "${chip_root}/src/platform:platform_base", ] + if (chip_enable_ota_requestor) { + sources += [ + "OTAImageProcessorImpl.cpp", + "OTAImageProcessorImpl.h", + ] + } if (chip_enable_wifi) { sources += [ diff --git a/src/platform/ESP32/OTAImageProcessorImpl.cpp b/src/platform/ESP32/OTAImageProcessorImpl.cpp new file mode 100644 index 00000000000000..67d873b2abc569 --- /dev/null +++ b/src/platform/ESP32/OTAImageProcessorImpl.cpp @@ -0,0 +1,211 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "OTAImageProcessorImpl.h" +#include "esp_err.h" +#include "esp_log.h" +#include "esp_ota_ops.h" +#include "esp_system.h" +#include "lib/core/CHIPError.h" + +#define TAG "OTAImageProcessor" +using namespace ::chip::DeviceLayer::Internal; + +namespace chip { + +CHIP_ERROR OTAImageProcessorImpl::PrepareDownload() +{ + DeviceLayer::PlatformMgr().ScheduleWork(HandlePrepareDownload, reinterpret_cast(this)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::Finalize() +{ + DeviceLayer::PlatformMgr().ScheduleWork(HandleFinalize, reinterpret_cast(this)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::Apply() +{ + DeviceLayer::PlatformMgr().ScheduleWork(HandleApply, reinterpret_cast(this)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::Abort() +{ + DeviceLayer::PlatformMgr().ScheduleWork(HandleAbort, reinterpret_cast(this)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::ProcessBlock(ByteSpan & block) +{ + CHIP_ERROR err = SetBlock(block); + if (err != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "Cannot set block data: %" CHIP_ERROR_FORMAT, err.Format()); + return err; + } + DeviceLayer::PlatformMgr().ScheduleWork(HandleProcessBlock, reinterpret_cast(this)); + return CHIP_NO_ERROR; +} + +void OTAImageProcessorImpl::HandlePrepareDownload(intptr_t context) +{ + auto * imageProcessor = reinterpret_cast(context); + if (imageProcessor == nullptr) + { + ChipLogError(SoftwareUpdate, "ImageProcessor context is null"); + return; + } + else if (imageProcessor->mDownloader == nullptr) + { + ChipLogError(SoftwareUpdate, "mDownloader is null"); + return; + } + imageProcessor->mOTAUpdatePartition = esp_ota_get_next_update_partition(NULL); + if (imageProcessor->mOTAUpdatePartition == NULL) + { + ChipLogError(SoftwareUpdate, "OTA partition not found"); + return; + } + esp_err_t err = + esp_ota_begin(imageProcessor->mOTAUpdatePartition, OTA_WITH_SEQUENTIAL_WRITES, &(imageProcessor->mOTAUpdateHandle)); + if (err != ESP_OK) + { + imageProcessor->mDownloader->OnPreparedForDownload(ESP32Utils::MapError(err)); + return; + } + imageProcessor->mDownloader->OnPreparedForDownload(CHIP_NO_ERROR); +} + +void OTAImageProcessorImpl::HandleFinalize(intptr_t context) +{ + auto * imageProcessor = reinterpret_cast(context); + if (imageProcessor == nullptr) + { + ChipLogError(SoftwareUpdate, "ImageProcessor context is null"); + return; + } + esp_err_t err = esp_ota_end(imageProcessor->mOTAUpdateHandle); + if (err != ESP_OK) + { + if (err == ESP_ERR_OTA_VALIDATE_FAILED) + { + ESP_LOGE(TAG, "Image validation failed, image is corrupted"); + } + else + { + ESP_LOGE(TAG, "esp_ota_end failed (%s)!", esp_err_to_name(err)); + } + return; + } + imageProcessor->ReleaseBlock(); + ChipLogProgress(SoftwareUpdate, "OTA image downloaded to offset 0x%x", imageProcessor->mOTAUpdatePartition->address); +} + +void OTAImageProcessorImpl::HandleAbort(intptr_t context) +{ + auto * imageProcessor = reinterpret_cast(context); + if (imageProcessor == nullptr) + { + ChipLogError(SoftwareUpdate, "ImageProcessor context is null"); + return; + } + if (esp_ota_abort(imageProcessor->mOTAUpdateHandle) != ESP_OK) + { + ESP_LOGE(TAG, "ESP OTA abort failed"); + } + imageProcessor->ReleaseBlock(); +} + +void OTAImageProcessorImpl::HandleProcessBlock(intptr_t context) +{ + auto * imageProcessor = reinterpret_cast(context); + if (imageProcessor == nullptr) + { + ChipLogError(SoftwareUpdate, "ImageProcessor context is null"); + return; + } + else if (imageProcessor->mDownloader == nullptr) + { + ChipLogError(SoftwareUpdate, "mDownloader is null"); + return; + } + esp_err_t err = esp_ota_write(imageProcessor->mOTAUpdateHandle, imageProcessor->mBlock.data(), imageProcessor->mBlock.size()); + if (err != ESP_OK) + { + ESP_LOGE(TAG, "esp_ota_write failed (%s)", esp_err_to_name(err)); + imageProcessor->mDownloader->EndDownload(CHIP_ERROR_WRITE_FAILED); + } + imageProcessor->mParams.downloadedBytes += imageProcessor->mBlock.size(); + imageProcessor->mDownloader->FetchNextData(); +} + +void OTAImageProcessorImpl::HandleApply(intptr_t context) +{ + auto * imageProcessor = reinterpret_cast(context); + esp_err_t err = esp_ota_set_boot_partition(imageProcessor->mOTAUpdatePartition); + if (err != ESP_OK) + { + ESP_LOGE(TAG, "esp_ota_set_boot_partition failed (%s)!", esp_err_to_name(err)); + return; + } + ESP_LOGI(TAG, "Applying, Boot partition set offset:0x%x", imageProcessor->mOTAUpdatePartition->address); +} + +CHIP_ERROR OTAImageProcessorImpl::SetBlock(ByteSpan & block) +{ + if (!IsSpanUsable(block)) + { + ReleaseBlock(); + return CHIP_NO_ERROR; + } + if (mBlock.size() < block.size()) + { + if (!mBlock.empty()) + { + ReleaseBlock(); + } + uint8_t * mBlock_ptr = static_cast(chip::Platform::MemoryAlloc(block.size())); + if (mBlock_ptr == nullptr) + { + return CHIP_ERROR_NO_MEMORY; + } + mBlock = MutableByteSpan(mBlock_ptr, block.size()); + } + CHIP_ERROR err = CopySpanToMutableSpan(block, mBlock); + if (err != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "Cannot copy block data: %" CHIP_ERROR_FORMAT, err.Format()); + return err; + } + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::ReleaseBlock() +{ + if (mBlock.data() != nullptr) + { + chip::Platform::MemoryFree(mBlock.data()); + } + mBlock = MutableByteSpan(); + return CHIP_NO_ERROR; +} +} // namespace chip diff --git a/src/platform/ESP32/OTAImageProcessorImpl.h b/src/platform/ESP32/OTAImageProcessorImpl.h new file mode 100644 index 00000000000000..f8530606229645 --- /dev/null +++ b/src/platform/ESP32/OTAImageProcessorImpl.h @@ -0,0 +1,54 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "esp_ota_ops.h" +#include +#include +#include + +namespace chip { + +class OTAImageProcessorImpl : public OTAImageProcessorInterface +{ +public: + //////////// OTAImageProcessorInterface Implementation /////////////// + CHIP_ERROR PrepareDownload() override; + CHIP_ERROR Finalize() override; + CHIP_ERROR Apply() override; + CHIP_ERROR Abort() override; + CHIP_ERROR ProcessBlock(ByteSpan & block) override; + void SetOTADownloader(OTADownloader * downloader) { mDownloader = downloader; }; + +private: + static void HandlePrepareDownload(intptr_t context); + static void HandleFinalize(intptr_t context); + static void HandleAbort(intptr_t context); + static void HandleProcessBlock(intptr_t context); + static void HandleApply(intptr_t context); + + CHIP_ERROR SetBlock(ByteSpan & block); + CHIP_ERROR ReleaseBlock(); + + OTADownloader * mDownloader = nullptr; + MutableByteSpan mBlock; + const esp_partition_t * mOTAUpdatePartition = nullptr; + esp_ota_handle_t mOTAUpdateHandle; +}; + +} // namespace chip diff --git a/src/platform/GenericOTARequestorDriver.cpp b/src/platform/GenericOTARequestorDriver.cpp new file mode 100644 index 00000000000000..96acdfbe75c544 --- /dev/null +++ b/src/platform/GenericOTARequestorDriver.cpp @@ -0,0 +1,100 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "GenericOTARequestorDriver.h" + +#include +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace { + +GenericOTARequestorDriver * ToDriver(void * context) +{ + return static_cast(context); +} + +} // namespace + +bool GenericOTARequestorDriver::CanConsent() +{ + return false; +} + +uint16_t GenericOTARequestorDriver::GetMaxDownloadBlockSize() +{ + return 1024; +} + +void GenericOTARequestorDriver::HandleError(UpdateStateEnum state, CHIP_ERROR error) +{ + // TODO: Schedule the next QueryImage +} + +void GenericOTARequestorDriver::UpdateAvailable(const UpdateDescription & update, System::Clock::Seconds32 delay) +{ + VerifyOrDie(mRequestor != nullptr); + ScheduleDelayedAction(UpdateStateEnum::DelayedOnQuery, delay, + [](System::Layer *, void * context) { ToDriver(context)->mRequestor->DownloadUpdate(); }); +} + +void GenericOTARequestorDriver::UpdateNotFound(UpdateNotFoundReason reason, System::Clock::Seconds32 delay) +{ + // TODO: Schedule the next QueryImage +} + +void GenericOTARequestorDriver::UpdateDownloaded() +{ + VerifyOrDie(mRequestor != nullptr); + mRequestor->ApplyUpdate(); +} + +void GenericOTARequestorDriver::UpdateConfirmed(System::Clock::Seconds32 delay) +{ + VerifyOrDie(mImageProcessor != nullptr); + ScheduleDelayedAction(UpdateStateEnum::DelayedOnApply, delay, + [](System::Layer *, void * context) { ToDriver(context)->mImageProcessor->Apply(); }); +} + +void GenericOTARequestorDriver::UpdateSuspended(System::Clock::Seconds32 delay) +{ + VerifyOrDie(mRequestor != nullptr); + ScheduleDelayedAction(UpdateStateEnum::DelayedOnApply, delay, + [](System::Layer *, void * context) { ToDriver(context)->mRequestor->ApplyUpdate(); }); +} + +void GenericOTARequestorDriver::UpdateDiscontinued() +{ + VerifyOrDie(mImageProcessor != nullptr); + mImageProcessor->Abort(); +} + +void GenericOTARequestorDriver::ScheduleDelayedAction(UpdateStateEnum state, System::Clock::Seconds32 delay, + System::TimerCompleteCallback action) +{ + CHIP_ERROR error = SystemLayer().StartTimer(std::chrono::duration_cast(delay), action, this); + + if (error != CHIP_NO_ERROR) + { + HandleError(state, error); + } +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/GenericOTARequestorDriver.h b/src/platform/GenericOTARequestorDriver.h new file mode 100644 index 00000000000000..9f552a763a30d2 --- /dev/null +++ b/src/platform/GenericOTARequestorDriver.h @@ -0,0 +1,59 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace chip { + +class OTARequestorInterface; +class OTAImageProcessorInterface; + +namespace DeviceLayer { + +class GenericOTARequestorDriver : public OTARequestorDriver +{ +public: + void Init(OTARequestorInterface * requestor, OTAImageProcessorInterface * processor) + { + mRequestor = requestor; + mImageProcessor = processor; + } + + bool CanConsent() override; + uint16_t GetMaxDownloadBlockSize() override; + + void HandleError(UpdateStateEnum state, CHIP_ERROR error) override; + void UpdateAvailable(const UpdateDescription & update, System::Clock::Seconds32 delay) override; + void UpdateNotFound(UpdateNotFoundReason reason, System::Clock::Seconds32 delay) override; + void UpdateDownloaded() override; + void UpdateConfirmed(System::Clock::Seconds32 delay) override; + void UpdateSuspended(System::Clock::Seconds32 delay) override; + void UpdateDiscontinued() override; + +private: + void ScheduleDelayedAction(UpdateStateEnum state, System::Clock::Seconds32 delay, System::TimerCompleteCallback action); + + OTARequestorInterface * mRequestor = nullptr; + OTAImageProcessorInterface * mImageProcessor = nullptr; +}; + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/Linux/BUILD.gn b/src/platform/Linux/BUILD.gn index 6c9bcb122dc072..0033bac95cc3f7 100644 --- a/src/platform/Linux/BUILD.gn +++ b/src/platform/Linux/BUILD.gn @@ -61,6 +61,9 @@ static_library("Linux") { "KeyValueStoreManagerImpl.cpp", "KeyValueStoreManagerImpl.h", "Logging.cpp", + "NetworkCommissioningDriver.h", + "NetworkCommissioningThreadDriver.cpp", + "NetworkCommissioningWiFiDriver.cpp", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", "PosixConfig.cpp", @@ -81,6 +84,7 @@ static_library("Linux") { deps = [ "${chip_root}/src/setup_payload" ] public_deps = [ + "${chip_root}/src/app/common:cluster-objects", "${chip_root}/src/platform:platform_base", "${chip_root}/third_party/inipp", ] @@ -98,6 +102,13 @@ static_library("Linux") { public_configs += [ ":avahi_client_config" ] } + if (chip_enable_ota_requestor) { + sources += [ + "OTAImageProcessorImpl.cpp", + "OTAImageProcessorImpl.h", + ] + } + if (chip_enable_openthread) { sources += [ "GlibTypeDeleter.h", diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index d1d50779e38009..1496f04dad35e1 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -22,11 +22,15 @@ #include #include #include +#include #include #include #include #include +#include +#include +#include #include #include @@ -60,6 +64,8 @@ using namespace ::chip::DeviceLayer::Internal; using namespace ::chip::app::Clusters::GeneralDiagnostics; using namespace ::chip::app::Clusters::WiFiNetworkDiagnostics; +using namespace ::chip::DeviceLayer::NetworkCommissioning; + namespace chip { namespace DeviceLayer { @@ -69,12 +75,17 @@ ConnectivityManagerImpl ConnectivityManagerImpl::sInstance; char ConnectivityManagerImpl::sWiFiIfName[]; #endif +WiFiDriver::ScanCallback * ConnectivityManagerImpl::mpScanCallback; +NetworkCommissioning::Internal::WirelessDriver::ConnectCallback * ConnectivityManagerImpl::mpConnectCallback; + CHIP_ERROR ConnectivityManagerImpl::_Init() { #if CHIP_DEVICE_CONFIG_ENABLE_WPA mWiFiStationMode = kWiFiStationMode_Disabled; mWiFiStationReconnectInterval = System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL); #endif + mpConnectCallback = nullptr; + mpScanCallback = nullptr; if (ConnectivityUtils::GetEthInterfaceName(mEthIfName, IFNAMSIZ) == CHIP_NO_ERROR) { @@ -427,6 +438,7 @@ void ConnectivityManagerImpl::_OnWpaInterfaceProxyReady(GObject * source_object, ChipLogProgress(DeviceLayer, "wpa_supplicant: connected to wpa_supplicant interface proxy"); g_signal_connect(mWpaSupplicant.iface, "properties-changed", G_CALLBACK(_OnWpaPropertiesChanged), NULL); + g_signal_connect(mWpaSupplicant.iface, "scan-done", G_CALLBACK(_OnWpaInterfaceScanDone), NULL); } else { @@ -632,6 +644,17 @@ void ConnectivityManagerImpl::_OnWpaProxyReady(GObject * source_object, GAsyncRe mWpaSupplicant.state = GDBusWpaSupplicant::WPA_NOT_CONNECTED; } + // We need to stop auto scan or it will block our network scan. + DeviceLayer::SystemLayer().ScheduleLambda([]() { + std::lock_guard innerLock(mWpaSupplicantMutex); + ChipLogDetail(DeviceLayer, "Disabling auto scan"); + CHIP_ERROR errInner = StopAutoScan(); + if (errInner != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Failed to stop auto scan"); + } + }); + if (err != nullptr) g_error_free(err); } @@ -864,6 +887,126 @@ void ConnectivityManagerImpl::DriveAPState(::chip::System::Layer * aLayer, void sInstance.DriveAPState(); } +CHIP_ERROR +ConnectivityManagerImpl::ConnectWiFiNetworkAsync(ByteSpan ssid, ByteSpan credentials, + NetworkCommissioning::Internal::WirelessDriver::ConnectCallback * apCallback) +{ + CHIP_ERROR ret = CHIP_NO_ERROR; + GError * err = nullptr; + GVariant * args = nullptr; + GVariantBuilder builder; + gboolean result; + char ssidStr[kMaxWiFiSSIDLength] = { 0 }; + char keyStr[kMaxWiFiKeyLength] = { 0 }; + // There is another ongoing connect request, reject the new one. + VerifyOrReturnError(mpConnectCallback == nullptr, CHIP_ERROR_INCORRECT_STATE); + + // Clean up current network if exists + if (mWpaSupplicant.networkPath) + { + GError * error = nullptr; + + result = wpa_fi_w1_wpa_supplicant1_interface_call_remove_network_sync(mWpaSupplicant.iface, mWpaSupplicant.networkPath, + nullptr, &error); + + if (result) + { + ChipLogProgress(DeviceLayer, "wpa_supplicant: removed network: %s", mWpaSupplicant.networkPath); + g_free(mWpaSupplicant.networkPath); + mWpaSupplicant.networkPath = nullptr; + } + else + { + ChipLogProgress(DeviceLayer, "wpa_supplicant: failed to stop AP mode with error: %s", + error ? error->message : "unknown error"); + ret = CHIP_ERROR_INTERNAL; + } + + if (error != nullptr) + g_error_free(error); + + SuccessOrExit(ret); + } + + g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); + memcpy(ssidStr, ssid.data(), ssid.size()); + memcpy(keyStr, credentials.data(), credentials.size()); + g_variant_builder_add(&builder, "{sv}", "ssid", g_variant_new_string(ssidStr)); + g_variant_builder_add(&builder, "{sv}", "psk", g_variant_new_string(keyStr)); + g_variant_builder_add(&builder, "{sv}", "key_mgmt", g_variant_new_string("WPA-PSK")); + args = g_variant_builder_end(&builder); + + result = wpa_fi_w1_wpa_supplicant1_interface_call_add_network_sync(mWpaSupplicant.iface, args, &mWpaSupplicant.networkPath, + nullptr, &err); + + if (result) + { + // Note: wpa_supplicant will return immediately if the network is already connected, but it will still try reconnect in the + // background. The client still need to wait for a few seconds for this reconnect operation. So we always disconnect from + // the network we are connected and ignore any errors. + wpa_fi_w1_wpa_supplicant1_interface_call_disconnect_sync(mWpaSupplicant.iface, nullptr, nullptr); + ChipLogProgress(DeviceLayer, "wpa_supplicant: added network: %s", mWpaSupplicant.networkPath); + + wpa_fi_w1_wpa_supplicant1_interface_call_select_network(mWpaSupplicant.iface, mWpaSupplicant.networkPath, nullptr, + _ConnectWiFiNetworkAsyncCallback, this); + mpConnectCallback = apCallback; + } + else + { + ChipLogProgress(DeviceLayer, "wpa_supplicant: failed to add network: %s", err ? err->message : "unknown error"); + + if (mWpaSupplicant.networkPath) + { + g_object_unref(mWpaSupplicant.networkPath); + mWpaSupplicant.networkPath = nullptr; + } + + ret = CHIP_ERROR_INTERNAL; + } + +exit: + if (err != nullptr) + g_error_free(err); + + return ret; +} + +void ConnectivityManagerImpl::_ConnectWiFiNetworkAsyncCallback(GObject * source_object, GAsyncResult * res, gpointer user_data) +{ + ConnectivityManagerImpl * this_ = reinterpret_cast(user_data); + std::unique_ptr attachRes; + std::unique_ptr err; + { + gboolean result = wpa_fi_w1_wpa_supplicant1_interface_call_select_network_finish(mWpaSupplicant.iface, res, + &MakeUniquePointerReceiver(err).Get()); + if (!result) + { + ChipLogError(DeviceLayer, "Failed to perform connect network: %s", err == nullptr ? "unknown error" : err->message); + DeviceLayer::SystemLayer().ScheduleLambda([this_]() { + if (mpConnectCallback != nullptr) + { + // TODO: Replace this with actual thread attach result. + this_->mpConnectCallback->OnResult(NetworkCommissioning::Status::kUnknownError, CharSpan(), 0); + this_->mpConnectCallback = nullptr; + } + mpConnectCallback = nullptr; + }); + } + else + { + DeviceLayer::SystemLayer().ScheduleLambda([this_]() { + if (this_->mpConnectCallback != nullptr) + { + // TODO: Replace this with actual thread attach result. + this_->mpConnectCallback->OnResult(NetworkCommissioning::Status::kSuccess, CharSpan(), 0); + this_->mpConnectCallback = nullptr; + } + this_->PostNetworkConnect(); + }); + } + } +} + CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, const char * key) { CHIP_ERROR ret = CHIP_NO_ERROR; @@ -937,45 +1080,7 @@ CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, cons if (gerror != nullptr) g_error_free(gerror); - // Iterate on the network interface to see if we already have beed assigned addresses. - // The temporary hack for getting IP address change on linux for network provisioning in the rendezvous session. - // This should be removed or find a better place once we depercate the rendezvous session. - for (chip::Inet::InterfaceAddressIterator it; it.HasCurrent(); it.Next()) - { - char ifName[chip::Inet::InterfaceId::kMaxIfNameLength]; - if (it.IsUp() && CHIP_NO_ERROR == it.GetInterfaceName(ifName, sizeof(ifName)) && - strncmp(ifName, sWiFiIfName, sizeof(ifName)) == 0) - { - chip::Inet::IPAddress addr = it.GetAddress(); - if (addr.IsIPv4()) - { - ChipDeviceEvent event; - event.Type = DeviceEventType::kInternetConnectivityChange; - event.InternetConnectivityChange.IPv4 = kConnectivity_Established; - event.InternetConnectivityChange.IPv6 = kConnectivity_NoChange; - addr.ToString(event.InternetConnectivityChange.address); - - ChipLogDetail(DeviceLayer, "Got IP address on interface: %s IP: %s", ifName, - event.InternetConnectivityChange.address); - - PlatformMgr().PostEventOrDie(&event); - } - } - } - - // Run dhclient for IP on WiFi. - // TODO: The wifi can be managed by networkmanager on linux so we don't have to care about this. - char cmdBuffer[128]; - sprintf(cmdBuffer, CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD, sWiFiIfName); - int dhclientSystemRet = system(cmdBuffer); - if (dhclientSystemRet != 0) - { - ChipLogError(DeviceLayer, "Failed to run dhclient, system() returns %d", dhclientSystemRet); - } - else - { - ChipLogProgress(DeviceLayer, "dhclient is running on the %s interface.", sWiFiIfName); - } + PostNetworkConnect(); // Return success as long as the device is connected to the network ret = CHIP_NO_ERROR; @@ -1011,6 +1116,69 @@ CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, cons return ret; } +void ConnectivityManagerImpl::PostNetworkConnect() +{ + // Iterate on the network interface to see if we already have beed assigned addresses. + // The temporary hack for getting IP address change on linux for network provisioning in the rendezvous session. + // This should be removed or find a better place once we depercate the rendezvous session. + for (chip::Inet::InterfaceAddressIterator it; it.HasCurrent(); it.Next()) + { + char ifName[chip::Inet::InterfaceId::kMaxIfNameLength]; + if (it.IsUp() && CHIP_NO_ERROR == it.GetInterfaceName(ifName, sizeof(ifName)) && + strncmp(ifName, sWiFiIfName, sizeof(ifName)) == 0) + { + chip::Inet::IPAddress addr; + if ((it.GetAddress(addr) == CHIP_NO_ERROR) && addr.IsIPv4()) + { + ChipDeviceEvent event; + event.Type = DeviceEventType::kInternetConnectivityChange; + event.InternetConnectivityChange.IPv4 = kConnectivity_Established; + event.InternetConnectivityChange.IPv6 = kConnectivity_NoChange; + addr.ToString(event.InternetConnectivityChange.address); + + ChipLogDetail(DeviceLayer, "Got IP address on interface: %s IP: %s", ifName, + event.InternetConnectivityChange.address); + + PlatformMgr().PostEventOrDie(&event); + } + } + } + + // Run dhclient for IP on WiFi. + // TODO: The wifi can be managed by networkmanager on linux so we don't have to care about this. + char cmdBuffer[128]; + sprintf(cmdBuffer, CHIP_DEVICE_CONFIG_LINUX_DHCPC_CMD, sWiFiIfName); + int dhclientSystemRet = system(cmdBuffer); + if (dhclientSystemRet != 0) + { + ChipLogError(DeviceLayer, "Failed to run dhclient, system() returns %d", dhclientSystemRet); + } + else + { + ChipLogProgress(DeviceLayer, "dhclient is running on the %s interface.", sWiFiIfName); + } +} + +CHIP_ERROR ConnectivityManagerImpl::CommitConfig() +{ + gboolean result; + std::unique_ptr err; + + ChipLogProgress(DeviceLayer, "wpa_supplicant: connected to network"); + + result = wpa_fi_w1_wpa_supplicant1_interface_call_save_config_sync(mWpaSupplicant.iface, nullptr, + &MakeUniquePointerReceiver(err).Get()); + + if (!result) + { + ChipLogProgress(DeviceLayer, "wpa_supplicant: failed to save config: %s", err ? err->message : "unknown error"); + return CHIP_ERROR_INTERNAL; + } + + ChipLogProgress(DeviceLayer, "wpa_supplicant: save config succeeded!"); + return CHIP_NO_ERROR; +} + CHIP_ERROR ConnectivityManagerImpl::GetWiFiBssId(ByteSpan & value) { CHIP_ERROR err = CHIP_ERROR_READ_FAILED; @@ -1110,6 +1278,368 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiVersion(uint8_t & wiFiVersion) return CHIP_NO_ERROR; } +CHIP_ERROR ConnectivityManagerImpl::GetConnectedNetwork(NetworkCommissioning::Network & network) +{ + std::lock_guard lock(mWpaSupplicantMutex); + std::unique_ptr err; + + const gchar * networkPath = wpa_fi_w1_wpa_supplicant1_interface_get_current_network(mWpaSupplicant.iface); + + std::unique_ptr networkInfo( + wpa_fi_w1_wpa_supplicant1_network_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, + kWpaSupplicantServiceName, networkPath, nullptr, + &MakeUniquePointerReceiver(err).Get())); + if (networkInfo == nullptr) + { + return CHIP_ERROR_INTERNAL; + } + + network.connected = wpa_fi_w1_wpa_supplicant1_network_get_enabled(networkInfo.get()); + GVariant * properties = wpa_fi_w1_wpa_supplicant1_network_get_properties(networkInfo.get()); + GVariant * ssid = g_variant_lookup_value(properties, "ssid", nullptr); + gsize length; + const gchar * ssidStr = g_variant_get_string(ssid, &length); + if (length > sizeof(network.networkID)) + { + return CHIP_ERROR_INTERNAL; + } + // TODO: wpa_supplicant will return ssid with quotes! We should have a better way to get the actual ssid in bytes. + ChipLogDetail(DeviceLayer, "Current connected network: %s", ssidStr); + memcpy(network.networkID, ssidStr + 1, length - 2); + network.networkIDLen = length - 2; + return CHIP_NO_ERROR; +} + +CHIP_ERROR ConnectivityManagerImpl::StopAutoScan() +{ + std::unique_ptr err; + + gboolean result; + result = wpa_fi_w1_wpa_supplicant1_interface_call_auto_scan_sync( + mWpaSupplicant.iface, "" /* empty string means disabling auto scan */, nullptr, &MakeUniquePointerReceiver(err).Get()); + if (!result) + { + ChipLogError(DeviceLayer, "wpa_supplicant: Failed to stop auto network scan: %s", err ? err->message : "unknown"); + return CHIP_ERROR_INTERNAL; + } + return CHIP_NO_ERROR; +} + +CHIP_ERROR ConnectivityManagerImpl::StartWiFiScan(ByteSpan ssid, WiFiDriver::ScanCallback * callback) +{ + std::lock_guard lock(mWpaSupplicantMutex); + VerifyOrReturnError(mWpaSupplicant.iface != nullptr, CHIP_ERROR_INCORRECT_STATE); + // There is another ongoing scan request, reject the new one. + VerifyOrReturnError(mpScanCallback == nullptr, CHIP_ERROR_INCORRECT_STATE); + + CHIP_ERROR ret = CHIP_NO_ERROR; + GError * err = nullptr; + GVariant * args = nullptr; + GVariantBuilder builder; + gboolean result; + + g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); + g_variant_builder_add(&builder, "{sv}", "Type", g_variant_new_string("active")); + args = g_variant_builder_end(&builder); + + result = wpa_fi_w1_wpa_supplicant1_interface_call_scan_sync(mWpaSupplicant.iface, args, nullptr, &err); + + if (result) + { + ChipLogProgress(DeviceLayer, "wpa_supplicant: initialized network scan."); + mpScanCallback = callback; + } + else + { + ChipLogProgress(DeviceLayer, "wpa_supplicant: failed to start network scan: %s", err ? err->message : "unknown error"); + ret = CHIP_ERROR_INTERNAL; + } + + if (err != nullptr) + { + g_error_free(err); + } + return ret; +} + +namespace { +// wpa_supplicant's scan results don't contains the channel infomation, so we need this lookup table for resolving the band and +// channel infomation. +std::pair GetBandAndChannelFromFrequency(uint32_t freq) +{ + std::pair ret = std::make_pair(WiFiBand::k2g4, 0); + if (freq <= 2472) + { + ret.second = static_cast((freq - 2412) / 5 + 1); + } + else if (freq == 2484) + { + ret.second = 14; + } + else if (freq >= 3600 && freq <= 3700) + { + // Note: There are not many devices supports this band, and this band contains rational frequency in MHz, need to figure out + // the behavior of wpa_supplicant in this case. + ret.first = WiFiBand::k3g65; + } + else if (freq >= 5035 && freq <= 5945) + { + ret.first = WiFiBand::k5g; + ret.second = static_cast((freq - 5000) / 5); + } + else if (freq == 5960 || freq == 5980) + { + ret.first = WiFiBand::k5g; + ret.second = static_cast((freq - 5000) / 5); + } + else if (freq >= 5955) + { + ret.first = WiFiBand::k6g; + ret.second = static_cast((freq - 5950) / 5); + } + else if (freq >= 58000) + { + ret.first = WiFiBand::k60g; + // Note: Some channel has the same center frequency but different bandwidth. Should figure out wpa_supplicant's behavior in + // this case. Also, wpa_supplicant's frequency property is uint16 infact. + switch (freq) + { + case 58'320: + ret.second = 1; + break; + case 60'480: + ret.second = 2; + break; + case 62'640: + ret.second = 3; + break; + case 64'800: + ret.second = 4; + break; + case 66'960: + ret.second = 5; + break; + case 69'120: + ret.second = 6; + break; + case 59'400: + ret.second = 9; + break; + case 61'560: + ret.second = 10; + break; + case 63'720: + ret.second = 11; + break; + case 65'880: + ret.second = 12; + break; + case 68'040: + ret.second = 13; + break; + } + } + return ret; +} +} // namespace + +bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissioning::WiFiScanResponse & result) +{ + std::unique_ptr err; + std::unique_ptr bss( + wpa_fi_w1_wpa_supplicant1_bss_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, kWpaSupplicantServiceName, + bssPath, nullptr, &MakeUniquePointerReceiver(err).Get())); + + if (bss == nullptr) + { + return false; + } + + WpaFiW1Wpa_supplicant1BSSProxy * bssProxy = WPA_FI_W1_WPA_SUPPLICANT1_BSS_PROXY(bss.get()); + + std::unique_ptr ssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "SSID")); + std::unique_ptr bssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "BSSID")); + + const guchar * ssidStr = nullptr; + const guchar * bssidBuf = nullptr; + char bssidStr[2 * 6 + 5 + 1] = { 0 }; + gsize ssidLen = 0; + gsize bssidLen = 0; + gint16 signal = wpa_fi_w1_wpa_supplicant1_bss_get_signal(bss.get()); + guint16 frequency = wpa_fi_w1_wpa_supplicant1_bss_get_frequency(bss.get()); + + ssidStr = reinterpret_cast(g_variant_get_fixed_array(ssid.get(), &ssidLen, sizeof(guchar))); + bssidBuf = reinterpret_cast(g_variant_get_fixed_array(bssid.get(), &bssidLen, sizeof(guchar))); + + if (bssidLen == 6) + { + snprintf(bssidStr, sizeof(bssidStr), "%02x:%02x:%02x:%02x:%02x:%02x", bssidBuf[0], bssidBuf[1], bssidBuf[2], bssidBuf[3], + bssidBuf[4], bssidBuf[5]); + } + else + { + bssidLen = 0; + ChipLogError(DeviceLayer, "Got a network with bssid not equals to 6"); + } + ChipLogDetail(DeviceLayer, "Network Found: %.*s (%s) Signal:%" PRId16, int(ssidLen), ssidStr, bssidStr, signal); + + // A flag for enterprise encryption option to avoid returning open for these networks by mistake + // TODO: The following code will mistakenly recognize WEP encryption as OPEN network, this should be fixed by reading + // IEs (information elements) field instead of reading cooked data. + + static constexpr uint8_t kEAP = (1 << 7); + + auto IsNetworkWPAPSK = [](GVariant * wpa) -> uint8_t { + if (wpa == nullptr) + { + return 0; + } + + GVariant * keyMgmt = g_variant_lookup_value(wpa, "KeyMgmt", nullptr); + if (keyMgmt == nullptr) + { + return 0; + } + const gchar ** keyMgmts = g_variant_get_strv(keyMgmt, nullptr); + const gchar ** keyMgmtsForFree = keyMgmts; + uint8_t res = 0; + for (const gchar * keyMgmtVal = (keyMgmts != nullptr ? *keyMgmts : nullptr); keyMgmtVal != nullptr; + keyMgmtVal = *(++keyMgmts)) + { + if (g_strcasecmp(keyMgmtVal, "wpa-psk") == 0 || g_strcasecmp(keyMgmtVal, "wpa-none") == 0) + { + res |= (1 << 2); // SecurityType::WPA_PERSONAL + } + else if (g_strcasecmp(keyMgmtVal, "wpa-eap")) + { + res |= (kEAP); + } + } + g_variant_unref(keyMgmt); + g_free(keyMgmtsForFree); + return res; + }; + auto IsNetworkWPA2PSK = [](GVariant * rsn) -> uint8_t { + if (rsn == nullptr) + { + return 0; + } + GVariant * keyMgmt = g_variant_lookup_value(rsn, "KeyMgmt", nullptr); + if (keyMgmt == nullptr) + { + return 0; + } + const gchar ** keyMgmts = g_variant_get_strv(keyMgmt, nullptr); + const gchar ** keyMgmtsForFree = keyMgmts; + uint8_t res = 0; + for (const gchar * keyMgmtVal = (keyMgmts != nullptr ? *keyMgmts : nullptr); keyMgmtVal != nullptr; + keyMgmtVal = *(++keyMgmts)) + { + if (g_strcasecmp(keyMgmtVal, "wpa-psk") == 0 || g_strcasecmp(keyMgmtVal, "wpa-psk-sha256") == 0 || + g_strcasecmp(keyMgmtVal, "wpa-ft-psk") == 0) + { + res |= (1 << 3); // SecurityType::WPA2_PERSONAL + } + else if (g_strcasecmp(keyMgmtVal, "wpa-eap") == 0 || g_strcasecmp(keyMgmtVal, "wpa-eap-sha256") == 0 || + g_strcasecmp(keyMgmtVal, "wpa-ft-eap") == 0) + { + res |= kEAP; + } + else if (g_strcasecmp(keyMgmtVal, "sae") == 0) + { + // wpa_supplicant will include "sae" in KeyMgmt field for WPA3 WiFi, this is not included in the wpa_supplicant + // document. + res |= (1 << 4); // SecurityType::WPA3_PERSONAL + } + } + g_variant_unref(keyMgmt); + g_free(keyMgmtsForFree); + return res; + }; + auto GetNetworkSecurityType = [IsNetworkWPAPSK, IsNetworkWPA2PSK](WpaFiW1Wpa_supplicant1BSSProxy * proxy) -> uint8_t { + std::unique_ptr wpa(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(proxy), "WPA")); + std::unique_ptr rsn(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(proxy), "RSN")); + + uint8_t res = IsNetworkWPAPSK(wpa.get()) | IsNetworkWPA2PSK(rsn.get()); + if (res == 0) + { + res = 1; // Open + } + return res & (0x7F); + }; + + // Drop the network if its SSID or BSSID is illegal. + VerifyOrReturnError(ssidLen <= kMaxWiFiSSIDLength, false); + VerifyOrReturnError(bssidLen == kWiFiBSSIDLength, false); + memcpy(result.ssid, ssidStr, ssidLen); + memcpy(result.bssid, bssidBuf, bssidLen); + result.ssidLen = ssidLen; + if (signal < INT8_MIN) + { + result.rssi = INT8_MIN; + } + else if (signal > INT8_MAX) + { + result.rssi = INT8_MAX; + } + else + { + result.rssi = static_cast(signal); + } + + auto bandInfo = GetBandAndChannelFromFrequency(frequency); + result.wiFiBand = bandInfo.first; + result.channel = bandInfo.second; + result.security = GetNetworkSecurityType(bssProxy); + + return true; +} + +void ConnectivityManagerImpl::_OnWpaInterfaceScanDone(GObject * source_object, GAsyncResult * res, gpointer user_data) +{ + ChipLogProgress(DeviceLayer, "wpa_supplicant: network scan done"); + gchar ** bsss = wpa_fi_w1_wpa_supplicant1_interface_dup_bsss(mWpaSupplicant.iface); + gchar ** oldBsss = bsss; + if (bsss == nullptr) + { + ChipLogProgress(DeviceLayer, "wpa_supplicant: no network found"); + DeviceLayer::SystemLayer().ScheduleLambda([]() { + if (mpScanCallback != nullptr) + { + mpScanCallback->OnFinished(Status::kSuccess, CharSpan(), nullptr); + mpScanCallback = nullptr; + } + }); + return; + } + + std::vector * networkScanned = new std::vector(); + for (const gchar * bssPath = (bsss != nullptr ? *bsss : nullptr); bssPath != nullptr; bssPath = *(++bsss)) + { + WiFiScanResponse network; + if (_GetBssInfo(bssPath, network)) + { + networkScanned->push_back(network); + } + } + + DeviceLayer::SystemLayer().ScheduleLambda([networkScanned]() { + // Note: We cannot post a event in ScheduleLambda since std::vector is not trivial copiable. This results in the use of + // const_cast but should be fine for almost all cases, since we actually handled the ownership of this element to this + // lambda. + if (mpScanCallback != nullptr) + { + LinuxScanResponseIterator iter(const_cast *>(networkScanned)); + mpScanCallback->OnFinished(Status::kSuccess, CharSpan(), &iter); + mpScanCallback = nullptr; + } + + delete const_cast *>(networkScanned); + }); + + g_strfreev(oldBsss); +} + #endif // CHIP_DEVICE_CONFIG_ENABLE_WPA } // namespace DeviceLayer diff --git a/src/platform/Linux/ConnectivityManagerImpl.h b/src/platform/Linux/ConnectivityManagerImpl.h index 39b7aec2db2467..555aa2ae28802e 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.h +++ b/src/platform/Linux/ConnectivityManagerImpl.h @@ -45,6 +45,10 @@ #include #endif +#include +#include +#include + namespace chip { namespace Inet { class IPAddress; @@ -110,11 +114,19 @@ class ConnectivityManagerImpl final : public ConnectivityManager, public: #if CHIP_DEVICE_CONFIG_ENABLE_WPA CHIP_ERROR ProvisionWiFiNetwork(const char * ssid, const char * key); + CHIP_ERROR ConnectWiFiNetworkAsync(ByteSpan ssid, ByteSpan credentials, + NetworkCommissioning::Internal::WirelessDriver::ConnectCallback * connectCallback); + void PostNetworkConnect(); + static void _ConnectWiFiNetworkAsyncCallback(GObject * source_object, GAsyncResult * res, gpointer user_data); + CHIP_ERROR CommitConfig(); + void StartWiFiManagement(); bool IsWiFiManagementStarted(); CHIP_ERROR GetWiFiBssId(ByteSpan & value); CHIP_ERROR GetWiFiSecurityType(uint8_t & securityType); CHIP_ERROR GetWiFiVersion(uint8_t & wiFiVersion); + CHIP_ERROR GetConnectedNetwork(NetworkCommissioning::Network & network); + CHIP_ERROR StartWiFiScan(ByteSpan ssid, NetworkCommissioning::WiFiDriver::ScanCallback * callback); #endif const char * GetEthernetIfName() { return (mEthIfName[0] == '\0') ? nullptr : mEthIfName; } @@ -126,6 +138,18 @@ class ConnectivityManagerImpl final : public ConnectivityManager, private: // ===== Members that implement the ConnectivityManager abstract interface. + struct WiFiNetworkScanned + { + // The fields matches WiFiInterfaceScanResult::Type. + uint8_t ssid[Internal::kMaxWiFiSSIDLength]; + uint8_t ssidLen; + uint8_t bssid[6]; + int8_t rssi; + uint16_t frequencyBand; + uint8_t channel; + uint8_t security; + }; + CHIP_ERROR _Init(); void _OnPlatformEvent(const ChipDeviceEvent * event); @@ -150,6 +174,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, void _MaintainOnDemandWiFiAP(); System::Clock::Timeout _GetWiFiAPIdleTimeout(); void _SetWiFiAPIdleTimeout(System::Clock::Timeout val); + static CHIP_ERROR StopAutoScan(); static void _OnWpaProxyReady(GObject * source_object, GAsyncResult * res, gpointer user_data); static void _OnWpaInterfaceRemoved(WpaFiW1Wpa_supplicant1 * proxy, const gchar * path, GVariant * properties, @@ -160,6 +185,9 @@ class ConnectivityManagerImpl final : public ConnectivityManager, static void _OnWpaInterfaceReady(GObject * source_object, GAsyncResult * res, gpointer user_data); static void _OnWpaInterfaceProxyReady(GObject * source_object, GAsyncResult * res, gpointer user_data); static void _OnWpaBssProxyReady(GObject * source_object, GAsyncResult * res, gpointer user_data); + static void _OnWpaInterfaceScanDone(GObject * source_object, GAsyncResult * res, gpointer user_data); + + static bool _GetBssInfo(const gchar * bssPath, NetworkCommissioning::WiFiScanResponse & result); static bool mAssociattionStarted; static BitFlags mConnectivityFlag; @@ -199,6 +227,9 @@ class ConnectivityManagerImpl final : public ConnectivityManager, #if CHIP_DEVICE_CONFIG_ENABLE_WIFI static char sWiFiIfName[IFNAMSIZ]; #endif + + static NetworkCommissioning::WiFiDriver::ScanCallback * mpScanCallback; + static NetworkCommissioning::Internal::WirelessDriver::ConnectCallback * mpConnectCallback; }; #if CHIP_DEVICE_CONFIG_ENABLE_WPA diff --git a/src/platform/Linux/DnssdImpl.cpp b/src/platform/Linux/DnssdImpl.cpp index cfc0415b099dec..7709a8eee6a0c1 100644 --- a/src/platform/Linux/DnssdImpl.cpp +++ b/src/platform/Linux/DnssdImpl.cpp @@ -439,8 +439,8 @@ void MdnsAvahi::HandleGroupState(AvahiEntryGroup * group, AvahiEntryGroupState s ChipLogProgress(DeviceLayer, "Avahi group established"); break; case AVAHI_ENTRY_GROUP_COLLISION: - ChipLogError(DeviceLayer, "Avahi group collission"); - mErrorCallback(mAsyncReturnContext, CHIP_ERROR_MDNS_COLLISSION); + ChipLogError(DeviceLayer, "Avahi group collision"); + mErrorCallback(mAsyncReturnContext, CHIP_ERROR_MDNS_COLLISION); break; case AVAHI_ENTRY_GROUP_FAILURE: ChipLogError(DeviceLayer, "Avahi group internal failure %s", diff --git a/src/platform/Linux/NetworkCommissioningDriver.h b/src/platform/Linux/NetworkCommissioningDriver.h new file mode 100644 index 00000000000000..41daa19ef04a18 --- /dev/null +++ b/src/platform/Linux/NetworkCommissioningDriver.h @@ -0,0 +1,159 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace NetworkCommissioning { + +template +class LinuxScanResponseIterator : public Iterator +{ +public: + LinuxScanResponseIterator(std::vector * apScanResponse) : mpScanResponse(apScanResponse) {} + size_t Count() override { return mpScanResponse != nullptr ? mpScanResponse->size() : 0; } + bool Next(T & item) override + { + if (mpScanResponse == nullptr || currentIterating >= mpScanResponse->size()) + { + return false; + } + item = (*mpScanResponse)[currentIterating]; + currentIterating++; + return true; + } + void Release() override + { /* nothing to do, we don't hold the ownership of the vector, and users is not expected to hold the ownership in OnFinished for + scan. */ + } + +private: + size_t currentIterating = 0; + // Note: We cannot post a event in ScheduleLambda since std::vector is not trivial copiable. + std::vector * mpScanResponse; +}; + +#if CHIP_DEVICE_CONFIG_ENABLE_WPA +class LinuxWiFiDriver final : public WiFiDriver +{ +public: + class WiFiNetworkIterator final : public NetworkIterator + { + public: + WiFiNetworkIterator(LinuxWiFiDriver * aDriver) : driver(aDriver) {} + size_t Count() override; + bool Next(Network & item) override; + void Release() override { delete this; } + ~WiFiNetworkIterator() = default; + + private: + LinuxWiFiDriver * driver; + bool exhausted = false; + }; + + struct WiFiNetwork + { + uint8_t ssid[DeviceLayer::Internal::kMaxWiFiSSIDLength]; + uint8_t ssidLen = 0; + uint8_t credentials[DeviceLayer::Internal::kMaxWiFiKeyLength]; + uint8_t credentialsLen = 0; + }; + + // BaseDriver + NetworkIterator * GetNetworks() override { return new WiFiNetworkIterator(this); } + CHIP_ERROR Init() override; + CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } // Nothing to do on linux for shutdown. + + // WirelessDriver + uint8_t GetMaxNetworks() override { return 1; } + uint8_t GetScanNetworkTimeoutSeconds() override { return 10; } + uint8_t GetConnectNetworkTimeoutSeconds() override { return 20; } + + CHIP_ERROR CommitConfiguration() override; + CHIP_ERROR RevertConfiguration() override; + + Status RemoveNetwork(ByteSpan networkId) override; + Status ReorderNetwork(ByteSpan networkId, uint8_t index) override; + void ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) override; + + // WiFiDriver + Status AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials) override; + void ScanNetworks(ByteSpan ssid, ScanCallback * callback) override; + +private: + bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); + + WiFiNetworkIterator mWiFiIterator = WiFiNetworkIterator(this); + WiFiNetwork mSavedNetwork; + WiFiNetwork mStagingNetwork; +}; +#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +class LinuxThreadDriver final : public ThreadDriver +{ +public: + class ThreadNetworkIterator final : public NetworkIterator + { + public: + ThreadNetworkIterator(LinuxThreadDriver * aDriver) : driver(aDriver) {} + size_t Count() override; + bool Next(Network & item) override; + void Release() override { delete this; } + ~ThreadNetworkIterator() = default; + + private: + LinuxThreadDriver * driver; + bool exhausted = false; + }; + + // BaseDriver + NetworkIterator * GetNetworks() override { return new ThreadNetworkIterator(this); } + CHIP_ERROR Init() override; + CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } // Nothing to do on linux for shutdown. + + // WirelessDriver + uint8_t GetMaxNetworks() override { return 1; } + uint8_t GetScanNetworkTimeoutSeconds() override { return 10; } + uint8_t GetConnectNetworkTimeoutSeconds() override { return 20; } + + CHIP_ERROR CommitConfiguration() override; + CHIP_ERROR RevertConfiguration() override; + + Status RemoveNetwork(ByteSpan networkId) override; + Status ReorderNetwork(ByteSpan networkId, uint8_t index) override; + void ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) override; + + // ThreadDriver + Status AddOrUpdateNetwork(ByteSpan operationalDataset) override; + void ScanNetworks(ScanCallback * callback) override; + +private: + ThreadNetworkIterator mThreadIterator = ThreadNetworkIterator(this); + Thread::OperationalDataset mSavedNetwork; + Thread::OperationalDataset mStagingNetwork; +}; + +#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD + +} // namespace NetworkCommissioning +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/Linux/NetworkCommissioningThreadDriver.cpp b/src/platform/Linux/NetworkCommissioningThreadDriver.cpp new file mode 100644 index 00000000000000..abbeeaa3f0af84 --- /dev/null +++ b/src/platform/Linux/NetworkCommissioningThreadDriver.cpp @@ -0,0 +1,196 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +using namespace chip; +using namespace chip::Thread; + +namespace chip { +namespace DeviceLayer { +namespace NetworkCommissioning { + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + +// NOTE: For ThreadDriver, we uses two network configs, one is mSavedNetwork, and another is mStagingNetwork, during init, it will +// load the network config from otbr-agent, and loads it into both mSavedNetwork and mStagingNetwork. When updating the networks, +// all changed are made on the staging network. +// TODO: The otbr-posix does not actually maintains its own networking states, it will always persist the last network connected. +// This should not be an issue for most cases, but we should implement the code for maintaining the states by ourselves. + +CHIP_ERROR LinuxThreadDriver::Init() +{ + ByteSpan currentProvision; + VerifyOrReturnError(ConnectivityMgrImpl().IsThreadAttached(), CHIP_NO_ERROR); + VerifyOrReturnError(ThreadStackMgrImpl().GetThreadProvision(currentProvision) == CHIP_NO_ERROR, CHIP_NO_ERROR); + + mSavedNetwork.Init(currentProvision); + mStagingNetwork.Init(currentProvision); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR LinuxThreadDriver::CommitConfiguration() +{ + // Note: otbr-agent will persist the networks by their own, we don't have much to do for saving the networks (see Init() above, + // we just loads the saved dataset from otbr-agent.) + mSavedNetwork = mStagingNetwork; + return CHIP_NO_ERROR; +} + +CHIP_ERROR LinuxThreadDriver::RevertConfiguration() +{ + mStagingNetwork = mSavedNetwork; + return CHIP_NO_ERROR; +} + +Status LinuxThreadDriver::AddOrUpdateNetwork(ByteSpan operationalDataset) +{ + uint8_t extpanid[kSizeExtendedPanId]; + uint8_t newExtpanid[kSizeExtendedPanId]; + Thread::OperationalDataset newDataset; + + newDataset.Init(operationalDataset); + VerifyOrReturnError(newDataset.IsCommissioned(), Status::kOutOfRange); + + VerifyOrReturnError(!mStagingNetwork.IsCommissioned() || memcmp(extpanid, newExtpanid, kSizeExtendedPanId) == 0, + Status::kBoundsExceeded); + + mStagingNetwork = newDataset; + return Status::kSuccess; +} + +Status LinuxThreadDriver::RemoveNetwork(ByteSpan networkId) +{ + uint8_t extpanid[kSizeExtendedPanId]; + if (!mStagingNetwork.IsCommissioned()) + { + return Status::kNetworkNotFound; + } + else if (mStagingNetwork.GetExtendedPanId(extpanid) != CHIP_NO_ERROR) + { + return Status::kUnknownError; + } + + VerifyOrReturnError(networkId.size() == kSizeExtendedPanId && memcmp(networkId.data(), extpanid, kSizeExtendedPanId) == 0, + Status::kNetworkNotFound); + mStagingNetwork.Clear(); + return Status::kSuccess; +} + +Status LinuxThreadDriver::ReorderNetwork(ByteSpan networkId, uint8_t index) +{ + uint8_t extpanid[kSizeExtendedPanId]; + if (!mStagingNetwork.IsCommissioned()) + { + return Status::kNetworkNotFound; + } + else if (mStagingNetwork.GetExtendedPanId(extpanid) != CHIP_NO_ERROR) + { + return Status::kUnknownError; + } + + VerifyOrReturnError(networkId.size() == kSizeExtendedPanId && memcmp(networkId.data(), extpanid, kSizeExtendedPanId) == 0, + Status::kNetworkNotFound); + + return Status::kSuccess; +} + +void LinuxThreadDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) +{ + NetworkCommissioning::Status status = Status::kSuccess; + uint8_t extpanid[kSizeExtendedPanId]; + if (!mStagingNetwork.IsCommissioned()) + { + ExitNow(status = Status::kNetworkNotFound); + } + else if (mStagingNetwork.GetExtendedPanId(extpanid) != CHIP_NO_ERROR) + { + ExitNow(status = Status::kUnknownError); + } + + VerifyOrExit((networkId.size() == kSizeExtendedPanId && memcmp(networkId.data(), extpanid, kSizeExtendedPanId) == 0), + status = Status::kNetworkNotFound); + + VerifyOrExit(DeviceLayer::ThreadStackMgrImpl().AttachToThreadNetwork(mStagingNetwork.AsByteSpan(), callback) == CHIP_NO_ERROR, + status = Status::kUnknownError); + +exit: + if (status != Status::kSuccess) + { + callback->OnResult(status, CharSpan(), 0); + } +} + +void LinuxThreadDriver::ScanNetworks(ThreadDriver::ScanCallback * callback) +{ + CHIP_ERROR err = DeviceLayer::ThreadStackMgrImpl().StartThreadScan(callback); + if (err != CHIP_NO_ERROR) + { + callback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); + } +} + +size_t LinuxThreadDriver::ThreadNetworkIterator::Count() +{ + return driver->mStagingNetwork.IsCommissioned() ? 1 : 0; +} + +bool LinuxThreadDriver::ThreadNetworkIterator::Next(Network & item) +{ + if (exhausted || !driver->mStagingNetwork.IsCommissioned()) + { + return false; + } + uint8_t extpanid[kSizeExtendedPanId]; + VerifyOrReturnError(driver->mStagingNetwork.GetExtendedPanId(extpanid) == CHIP_NO_ERROR, false); + memcpy(item.networkID, extpanid, kSizeExtendedPanId); + item.networkIDLen = kSizeExtendedPanId; + item.connected = false; + exhausted = true; + + ByteSpan currentProvision; + Thread::OperationalDataset currentDataset; + uint8_t enabledExtPanId[Thread::kSizeExtendedPanId]; + + // The Thread network is not actually enabled. + VerifyOrReturnError(ConnectivityMgrImpl().IsThreadAttached(), true); + VerifyOrReturnError(ThreadStackMgrImpl().GetThreadProvision(currentProvision) == CHIP_NO_ERROR, true); + VerifyOrReturnError(currentDataset.Init(currentProvision) == CHIP_NO_ERROR, true); + // The Thread network is not enabled, but has a different extended pan id. + VerifyOrReturnError(currentDataset.GetExtendedPanId(enabledExtPanId) == CHIP_NO_ERROR, true); + VerifyOrReturnError(memcmp(extpanid, enabledExtPanId, kSizeExtendedPanId) == 0, true); + // The Thread network is enabled and has the same extended pan id as the one in our record. + item.connected = true; + + return true; +} + +#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD + +} // namespace NetworkCommissioning +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/Linux/NetworkCommissioningWiFiDriver.cpp b/src/platform/Linux/NetworkCommissioningWiFiDriver.cpp new file mode 100644 index 00000000000000..5483715eb3b5dc --- /dev/null +++ b/src/platform/Linux/NetworkCommissioningWiFiDriver.cpp @@ -0,0 +1,207 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include +#include +#include + +using namespace chip; +using namespace chip::Thread; + +namespace chip { +namespace DeviceLayer { +namespace NetworkCommissioning { + +#if CHIP_DEVICE_CONFIG_ENABLE_WPA +// TODO: Here, most interfaces are just calling ConnectivityManager interfaces, this is because the ConnectivityProvides some +// bootstrap code for the wpa_supplicant. However, we can wrap the wpa_supplicant dbus api directly (and remove the related code in +// ConnectivityManagerImpl). +namespace { +constexpr char kWiFiSSIDKeyName[] = "wifi-ssid"; +constexpr char kWiFiCredentialsKeyName[] = "wifi-pass"; +} // namespace + +// NOTE: For WiFiDriver, we uses two network configs, one is mSavedNetwork, and another is mStagingNetwork, during init, it will +// load the network config from k-v storage, and loads it into both mSavedNetwork and mStagingNetwork. When updating the networks, +// all changed are made on the staging network, and when the network is committed, it will update the mSavedNetwork to +// mStagingNetwork and persist the changes. + +// NOTE: LinuxWiFiDriver uses network config with empty ssid (ssidLen = 0) for empty network config. + +// NOTE: For now, the LinuxWiFiDriver only supports one network, this can be fixed by using the wpa_supplicant API directly (then +// wpa_supplicant will manage the networks for us.) + +CHIP_ERROR LinuxWiFiDriver::Init() +{ + CHIP_ERROR err; + size_t ssidLen = 0; + size_t credentialsLen = 0; + + err = PersistedStorage::KeyValueStoreMgr().Get(kWiFiCredentialsKeyName, mSavedNetwork.credentials, + sizeof(mSavedNetwork.credentials), &credentialsLen); + if (err == CHIP_ERROR_KEY_NOT_FOUND) + { + return CHIP_NO_ERROR; + } + + err = PersistedStorage::KeyValueStoreMgr().Get(kWiFiSSIDKeyName, mSavedNetwork.ssid, sizeof(mSavedNetwork.ssid), &ssidLen); + if (err == CHIP_ERROR_KEY_NOT_FOUND) + { + return CHIP_NO_ERROR; + } + + mSavedNetwork.credentialsLen = credentialsLen; + mSavedNetwork.ssidLen = ssidLen; + + mStagingNetwork = mSavedNetwork; + return CHIP_NO_ERROR; +} + +CHIP_ERROR LinuxWiFiDriver::CommitConfiguration() +{ + ReturnErrorOnFailure(PersistedStorage::KeyValueStoreMgr().Put(kWiFiSSIDKeyName, mStagingNetwork.ssid, mStagingNetwork.ssidLen)); + ReturnErrorOnFailure(PersistedStorage::KeyValueStoreMgr().Put(kWiFiCredentialsKeyName, mStagingNetwork.credentials, + mStagingNetwork.credentialsLen)); + ReturnErrorOnFailure(ConnectivityMgrImpl().CommitConfig()); + mSavedNetwork = mStagingNetwork; + return CHIP_NO_ERROR; +} + +CHIP_ERROR LinuxWiFiDriver::RevertConfiguration() +{ + mStagingNetwork = mSavedNetwork; + return CHIP_NO_ERROR; +} + +bool LinuxWiFiDriver::NetworkMatch(const WiFiNetwork & network, ByteSpan networkId) +{ + return networkId.size() == network.ssidLen && memcmp(networkId.data(), network.ssid, network.ssidLen) == 0; +} + +Status LinuxWiFiDriver::AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials) +{ + VerifyOrReturnError(mStagingNetwork.ssidLen == 0 || NetworkMatch(mStagingNetwork, ssid), Status::kBoundsExceeded); + + static_assert(sizeof(WiFiNetwork::ssid) <= std::numeric_limits::max(), + "Max length of WiFi ssid exceeds the limit of ssidLen field"); + static_assert(sizeof(WiFiNetwork::credentials) <= std::numeric_limits::max(), + "Max length of WiFi credentials exceeds the limit of credentialsLen field"); + + // Do the check before setting the values, so the data is not updated on error. + VerifyOrReturnError(credentials.size() <= sizeof(mStagingNetwork.credentials), Status::kOutOfRange); + VerifyOrReturnError(ssid.size() <= sizeof(mStagingNetwork.ssid), Status::kOutOfRange); + + memcpy(mStagingNetwork.credentials, credentials.data(), credentials.size()); + mStagingNetwork.credentialsLen = static_cast(credentials.size()); + + memcpy(mStagingNetwork.ssid, ssid.data(), ssid.size()); + mStagingNetwork.ssidLen = static_cast(ssid.size()); + + return Status::kSuccess; +} + +Status LinuxWiFiDriver::RemoveNetwork(ByteSpan networkId) +{ + VerifyOrReturnError(NetworkMatch(mStagingNetwork, networkId), Status::kNetworkIDNotFound); + + // Use empty ssid for representing invalid network + mStagingNetwork.ssidLen = 0; + return Status::kSuccess; +} + +Status LinuxWiFiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index) +{ + VerifyOrReturnError(NetworkMatch(mStagingNetwork, networkId), Status::kNetworkIDNotFound); + // We only support one network, so reorder is actually no-op. + + return Status::kSuccess; +} + +void LinuxWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + Status networkingStatus = Status::kSuccess; + + VerifyOrExit(NetworkMatch(mStagingNetwork, networkId), networkingStatus = Status::kNetworkIDNotFound); + + ChipLogProgress(NetworkProvisioning, "LinuxNetworkCommissioningDelegate: SSID: %s", networkId.data()); + + err = ConnectivityMgrImpl().ConnectWiFiNetworkAsync(ByteSpan(mStagingNetwork.ssid, mStagingNetwork.ssidLen), + ByteSpan(mStagingNetwork.credentials, mStagingNetwork.credentialsLen), + callback); +exit: + if (err != CHIP_NO_ERROR) + { + networkingStatus = Status::kUnknownError; + } + + if (networkingStatus != Status::kSuccess) + { + ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network: %s", chip::ErrorStr(err)); + callback->OnResult(networkingStatus, CharSpan(), 0); + } +} + +void LinuxWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) +{ + CHIP_ERROR err = DeviceLayer::ConnectivityMgrImpl().StartWiFiScan(ssid, callback); + if (err != CHIP_NO_ERROR) + { + callback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); + } +} + +size_t LinuxWiFiDriver::WiFiNetworkIterator::Count() +{ + return driver->mStagingNetwork.ssidLen == 0 ? 0 : 1; +} + +bool LinuxWiFiDriver::WiFiNetworkIterator::Next(Network & item) +{ + if (exhausted || driver->mStagingNetwork.ssidLen == 0) + { + return false; + } + memcpy(item.networkID, driver->mStagingNetwork.ssid, driver->mStagingNetwork.ssidLen); + item.networkIDLen = driver->mStagingNetwork.ssidLen; + item.connected = false; + exhausted = true; + + Network connectedNetwork; + CHIP_ERROR err = DeviceLayer::ConnectivityMgrImpl().GetConnectedNetwork(connectedNetwork); + if (err == CHIP_NO_ERROR) + { + if (connectedNetwork.networkIDLen == item.networkIDLen && + memcmp(connectedNetwork.networkID, item.networkID, item.networkIDLen) == 0) + { + item.connected = true; + } + } + + return true; +} + +#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA + +} // namespace NetworkCommissioning +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/Linux/OTAImageProcessorImpl.cpp b/src/platform/Linux/OTAImageProcessorImpl.cpp new file mode 100644 index 00000000000000..14a061484b680e --- /dev/null +++ b/src/platform/Linux/OTAImageProcessorImpl.cpp @@ -0,0 +1,203 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "OTAImageProcessorImpl.h" + +namespace chip { + +CHIP_ERROR OTAImageProcessorImpl::PrepareDownload() +{ + if (mParams.imageFile.empty()) + { + ChipLogError(SoftwareUpdate, "Invalid output image file supplied"); + return CHIP_ERROR_INTERNAL; + } + + DeviceLayer::PlatformMgr().ScheduleWork(HandlePrepareDownload, reinterpret_cast(this)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::Finalize() +{ + DeviceLayer::PlatformMgr().ScheduleWork(HandleFinalize, reinterpret_cast(this)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::Apply() +{ + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::Abort() +{ + if (mParams.imageFile.empty()) + { + ChipLogError(SoftwareUpdate, "Invalid output image file supplied"); + return CHIP_ERROR_INTERNAL; + } + + DeviceLayer::PlatformMgr().ScheduleWork(HandleAbort, reinterpret_cast(this)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::ProcessBlock(ByteSpan & block) +{ + if (!mOfs.is_open() || !mOfs.good()) + { + return CHIP_ERROR_INTERNAL; + } + + if ((block.data() == nullptr) || block.empty()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + // Store block data for HandleProcessBlock to access + CHIP_ERROR err = SetBlock(block); + if (err != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "Cannot set block data: %" CHIP_ERROR_FORMAT, err.Format()); + } + + DeviceLayer::PlatformMgr().ScheduleWork(HandleProcessBlock, reinterpret_cast(this)); + return CHIP_NO_ERROR; +} + +void OTAImageProcessorImpl::HandlePrepareDownload(intptr_t context) +{ + auto * imageProcessor = reinterpret_cast(context); + if (imageProcessor == nullptr) + { + ChipLogError(SoftwareUpdate, "ImageProcessor context is null"); + return; + } + else if (imageProcessor->mDownloader == nullptr) + { + ChipLogError(SoftwareUpdate, "mDownloader is null"); + return; + } + + imageProcessor->mOfs.open(imageProcessor->mParams.imageFile.data(), + std::ofstream::out | std::ofstream::ate | std::ofstream::app); + if (!imageProcessor->mOfs.good()) + { + imageProcessor->mDownloader->OnPreparedForDownload(CHIP_ERROR_OPEN_FAILED); + return; + } + + // TODO: if file already exists and is not empty, erase previous contents + + imageProcessor->mDownloader->OnPreparedForDownload(CHIP_NO_ERROR); +} + +void OTAImageProcessorImpl::HandleFinalize(intptr_t context) +{ + auto * imageProcessor = reinterpret_cast(context); + if (imageProcessor == nullptr) + { + return; + } + + imageProcessor->mOfs.close(); + imageProcessor->ReleaseBlock(); + + ChipLogProgress(SoftwareUpdate, "OTA image downloaded to %s", imageProcessor->mParams.imageFile.data()); +} + +void OTAImageProcessorImpl::HandleAbort(intptr_t context) +{ + auto * imageProcessor = reinterpret_cast(context); + if (imageProcessor == nullptr) + { + return; + } + + imageProcessor->mOfs.close(); + remove(imageProcessor->mParams.imageFile.data()); + imageProcessor->ReleaseBlock(); +} + +void OTAImageProcessorImpl::HandleProcessBlock(intptr_t context) +{ + auto * imageProcessor = reinterpret_cast(context); + if (imageProcessor == nullptr) + { + ChipLogError(SoftwareUpdate, "ImageProcessor context is null"); + return; + } + else if (imageProcessor->mDownloader == nullptr) + { + ChipLogError(SoftwareUpdate, "mDownloader is null"); + return; + } + + // TODO: Process block header if any + + if (!imageProcessor->mOfs.write(reinterpret_cast(imageProcessor->mBlock.data()), + static_cast(imageProcessor->mBlock.size()))) + { + imageProcessor->mDownloader->EndDownload(CHIP_ERROR_WRITE_FAILED); + return; + } + + imageProcessor->mParams.downloadedBytes += imageProcessor->mBlock.size(); + imageProcessor->mDownloader->FetchNextData(); +} + +CHIP_ERROR OTAImageProcessorImpl::SetBlock(ByteSpan & block) +{ + if ((block.data() == nullptr) || block.empty()) + { + return CHIP_NO_ERROR; + } + + // Allocate memory for block data if it has not been done yet + if (mBlock.empty()) + { + mBlock = MutableByteSpan(static_cast(chip::Platform::MemoryAlloc(block.size())), block.size()); + if (mBlock.data() == nullptr) + { + return CHIP_ERROR_NO_MEMORY; + } + } + + // Store the actual block data + CHIP_ERROR err = CopySpanToMutableSpan(block, mBlock); + if (err != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "Cannot copy block data: %" CHIP_ERROR_FORMAT, err.Format()); + return err; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::ReleaseBlock() +{ + if (mBlock.data() != nullptr) + { + chip::Platform::MemoryFree(mBlock.data()); + } + + mBlock = MutableByteSpan(); + return CHIP_NO_ERROR; +} + +} // namespace chip diff --git a/src/platform/Linux/OTAImageProcessorImpl.h b/src/platform/Linux/OTAImageProcessorImpl.h new file mode 100644 index 00000000000000..77a13ca36e890c --- /dev/null +++ b/src/platform/Linux/OTAImageProcessorImpl.h @@ -0,0 +1,63 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +#include + +namespace chip { + +class OTAImageProcessorImpl : public OTAImageProcessorInterface +{ +public: + //////////// OTAImageProcessorInterface Implementation /////////////// + CHIP_ERROR PrepareDownload() override; + CHIP_ERROR Finalize() override; + CHIP_ERROR Apply() override; + CHIP_ERROR Abort() override; + CHIP_ERROR ProcessBlock(ByteSpan & block) override; + + void SetOTADownloader(OTADownloader * downloader) { mDownloader = downloader; } + +private: + //////////// Actual handlers for the OTAImageProcessorInterface /////////////// + static void HandlePrepareDownload(intptr_t context); + static void HandleFinalize(intptr_t context); + static void HandleAbort(intptr_t context); + static void HandleProcessBlock(intptr_t context); + + /** + * Called to allocate memory for mBlock if necessary and set it to block + */ + CHIP_ERROR SetBlock(ByteSpan & block); + + /** + * Called to release allocated memory for mBlock + */ + CHIP_ERROR ReleaseBlock(); + + std::ofstream mOfs; + MutableByteSpan mBlock; + OTADownloader * mDownloader; +}; + +} // namespace chip diff --git a/src/platform/Linux/PlatformManagerImpl.cpp b/src/platform/Linux/PlatformManagerImpl.cpp index 574a8ce58fd632..3bd94d6bf8f4a2 100644 --- a/src/platform/Linux/PlatformManagerImpl.cpp +++ b/src/platform/Linux/PlatformManagerImpl.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -98,6 +99,9 @@ void SignalHandler(int signum) case SIGVTALRM: PlatformMgrImpl().HandleGeneralFault(GeneralDiagnostics::Events::NetworkFaultChange::kEventId); break; + case SIGIO: + PlatformMgrImpl().HandleSwitchEvent(Switch::Events::SwitchLatched::kEventId); + break; default: break; } @@ -297,6 +301,14 @@ CHIP_ERROR PlatformManagerImpl::_GetFixedLabelList( return CHIP_NO_ERROR; } +CHIP_ERROR +PlatformManagerImpl::_SetUserLabelList(EndpointId endpoint, + LabelList & labelList) +{ + // TODO:: store the user labelList, and read back stored user labelList if it has been set. Add yaml test to verify this. + return CHIP_NO_ERROR; +} + CHIP_ERROR PlatformManagerImpl::_GetUserLabelList(EndpointId endpoint, LabelList & labelList) @@ -432,6 +444,89 @@ void PlatformManagerImpl::HandleSoftwareFault(uint32_t EventId) } } +void PlatformManagerImpl::HandleSwitchEvent(uint32_t EventId) +{ + SwitchDeviceControlDelegate * delegate = DeviceControlServer::DeviceControlSvr().GetSwitchDelegate(); + + if (delegate == nullptr) + { + ChipLogError(DeviceLayer, "No delegate registered to handle Switch event"); + return; + } + + if (EventId == Switch::Events::SwitchLatched::kEventId) + { + uint8_t newPosition = 0; + +#if CHIP_CONFIG_TEST + newPosition = 100; +#endif + delegate->OnSwitchLatched(newPosition); + } + else if (EventId == Switch::Events::InitialPress::kEventId) + { + uint8_t newPosition = 0; + +#if CHIP_CONFIG_TEST + newPosition = 100; +#endif + delegate->OnInitialPressed(newPosition); + } + else if (EventId == Switch::Events::LongPress::kEventId) + { + uint8_t newPosition = 0; + +#if CHIP_CONFIG_TEST + newPosition = 100; +#endif + delegate->OnLongPressed(newPosition); + } + else if (EventId == Switch::Events::ShortRelease::kEventId) + { + uint8_t previousPosition = 0; + +#if CHIP_CONFIG_TEST + previousPosition = 50; +#endif + delegate->OnShortReleased(previousPosition); + } + else if (EventId == Switch::Events::LongRelease::kEventId) + { + uint8_t previousPosition = 0; + +#if CHIP_CONFIG_TEST + previousPosition = 50; +#endif + delegate->OnLongReleased(previousPosition); + } + else if (EventId == Switch::Events::MultiPressOngoing::kEventId) + { + uint8_t newPosition = 0; + uint8_t currentNumberOfPressesCounted = 0; + +#if CHIP_CONFIG_TEST + newPosition = 10; + currentNumberOfPressesCounted = 5; +#endif + delegate->OnMultiPressOngoing(newPosition, currentNumberOfPressesCounted); + } + else if (EventId == Switch::Events::MultiPressComplete::kEventId) + { + uint8_t newPosition = 0; + uint8_t totalNumberOfPressesCounted = 0; + +#if CHIP_CONFIG_TEST + newPosition = 10; + totalNumberOfPressesCounted = 5; +#endif + delegate->OnMultiPressComplete(newPosition, totalNumberOfPressesCounted); + } + else + { + ChipLogError(DeviceLayer, "Unknow event ID:%d", EventId); + } +} + #if CHIP_WITH_GIO GDBusConnection * PlatformManagerImpl::GetGDBusConnection() { diff --git a/src/platform/Linux/PlatformManagerImpl.h b/src/platform/Linux/PlatformManagerImpl.h index a3017e97029c5b..6757b93108f079 100644 --- a/src/platform/Linux/PlatformManagerImpl.h +++ b/src/platform/Linux/PlatformManagerImpl.h @@ -58,6 +58,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener void HandleGeneralFault(uint32_t EventId); void HandleSoftwareFault(uint32_t EventId); + void HandleSwitchEvent(uint32_t EventId); private: // ===== Methods that implement the PlatformManager abstract interface. @@ -66,6 +67,8 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener CHIP_ERROR _Shutdown(); CHIP_ERROR _GetFixedLabelList(EndpointId endpoint, LabelList & labelList); + CHIP_ERROR _SetUserLabelList(EndpointId endpoint, + LabelList & labelList); CHIP_ERROR _GetUserLabelList(EndpointId endpoint, LabelList & labelList); diff --git a/src/platform/Linux/ThreadStackManagerImpl.cpp b/src/platform/Linux/ThreadStackManagerImpl.cpp index f51e1cb8dbaada..d50aed7be164c4 100644 --- a/src/platform/Linux/ThreadStackManagerImpl.cpp +++ b/src/platform/Linux/ThreadStackManagerImpl.cpp @@ -21,11 +21,17 @@ #include #include #include +#include #include #include +#include +#include +#include + using namespace ::chip::app; using namespace ::chip::app::Clusters; +using namespace chip::DeviceLayer::NetworkCommissioning; namespace chip { namespace DeviceLayer { @@ -232,8 +238,15 @@ CHIP_ERROR ThreadStackManagerImpl::_GetThreadProvision(ByteSpan & netInfo) VerifyOrReturnError(mProxy, CHIP_ERROR_INCORRECT_STATE); { + // TODO: The following code does not works actually, since otbr-posix does not emit signals for properties changes. Which is + // required for gdbus to caching properties. std::unique_ptr value( openthread_io_openthread_border_router_dup_active_dataset_tlvs(mProxy.get())); + if (value == nullptr) + { + netInfo = ByteSpan(); + return CHIP_ERROR_KEY_NOT_FOUND; + } GBytes * bytes = g_variant_get_data_as_bytes(value.get()); gsize size; const uint8_t * data = reinterpret_cast(g_bytes_get_data(bytes, &size)); @@ -276,20 +289,7 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadEnabled(bool val) VerifyOrReturnError(mProxy, CHIP_ERROR_INCORRECT_STATE); if (val) { - std::unique_ptr err; - gboolean result = - openthread_io_openthread_border_router_call_attach_sync(mProxy.get(), nullptr, &MakeUniquePointerReceiver(err).Get()); - if (err) - { - ChipLogError(DeviceLayer, "openthread: _SetThreadEnabled calling %s failed: %s", "Attach", err->message); - return CHIP_ERROR_INTERNAL; - } - - if (!result) - { - ChipLogError(DeviceLayer, "openthread: _SetThreadEnabled calling %s failed: %s", "Attach", "return false"); - return CHIP_ERROR_INTERNAL; - } + openthread_io_openthread_border_router_call_attach(mProxy.get(), nullptr, _OnThreadAttachFinished, this); } else { @@ -311,6 +311,41 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadEnabled(bool val) return CHIP_NO_ERROR; } +void ThreadStackManagerImpl::_OnThreadAttachFinished(GObject * source_object, GAsyncResult * res, gpointer user_data) +{ + ThreadStackManagerImpl * this_ = reinterpret_cast(user_data); + std::unique_ptr attachRes; + std::unique_ptr err; + { + gboolean result = openthread_io_openthread_border_router_call_attach_finish(this_->mProxy.get(), res, + &MakeUniquePointerReceiver(err).Get()); + if (!result) + { + ChipLogError(DeviceLayer, "Failed to perform finish Thread network scan: %s", + err == nullptr ? "unknown error" : err->message); + DeviceLayer::SystemLayer().ScheduleLambda([this_]() { + if (this_->mpConnectCallback != nullptr) + { + // TODO: Replace this with actual thread attach result. + this_->mpConnectCallback->OnResult(NetworkCommissioning::Status::kUnknownError, CharSpan(), 0); + this_->mpConnectCallback = nullptr; + } + }); + } + else + { + DeviceLayer::SystemLayer().ScheduleLambda([this_]() { + if (this_->mpConnectCallback != nullptr) + { + // TODO: Replace this with actual thread attach result. + this_->mpConnectCallback->OnResult(NetworkCommissioning::Status::kSuccess, CharSpan(), 0); + this_->mpConnectCallback = nullptr; + } + }); + } + } +} + ConnectivityManager::ThreadDeviceType ThreadStackManagerImpl::_GetThreadDeviceType() { ConnectivityManager::ThreadDeviceType type = ConnectivityManager::ThreadDeviceType::kThreadDeviceType_NotSupported; @@ -472,6 +507,109 @@ CHIP_ERROR ThreadStackManagerImpl::_JoinerStart() return CHIP_ERROR_NOT_IMPLEMENTED; } +CHIP_ERROR ThreadStackManagerImpl::StartThreadScan(ThreadDriver::ScanCallback * callback) +{ + // There is another ongoing scan request, reject the new one. + VerifyOrReturnError(mpScanCallback == nullptr, CHIP_ERROR_INCORRECT_STATE); + mpScanCallback = callback; + openthread_io_openthread_border_router_call_scan(mProxy.get(), nullptr, _OnNetworkScanFinished, this); + return CHIP_NO_ERROR; +} + +void ThreadStackManagerImpl::_OnNetworkScanFinished(GObject * source_object, GAsyncResult * res, gpointer user_data) +{ + ThreadStackManagerImpl * this_ = reinterpret_cast(user_data); + this_->_OnNetworkScanFinished(res); +} + +void ThreadStackManagerImpl::_OnNetworkScanFinished(GAsyncResult * res) +{ + std::unique_ptr scan_result; + std::unique_ptr err; + { + gboolean result = openthread_io_openthread_border_router_call_scan_finish( + mProxy.get(), &MakeUniquePointerReceiver(scan_result).Get(), res, &MakeUniquePointerReceiver(err).Get()); + if (!result) + { + ChipLogError(DeviceLayer, "Failed to perform finish Thread network scan: %s", + err == nullptr ? "unknown error" : err->message); + DeviceLayer::SystemLayer().ScheduleLambda([this]() { + if (mpScanCallback != nullptr) + { + LinuxScanResponseIterator iter(nullptr); + mpScanCallback->OnFinished(Status::kUnknownError, CharSpan(), &iter); + } + mpScanCallback = nullptr; + }); + } + } + + std::vector * scanResult = + new std::vector(); + + if (g_variant_n_children(scan_result.get()) > 0) + { + std::unique_ptr iter; + g_variant_get(scan_result.get(), "a(tstayqqyyyybb)", &MakeUniquePointerReceiver(iter).Get()); + if (!iter) + return; + + guint64 ext_address; + const gchar * network_name; + guint64 ext_panid; + const gchar * steering_data; + guint16 panid; + guint16 joiner_udp_port; + guint8 channel; + guint8 rssi; + guint8 lqi; + guint8 version; + gboolean is_native; + gboolean is_joinable; + + while (g_variant_iter_loop(iter.get(), "(tstayqqyyyybb)", &ext_address, &network_name, &ext_panid, &steering_data, &panid, + &joiner_udp_port, &channel, &rssi, &lqi, &version, &is_native, &is_joinable)) + { + ChipLogProgress(DeviceLayer, + "Thread Network: %s (%016" PRIx64 ") ExtPanId(%016" PRIx64 ") RSSI %" PRIu16 " LQI %" PRIu8 + " Version %" PRIu8, + network_name, ext_address, ext_panid, rssi, lqi, version); + NetworkCommissioning::ThreadScanResponse networkScanned; + networkScanned.panId = panid; + networkScanned.extendedPanId = ext_panid; + size_t networkNameLen = strlen(network_name); + if (networkNameLen > 16) + { + ChipLogProgress(DeviceLayer, "Network name is too long, ignore it."); + continue; + } + networkScanned.networkNameLen = static_cast(networkNameLen); + memcpy(networkScanned.networkName, network_name, networkNameLen); + networkScanned.channel = channel; + networkScanned.version = version; + networkScanned.extendedAddress = 0; + networkScanned.rssi = rssi; + networkScanned.lqi = lqi; + + scanResult->push_back(networkScanned); + } + } + + DeviceLayer::SystemLayer().ScheduleLambda([this, scanResult]() { + // Note: We cannot post a event in ScheduleLambda since std::vector is not trivial copiable. This results in the use of + // const_cast but should be fine for almost all cases, since we actually handled the ownership of this element to this + // lambda. + if (mpScanCallback != nullptr) + { + LinuxScanResponseIterator iter( + const_cast *>(scanResult)); + mpScanCallback->OnFinished(Status::kSuccess, CharSpan(), &iter); + mpScanCallback = nullptr; + } + delete const_cast *>(scanResult); + }); +} + void ThreadStackManagerImpl::_ResetThreadNetworkDiagnosticsCounts() {} CHIP_ERROR ThreadStackManagerImpl::_WriteThreadNetworkDiagnosticAttributeToTlv(AttributeId attributeId, @@ -486,7 +624,7 @@ CHIP_ERROR ThreadStackManagerImpl::_WriteThreadNetworkDiagnosticAttributeToTlv(A case ThreadNetworkDiagnostics::Attributes::SecurityPolicy::Id: case ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::Id: case ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::Id: { - err = encoder.Encode(DataModel::List()); + err = encoder.EncodeEmptyList(); break; } default: { @@ -498,6 +636,19 @@ CHIP_ERROR ThreadStackManagerImpl::_WriteThreadNetworkDiagnosticAttributeToTlv(A return err; } +CHIP_ERROR +ThreadStackManagerImpl::AttachToThreadNetwork(ByteSpan netInfo, + NetworkCommissioning::Internal::WirelessDriver::ConnectCallback * callback) +{ + // There is another ongoing connect request, reject the new one. + VerifyOrReturnError(mpConnectCallback == nullptr, CHIP_ERROR_INCORRECT_STATE); + ReturnErrorOnFailure(DeviceLayer::ThreadStackMgr().SetThreadEnabled(false)); + ReturnErrorOnFailure(DeviceLayer::ThreadStackMgr().SetThreadProvision(netInfo)); + ReturnErrorOnFailure(DeviceLayer::ThreadStackMgr().SetThreadEnabled(true)); + mpConnectCallback = callback; + return CHIP_NO_ERROR; +} + ThreadStackManager & ThreadStackMgr() { return chip::DeviceLayer::ThreadStackManagerImpl::sInstance; diff --git a/src/platform/Linux/ThreadStackManagerImpl.h b/src/platform/Linux/ThreadStackManagerImpl.h index 3bbd29867ab811..caac53708b9922 100644 --- a/src/platform/Linux/ThreadStackManagerImpl.h +++ b/src/platform/Linux/ThreadStackManagerImpl.h @@ -18,11 +18,13 @@ #pragma once #include +#include #include #include #include #include +#include #include #include @@ -50,6 +52,11 @@ class ThreadStackManagerImpl : public ThreadStackManager CHIP_ERROR _SetThreadProvision(ByteSpan netInfo); + void _OnNetworkScanFinished(GAsyncResult * res); + static void _OnNetworkScanFinished(GObject * source_object, GAsyncResult * res, gpointer user_data); + + CHIP_ERROR GetExtendedPanId(uint8_t extPanId[Thread::kSizeExtendedPanId]); + void _ErasePersistentInfo(); bool _IsThreadProvisioned(); @@ -58,7 +65,10 @@ class ThreadStackManagerImpl : public ThreadStackManager bool _IsThreadAttached(); + CHIP_ERROR AttachToThreadNetwork(ByteSpan netInfo, NetworkCommissioning::Internal::WirelessDriver::ConnectCallback * callback); + CHIP_ERROR _SetThreadEnabled(bool val); + static void _OnThreadAttachFinished(GObject * source_object, GAsyncResult * res, gpointer user_data); ConnectivityManager::ThreadDeviceType _GetThreadDeviceType(); @@ -90,6 +100,8 @@ class ThreadStackManagerImpl : public ThreadStackManager CHIP_ERROR _WriteThreadNetworkDiagnosticAttributeToTlv(AttributeId attributeId, app::AttributeValueEncoder & encoder); + CHIP_ERROR StartThreadScan(NetworkCommissioning::ThreadDriver::ScanCallback * callback); + ~ThreadStackManagerImpl() = default; static ThreadStackManagerImpl sInstance; @@ -106,6 +118,19 @@ class ThreadStackManagerImpl : public ThreadStackManager static constexpr char kPropertyDeviceRole[] = "DeviceRole"; + struct ThreadNetworkScanned + { + uint16_t panId; + uint64_t extendedPanId; + uint8_t networkName[16]; + uint8_t networkNameLen; + uint16_t channel; + uint8_t version; + uint64_t extendedAddress; + int8_t rssi; + uint8_t lqi; + }; + std::unique_ptr mProxy; static void OnDbusPropertiesChanged(OpenthreadIoOpenthreadBorderRouter * proxy, GVariant * changed_properties, @@ -114,6 +139,9 @@ class ThreadStackManagerImpl : public ThreadStackManager Thread::OperationalDataset mDataset = {}; + NetworkCommissioning::ThreadDriver::ScanCallback * mpScanCallback; + NetworkCommissioning::Internal::WirelessDriver::ConnectCallback * mpConnectCallback; + bool mAttached; }; diff --git a/src/platform/Linux/dbus/openthread/introspect.xml b/src/platform/Linux/dbus/openthread/introspect.xml index e92b3acf4c57aa..e583697e1f63ec 100644 --- a/src/platform/Linux/dbus/openthread/introspect.xml +++ b/src/platform/Linux/dbus/openthread/introspect.xml @@ -30,8 +30,8 @@ limitations under the License. uint8[] steering_data uint16 panid uint16 joiner_udp_port - uint16 channel - uint16 rssi + uint8 channel + uint8 rssi uint8 lqi uint8 version bool is_native @@ -40,7 +40,7 @@ limitations under the License. --> - + diff --git a/src/platform/Linux/dbus/wpa/DBusWpaBss.xml b/src/platform/Linux/dbus/wpa/DBusWpaBss.xml index b6e8fee4633745..8ec5c4aa749dcb 100644 --- a/src/platform/Linux/dbus/wpa/DBusWpaBss.xml +++ b/src/platform/Linux/dbus/wpa/DBusWpaBss.xml @@ -2,8 +2,18 @@ - - + + + + + + + + + + + + diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp index ac309d1aa2f1de..969c1c52075894 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp @@ -339,7 +339,6 @@ GenericThreadStackManagerImpl_OpenThread::_SetThreadDeviceType(Connec } #if CHIP_PROGRESS_LOGGING - { const char * deviceTypeStr; switch (deviceType) @@ -452,15 +451,17 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetAndLogThread { CHIP_ERROR err = CHIP_NO_ERROR; otError otErr; - const otMacCounters * macCounters; - const otIpCounters * ipCounters; otOperationalDataset activeDataset; - otDeviceRole role; Impl()->LockThreadStack(); +#if CHIP_PROGRESS_LOGGING + { + otDeviceRole role; - role = otThreadGetDeviceRole(mOTInst); - ChipLogProgress(DeviceLayer, "Thread Role: %d\n", role); + role = otThreadGetDeviceRole(mOTInst); + ChipLogProgress(DeviceLayer, "Thread Role: %d\n", role); + } +#endif // CHIP_PROGRESS_LOGGING if (otDatasetIsCommissioned(mOTInst)) { @@ -473,61 +474,67 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetAndLogThread } } - macCounters = otLinkGetCounters(mOTInst); +#if CHIP_PROGRESS_LOGGING + { + const otIpCounters * ipCounters; + const otMacCounters * macCounters; - ChipLogProgress(DeviceLayer, - "Rx Counters:\n" - "PHY Rx Total: %" PRIu32 "\n" - "MAC Rx Unicast: %" PRIu32 "\n" - "MAC Rx Broadcast: %" PRIu32 "\n" - "MAC Rx Data: %" PRIu32 "\n" - "MAC Rx Data Polls: %" PRIu32 "\n" - "MAC Rx Beacons: %" PRIu32 "\n" - "MAC Rx Beacon Reqs: %" PRIu32 "\n" - "MAC Rx Other: %" PRIu32 "\n" - "MAC Rx Filtered Whitelist: %" PRIu32 "\n" - "MAC Rx Filtered DestAddr: %" PRIu32 "\n", - macCounters->mRxTotal, macCounters->mRxUnicast, macCounters->mRxBroadcast, macCounters->mRxData, - macCounters->mRxDataPoll, macCounters->mRxBeacon, macCounters->mRxBeaconRequest, macCounters->mRxOther, - macCounters->mRxAddressFiltered, macCounters->mRxDestAddrFiltered); + macCounters = otLinkGetCounters(mOTInst); - ChipLogProgress(DeviceLayer, - "Tx Counters:\n" - "PHY Tx Total: %" PRIu32 "\n" - "MAC Tx Unicast: %" PRIu32 "\n" - "MAC Tx Broadcast: %" PRIu32 "\n" - "MAC Tx Data: %" PRIu32 "\n" - "MAC Tx Data Polls: %" PRIu32 "\n" - "MAC Tx Beacons: %" PRIu32 "\n" - "MAC Tx Beacon Reqs: %" PRIu32 "\n" - "MAC Tx Other: %" PRIu32 "\n" - "MAC Tx Retry: %" PRIu32 "\n" - "MAC Tx CCA Fail: %" PRIu32 "\n", - macCounters->mTxTotal, macCounters->mTxUnicast, macCounters->mTxBroadcast, macCounters->mTxData, - macCounters->mTxDataPoll, macCounters->mTxBeacon, macCounters->mTxBeaconRequest, macCounters->mTxOther, - macCounters->mTxRetry, macCounters->mTxErrCca); + ChipLogProgress(DeviceLayer, + "Rx Counters:\n" + "PHY Rx Total: %" PRIu32 "\n" + "MAC Rx Unicast: %" PRIu32 "\n" + "MAC Rx Broadcast: %" PRIu32 "\n" + "MAC Rx Data: %" PRIu32 "\n" + "MAC Rx Data Polls: %" PRIu32 "\n" + "MAC Rx Beacons: %" PRIu32 "\n" + "MAC Rx Beacon Reqs: %" PRIu32 "\n" + "MAC Rx Other: %" PRIu32 "\n" + "MAC Rx Filtered Whitelist: %" PRIu32 "\n" + "MAC Rx Filtered DestAddr: %" PRIu32 "\n", + macCounters->mRxTotal, macCounters->mRxUnicast, macCounters->mRxBroadcast, macCounters->mRxData, + macCounters->mRxDataPoll, macCounters->mRxBeacon, macCounters->mRxBeaconRequest, macCounters->mRxOther, + macCounters->mRxAddressFiltered, macCounters->mRxDestAddrFiltered); - ChipLogProgress(DeviceLayer, - "Failure Counters:\n" - "MAC Rx Decrypt Fail: %" PRIu32 "\n" - "MAC Rx No Frame Fail: %" PRIu32 "\n" - "MAC Rx Unknown Neighbor Fail: %" PRIu32 "\n" - "MAC Rx Invalid Src Addr Fail: %" PRIu32 "\n" - "MAC Rx FCS Fail: %" PRIu32 "\n" - "MAC Rx Other Fail: %" PRIu32 "\n", - macCounters->mRxErrSec, macCounters->mRxErrNoFrame, macCounters->mRxErrUnknownNeighbor, - macCounters->mRxErrInvalidSrcAddr, macCounters->mRxErrFcs, macCounters->mRxErrOther); - - ipCounters = otThreadGetIp6Counters(mOTInst); + ChipLogProgress(DeviceLayer, + "Tx Counters:\n" + "PHY Tx Total: %" PRIu32 "\n" + "MAC Tx Unicast: %" PRIu32 "\n" + "MAC Tx Broadcast: %" PRIu32 "\n" + "MAC Tx Data: %" PRIu32 "\n" + "MAC Tx Data Polls: %" PRIu32 "\n" + "MAC Tx Beacons: %" PRIu32 "\n" + "MAC Tx Beacon Reqs: %" PRIu32 "\n" + "MAC Tx Other: %" PRIu32 "\n" + "MAC Tx Retry: %" PRIu32 "\n" + "MAC Tx CCA Fail: %" PRIu32 "\n", + macCounters->mTxTotal, macCounters->mTxUnicast, macCounters->mTxBroadcast, macCounters->mTxData, + macCounters->mTxDataPoll, macCounters->mTxBeacon, macCounters->mTxBeaconRequest, macCounters->mTxOther, + macCounters->mTxRetry, macCounters->mTxErrCca); - ChipLogProgress(DeviceLayer, - "IP Counters:\n" - "IP Tx Success: %" PRIu32 "\n" - "IP Rx Success: %" PRIu32 "\n" - "IP Tx Fail: %" PRIu32 "\n" - "IP Rx Fail: %" PRIu32 "\n", - ipCounters->mTxSuccess, ipCounters->mRxSuccess, ipCounters->mTxFailure, ipCounters->mRxFailure); + ChipLogProgress(DeviceLayer, + "Failure Counters:\n" + "MAC Rx Decrypt Fail: %" PRIu32 "\n" + "MAC Rx No Frame Fail: %" PRIu32 "\n" + "MAC Rx Unknown Neighbor Fail: %" PRIu32 "\n" + "MAC Rx Invalid Src Addr Fail: %" PRIu32 "\n" + "MAC Rx FCS Fail: %" PRIu32 "\n" + "MAC Rx Other Fail: %" PRIu32 "\n", + macCounters->mRxErrSec, macCounters->mRxErrNoFrame, macCounters->mRxErrUnknownNeighbor, + macCounters->mRxErrInvalidSrcAddr, macCounters->mRxErrFcs, macCounters->mRxErrOther); + + ipCounters = otThreadGetIp6Counters(mOTInst); + ChipLogProgress(DeviceLayer, + "IP Counters:\n" + "IP Tx Success: %" PRIu32 "\n" + "IP Rx Success: %" PRIu32 "\n" + "IP Tx Fail: %" PRIu32 "\n" + "IP Rx Fail: %" PRIu32 "\n", + ipCounters->mTxSuccess, ipCounters->mRxSuccess, ipCounters->mTxFailure, ipCounters->mRxFailure); + } +#endif // CHIP_PROGRESS_LOGGING exit: Impl()->UnlockThreadStack(); return err; @@ -537,6 +544,8 @@ template CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetAndLogThreadTopologyMinimal(void) { CHIP_ERROR err = CHIP_NO_ERROR; + +#if CHIP_PROGRESS_LOGGING otError otErr; const otExtAddress * extAddress; uint16_t rloc16; @@ -589,7 +598,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetAndLogThread { ChipLogError(DeviceLayer, "GetAndLogThreadTopologyMinimul failed: %" CHIP_ERROR_FORMAT, err.Format()); } - +#endif // CHIP_PROGRESS_LOGGING return err; } @@ -601,6 +610,8 @@ template CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetAndLogThreadTopologyFull() { CHIP_ERROR err = CHIP_NO_ERROR; + +#if CHIP_PROGRESS_LOGGING otError otErr; otIp6Address * leaderAddr = NULL; uint8_t * networkData = NULL; @@ -737,13 +748,13 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetAndLogThread } exit: - Impl()->UnlockThreadStack(); if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "GetAndLogThreadTopologyFull failed: %s", ErrorStr(err)); } +#endif // CHIP_PROGRESS_LOGGING return err; } #else // CHIP_DEVICE_CONFIG_THREAD_FTD @@ -1627,6 +1638,8 @@ void GenericThreadStackManagerImpl_OpenThread::OnJoinerComplete(otErr template void GenericThreadStackManagerImpl_OpenThread::OnJoinerComplete(otError aError) { +#if CHIP_PROGRESS_LOGGING + ChipLogProgress(DeviceLayer, "Join Thread network: %s", otThreadErrorToString(aError)); if (aError == OT_ERROR_NONE) @@ -1635,6 +1648,7 @@ void GenericThreadStackManagerImpl_OpenThread::OnJoinerComplete(otErr ChipLogProgress(DeviceLayer, "Start Thread network: %s", otThreadErrorToString(error)); } +#endif // CHIP_PROGRESS_LOGGING } template diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp index cb9c425776f769..957dc20a05ab24 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.cpp @@ -275,9 +275,9 @@ err_t GenericThreadStackManagerImpl_OpenThread_LwIP::DoInitThreadNetI netif->name[0] = CHIP_DEVICE_CONFIG_LWIP_THREAD_IF_NAME[0]; netif->name[1] = CHIP_DEVICE_CONFIG_LWIP_THREAD_IF_NAME[1]; netif->output_ip6 = SendPacket; -#if LWIP_IPV4 || LWIP_VERSION_MAJOR < 2 +#if LWIP_IPV4 netif->output = NULL; -#endif /* LWIP_IPV4 || LWIP_VERSION_MAJOR < 2 */ +#endif // LWIP_IPV4 netif->linkoutput = NULL; netif->flags = NETIF_FLAG_UP | NETIF_FLAG_LINK_UP | NETIF_FLAG_BROADCAST; netif->mtu = CHIP_DEVICE_CONFIG_THREAD_IF_MTU; @@ -293,13 +293,8 @@ err_t GenericThreadStackManagerImpl_OpenThread_LwIP::DoInitThreadNetI * NB: This method is called in the LwIP TCPIP thread with the LwIP core lock held. */ template -#if LWIP_VERSION_MAJOR < 2 -err_t GenericThreadStackManagerImpl_OpenThread_LwIP::SendPacket(struct netif * netif, struct pbuf * pktPBuf, - struct ip6_addr * ipaddr) -#else err_t GenericThreadStackManagerImpl_OpenThread_LwIP::SendPacket(struct netif * netif, struct pbuf * pktPBuf, const struct ip6_addr * ipaddr) -#endif { err_t lwipErr = ERR_OK; otError otErr; diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.h b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.h index c829512a872593..cc497db7b24b97 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.h +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread_LwIP.h @@ -73,11 +73,7 @@ class GenericThreadStackManagerImpl_OpenThread_LwIP : public GenericThreadStackM bool mAddrAssigned[LWIP_IPV6_NUM_ADDRESSES]; static err_t DoInitThreadNetIf(struct netif * netif); -#if LWIP_VERSION_MAJOR < 2 - static err_t SendPacket(struct netif * netif, struct pbuf * pkt, struct ip6_addr * ipaddr); -#else static err_t SendPacket(struct netif * netif, struct pbuf * pkt, const struct ip6_addr * ipaddr); -#endif static void ReceivePacket(otMessage * pkt, void * context); inline ImplClass * Impl() { return static_cast(this); } diff --git a/src/platform/P6/BLEManagerImpl.cpp b/src/platform/P6/BLEManagerImpl.cpp index 69620b24543e65..b1211857d88d81 100644 --- a/src/platform/P6/BLEManagerImpl.cpp +++ b/src/platform/P6/BLEManagerImpl.cpp @@ -819,7 +819,7 @@ void BLEManagerImpl::SetAdvertisingData(void) localDeviceNameLen = strlen(sInstance.mDeviceName); } - /* First element is the advertisment flags */ + /* First element is the advertisement flags */ adv_elem[num_elem].advert_type = BTM_BLE_ADVERT_TYPE_FLAG; adv_elem[num_elem].len = sizeof(uint8_t); adv_elem[num_elem].p_data = &flag; diff --git a/src/platform/Tizen/DnssdImpl.cpp b/src/platform/Tizen/DnssdImpl.cpp index 8792ce52d95c34..7eaaeb409e6f30 100644 --- a/src/platform/Tizen/DnssdImpl.cpp +++ b/src/platform/Tizen/DnssdImpl.cpp @@ -445,15 +445,17 @@ void OnResolve(dnssd_error_e result, dnssd_service_h service, void * data) // If both IPv4 and IPv6 are set, IPv6 address has higher priority. if (ipv6 != nullptr) { - validIP = chip::Inet::IPAddress::FromString(ipv6, ipStr); + validIP = (chip::Inet::IPAddress::FromString(ipv6, ipStr) && ipStr.Type() == chip::Inet::IPAddressType::kIPv6); } #if INET_CONFIG_ENABLE_IPV4 else if (ipv4 != nullptr) { - validIP = chip::Inet::IPAddress::FromString(ipv4, ipStr); + validIP = (chip::Inet::IPAddress::FromString(ipv4, ipStr) && ipStr.Type() == chip::Inet::IPAddressType::kIPv4); } #endif + ChipLogDetail(DeviceLayer, "Dnssd: %s ipv4: %s, ipv6: %s, valid: %d", __func__, ipv4, ipv6, validIP); + if (validIP) { mdnsService.mAddress.SetValue(ipStr); diff --git a/src/platform/Zephyr/BLEManagerImpl.cpp b/src/platform/Zephyr/BLEManagerImpl.cpp index 8b7696d772016e..52331487e53248 100644 --- a/src/platform/Zephyr/BLEManagerImpl.cpp +++ b/src/platform/Zephyr/BLEManagerImpl.cpp @@ -221,7 +221,7 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) const uint8_t advFlags = BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR; const bool isAdvertisingRerun = mFlags.Has(Flags::kAdvertising); - // At first run always select fast advertising, on the next attemp slow down interval. + // At first run always select fast advertising, on the next attempt slow down interval. const uint32_t intervalMin = mFlags.Has(Flags::kFastAdvertisingEnabled) ? CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN : CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN; const uint32_t intervalMax = mFlags.Has(Flags::kFastAdvertisingEnabled) ? CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX diff --git a/src/platform/Zephyr/ConfigurationManagerImpl.cpp b/src/platform/Zephyr/ConfigurationManagerImpl.cpp index 7c4f7ab9b095ba..65f95d9c3c3e40 100644 --- a/src/platform/Zephyr/ConfigurationManagerImpl.cpp +++ b/src/platform/Zephyr/ConfigurationManagerImpl.cpp @@ -111,6 +111,22 @@ CHIP_ERROR ConfigurationManagerImpl::StoreRebootCount(uint32_t rebootCount) return WriteConfigValue(ZephyrConfig::kCounterKey_RebootCount, rebootCount); } +CHIP_ERROR ConfigurationManagerImpl::GetTotalOperationalHours(uint32_t & totalOperationalHours) +{ + if (!ZephyrConfig::ConfigValueExists(ZephyrConfig::kCounterKey_TotalOperationalHours)) + { + totalOperationalHours = 0; + return CHIP_NO_ERROR; + } + + return ZephyrConfig::ReadConfigValue(ZephyrConfig::kCounterKey_TotalOperationalHours, totalOperationalHours); +} + +CHIP_ERROR ConfigurationManagerImpl::StoreTotalOperationalHours(uint32_t totalOperationalHours) +{ + return ZephyrConfig::WriteConfigValue(ZephyrConfig::kCounterKey_TotalOperationalHours, totalOperationalHours); +} + void ConfigurationManagerImpl::InitiateFactoryReset() { PlatformMgr().ScheduleWork(DoFactoryReset); diff --git a/src/platform/Zephyr/ConfigurationManagerImpl.h b/src/platform/Zephyr/ConfigurationManagerImpl.h index bcca062af99771..44d66d3ab63e15 100644 --- a/src/platform/Zephyr/ConfigurationManagerImpl.h +++ b/src/platform/Zephyr/ConfigurationManagerImpl.h @@ -38,6 +38,8 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp public: CHIP_ERROR GetRebootCount(uint32_t & rebootCount) override; CHIP_ERROR StoreRebootCount(uint32_t rebootCount) override; + CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours) override; + CHIP_ERROR StoreTotalOperationalHours(uint32_t totalOperationalHours) override; // This returns an instance of this class. static ConfigurationManagerImpl & GetDefaultInstance(); diff --git a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp index e627bb5a0d7296..44fad86762e98e 100644 --- a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp @@ -90,6 +90,37 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetRebootCount(uint16_t & rebootCount) return err; } +CHIP_ERROR DiagnosticDataProviderImpl::GetUpTime(uint64_t & upTime) +{ + System::Clock::Timestamp currentTime = System::SystemClock().GetMonotonicTimestamp(); + System::Clock::Timestamp startTime = PlatformMgrImpl().GetStartTime(); + + if (currentTime >= startTime) + { + upTime = std::chrono::duration_cast(currentTime - startTime).count(); + return CHIP_NO_ERROR; + } + + return CHIP_ERROR_INVALID_TIME; +} + +CHIP_ERROR DiagnosticDataProviderImpl::GetTotalOperationalHours(uint32_t & totalOperationalHours) +{ + uint64_t upTimeS; + + ReturnErrorOnFailure(GetUpTime(upTimeS)); + + uint64_t totalHours = 0; + const uint32_t upTimeH = upTimeS / 3600 < UINT32_MAX ? static_cast(upTimeS / 3600) : UINT32_MAX; + const uint64_t deltaTime = upTimeH - PlatformMgrImpl().GetSavedOperationalHoursSinceBoot(); + + ReturnErrorOnFailure(ConfigurationMgr().GetTotalOperationalHours(reinterpret_cast(totalHours))); + + totalOperationalHours = totalHours + deltaTime < UINT32_MAX ? totalHours + deltaTime : UINT32_MAX; + + return CHIP_NO_ERROR; +} + CHIP_ERROR DiagnosticDataProviderImpl::GetBootReason(uint8_t & bootReason) { #if CONFIG_HWINFO diff --git a/src/platform/Zephyr/DiagnosticDataProviderImpl.h b/src/platform/Zephyr/DiagnosticDataProviderImpl.h index 36eeef68422879..05687dcb9832fc 100644 --- a/src/platform/Zephyr/DiagnosticDataProviderImpl.h +++ b/src/platform/Zephyr/DiagnosticDataProviderImpl.h @@ -44,6 +44,8 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override; CHIP_ERROR GetRebootCount(uint16_t & rebootCount) override; + CHIP_ERROR GetUpTime(uint64_t & upTime) override; + CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours) override; CHIP_ERROR GetBootReason(uint8_t & bootReason) override; CHIP_ERROR GetNetworkInterfaces(NetworkInterface ** netifpp) override; void ReleaseNetworkInterfaces(NetworkInterface * netifp) override; diff --git a/src/platform/Zephyr/Logging.cpp b/src/platform/Zephyr/Logging.cpp index f2bb80877e4d5a..017ed0f478313c 100644 --- a/src/platform/Zephyr/Logging.cpp +++ b/src/platform/Zephyr/Logging.cpp @@ -18,7 +18,7 @@ #define LOG_MESSAGE(msg) (msg) #endif -LOG_MODULE_REGISTER(chip, LOG_LEVEL_DBG); +LOG_MODULE_REGISTER(chip, CONFIG_MATTER_LOG_LEVEL); namespace chip { namespace DeviceLayer { diff --git a/src/platform/Zephyr/PlatformManagerImpl.cpp b/src/platform/Zephyr/PlatformManagerImpl.cpp index 1efda5025fa61c..f730e10059b358 100644 --- a/src/platform/Zephyr/PlatformManagerImpl.cpp +++ b/src/platform/Zephyr/PlatformManagerImpl.cpp @@ -42,6 +42,8 @@ static K_THREAD_STACK_DEFINE(sChipThreadStack, CHIP_DEVICE_CONFIG_CHIP_TASK_STAC PlatformManagerImpl PlatformManagerImpl::sInstance{ sChipThreadStack }; +static k_timer sOperationalHoursSavingTimer; + #if !CONFIG_NORDIC_SECURITY_BACKEND static int app_entropy_source(void * data, unsigned char * output, size_t len, size_t * olen) { @@ -61,6 +63,37 @@ static int app_entropy_source(void * data, unsigned char * output, size_t len, s } #endif // !CONFIG_NORDIC_SECURITY_BACKEND +void PlatformManagerImpl::OperationalHoursSavingTimerEventHandler(k_timer * timer) +{ + PlatformMgr().ScheduleWork(UpdateOperationalHours); +} + +void PlatformManagerImpl::UpdateOperationalHours(intptr_t arg) +{ + uint64_t upTimeS; + + if (GetDiagnosticDataProvider().GetUpTime(upTimeS) != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Failed to get up time of the node"); + return; + } + + uint64_t totalOperationalHours = 0; + const uint32_t upTimeH = upTimeS / 3600 < UINT32_MAX ? static_cast(upTimeS / 3600) : UINT32_MAX; + const uint64_t deltaTime = upTimeH - sInstance.mSavedOperationalHoursSinceBoot; + + if (ConfigurationMgr().GetTotalOperationalHours(reinterpret_cast(totalOperationalHours)) == CHIP_NO_ERROR) + { + ConfigurationMgr().StoreTotalOperationalHours( + totalOperationalHours + deltaTime < UINT32_MAX ? totalOperationalHours + deltaTime : UINT32_MAX); + sInstance.mSavedOperationalHoursSinceBoot = upTimeH; + } + else + { + ChipLogError(DeviceLayer, "Failed to get total operational hours of the node"); + } +} + CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) { CHIP_ERROR err; @@ -86,9 +119,27 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) err = Internal::GenericPlatformManagerImpl_Zephyr::_InitChipStack(); SuccessOrExit(err); + // Start the timer to periodically save node operational hours. + k_timer_init(&sOperationalHoursSavingTimer, &PlatformManagerImpl::OperationalHoursSavingTimerEventHandler, nullptr); + k_timer_user_data_set(&sOperationalHoursSavingTimer, this); + k_timer_start(&sOperationalHoursSavingTimer, K_HOURS(CONFIG_CHIP_OPERATIONAL_TIME_SAVE_INTERVAL), + K_HOURS(CONFIG_CHIP_OPERATIONAL_TIME_SAVE_INTERVAL)); + + ScheduleWork(OnDeviceBoot, 0); + exit: return err; } +void PlatformManagerImpl::OnDeviceBoot(intptr_t arg) +{ + GeneralDiagnosticsDelegate * generalDiagnosticsDelegate = GetDiagnosticDataProvider().GetGeneralDiagnosticsDelegate(); + + if (generalDiagnosticsDelegate) + { + generalDiagnosticsDelegate->OnDeviceRebooted(); + } +} + } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/Zephyr/PlatformManagerImpl.h b/src/platform/Zephyr/PlatformManagerImpl.h index cdc924029f3847..a4bb23f456e235 100644 --- a/src/platform/Zephyr/PlatformManagerImpl.h +++ b/src/platform/Zephyr/PlatformManagerImpl.h @@ -29,7 +29,7 @@ namespace chip { namespace DeviceLayer { /** - * Concrete implementation of the PlatformManager singleton object for the nRF Connect SDK platforms. + * Concrete implementation of the PlatformManager singleton object for the Zephyr platforms. */ class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl_Zephyr { @@ -46,19 +46,27 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener public: // ===== Platform-specific members that may be accessed directly by the application. - /* none so far */ + System::Clock::Timestamp GetStartTime() { return mStartTime; } + uint32_t GetSavedOperationalHoursSinceBoot() { return mSavedOperationalHoursSinceBoot; } private: // ===== Methods that implement the PlatformManager abstract interface. CHIP_ERROR _InitChipStack(void); + static void OperationalHoursSavingTimerEventHandler(k_timer * timer); + static void UpdateOperationalHours(intptr_t arg); + static void OnDeviceBoot(intptr_t arg); + // ===== Members for internal use by the following friends. friend PlatformManager & PlatformMgr(void); friend PlatformManagerImpl & PlatformMgrImpl(void); friend class Internal::BLEManagerImpl; + System::Clock::Timestamp mStartTime = System::Clock::kZero; + uint32_t mSavedOperationalHoursSinceBoot = 0; + explicit PlatformManagerImpl(ThreadStack & stack) : Internal::GenericPlatformManagerImpl_Zephyr(stack) {} static PlatformManagerImpl sInstance; @@ -79,7 +87,7 @@ inline PlatformManager & PlatformMgr(void) * Returns the platform-specific implementation of the PlatformManager singleton object. * * chip applications can use this to gain access to features of the PlatformManager - * that are specific to the ESP32 platform. + * that are specific to the Zephyr platform. */ inline PlatformManagerImpl & PlatformMgrImpl() { diff --git a/src/platform/Zephyr/ZephyrConfig.cpp b/src/platform/Zephyr/ZephyrConfig.cpp index 9bdbccb80d7c79..395d6374921740 100644 --- a/src/platform/Zephyr/ZephyrConfig.cpp +++ b/src/platform/Zephyr/ZephyrConfig.cpp @@ -73,8 +73,9 @@ const ZephyrConfig::Key ZephyrConfig::kConfigKey_CountryCode = CONFIG_KEY const ZephyrConfig::Key ZephyrConfig::kConfigKey_Breadcrumb = CONFIG_KEY(NAMESPACE_CONFIG "breadcrumb"); // Keys stored in the counters namespace -const ZephyrConfig::Key ZephyrConfig::kCounterKey_RebootCount = CONFIG_KEY(NAMESPACE_COUNTERS "reboot-count"); -const ZephyrConfig::Key ZephyrConfig::kCounterKey_BootReason = CONFIG_KEY(NAMESPACE_COUNTERS "boot-reason"); +const ZephyrConfig::Key ZephyrConfig::kCounterKey_RebootCount = CONFIG_KEY(NAMESPACE_COUNTERS "reboot-count"); +const ZephyrConfig::Key ZephyrConfig::kCounterKey_BootReason = CONFIG_KEY(NAMESPACE_COUNTERS "boot-reason"); +const ZephyrConfig::Key ZephyrConfig::kCounterKey_TotalOperationalHours = CONFIG_KEY(NAMESPACE_COUNTERS "total-operational-hours"); namespace { diff --git a/src/platform/Zephyr/ZephyrConfig.h b/src/platform/Zephyr/ZephyrConfig.h index a43d3bfc368be6..f6a1b23ed921bd 100644 --- a/src/platform/Zephyr/ZephyrConfig.h +++ b/src/platform/Zephyr/ZephyrConfig.h @@ -65,6 +65,7 @@ class ZephyrConfig static const Key kConfigKey_Breadcrumb; static const Key kCounterKey_RebootCount; static const Key kCounterKey_BootReason; + static const Key kCounterKey_TotalOperationalHours; static CHIP_ERROR Init(void); diff --git a/src/platform/cc13x2_26x2/BLEManagerImpl.cpp b/src/platform/cc13x2_26x2/BLEManagerImpl.cpp index e917cedeee1066..8072f5a582062e 100644 --- a/src/platform/cc13x2_26x2/BLEManagerImpl.cpp +++ b/src/platform/cc13x2_26x2/BLEManagerImpl.cpp @@ -664,12 +664,12 @@ CHIP_ERROR BLEManagerImpl::CreateEventHandler(void) BaseType_t xReturned; /* Create the task, storing the handle. */ - xReturned = xTaskCreate(EventHandler, /* Function that implements the task. */ - "ble_hndlr", /* Text name for the task. */ - 4096 / sizeof(uint32_t), /* Stack size in words, not bytes. */ - this, /* Parameter passed into the task. */ - ICALL_TASK_PRIORITIES, /* Keep priority the same as ICALL until init is complete */ - NULL); /* Used to pass out the created task's handle. */ + xReturned = xTaskCreate(EventHandler, /* Function that implements the task. */ + "ble_hndlr", /* Text name for the task. */ + BLEMANAGER_EVENT_HANDLER_STACK_SIZE, /* Stack size in words, not bytes. */ + this, /* Parameter passed into the task. */ + ICALL_TASK_PRIORITIES, /* Keep priority the same as ICALL until init is complete */ + NULL); /* Used to pass out the created task's handle. */ if (xReturned == errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY) { @@ -748,7 +748,7 @@ uint8_t BLEManagerImpl::ProcessStackEvent(ICall_Hdr * pMsg) } else { - /* PHY Update successfull */ + /* PHY Update successful */ } } break; diff --git a/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h b/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h index 45398c4cfa9a73..ed7532d5ca1ea2 100644 --- a/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h +++ b/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h @@ -41,7 +41,9 @@ #define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE (8192) -#define BLEMANAGER_EVENT_HANDLER_STACK_SIZE (4096) +#define CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE (7168) + +#define BLEMANAGER_EVENT_HANDLER_STACK_SIZE (924) #define BLEMANAGER_EVENT_HANDLER_PRIORITY (2) #define CHIP_DEVICE_CONFIG_ENABLE_THREAD 1 diff --git a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h index 6fabd3d32fa7e4..4d6fec8a2309dd 100644 --- a/src/platform/cc13x2_26x2/CHIPPlatformConfig.h +++ b/src/platform/cc13x2_26x2/CHIPPlatformConfig.h @@ -40,10 +40,7 @@ #define CHIP_CONFIG_PERSISTED_STORAGE_KEY_GLOBAL_MESSAGE_COUNTER 0x2 // ==================== Security Adaptations ==================== - -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY 1 -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY 2 -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY 3 +#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_GLOBAL_EIDC_KEY 2 // This platform uses mbedtls, but these defines don't seem to be used in source #define CHIP_CONFIG_USE_OPENSSL_ECC 0 diff --git a/src/platform/cc13x2_26x2/FreeRTOSConfig.h b/src/platform/cc13x2_26x2/FreeRTOSConfig.h index 1d3798b6c8dcc3..e5af86c4ac7073 100644 --- a/src/platform/cc13x2_26x2/FreeRTOSConfig.h +++ b/src/platform/cc13x2_26x2/FreeRTOSConfig.h @@ -58,7 +58,7 @@ /* Constants that describe the hardware and memory usage. */ #define configCPU_CLOCK_HZ ((unsigned long) 48000000) -#define configMINIMAL_STACK_SIZE ((unsigned short) 1024) +#define configMINIMAL_STACK_SIZE ((unsigned short) 512) #define configMAX_TASK_NAME_LEN (12) /* FreeRTOS heap size is 0 because currently "bget" heap is the @@ -105,8 +105,9 @@ #define configUSE_TIMERS 1 #define configTIMER_TASK_PRIORITY (6) #define configTIMER_QUEUE_LENGTH (20) -#define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 2) +#define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE) #define configIDLE_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE) + #define configENABLE_BACKWARD_COMPATIBILITY 1 #if defined(__TI_COMPILER_VERSION__) || defined(__ti_version__) diff --git a/src/platform/cc13x2_26x2/Logging.cpp b/src/platform/cc13x2_26x2/Logging.cpp index 7cfe2d73e82c04..6d0e932708119c 100644 --- a/src/platform/cc13x2_26x2/Logging.cpp +++ b/src/platform/cc13x2_26x2/Logging.cpp @@ -56,7 +56,7 @@ namespace DeviceLayer { /** * Called whenever a log message is emitted. * - * Can be overriden by the device logging file + * Can be overridden by the device logging file */ void __attribute__((weak)) OnLogOutput(void) {} diff --git a/src/platform/device.gni b/src/platform/device.gni index 7fac9867fe2632..ff9ce0b0e43b5e 100755 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -21,7 +21,7 @@ declare_args() { chip_device_platform = "auto" chip_platform_target = "" - # Substitue fake platform when building with chip_device_platform=auto. + # Substitute fake platform when building with chip_device_platform=auto. chip_fake_platform = false } diff --git a/src/platform/fake/PlatformManagerImpl.h b/src/platform/fake/PlatformManagerImpl.h index 204b49e176e221..a3e8cf30ae59c4 100644 --- a/src/platform/fake/PlatformManagerImpl.h +++ b/src/platform/fake/PlatformManagerImpl.h @@ -104,6 +104,12 @@ class PlatformManagerImpl final : public PlatformManager return CHIP_ERROR_NOT_IMPLEMENTED; } + CHIP_ERROR _SetUserLabelList(EndpointId endpoint, + LabelList & labelList) + { + return CHIP_ERROR_NOT_IMPLEMENTED; + } + CHIP_ERROR _GetUserLabelList(EndpointId endpoint, LabelList & labelList) { diff --git a/src/platform/mbed/Logging.cpp b/src/platform/mbed/Logging.cpp index 42e6b9f18604c3..0da70e436d08be 100644 --- a/src/platform/mbed/Logging.cpp +++ b/src/platform/mbed/Logging.cpp @@ -93,7 +93,7 @@ void LogV(const char * module, uint8_t category, const char * msg, va_list v) void mbed_logging_init() { - // Mbed trace initalization + // Mbed trace initialization mbed_trace_init(); mbed_trace_include_filters_set((char *) TRACE_GROUP); mbed_trace_config_set(TRACE_ACTIVE_LEVEL_ALL | TRACE_MODE_COLOR); diff --git a/src/platform/nrfconnect/BUILD.gn b/src/platform/nrfconnect/BUILD.gn index d2296794185015..0bf154e0ded158 100644 --- a/src/platform/nrfconnect/BUILD.gn +++ b/src/platform/nrfconnect/BUILD.gn @@ -70,4 +70,11 @@ static_library("nrfconnect") { "NFCManagerImpl.h", ] } + + if (chip_enable_ota_requestor) { + sources += [ + "OTAImageProcessorImpl.cpp", + "OTAImageProcessorImpl.h", + ] + } } diff --git a/src/platform/nrfconnect/OTAImageProcessorImpl.cpp b/src/platform/nrfconnect/OTAImageProcessorImpl.cpp new file mode 100644 index 00000000000000..c31f321a70872b --- /dev/null +++ b/src/platform/nrfconnect/OTAImageProcessorImpl.cpp @@ -0,0 +1,77 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "OTAImageProcessorImpl.h" + +#include +#include +#include +#include + +#include +#include + +namespace chip { +namespace DeviceLayer { + +CHIP_ERROR OTAImageProcessorImpl::PrepareDownload() +{ + VerifyOrReturnError(mDownloader != nullptr, CHIP_ERROR_INCORRECT_STATE); + + return DeviceLayer::SystemLayer().ScheduleLambda([this] { mDownloader->OnPreparedForDownload(PrepareDownloadImpl()); }); +} + +CHIP_ERROR OTAImageProcessorImpl::PrepareDownloadImpl() +{ + ReturnErrorOnFailure(System::MapErrorZephyr(dfu_target_mcuboot_set_buf(mBuffer, sizeof(mBuffer)))); + ReturnErrorOnFailure(System::MapErrorZephyr(dfu_target_reset())); + return System::MapErrorZephyr(dfu_target_init(DFU_TARGET_IMAGE_TYPE_MCUBOOT, /* size */ 0, nullptr)); +} + +CHIP_ERROR OTAImageProcessorImpl::Finalize() +{ + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAImageProcessorImpl::Abort() +{ + return System::MapErrorZephyr(dfu_target_reset()); +} + +CHIP_ERROR OTAImageProcessorImpl::Apply() +{ + return System::MapErrorZephyr(dfu_target_done(true)); +} + +CHIP_ERROR OTAImageProcessorImpl::ProcessBlock(ByteSpan & block) +{ + VerifyOrReturnError(mDownloader != nullptr, CHIP_ERROR_INCORRECT_STATE); + + // DFU target library buffers data internally, so do not clone the block data. + CHIP_ERROR error = System::MapErrorZephyr(dfu_target_write(block.data(), block.size())); + + // Report the result back to the downloader asynchronously. + return DeviceLayer::SystemLayer().ScheduleLambda([this, error] { + if (error == CHIP_NO_ERROR) + mDownloader->FetchNextData(); + else + mDownloader->EndDownload(error); + }); +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/nrfconnect/OTAImageProcessorImpl.h b/src/platform/nrfconnect/OTAImageProcessorImpl.h new file mode 100644 index 00000000000000..a9db9201ec6565 --- /dev/null +++ b/src/platform/nrfconnect/OTAImageProcessorImpl.h @@ -0,0 +1,50 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { + +class OTADownloader; + +namespace DeviceLayer { + +class OTAImageProcessorImpl : public OTAImageProcessorInterface +{ +public: + static constexpr size_t kBufferSize = CONFIG_CHIP_OTA_REQUESTOR_BUFFER_SIZE; + + void SetOTADownloader(OTADownloader * downloader) { mDownloader = downloader; }; + + CHIP_ERROR PrepareDownload() override; + CHIP_ERROR Finalize() override; + CHIP_ERROR Abort() override; + CHIP_ERROR Apply() override; + CHIP_ERROR ProcessBlock(ByteSpan & block) override; + +private: + CHIP_ERROR PrepareDownloadImpl(); + + OTADownloader * mDownloader = nullptr; + uint8_t mBuffer[kBufferSize]; +}; + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp index 69cbda3df32a56..c1d0c7bdd1aaf7 100644 --- a/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/BLEManagerImpl.cpp @@ -70,7 +70,7 @@ namespace { /* Timeout of BLE commands */ #define CHIP_BLE_KW_EVNT_TIMEOUT 1000 -/** BLE advertisment state changed */ +/** BLE advertisement state changed */ #define CHIP_BLE_KW_EVNT_ADV_CHANGED 0x0001 /** BLE advertisement command failed */ #define CHIP_BLE_KW_EVNT_ADV_FAILED 0x0002 @@ -1545,7 +1545,7 @@ void BLEManagerImpl::BleAdvTimeoutHandler(TimerHandle_t xTimer) { if (sInstance.mFlags.Has(Flags::kFastAdvertisingEnabled)) { - ChipLogDetail(DeviceLayer, "bleAdv Timeout : Start slow advertisment"); + ChipLogDetail(DeviceLayer, "bleAdv Timeout : Start slow advertisement"); sInstance.mFlags.Clear(Flags::kFastAdvertisingEnabled); // stop advertiser, change interval and restart it; diff --git a/src/platform/nxp/k32w/k32w0/CHIPDevicePlatformConfig.h b/src/platform/nxp/k32w/k32w0/CHIPDevicePlatformConfig.h index b55382633713af..8bbfc047b3edb6 100644 --- a/src/platform/nxp/k32w/k32w0/CHIPDevicePlatformConfig.h +++ b/src/platform/nxp/k32w/k32w0/CHIPDevicePlatformConfig.h @@ -43,9 +43,7 @@ #define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY 2 -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY 3 -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY 4 +#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_GLOBAL_EIDC_KEY 2 // ========== Platform-specific Configuration ========= diff --git a/src/platform/qpg/CHIPDevicePlatformConfig.h b/src/platform/qpg/CHIPDevicePlatformConfig.h index 2a950414f6cc26..81bcbcfa269419 100644 --- a/src/platform/qpg/CHIPDevicePlatformConfig.h +++ b/src/platform/qpg/CHIPDevicePlatformConfig.h @@ -40,9 +40,7 @@ #define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_CRIT_EIDC_KEY 2 -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_INFO_EIDC_KEY 3 -#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_DEBUG_EIDC_KEY 4 +#define CHIP_DEVICE_CONFIG_PERSISTED_STORAGE_GLOBAL_EIDC_KEY 2 #define CHIP_DEVICE_CONFIG_ENABLE_DNSSD 1 diff --git a/src/platform/qpg/args.gni b/src/platform/qpg/args.gni index a051e30b87bbbc..c818cd6168f99e 100644 --- a/src/platform/qpg/args.gni +++ b/src/platform/qpg/args.gni @@ -44,9 +44,9 @@ chip_build_tests = false chip_enable_rotating_device_id = false openthread_external_mbedtls = mbedtls_target -openthread_project_core_config_file = "openthread-core-qpg6100-config.h" +openthread_project_core_config_file = "openthread-core-qpg6105-config.h" openthread_core_config_platform_check_file = - "openthread-core-qpg6100-config-check.h" + "openthread-core-qpg6105-config-check.h" openthread_core_config_deps = [ "${chip_root}/third_party/openthread/platforms/qpg:libopenthread-qpg-config", ] diff --git a/src/protocols/bdx/BdxMessages.h b/src/protocols/bdx/BdxMessages.h index 9ac493d6ab5711..0fd13d73962f47 100644 --- a/src/protocols/bdx/BdxMessages.h +++ b/src/protocols/bdx/BdxMessages.h @@ -95,7 +95,7 @@ struct BdxMessage * so it is essential that the underlying PacketBuffer is not modified until after this * struct is no longer needed. * - * @param[in] aBuffer A PacketBufferHandle with a refernce to the PacketBuffer containing the data. + * @param[in] aBuffer A PacketBufferHandle with a reference to the PacketBuffer containing the data. * * @return CHIP_ERROR Return an error if the message format is invalid and/or can't be parsed */ diff --git a/src/protocols/bdx/BdxTransferSession.cpp b/src/protocols/bdx/BdxTransferSession.cpp index 33665bb9a740c0..f92fb109284cd2 100644 --- a/src/protocols/bdx/BdxTransferSession.cpp +++ b/src/protocols/bdx/BdxTransferSession.cpp @@ -123,7 +123,7 @@ void TransferSession::PollOutput(OutputEvent & event, System::Clock::Timestamp c break; } - // If there's no other pending output but an error occured or was received, then continue to output the error. + // If there's no other pending output but an error occurred or was received, then continue to output the error. // This ensures that when the TransferSession encounters an error and needs to send a StatusReport, both a kMsgToSend and a // kInternalError output event will be emitted. if (event.EventType == OutputEventType::kNone && mState == TransferState::kErrorState) diff --git a/src/protocols/echo/Echo.h b/src/protocols/echo/Echo.h index 9c4a625b80647c..1f3429b85abba7 100644 --- a/src/protocols/echo/Echo.h +++ b/src/protocols/echo/Echo.h @@ -18,7 +18,7 @@ /** * @file - * This file defines objects for a CHIP Echo unsolicitied + * This file defines objects for a CHIP Echo unsolicited * initaitor (client) and responder (server). * */ @@ -67,7 +67,7 @@ class DLL_EXPORT EchoClient : public Messaging::ExchangeDelegate * @retval #CHIP_NO_ERROR On success. * */ - CHIP_ERROR Init(Messaging::ExchangeManager * exchangeMgr, SessionHandle session); + CHIP_ERROR Init(Messaging::ExchangeManager * exchangeMgr, const SessionHandle & session); /** * Shutdown the EchoClient. This terminates this instance diff --git a/src/protocols/echo/EchoClient.cpp b/src/protocols/echo/EchoClient.cpp index e861ffa9feebb4..e8bf65cf28ef68 100644 --- a/src/protocols/echo/EchoClient.cpp +++ b/src/protocols/echo/EchoClient.cpp @@ -18,7 +18,7 @@ /** * @file - * This file implements an object for a CHIP Echo unsolicitied + * This file implements an object for a CHIP Echo unsolicited * initiator (client). * */ @@ -32,7 +32,7 @@ namespace Echo { // The Echo message timeout value in milliseconds. constexpr System::Clock::Timeout kEchoMessageTimeout = System::Clock::Milliseconds32(800); -CHIP_ERROR EchoClient::Init(Messaging::ExchangeManager * exchangeMgr, SessionHandle session) +CHIP_ERROR EchoClient::Init(Messaging::ExchangeManager * exchangeMgr, const SessionHandle & session) { // Error if already initialized. if (mExchangeMgr != nullptr) diff --git a/src/protocols/echo/EchoServer.cpp b/src/protocols/echo/EchoServer.cpp index f93b8791d0b784..a9fea3ee3075d9 100644 --- a/src/protocols/echo/EchoServer.cpp +++ b/src/protocols/echo/EchoServer.cpp @@ -18,7 +18,7 @@ /** * @file - * This file implements an object for a CHIP Echo unsolicitied + * This file implements an object for a CHIP Echo unsolicited * responder (server). * */ diff --git a/src/protocols/secure_channel/CASEServer.cpp b/src/protocols/secure_channel/CASEServer.cpp index cf3cf5cdc0d555..fb524277d602ab 100644 --- a/src/protocols/secure_channel/CASEServer.cpp +++ b/src/protocols/secure_channel/CASEServer.cpp @@ -45,9 +45,6 @@ CHIP_ERROR CASEServer::ListenForSessionEstablishment(Messaging::ExchangeManager mIDAllocator = idAllocator; Cleanup(); - - ReturnErrorOnFailure(GetSession().MessageDispatch().Init(sessionManager)); - return CHIP_NO_ERROR; } diff --git a/src/protocols/secure_channel/CASEServer.h b/src/protocols/secure_channel/CASEServer.h index c2699b2a3f9f25..95fea0b43e9e2e 100644 --- a/src/protocols/secure_channel/CASEServer.h +++ b/src/protocols/secure_channel/CASEServer.h @@ -49,11 +49,7 @@ class CASEServer : public SessionEstablishmentDelegate, public Messaging::Exchan CHIP_ERROR OnMessageReceived(Messaging::ExchangeContext * ec, const PayloadHeader & payloadHeader, System::PacketBufferHandle && payload) override; void OnResponseTimeout(Messaging::ExchangeContext * ec) override {} - Messaging::ExchangeMessageDispatch * GetMessageDispatch(Messaging::ReliableMessageMgr * reliableMessageManager, - SessionManager * sessionManager) override - { - return GetSession().GetMessageDispatch(reliableMessageManager, sessionManager); - } + Messaging::ExchangeMessageDispatch & GetMessageDispatch() override { return GetSession().GetMessageDispatch(); } virtual CASESession & GetSession() { return mPairingSession; } diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index db782eac4b4322..6555232ccb863b 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -214,7 +214,7 @@ CHIP_ERROR CASESession::EstablishSession(const Transport::PeerAddress peerAddres { CHIP_ERROR err = CHIP_NO_ERROR; - // Return early on error here, as we have not initalized any state yet + // Return early on error here, as we have not initialized any state yet ReturnErrorCodeIf(exchangeCtxt == nullptr, CHIP_ERROR_INVALID_ARGUMENT); ReturnErrorCodeIf(fabric == nullptr, CHIP_ERROR_INVALID_ARGUMENT); @@ -231,7 +231,7 @@ CHIP_ERROR CASESession::EstablishSession(const Transport::PeerAddress peerAddres mFabricInfo = fabric; mLocalMRPConfig = mrpConfig; - mExchangeCtxt->SetResponseTimeout(kSigma_Response_Timeout); + mExchangeCtxt->SetResponseTimeout(kSigma_Response_Timeout + mExchangeCtxt->GetAckTimeout()); SetPeerAddress(peerAddress); SetPeerNodeId(peerNodeId); @@ -313,7 +313,7 @@ CHIP_ERROR CASESession::SendSigma1() VerifyOrReturnError(!msg_R1.IsNull(), CHIP_ERROR_NO_MEMORY); tlvWriter.Init(std::move(msg_R1)); - ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(1), ByteSpan(mInitiatorRandom))); // Retrieve Session Identifier ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(2), GetLocalSessionId())); @@ -356,16 +356,12 @@ CHIP_ERROR CASESession::SendSigma1() ReturnErrorOnFailure(mCommissioningHash.AddData(ByteSpan{ msg_R1->Start(), msg_R1->DataLength() })); - // The state is being updated here before the message is successfully sent. - // This is done here due to limitation in unit test harness, where the SendMessage() immediately calls - // the OnMessageReceived(). If mState was updated after SendMessage, the receive will fail in unit tests. - // TODO: Update secure session SendMessage() unit test harness to do asynchronous send and receives. - mState = kSentSigma1; - // Call delegate to send the msg to peer ReturnErrorOnFailure(mExchangeCtxt->SendMessage(Protocols::SecureChannel::MsgType::CASE_Sigma1, std::move(msg_R1), SendFlags(SendMessageFlags::kExpectResponse))); + mState = kSentSigma1; + ChipLogDetail(SecureChannel, "Sent Sigma1 msg"); mDelegate->OnSessionEstablishmentStarted(); @@ -475,7 +471,7 @@ CHIP_ERROR CASESession::SendSigma2Resume(const ByteSpan & initiatorRandom) // Generate a new resumption ID ReturnErrorOnFailure(DRBG_get_bytes(mResumptionId, sizeof(mResumptionId))); - ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(1), ByteSpan(mResumptionId))); uint8_t sigma2ResumeMIC[CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES]; @@ -496,16 +492,12 @@ CHIP_ERROR CASESession::SendSigma2Resume(const ByteSpan & initiatorRandom) ReturnErrorOnFailure(tlvWriter.EndContainer(outerContainerType)); ReturnErrorOnFailure(tlvWriter.Finalize(&msg_R2_resume)); - // The state is being updated here before the message is successfully sent. - // This is done here due to limitation in unit test harness, where the SendMessage() immediately calls - // the OnMessageReceived(). If mState was updated after SendMessage, the receive will fail in unit tests. - // TODO: Update secure session SendMessage() unit test harness to do asynchronous send and receives. - mState = kSentSigma2Resume; - // Call delegate to send the msg to peer ReturnErrorOnFailure(mExchangeCtxt->SendMessage(Protocols::SecureChannel::MsgType::CASE_Sigma2Resume, std::move(msg_R2_resume), SendFlags(SendMessageFlags::kExpectResponse))); + mState = kSentSigma2Resume; + ChipLogDetail(SecureChannel, "Sent Sigma2Resume msg"); return CHIP_NO_ERROR; @@ -577,7 +569,7 @@ CHIP_ERROR CASESession::SendSigma2() TLV::TLVType outerContainerType = TLV::kTLVType_NotSpecified; tlvWriter.Init(msg_R2_Encrypted.Get(), msg_r2_signed_enc_len); - ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(kTag_TBEData_SenderNOC), nocCert)); if (!icaCert.empty()) { @@ -613,7 +605,7 @@ CHIP_ERROR CASESession::SendSigma2() outerContainerType = TLV::kTLVType_NotSpecified; tlvWriterMsg2.Init(std::move(msg_R2)); - ReturnErrorOnFailure(tlvWriterMsg2.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriterMsg2.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); ReturnErrorOnFailure(tlvWriterMsg2.PutBytes(TLV::ContextTag(1), &msg_rand[0], sizeof(msg_rand))); ReturnErrorOnFailure(tlvWriterMsg2.Put(TLV::ContextTag(2), GetLocalSessionId())); ReturnErrorOnFailure( @@ -630,16 +622,12 @@ CHIP_ERROR CASESession::SendSigma2() ReturnErrorOnFailure(mCommissioningHash.AddData(ByteSpan{ msg_R2->Start(), msg_R2->DataLength() })); - // The state is being updated here before the message is successfully sent. - // This is done here due to limitation in unit test harness, where the SendMessage() immediately calls - // the OnMessageReceived(). If mState was updated after SendMessage, the receive will fail in unit tests. - // TODO: Update secure session SendMessage() unit test harness to do asynchronous send and receives. - mState = kSentSigma2; - // Call delegate to send the msg to peer ReturnErrorOnFailure(mExchangeCtxt->SendMessage(Protocols::SecureChannel::MsgType::CASE_Sigma2, std::move(msg_R2), SendFlags(SendMessageFlags::kExpectResponse))); + mState = kSentSigma2; + ChipLogDetail(SecureChannel, "Sent Sigma2 msg"); return CHIP_NO_ERROR; @@ -660,7 +648,7 @@ CHIP_ERROR CASESession::HandleSigma2Resume(System::PacketBufferHandle && msg) uint8_t sigma2ResumeMIC[CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES]; tlvReader.Init(std::move(msg)); - SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag)); + SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag())); SuccessOrExit(err = tlvReader.EnterContainer(containerType)); SuccessOrExit(err = tlvReader.Next()); @@ -755,7 +743,7 @@ CHIP_ERROR CASESession::HandleSigma2(System::PacketBufferHandle && msg) ChipLogDetail(SecureChannel, "Received Sigma2 msg"); tlvReader.Init(std::move(msg)); - SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag)); + SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag())); SuccessOrExit(err = tlvReader.EnterContainer(containerType)); // Retrieve Responder's Random value @@ -809,7 +797,7 @@ CHIP_ERROR CASESession::HandleSigma2(System::PacketBufferHandle && msg) decryptedDataTlvReader.Init(msg_R2_Encrypted.Get(), msg_r2_encrypted_len); containerType = TLV::kTLVType_Structure; - SuccessOrExit(err = decryptedDataTlvReader.Next(containerType, TLV::AnonymousTag)); + SuccessOrExit(err = decryptedDataTlvReader.Next(containerType, TLV::AnonymousTag())); SuccessOrExit(err = decryptedDataTlvReader.EnterContainer(containerType)); SuccessOrExit(err = decryptedDataTlvReader.Next(TLV::kTLVType_ByteString, TLV::ContextTag(kTag_TBEData_SenderNOC))); @@ -926,7 +914,7 @@ CHIP_ERROR CASESession::SendSigma3() TLV::TLVType outerContainerType = TLV::kTLVType_NotSpecified; tlvWriter.Init(msg_R3_Encrypted.Get(), msg_r3_encrypted_len); - SuccessOrExit(err = tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + SuccessOrExit(err = tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); SuccessOrExit(err = tlvWriter.Put(TLV::ContextTag(kTag_TBEData_SenderNOC), nocCert)); if (!icaCert.empty()) { @@ -968,7 +956,7 @@ CHIP_ERROR CASESession::SendSigma3() TLV::TLVType outerContainerType = TLV::kTLVType_NotSpecified; tlvWriter.Init(std::move(msg_R3)); - err = tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType); + err = tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType); SuccessOrExit(err); err = tlvWriter.PutBytes(TLV::ContextTag(1), msg_R3_Encrypted.Get(), static_cast(msg_r3_encrypted_len + CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES)); @@ -982,12 +970,6 @@ CHIP_ERROR CASESession::SendSigma3() err = mCommissioningHash.AddData(ByteSpan{ msg_R3->Start(), msg_R3->DataLength() }); SuccessOrExit(err); - // The state is being updated here before the message is successfully sent. - // This is done here due to limitation in unit test harness, where the SendMessage() immediately calls - // the OnMessageReceived(). If mState was updated after SendMessage, the receive will fail in unit tests. - // TODO: Update secure session SendMessage() unit test harness to do asynchronous send and receives. - mState = kSentSigma3; - // Call delegate to send the Msg3 to peer err = mExchangeCtxt->SendMessage(Protocols::SecureChannel::MsgType::CASE_Sigma3, std::move(msg_R3), SendFlags(SendMessageFlags::kExpectResponse)); @@ -998,6 +980,8 @@ CHIP_ERROR CASESession::SendSigma3() err = mCommissioningHash.Finish(messageDigestSpan); SuccessOrExit(err); + mState = kSentSigma3; + exit: if (err != CHIP_NO_ERROR) @@ -1041,7 +1025,7 @@ CHIP_ERROR CASESession::HandleSigma3(System::PacketBufferHandle && msg) ChipLogDetail(SecureChannel, "Received Sigma3 msg"); tlvReader.Init(std::move(msg)); - SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag)); + SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag())); SuccessOrExit(err = tlvReader.EnterContainer(containerType)); // Fetch encrypted data @@ -1075,7 +1059,7 @@ CHIP_ERROR CASESession::HandleSigma3(System::PacketBufferHandle && msg) decryptedDataTlvReader.Init(msg_R3_Encrypted.Get(), msg_r3_encrypted_len); containerType = TLV::kTLVType_Structure; - SuccessOrExit(err = decryptedDataTlvReader.Next(containerType, TLV::AnonymousTag)); + SuccessOrExit(err = decryptedDataTlvReader.Next(containerType, TLV::AnonymousTag())); SuccessOrExit(err = decryptedDataTlvReader.EnterContainer(containerType)); SuccessOrExit(err = decryptedDataTlvReader.Next(TLV::kTLVType_ByteString, TLV::ContextTag(kTag_TBEData_SenderNOC))); @@ -1275,7 +1259,7 @@ CHIP_ERROR CASESession::ConstructTBSData(const ByteSpan & senderNOC, const ByteS }; tlvWriter.Init(tbsData, tbsDataLen); - ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(kTag_TBSData_SenderNOC), senderNOC)); if (!senderICAC.empty()) { @@ -1366,7 +1350,7 @@ CHIP_ERROR CASESession::ParseSigma1(TLV::ContiguousBufferTLVReader & tlvReader, constexpr uint8_t kResume1MICTag = 7; TLVType containerType = kTLVType_Structure; - ReturnErrorOnFailure(tlvReader.Next(containerType, AnonymousTag)); + ReturnErrorOnFailure(tlvReader.Next(containerType, AnonymousTag())); ReturnErrorOnFailure(tlvReader.EnterContainer(containerType)); ReturnErrorOnFailure(tlvReader.Next(ContextTag(kInitiatorRandomTag))); @@ -1454,7 +1438,7 @@ CHIP_ERROR CASESession::ValidateReceivedMessage(ExchangeContext * ec, const Payl else { mExchangeCtxt = ec; - mExchangeCtxt->SetResponseTimeout(kSigma_Response_Timeout); + mExchangeCtxt->SetResponseTimeout(kSigma_Response_Timeout + mExchangeCtxt->GetAckTimeout()); } VerifyOrReturnError(!msg.IsNull(), CHIP_ERROR_INVALID_ARGUMENT); diff --git a/src/protocols/secure_channel/CASESession.h b/src/protocols/secure_channel/CASESession.h index 9d967ddf7074fe..b266158c011f4d 100644 --- a/src/protocols/secure_channel/CASESession.h +++ b/src/protocols/secure_channel/CASESession.h @@ -156,17 +156,11 @@ class DLL_EXPORT CASESession : public Messaging::ExchangeDelegate, public Pairin **/ CHIP_ERROR FromCachable(const CASESessionCachable & output); - SessionEstablishmentExchangeDispatch & MessageDispatch() { return mMessageDispatch; } - //// ExchangeDelegate Implementation //// CHIP_ERROR OnMessageReceived(Messaging::ExchangeContext * ec, const PayloadHeader & payloadHeader, System::PacketBufferHandle && payload) override; void OnResponseTimeout(Messaging::ExchangeContext * ec) override; - Messaging::ExchangeMessageDispatch * GetMessageDispatch(Messaging::ReliableMessageMgr * rmMgr, - SessionManager * sessionManager) override - { - return &mMessageDispatch; - } + Messaging::ExchangeMessageDispatch & GetMessageDispatch() override { return SessionEstablishmentExchangeDispatch::Instance(); } FabricIndex GetFabricIndex() const { return mFabricInfo != nullptr ? mFabricInfo->GetFabricIndex() : kUndefinedFabricIndex; } @@ -249,7 +243,6 @@ class DLL_EXPORT CASESession : public Messaging::ExchangeDelegate, public Pairin uint8_t mIPK[kIPKSize]; Messaging::ExchangeContext * mExchangeCtxt = nullptr; - SessionEstablishmentExchangeDispatch mMessageDispatch; FabricTable * mFabricsTable = nullptr; FabricInfo * mFabricInfo = nullptr; diff --git a/src/protocols/secure_channel/MessageCounterManager.cpp b/src/protocols/secure_channel/MessageCounterManager.cpp index 5242f26acfb9f8..9c3a4d99143518 100644 --- a/src/protocols/secure_channel/MessageCounterManager.cpp +++ b/src/protocols/secure_channel/MessageCounterManager.cpp @@ -60,7 +60,7 @@ void MessageCounterManager::Shutdown() } } -CHIP_ERROR MessageCounterManager::StartSync(SessionHandle session, Transport::SecureSession * state) +CHIP_ERROR MessageCounterManager::StartSync(const SessionHandle & session, Transport::SecureSession * state) { // Initiate message counter synchronization if no message counter synchronization is in progress. Transport::PeerMessageCounter & counter = state->GetSessionMessageCounter().GetPeerMessageCounter(); @@ -72,7 +72,7 @@ CHIP_ERROR MessageCounterManager::StartSync(SessionHandle session, Transport::Se return CHIP_NO_ERROR; } -CHIP_ERROR MessageCounterManager::QueueReceivedMessageAndStartSync(const PacketHeader & packetHeader, SessionHandle session, +CHIP_ERROR MessageCounterManager::QueueReceivedMessageAndStartSync(const PacketHeader & packetHeader, const SessionHandle & session, Transport::SecureSession * state, const Transport::PeerAddress & peerAddress, System::PacketBufferHandle && msgBuf) @@ -175,7 +175,7 @@ void MessageCounterManager::ProcessPendingMessages(NodeId peerNodeId) } } -CHIP_ERROR MessageCounterManager::SendMsgCounterSyncReq(SessionHandle session, Transport::SecureSession * state) +CHIP_ERROR MessageCounterManager::SendMsgCounterSyncReq(const SessionHandle & session, Transport::SecureSession * state) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/protocols/secure_channel/MessageCounterManager.h b/src/protocols/secure_channel/MessageCounterManager.h index d2c39fce9961a7..5437cafeed4bad 100644 --- a/src/protocols/secure_channel/MessageCounterManager.h +++ b/src/protocols/secure_channel/MessageCounterManager.h @@ -46,8 +46,8 @@ class MessageCounterManager : public Messaging::ExchangeDelegate, public Transpo void Shutdown(); // Implement MessageCounterManagerInterface - CHIP_ERROR StartSync(SessionHandle session, Transport::SecureSession * state) override; - CHIP_ERROR QueueReceivedMessageAndStartSync(const PacketHeader & packetHeader, SessionHandle session, + CHIP_ERROR StartSync(const SessionHandle & session, Transport::SecureSession * state) override; + CHIP_ERROR QueueReceivedMessageAndStartSync(const PacketHeader & packetHeader, const SessionHandle & session, Transport::SecureSession * state, const Transport::PeerAddress & peerAddress, System::PacketBufferHandle && msgBuf) override; @@ -63,7 +63,7 @@ class MessageCounterManager : public Messaging::ExchangeDelegate, public Transpo * @retval #CHIP_NO_ERROR On success. * */ - CHIP_ERROR SendMsgCounterSyncReq(SessionHandle session, Transport::SecureSession * state); + CHIP_ERROR SendMsgCounterSyncReq(const SessionHandle & session, Transport::SecureSession * state); /** * Add a CHIP message into the cache table to queue the incoming messages that trigger message counter synchronization diff --git a/src/protocols/secure_channel/PASESession.cpp b/src/protocols/secure_channel/PASESession.cpp index d43f01c5ae0eb8..f02b501feed4e4 100644 --- a/src/protocols/secure_channel/PASESession.cpp +++ b/src/protocols/secure_channel/PASESession.cpp @@ -254,7 +254,7 @@ CHIP_ERROR PASESession::WaitForPairing(uint32_t mySetUpPINCode, uint32_t pbkdf2I uint16_t mySessionId, Optional mrpConfig, SessionEstablishmentDelegate * delegate) { - // Return early on error here, as we have not initalized any state yet + // Return early on error here, as we have not initialized any state yet ReturnErrorCodeIf(salt.empty(), CHIP_ERROR_INVALID_ARGUMENT); ReturnErrorCodeIf(salt.data() == nullptr, CHIP_ERROR_INVALID_ARGUMENT); @@ -316,7 +316,7 @@ CHIP_ERROR PASESession::Pair(const Transport::PeerAddress peerAddress, uint32_t SuccessOrExit(err); mExchangeCtxt = exchangeCtxt; - mExchangeCtxt->SetResponseTimeout(kSpake2p_Response_Timeout); + mExchangeCtxt->SetResponseTimeout(kSpake2p_Response_Timeout + mExchangeCtxt->GetAckTimeout()); SetPeerAddress(peerAddress); @@ -376,7 +376,7 @@ CHIP_ERROR PASESession::SendPBKDFParamRequest() tlvWriter.Init(std::move(req)); TLV::TLVType outerContainerType = TLV::kTLVType_NotSpecified; - ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); ReturnErrorOnFailure(tlvWriter.PutBytes(TLV::ContextTag(1), mPBKDFLocalRandomData, sizeof(mPBKDFLocalRandomData))); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(2), GetLocalSessionId())); ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(3), mPasscodeID)); @@ -392,11 +392,11 @@ CHIP_ERROR PASESession::SendPBKDFParamRequest() // Update commissioning hash with the pbkdf2 param request that's being sent. ReturnErrorOnFailure(mCommissioningHash.AddData(ByteSpan{ req->Start(), req->DataLength() })); - mNextExpectedMsg = MsgType::PBKDFParamResponse; - ReturnErrorOnFailure( mExchangeCtxt->SendMessage(MsgType::PBKDFParamRequest, std::move(req), SendFlags(SendMessageFlags::kExpectResponse))); + mNextExpectedMsg = MsgType::PBKDFParamResponse; + ChipLogDetail(SecureChannel, "Sent PBKDF param request"); return CHIP_NO_ERROR; @@ -420,7 +420,7 @@ CHIP_ERROR PASESession::HandlePBKDFParamRequest(System::PacketBufferHandle && ms SuccessOrExit(err = mCommissioningHash.AddData(ByteSpan{ msg->Start(), msg->DataLength() })); tlvReader.Init(std::move(msg)); - SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag)); + SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag())); SuccessOrExit(err = tlvReader.EnterContainer(containerType)); SuccessOrExit(err = tlvReader.Next()); @@ -481,7 +481,7 @@ CHIP_ERROR PASESession::SendPBKDFParamResponse(ByteSpan initiatorRandom, bool in tlvWriter.Init(std::move(resp)); TLV::TLVType outerContainerType = TLV::kTLVType_NotSpecified; - ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); // The initiator random value is being sent back in the response as required by the specifications ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(1), initiatorRandom)); ReturnErrorOnFailure(tlvWriter.PutBytes(TLV::ContextTag(2), mPBKDFLocalRandomData, sizeof(mPBKDFLocalRandomData))); @@ -512,12 +512,12 @@ CHIP_ERROR PASESession::SendPBKDFParamResponse(ByteSpan initiatorRandom, bool in size_t sizeof_point = sizeof(mPoint); ReturnErrorOnFailure(mSpake2p.ComputeL(mPoint, &sizeof_point, mPASEVerifier.mL, kSpake2p_WS_Length)); - mNextExpectedMsg = MsgType::PASE_Pake1; - ReturnErrorOnFailure( mExchangeCtxt->SendMessage(MsgType::PBKDFParamResponse, std::move(resp), SendFlags(SendMessageFlags::kExpectResponse))); ChipLogDetail(SecureChannel, "Sent PBKDF param response"); + mNextExpectedMsg = MsgType::PASE_Pake1; + return CHIP_NO_ERROR; } @@ -542,7 +542,7 @@ CHIP_ERROR PASESession::HandlePBKDFParamResponse(System::PacketBufferHandle && m SuccessOrExit(err = mCommissioningHash.AddData(ByteSpan{ msg->Start(), msg->DataLength() })); tlvReader.Init(std::move(msg)); - SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag)); + SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag())); SuccessOrExit(err = tlvReader.EnterContainer(containerType)); SuccessOrExit(err = tlvReader.Next()); @@ -621,7 +621,7 @@ CHIP_ERROR PASESession::SendMsg1() tlvWriter.Init(std::move(msg)); TLV::TLVType outerContainerType = TLV::kTLVType_NotSpecified; - ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + ReturnErrorOnFailure(tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); uint8_t X[kMAX_Point_Length]; size_t X_len = sizeof(X); @@ -636,12 +636,12 @@ CHIP_ERROR PASESession::SendMsg1() ReturnErrorOnFailure(tlvWriter.EndContainer(outerContainerType)); ReturnErrorOnFailure(tlvWriter.Finalize(&msg)); - mNextExpectedMsg = MsgType::PASE_Pake2; - ReturnErrorOnFailure( mExchangeCtxt->SendMessage(MsgType::PASE_Pake1, std::move(msg), SendFlags(SendMessageFlags::kExpectResponse))); ChipLogDetail(SecureChannel, "Sent spake2p msg1"); + mNextExpectedMsg = MsgType::PASE_Pake2; + return CHIP_NO_ERROR; } @@ -664,7 +664,7 @@ CHIP_ERROR PASESession::HandleMsg1_and_SendMsg2(System::PacketBufferHandle && ms size_t X_len = 0; tlvReader.Init(std::move(msg1)); - SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag)); + SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag())); SuccessOrExit(err = tlvReader.EnterContainer(containerType)); SuccessOrExit(err = tlvReader.Next()); @@ -691,16 +691,16 @@ CHIP_ERROR PASESession::HandleMsg1_and_SendMsg2(System::PacketBufferHandle && ms tlvWriter.Init(std::move(msg2)); TLV::TLVType outerContainerType = TLV::kTLVType_NotSpecified; - SuccessOrExit(err = tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + SuccessOrExit(err = tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); SuccessOrExit(err = tlvWriter.Put(TLV::ContextTag(kPake2_pB), ByteSpan(Y))); SuccessOrExit(err = tlvWriter.Put(TLV::ContextTag(kPake2_cB), ByteSpan(verifier, verifier_len))); SuccessOrExit(err = tlvWriter.EndContainer(outerContainerType)); SuccessOrExit(err = tlvWriter.Finalize(&msg2)); - mNextExpectedMsg = MsgType::PASE_Pake3; - err = mExchangeCtxt->SendMessage(MsgType::PASE_Pake2, std::move(msg2), SendFlags(SendMessageFlags::kExpectResponse)); SuccessOrExit(err); + + mNextExpectedMsg = MsgType::PASE_Pake3; } ChipLogDetail(SecureChannel, "Sent spake2p msg2"); @@ -737,7 +737,7 @@ CHIP_ERROR PASESession::HandleMsg2_and_SendMsg3(System::PacketBufferHandle && ms uint32_t decodeTagIdSeq = 0; tlvReader.Init(std::move(msg2)); - SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag)); + SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag())); SuccessOrExit(err = tlvReader.EnterContainer(containerType)); SuccessOrExit(err = tlvReader.Next()); @@ -767,15 +767,15 @@ CHIP_ERROR PASESession::HandleMsg2_and_SendMsg3(System::PacketBufferHandle && ms tlvWriter.Init(std::move(msg3)); TLV::TLVType outerContainerType = TLV::kTLVType_NotSpecified; - SuccessOrExit(err = tlvWriter.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType)); + SuccessOrExit(err = tlvWriter.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType)); SuccessOrExit(err = tlvWriter.Put(TLV::ContextTag(kPake3_cB), ByteSpan(verifier, verifier_len))); SuccessOrExit(err = tlvWriter.EndContainer(outerContainerType)); SuccessOrExit(err = tlvWriter.Finalize(&msg3)); - mNextExpectedMsg = MsgType::StatusReport; - err = mExchangeCtxt->SendMessage(MsgType::PASE_Pake3, std::move(msg3), SendFlags(SendMessageFlags::kExpectResponse)); SuccessOrExit(err); + + mNextExpectedMsg = MsgType::StatusReport; } ChipLogDetail(SecureChannel, "Sent spake2p msg3"); @@ -805,7 +805,7 @@ CHIP_ERROR PASESession::HandleMsg3(System::PacketBufferHandle && msg) size_t peer_verifier_len = 0; tlvReader.Init(std::move(msg)); - SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag)); + SuccessOrExit(err = tlvReader.Next(containerType, TLV::AnonymousTag())); SuccessOrExit(err = tlvReader.EnterContainer(containerType)); SuccessOrExit(err = tlvReader.Next()); @@ -884,7 +884,7 @@ CHIP_ERROR PASESession::ValidateReceivedMessage(ExchangeContext * exchange, cons else { mExchangeCtxt = exchange; - mExchangeCtxt->SetResponseTimeout(kSpake2p_Response_Timeout); + mExchangeCtxt->SetResponseTimeout(kSpake2p_Response_Timeout + mExchangeCtxt->GetAckTimeout()); } VerifyOrReturnError(!msg.IsNull(), CHIP_ERROR_INVALID_ARGUMENT); diff --git a/src/protocols/secure_channel/PASESession.h b/src/protocols/secure_channel/PASESession.h index 7cd218c1ef9035..2be0629dcc9035 100644 --- a/src/protocols/secure_channel/PASESession.h +++ b/src/protocols/secure_channel/PASESession.h @@ -165,7 +165,7 @@ class DLL_EXPORT PASESession : public Messaging::ExchangeDelegate, public Pairin * Derive a secure session from the paired session. The API will return error * if called before pairing is established. * - * @param session Referene to the secure session that will be + * @param session Reference to the secure session that will be * initialized once pairing is complete * @param role Role of the new session (initiator or responder) * @return CHIP_ERROR The result of session derivation @@ -201,8 +201,6 @@ class DLL_EXPORT PASESession : public Messaging::ExchangeDelegate, public Pairin **/ void Clear(); - SessionEstablishmentExchangeDispatch & MessageDispatch() { return mMessageDispatch; } - //// ExchangeDelegate Implementation //// /** * @brief @@ -229,11 +227,7 @@ class DLL_EXPORT PASESession : public Messaging::ExchangeDelegate, public Pairin */ void OnResponseTimeout(Messaging::ExchangeContext * ec) override; - Messaging::ExchangeMessageDispatch * GetMessageDispatch(Messaging::ReliableMessageMgr * rmMgr, - SessionManager * sessionManager) override - { - return &mMessageDispatch; - } + Messaging::ExchangeMessageDispatch & GetMessageDispatch() override { return SessionEstablishmentExchangeDispatch::Instance(); } private: enum Spake2pErrorType : uint8_t @@ -300,8 +294,6 @@ class DLL_EXPORT PASESession : public Messaging::ExchangeDelegate, public Pairin Messaging::ExchangeContext * mExchangeCtxt = nullptr; - SessionEstablishmentExchangeDispatch mMessageDispatch; - Optional mLocalMRPConfig; struct Spake2pErrorMsg diff --git a/src/protocols/secure_channel/RendezvousParameters.h b/src/protocols/secure_channel/RendezvousParameters.h index 043ad223626059..1c823d69a03855 100644 --- a/src/protocols/secure_channel/RendezvousParameters.h +++ b/src/protocols/secure_channel/RendezvousParameters.h @@ -105,31 +105,4 @@ class RendezvousParameters #endif // CONFIG_NETWORK_LAYER_BLE }; -class CommissioningParameters -{ -public: - bool HasCSRNonce() const { return mCSRNonce.HasValue(); } - bool HasAttestationNonce() const { return mAttestationNonce.HasValue(); } - const Optional GetCSRNonce() const { return mCSRNonce; } - const Optional GetAttestationNonce() const { return mAttestationNonce; } - - // The lifetime of the buffer csrNonce is pointing to, should exceed the lifetime of CommissioningParameters object. - CommissioningParameters & SetCSRNonce(ByteSpan csrNonce) - { - mCSRNonce.SetValue(csrNonce); - return *this; - } - - // The lifetime of the buffer attestationNonce is pointing to, should exceed the lifetime of CommissioningParameters object. - CommissioningParameters & SetAttestationNonce(ByteSpan attestationNonce) - { - mAttestationNonce.SetValue(attestationNonce); - return *this; - } - -private: - Optional mCSRNonce; ///< CSR Nonce passed by the commissioner - Optional mAttestationNonce; ///< Attestation Nonce passed by the commissioner -}; - } // namespace chip diff --git a/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.cpp b/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.cpp index 6fdd8fba85b24c..240c3ada9dc087 100644 --- a/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.cpp +++ b/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.cpp @@ -28,27 +28,6 @@ namespace chip { using namespace Messaging; -CHIP_ERROR SessionEstablishmentExchangeDispatch::PrepareMessage(SessionHandle session, PayloadHeader & payloadHeader, - System::PacketBufferHandle && message, - EncryptedPacketBufferHandle & preparedMessage) -{ - return mSessionManager->PrepareMessage(session, payloadHeader, std::move(message), preparedMessage); -} - -CHIP_ERROR SessionEstablishmentExchangeDispatch::SendPreparedMessage(SessionHandle session, - const EncryptedPacketBufferHandle & preparedMessage) const -{ - return mSessionManager->SendPreparedMessage(session, preparedMessage); -} - -CHIP_ERROR SessionEstablishmentExchangeDispatch::OnMessageReceived(uint32_t messageCounter, const PayloadHeader & payloadHeader, - const Transport::PeerAddress & peerAddress, - Messaging::MessageFlags msgFlags, - ReliableMessageContext * reliableMessageContext) -{ - return ExchangeMessageDispatch::OnMessageReceived(messageCounter, payloadHeader, peerAddress, msgFlags, reliableMessageContext); -} - bool SessionEstablishmentExchangeDispatch::MessagePermitted(uint16_t protocol, uint8_t type) { switch (protocol) diff --git a/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.h b/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.h index fcfc278b60de0c..60a3397033d716 100644 --- a/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.h +++ b/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.h @@ -25,39 +25,24 @@ #pragma once #include -#include namespace chip { class SessionEstablishmentExchangeDispatch : public Messaging::ExchangeMessageDispatch { public: - SessionEstablishmentExchangeDispatch() {} - - virtual ~SessionEstablishmentExchangeDispatch() {} - - CHIP_ERROR Init(SessionManager * sessionManager) + static ExchangeMessageDispatch & Instance() { - ReturnErrorCodeIf(sessionManager == nullptr, CHIP_ERROR_INVALID_ARGUMENT); - mSessionManager = sessionManager; - return ExchangeMessageDispatch::Init(); + static SessionEstablishmentExchangeDispatch instance; + return instance; } - CHIP_ERROR PrepareMessage(SessionHandle session, PayloadHeader & payloadHeader, System::PacketBufferHandle && message, - EncryptedPacketBufferHandle & out) override; - CHIP_ERROR SendPreparedMessage(SessionHandle session, const EncryptedPacketBufferHandle & preparedMessage) const override; - - CHIP_ERROR OnMessageReceived(uint32_t messageCounter, const PayloadHeader & payloadHeader, - const Transport::PeerAddress & peerAddress, Messaging::MessageFlags msgFlags, - Messaging::ReliableMessageContext * reliableMessageContext) override; + SessionEstablishmentExchangeDispatch() {} + virtual ~SessionEstablishmentExchangeDispatch() {} protected: bool MessagePermitted(uint16_t protocol, uint8_t type) override; - bool IsEncryptionRequired() const override { return false; } - -private: - SessionManager * mSessionManager = nullptr; }; } // namespace chip diff --git a/src/protocols/secure_channel/tests/TestCASESession.cpp b/src/protocols/secure_channel/tests/TestCASESession.cpp index aaaaf52b1a8a8e..a01c569b45394a 100644 --- a/src/protocols/secure_channel/tests/TestCASESession.cpp +++ b/src/protocols/secure_channel/tests/TestCASESession.cpp @@ -49,12 +49,12 @@ using namespace chip::Transport; using namespace chip::Messaging; using namespace chip::Protocols; -using TestContext = chip::Test::MessagingContext; +using TestContext = Test::LoopbackMessagingContext<>; namespace { -TransportMgrBase gTransportMgr; -Test::LoopbackTransport gLoopback; -chip::Test::IOContext gIOContext; +TestContext sContext; + +auto & gLoopback = sContext.GetLoopback(); FabricTable gCommissionerFabrics; FabricIndex gCommissionerFabricIndex; @@ -173,18 +173,22 @@ void CASE_SecurePairingStartTest(nlTestSuite * inSuite, void * inContext) FabricInfo * fabric = gCommissionerFabrics.FindFabricWithIndex(gCommissionerFabricIndex); NL_TEST_ASSERT(inSuite, fabric != nullptr); - NL_TEST_ASSERT(inSuite, pairing.MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); ExchangeContext * context = ctx.NewUnauthenticatedExchangeToBob(&pairing); NL_TEST_ASSERT(inSuite, pairing.EstablishSession(Transport::PeerAddress(Transport::Type::kBle), nullptr, Node01_01, 0, nullptr, nullptr) != CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); + NL_TEST_ASSERT(inSuite, pairing.EstablishSession(Transport::PeerAddress(Transport::Type::kBle), fabric, Node01_01, 0, nullptr, nullptr) != CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); + NL_TEST_ASSERT(inSuite, pairing.EstablishSession(Transport::PeerAddress(Transport::Type::kBle), fabric, Node01_01, 0, context, &delegate) == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 1); @@ -196,7 +200,6 @@ void CASE_SecurePairingStartTest(nlTestSuite * inSuite, void * inContext) gLoopback.mMessageSendError = CHIP_ERROR_BAD_REQUEST; CASESession pairing1; - NL_TEST_ASSERT(inSuite, pairing1.MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); gLoopback.mSentMessageCount = 0; gLoopback.mMessageSendError = CHIP_ERROR_BAD_REQUEST; @@ -205,6 +208,8 @@ void CASE_SecurePairingStartTest(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, pairing1.EstablishSession(Transport::PeerAddress(Transport::Type::kBle), fabric, Node01_01, 0, context1, &delegate) == CHIP_ERROR_BAD_REQUEST); + ctx.DrainAndServiceIO(); + gLoopback.mMessageSendError = CHIP_NO_ERROR; } @@ -220,8 +225,6 @@ void CASE_SecurePairingHandshakeTestCommon(nlTestSuite * inSuite, void * inConte CASESessionCachable serializableAccessory; gLoopback.mSentMessageCount = 0; - NL_TEST_ASSERT(inSuite, pairingCommissioner.MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, pairingAccessory.MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, ctx.GetExchangeManager().RegisterUnsolicitedMessageHandlerForType(Protocols::SecureChannel::MsgType::CASE_Sigma1, @@ -237,6 +240,7 @@ void CASE_SecurePairingHandshakeTestCommon(nlTestSuite * inSuite, void * inConte NL_TEST_ASSERT(inSuite, pairingCommissioner.EstablishSession(Transport::PeerAddress(Transport::Type::kBle), fabric, Node01_01, 0, contextCommissioner, &delegateCommissioner) == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 5); NL_TEST_ASSERT(inSuite, delegateAccessory.mNumPairingComplete == 1); @@ -357,13 +361,11 @@ void CASE_SecurePairingHandshakeServerTest(nlTestSuite * inSuite, void * inConte TestContext & ctx = *reinterpret_cast(inContext); gLoopback.mSentMessageCount = 0; - NL_TEST_ASSERT(inSuite, pairingCommissioner->MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, gPairingServer.GetSession().MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); SessionIDAllocator idAllocator; NL_TEST_ASSERT(inSuite, - gPairingServer.ListenForSessionEstablishment(&ctx.GetExchangeManager(), &gTransportMgr, nullptr, + gPairingServer.ListenForSessionEstablishment(&ctx.GetExchangeManager(), &ctx.GetTransportMgr(), nullptr, &ctx.GetSecureSessionManager(), &gDeviceFabrics, &idAllocator) == CHIP_NO_ERROR); @@ -375,17 +377,18 @@ void CASE_SecurePairingHandshakeServerTest(nlTestSuite * inSuite, void * inConte NL_TEST_ASSERT(inSuite, pairingCommissioner->EstablishSession(Transport::PeerAddress(Transport::Type::kBle), fabric, Node01_01, 0, contextCommissioner, &delegateCommissioner) == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); NL_TEST_ASSERT(inSuite, gLoopback.mSentMessageCount == 5); NL_TEST_ASSERT(inSuite, delegateCommissioner.mNumPairingComplete == 1); - auto * pairingCommissioner1 = chip::Platform::New(); - NL_TEST_ASSERT(inSuite, pairingCommissioner1->MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); + auto * pairingCommissioner1 = chip::Platform::New(); ExchangeContext * contextCommissioner1 = ctx.NewUnauthenticatedExchangeToBob(pairingCommissioner1); NL_TEST_ASSERT(inSuite, pairingCommissioner1->EstablishSession(Transport::PeerAddress(Transport::Type::kBle), fabric, Node01_01, 0, contextCommissioner1, &delegateCommissioner) == CHIP_NO_ERROR); + ctx.DrainAndServiceIO(); chip::Platform::Delete(pairingCommissioner); chip::Platform::Delete(pairingCommissioner1); @@ -424,7 +427,7 @@ static CHIP_ERROR EncodeSigma1(MutableByteSpan & buf) writer.Init(buf); TLVType containerType; - ReturnErrorOnFailure(writer.StartContainer(AnonymousTag, kTLVType_Structure, containerType)); + ReturnErrorOnFailure(writer.StartContainer(AnonymousTag(), kTLVType_Structure, containerType)); uint8_t initiatorRandom[Params::initiatorRandomLen] = { 1 }; ReturnErrorOnFailure(writer.Put(Params::NumToTag(Params::initiatorRandomTag), ByteSpan(initiatorRandom))); @@ -637,8 +640,6 @@ static nlTestSuite sSuite = }; // clang-format on -static TestContext sContext; - namespace { /* * Set up the test suite. @@ -647,12 +648,8 @@ CHIP_ERROR CASETestSecurePairingSetup(void * inContext) { TestContext & ctx = *reinterpret_cast(inContext); - ReturnErrorOnFailure(chip::Platform::MemoryInit()); - - gTransportMgr.Init(&gLoopback); - ReturnErrorOnFailure(gIOContext.Init()); - - ReturnErrorOnFailure(ctx.Init(&gTransportMgr, &gIOContext)); + ReturnErrorOnFailure(ctx.Init()); + ctx.EnableAsyncDispatch(); ctx.SetBobNodeId(kPlaceholderNodeId); ctx.SetAliceNodeId(kPlaceholderNodeId); @@ -660,8 +657,6 @@ CHIP_ERROR CASETestSecurePairingSetup(void * inContext) ctx.SetAliceKeyId(0); ctx.SetFabricIndex(kUndefinedFabricIndex); - gTransportMgr.SetSessionManager(&ctx.GetSecureSessionManager()); - gCommissionerFabrics.Init(&gCommissionerStorageDelegate); gDeviceFabrics.Init(&gDeviceStorageDelegate); @@ -682,13 +677,11 @@ int CASE_TestSecurePairing_Setup(void * inContext) */ int CASE_TestSecurePairing_Teardown(void * inContext) { - reinterpret_cast(inContext)->Shutdown(); - gIOContext.Shutdown(); gCommissionerStorageDelegate.Cleanup(); gDeviceStorageDelegate.Cleanup(); gCommissionerFabrics.Reset(); gDeviceFabrics.Reset(); - chip::Platform::MemoryShutdown(); + static_cast(inContext)->Shutdown(); return SUCCESS; } diff --git a/src/protocols/secure_channel/tests/TestCASESessionCache.cpp b/src/protocols/secure_channel/tests/TestCASESessionCache.cpp index 87def7e6243a26..1ed60e8fcfb4d1 100644 --- a/src/protocols/secure_channel/tests/TestCASESessionCache.cpp +++ b/src/protocols/secure_channel/tests/TestCASESessionCache.cpp @@ -33,13 +33,7 @@ using namespace chip; -using TestContext = chip::Test::MessagingContext; - namespace { -TransportMgrBase gTransportMgr; -Test::LoopbackTransport gLoopback; -chip::Test::IOContext gIOContext; - NodeId sTest_PeerId = 0xEDEDEDED00010001; uint8_t sTest_SharedSecret[] = { @@ -197,23 +191,13 @@ static nlTestSuite sSuite = }; // clang-format on -static TestContext sContext; - namespace { /* * Set up the test suite. */ CHIP_ERROR CASETestCacheSetup(void * inContext) { - TestContext & ctx = *reinterpret_cast(inContext); - ReturnErrorOnFailure(chip::Platform::MemoryInit()); - - gTransportMgr.Init(&gLoopback); - ReturnErrorOnFailure(gIOContext.Init()); - - ReturnErrorOnFailure(ctx.Init(&gTransportMgr, &gIOContext)); - return CHIP_NO_ERROR; } } // anonymous namespace @@ -231,8 +215,6 @@ int CASESessionCache_Test_Setup(void * inContext) */ int CASESessionCache_Test_Teardown(void * inContext) { - reinterpret_cast(inContext)->Shutdown(); - gIOContext.Shutdown(); chip::Platform::MemoryShutdown(); return SUCCESS; } @@ -243,7 +225,7 @@ int CASESessionCache_Test_Teardown(void * inContext) int TestCASESessionCache() { // Run test suit against one context - nlTestRunner(&sSuite, &sContext); + nlTestRunner(&sSuite, nullptr); return (nlTestRunnerStats(&sSuite)); } diff --git a/src/protocols/secure_channel/tests/TestPASESession.cpp b/src/protocols/secure_channel/tests/TestPASESession.cpp index 553fa514340d3e..3f50a98f2b5a95 100644 --- a/src/protocols/secure_channel/tests/TestPASESession.cpp +++ b/src/protocols/secure_channel/tests/TestPASESession.cpp @@ -126,7 +126,6 @@ void SecurePairingStartTest(nlTestSuite * inSuite, void * inContext) gLoopback.Reset(); - NL_TEST_ASSERT(inSuite, pairing.MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); ExchangeContext * context = ctx.NewUnauthenticatedExchangeToBob(&pairing); NL_TEST_ASSERT(inSuite, @@ -151,7 +150,6 @@ void SecurePairingStartTest(nlTestSuite * inSuite, void * inContext) gLoopback.mMessageSendError = CHIP_ERROR_BAD_REQUEST; PASESession pairing1; - NL_TEST_ASSERT(inSuite, pairing1.MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); ExchangeContext * context1 = ctx.NewUnauthenticatedExchangeToBob(&pairing1); NL_TEST_ASSERT(inSuite, pairing1.Pair(Transport::PeerAddress(Transport::Type::kBle), 1234, 0, @@ -174,9 +172,6 @@ void SecurePairingHandshakeTestCommon(nlTestSuite * inSuite, void * inContext, P gLoopback.mSentMessageCount = 0; - NL_TEST_ASSERT(inSuite, pairingCommissioner.MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, pairingAccessory.MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); - ExchangeContext * contextCommissioner = ctx.NewUnauthenticatedExchangeToBob(&pairingCommissioner); if (gLoopback.mNumMessagesToDrop != 0) @@ -307,9 +302,6 @@ void SecurePairingFailedHandshake(nlTestSuite * inSuite, void * inContext) gLoopback.Reset(); gLoopback.mSentMessageCount = 0; - NL_TEST_ASSERT(inSuite, pairingCommissioner.MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, pairingAccessory.MessageDispatch().Init(&ctx.GetSecureSessionManager()) == CHIP_NO_ERROR); - ExchangeContext * contextCommissioner = ctx.NewUnauthenticatedExchangeToBob(&pairingCommissioner); ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr(); diff --git a/src/protocols/user_directed_commissioning/UDCClientState.h b/src/protocols/user_directed_commissioning/UDCClientState.h index 1b8534711417dc..3e15df04017bb8 100644 --- a/src/protocols/user_directed_commissioning/UDCClientState.h +++ b/src/protocols/user_directed_commissioning/UDCClientState.h @@ -108,7 +108,7 @@ class UDCClientState private: PeerAddress mPeerAddress; - char mInstanceName[Dnssd::Commissionable::kInstanceNameMaxLength + 1]; + char mInstanceName[Dnssd::Commission::kInstanceNameMaxLength + 1]; char mDeviceName[Dnssd::kMaxDeviceNameLen + 1]; uint16_t mLongDiscriminator = 0; uint16_t mVendorId; diff --git a/src/protocols/user_directed_commissioning/UDCClients.h b/src/protocols/user_directed_commissioning/UDCClients.h index be7ef25b3962a1..47833bce421274 100644 --- a/src/protocols/user_directed_commissioning/UDCClients.h +++ b/src/protocols/user_directed_commissioning/UDCClients.h @@ -159,7 +159,7 @@ class UDCClients } // TODO: check length of instanceName - if (strncmp(stateiter.GetInstanceName(), instanceName, Dnssd::Commissionable::kInstanceNameMaxLength + 1) == 0) + if (strncmp(stateiter.GetInstanceName(), instanceName, Dnssd::Commission::kInstanceNameMaxLength + 1) == 0) { state = &stateiter; break; diff --git a/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h b/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h index c4a9874742ccae..0735248352e8da 100644 --- a/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h +++ b/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h @@ -18,7 +18,7 @@ /** * @file - * This file defines objects for a User-Directed Commissioning unsolicitied + * This file defines objects for a User-Directed Commissioning unsolicited * initiator (client) and recipient (server). * */ diff --git a/src/protocols/user_directed_commissioning/UserDirectedCommissioningClient.cpp b/src/protocols/user_directed_commissioning/UserDirectedCommissioningClient.cpp index 775de9c001e9b2..06e1ca1f20e683 100644 --- a/src/protocols/user_directed_commissioning/UserDirectedCommissioningClient.cpp +++ b/src/protocols/user_directed_commissioning/UserDirectedCommissioningClient.cpp @@ -18,7 +18,7 @@ /** * @file - * This file implements an object for a Matter User Directed Commissioning unsolicitied + * This file implements an object for a Matter User Directed Commissioning unsolicited * initiator (client). * */ diff --git a/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp b/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp index ccd07027f56aa2..fc73925bf75c6c 100644 --- a/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp +++ b/src/protocols/user_directed_commissioning/UserDirectedCommissioningServer.cpp @@ -18,7 +18,7 @@ /** * @file - * This file implements an object for a Matter User Directed Commissioning unsolicitied + * This file implements an object for a Matter User Directed Commissioning unsolicited * recipient (server). * */ @@ -47,8 +47,8 @@ void UserDirectedCommissioningServer::OnMessageReceived(const Transport::PeerAdd PayloadHeader payloadHeader; ReturnOnFailure(payloadHeader.DecodeAndConsume(msg)); - char instanceName[Dnssd::Commissionable::kInstanceNameMaxLength + 1]; - size_t instanceNameLength = std::min(msg->DataLength(), Dnssd::Commissionable::kInstanceNameMaxLength); + char instanceName[Dnssd::Commission::kInstanceNameMaxLength + 1]; + size_t instanceNameLength = std::min(msg->DataLength(), Dnssd::Commission::kInstanceNameMaxLength); msg->Read(Uint8::from_char(instanceName), instanceNameLength); instanceName[instanceNameLength] = '\0'; diff --git a/src/protocols/user_directed_commissioning/tests/TestUdcMessages.cpp b/src/protocols/user_directed_commissioning/tests/TestUdcMessages.cpp index d9a270cefa7c80..e6a1b91b4d9412 100644 --- a/src/protocols/user_directed_commissioning/tests/TestUdcMessages.cpp +++ b/src/protocols/user_directed_commissioning/tests/TestUdcMessages.cpp @@ -140,7 +140,7 @@ void TestUDCServerInstanceNameResolver(nlTestSuite * inSuite, void * inContext) udcServer.SetUDCClientProcessingState((char *) instanceName1, UDCClientProcessingState::kUserDeclined); // encode our client message - char nameBuffer[Dnssd::Commissionable::kInstanceNameMaxLength + 1] = "Chris"; + char nameBuffer[Dnssd::Commission::kInstanceNameMaxLength + 1] = "Chris"; System::PacketBufferHandle payloadBuf = MessagePacketBuffer::NewWithData(nameBuffer, strlen(nameBuffer)); udcClient.EncodeUDCMessage(std::move(payloadBuf)); @@ -189,7 +189,7 @@ void TestUDCServerInstanceNameResolver(nlTestSuite * inSuite, void * inContext) void TestUserDirectedCommissioningClientMessage(nlTestSuite * inSuite, void * inContext) { - char nameBuffer[Dnssd::Commissionable::kInstanceNameMaxLength + 1] = "Chris"; + char nameBuffer[Dnssd::Commission::kInstanceNameMaxLength + 1] = "Chris"; System::PacketBufferHandle payloadBuf = MessagePacketBuffer::NewWithData(nameBuffer, strlen(nameBuffer)); UserDirectedCommissioningClient udcClient; @@ -210,8 +210,8 @@ void TestUserDirectedCommissioningClientMessage(nlTestSuite * inSuite, void * in NL_TEST_ASSERT(inSuite, payloadHeader.IsInitiator()); // check the payload - char instanceName[Dnssd::Commissionable::kInstanceNameMaxLength + 1]; - size_t instanceNameLength = std::min(payloadBuf->DataLength(), Dnssd::Commissionable::kInstanceNameMaxLength); + char instanceName[Dnssd::Commission::kInstanceNameMaxLength + 1]; + size_t instanceNameLength = std::min(payloadBuf->DataLength(), Dnssd::Commission::kInstanceNameMaxLength); payloadBuf->Read(Uint8::from_char(instanceName), instanceNameLength); instanceName[instanceNameLength] = '\0'; ChipLogProgress(Inet, "UDC instance=%s", instanceName); diff --git a/src/setup_payload/AdditionalDataPayloadGenerator.cpp b/src/setup_payload/AdditionalDataPayloadGenerator.cpp index a864d53f030fab..7580263aa75aa6 100644 --- a/src/setup_payload/AdditionalDataPayloadGenerator.cpp +++ b/src/setup_payload/AdditionalDataPayloadGenerator.cpp @@ -55,7 +55,7 @@ AdditionalDataPayloadGenerator::generateAdditionalDataPayload(uint16_t lifetimeC // Initialize TLVWriter writer.Init(chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSize)); - ReturnErrorOnFailure(writer.OpenContainer(AnonymousTag, kTLVType_Structure, innerWriter)); + ReturnErrorOnFailure(writer.OpenContainer(AnonymousTag(), kTLVType_Structure, innerWriter)); if (additionalDataFields.Has(AdditionalDataFields::RotatingDeviceId)) { diff --git a/src/setup_payload/AdditionalDataPayloadParser.cpp b/src/setup_payload/AdditionalDataPayloadParser.cpp index f555fd45b6c3ba..09447114058277 100644 --- a/src/setup_payload/AdditionalDataPayloadParser.cpp +++ b/src/setup_payload/AdditionalDataPayloadParser.cpp @@ -43,7 +43,7 @@ CHIP_ERROR AdditionalDataPayloadParser::populatePayload(SetupPayloadData::Additi TLV::ContiguousBufferTLVReader innerReader; reader.Init(mPayloadBufferData, mPayloadBufferLength); - ReturnErrorOnFailure(reader.Next(TLV::kTLVType_Structure, TLV::AnonymousTag)); + ReturnErrorOnFailure(reader.Next(TLV::kTLVType_Structure, TLV::AnonymousTag())); // Open the container ReturnErrorOnFailure(reader.OpenContainer(innerReader)); diff --git a/src/setup_payload/QRCodeSetupPayloadGenerator.cpp b/src/setup_payload/QRCodeSetupPayloadGenerator.cpp index a81fabc6fad85b..86c8d44d605166 100644 --- a/src/setup_payload/QRCodeSetupPayloadGenerator.cpp +++ b/src/setup_payload/QRCodeSetupPayloadGenerator.cpp @@ -130,7 +130,7 @@ CHIP_ERROR QRCodeSetupPayloadGenerator::generateTLVFromOptionalData(SetupPayload TLV::TLVWriter innerStructureWriter; - ReturnErrorOnFailure(rootWriter.OpenContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, innerStructureWriter)); + ReturnErrorOnFailure(rootWriter.OpenContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, innerStructureWriter)); for (OptionalQRCodeInfo info : optionalData) { diff --git a/src/setup_payload/QRCodeSetupPayloadParser.cpp b/src/setup_payload/QRCodeSetupPayloadParser.cpp index 71075cb58ca813..c081c13f6d90e3 100644 --- a/src/setup_payload/QRCodeSetupPayloadParser.cpp +++ b/src/setup_payload/QRCodeSetupPayloadParser.cpp @@ -194,8 +194,9 @@ CHIP_ERROR QRCodeSetupPayloadParser::retrieveOptionalInfos(SetupPayload & outPay continue; } - const uint8_t tag = static_cast(TLV::TagNumFromTag(reader.GetTag())); - VerifyOrReturnError(TLV::IsContextTag(tag) == true || TLV::IsProfileTag(tag) == true, CHIP_ERROR_INVALID_TLV_TAG); + TLV::Tag tag = reader.GetTag(); + VerifyOrReturnError(TLV::IsContextTag(tag), CHIP_ERROR_INVALID_TLV_TAG); + const uint8_t tagNumber = static_cast(TLV::TagNumFromTag(tag)); optionalQRCodeInfoType elemType = optionalQRCodeInfoTypeUnknown; if (type == TLV::kTLVType_UTF8String) @@ -204,13 +205,13 @@ CHIP_ERROR QRCodeSetupPayloadParser::retrieveOptionalInfos(SetupPayload & outPay } if (type == TLV::kTLVType_SignedInteger || type == TLV::kTLVType_UnsignedInteger) { - elemType = outPayload.getNumericTypeFor(tag); + elemType = outPayload.getNumericTypeFor(tagNumber); } - if (IsCHIPTag(tag)) + if (IsCHIPTag(tagNumber)) { OptionalQRCodeInfoExtension info; - info.tag = tag; + info.tag = tagNumber; ReturnErrorOnFailure(retrieveOptionalInfo(reader, info, elemType)); ReturnErrorOnFailure(outPayload.addOptionalExtensionData(info)); @@ -218,7 +219,7 @@ CHIP_ERROR QRCodeSetupPayloadParser::retrieveOptionalInfos(SetupPayload & outPay else { OptionalQRCodeInfo info; - info.tag = tag; + info.tag = tagNumber; ReturnErrorOnFailure(retrieveOptionalInfo(reader, info, elemType)); ReturnErrorOnFailure(outPayload.addOptionalVendorData(info)); @@ -250,7 +251,7 @@ CHIP_ERROR QRCodeSetupPayloadParser::parseTLVFields(SetupPayload & outPayload, u } TLV::ContiguousBufferTLVReader innerStructureReader; - ReturnErrorOnFailure(openTLVContainer(rootReader, TLV::kTLVType_Structure, TLV::AnonymousTag, innerStructureReader)); + ReturnErrorOnFailure(openTLVContainer(rootReader, TLV::kTLVType_Structure, TLV::AnonymousTag(), innerStructureReader)); ReturnErrorOnFailure(innerStructureReader.Next()); err = retrieveOptionalInfos(outPayload, innerStructureReader); diff --git a/src/system/SystemConfig.h b/src/system/SystemConfig.h index 7e8450af33a95f..fc5ccaca924e53 100644 --- a/src/system/SystemConfig.h +++ b/src/system/SystemConfig.h @@ -300,7 +300,7 @@ * 1 -- Message Type * 2 -- Exchange Id * 4 -- Profile Id - * 4 -- Acknowleged Message Id + * 4 -- Acknowledged Message Id * * @note A number of these fields are optional or not presently used. So most headers will be considerably smaller than this. */ @@ -331,8 +331,8 @@ * Only socket platforms can override the default value. On LwIP-based platforms, the size is derived from the PBUF size * and overriding the value will result in a compile-time error. * - * This value should be set large enough to accomodate the usage of PacketBuffer in the system. In particular, for the use - * in CHIP, the value should be set to accomodate the desired path MTU (i.e. the largest IP packet that can be sent over + * This value should be set large enough to accommodate the usage of PacketBuffer in the system. In particular, for the use + * in CHIP, the value should be set to accommodate the desired path MTU (i.e. the largest IP packet that can be sent over * the network interface) plus any protocol overhead. * * For example, sending an IP packet over the tunnel requires additional overheads that depend on platform's network diff --git a/src/system/SystemPacketBuffer.h b/src/system/SystemPacketBuffer.h index 77a5bd3e727218..031a397c422bba 100644 --- a/src/system/SystemPacketBuffer.h +++ b/src/system/SystemPacketBuffer.h @@ -124,7 +124,7 @@ struct pbuf * environment, e.g. from LwIP pbuf target pools, from the standard C library heap, from an internal buffer pool. In the * simple pool case, the size of the data buffer is PacketBuffer::kBlockSize. * - * PacketBuffer objects may be chained to accomodate larger payloads. Chaining, however, is not transparent, and users of the + * PacketBuffer objects may be chained to accommodate larger payloads. Chaining, however, is not transparent, and users of the * class must explicitly decide to support chaining. Examples of classes written with chaining support are as follows: * * @ref chip::chipTLVReader @@ -615,7 +615,7 @@ class DLL_EXPORT PacketBufferHandle * @brief The PacketBufferHandle's ownership is transferred to the caller. * * @note This should only be used in low-level code. The caller owns one counted reference to the \c PacketBuffer - * and is reponsible for managing it safely. + * and is responsible for managing it safely. * * @note The ref-qualifier `&&` requires the caller to use `std::move` to emphasize that ownership is * moved out of this handle. @@ -778,7 +778,7 @@ class PacketBufferWriterBase : public Writer { public: /** - * Constructs a BufferWriter that writes into a packet buffer, using all avaiable space. + * Constructs a BufferWriter that writes into a packet buffer, using all available space. * * @param[in] aPacket A handle to PacketBuffer, to be used as backing store for the BufferWriter. */ diff --git a/src/system/SystemStats.cpp b/src/system/SystemStats.cpp index 57f6a4ee475f9e..bf3473fd62c924 100644 --- a/src/system/SystemStats.cpp +++ b/src/system/SystemStats.cpp @@ -107,13 +107,6 @@ bool Difference(Snapshot & result, Snapshot & after, Snapshot & before) #if CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_STATS && MEMP_STATS -// To use LwIP 1.x, some additional definitions are required here. -#if LWIP_VERSION_MAJOR < 2 -#ifndef MEMP_STATS_GET -#define MEMP_STATS_GET(FIELD, INDEX) (lwip_stats.memp[INDEX].FIELD) -#endif // !defined(MEMP_STATS_GET) -#endif // LWIP_VERSION_MAJOR - void UpdateLwipPbufCounts(void) { #if LWIP_PBUF_FROM_CUSTOM_POOLS diff --git a/src/system/tests/TestSystemPacketBuffer.cpp b/src/system/tests/TestSystemPacketBuffer.cpp index 15a9a5e3a6a34f..ed348448b63111 100644 --- a/src/system/tests/TestSystemPacketBuffer.cpp +++ b/src/system/tests/TestSystemPacketBuffer.cpp @@ -48,11 +48,11 @@ #include #if CHIP_SYSTEM_CONFIG_USE_LWIP -#if (LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1) -#define PBUF_TYPE(pbuf) (pbuf)->type_internal -#else +#if (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) #define PBUF_TYPE(pbuf) (pbuf)->type -#endif // (LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1) +#else // (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) +#define PBUF_TYPE(pbuf) (pbuf)->type_internal +#endif // (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) #endif // CHIP_SYSTEM_CONFIG_USE_LWIP using ::chip::Encoding::PacketBufferWriter; @@ -531,7 +531,7 @@ void PacketBufferTest::CheckDataLength(nlTestSuite * inSuite, void * inContext) * without specifying the head of the buffer chain. Otherwise, * test SetDataLength with one buffer being down the chain and the * other one being passed as the head of the chain. After calling - * the method verify that data lenghts were correctly adjusted. + * the method verify that data lengths were correctly adjusted. */ void PacketBufferTest::CheckSetDataLength(nlTestSuite * inSuite, void * inContext) { diff --git a/src/system/tests/TestSystemTimer.cpp b/src/system/tests/TestSystemTimer.cpp index 5ee0f9a2cd1534..59199db494605b 100644 --- a/src/system/tests/TestSystemTimer.cpp +++ b/src/system/tests/TestSystemTimer.cpp @@ -442,12 +442,17 @@ static int TestSetup(void * aContext) { TestContext & lContext = *reinterpret_cast(aContext); -#if CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_VERSION_MAJOR <= 2 && LWIP_VERSION_MINOR < 1 + if (::chip::Platform::MemoryInit() != CHIP_NO_ERROR) + { + return FAILURE; + } + +#if CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_VERSION_MAJOR == 2 && LWIP_VERSION_MINOR == 0 static sys_mbox_t * sLwIPEventQueue = NULL; sys_mbox_new(sLwIPEventQueue, 100); tcpip_init(NULL, NULL); -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_VERSION_MAJOR <= 2 && LWIP_VERSION_MINOR < 1 +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_VERSION_MAJOR == 2 && LWIP_VERSION_MINOR == 0 sLayer.Init(); @@ -467,12 +472,11 @@ static int TestTeardown(void * aContext) lContext.mLayer->Shutdown(); -#if CHIP_SYSTEM_CONFIG_USE_LWIP -#if !(LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1) +#if CHIP_SYSTEM_CONFIG_USE_LWIP && (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) tcpip_finish(NULL, NULL); -#endif -#endif +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP && (LWIP_VERSION_MAJOR == 2) && (LWIP_VERSION_MINOR == 0) + ::chip::Platform::MemoryShutdown(); return (SUCCESS); } diff --git a/src/system/tests/qemu_system_tests.sh b/src/system/tests/qemu_system_tests.sh deleted file mode 120000 index 8fbe617c97a267..00000000000000 --- a/src/system/tests/qemu_system_tests.sh +++ /dev/null @@ -1 +0,0 @@ -../../../scripts/tools/qemu_run_test.sh \ No newline at end of file diff --git a/src/test_driver/esp32/.gitignore b/src/test_driver/esp32/.gitignore index 84c048a73cc2e5..a90ab6f1e57d5a 100644 --- a/src/test_driver/esp32/.gitignore +++ b/src/test_driver/esp32/.gitignore @@ -1 +1,3 @@ /build/ +/sdkconfig +/sdkconfig.old diff --git a/src/test_driver/esp32/CMakeLists.txt b/src/test_driver/esp32/CMakeLists.txt new file mode 100644 index 00000000000000..c14242b906908b --- /dev/null +++ b/src/test_driver/esp32/CMakeLists.txt @@ -0,0 +1,57 @@ +# +# Copyright (c) 2021 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/esp32_unit_tests.cmake) + +set(EXTRA_COMPONENT_DIRS + "${CMAKE_CURRENT_LIST_DIR}/third_party/connectedhomeip/config/esp32/components" +) + +project(test-driver) + +# C++17 is required for RPC build. +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) + +# TODO: libAppTests depends on MessagingTestHelpers, which depends on +# NetworkTestHelpers. That sort of depends on InetTestHelpers or +# equivalent (to provide gSystemLayer, gInet, InitNetwork(), +# ShutdownNetwork()) but there's only a POSIX implementation of that +# last, which does not compile on ESP32. Need to figure out how to +# make that work. See comments below for the transport layer tests, +# which have the same issue. +# +# libAppTests.a -lMessagingTestHelpers -lNetworkTestHelpers +# +# TODO: ble tests do not compile using CMake (library is not auto-built) +# libBleLayerTests.a + +esp32_unit_test(NAME testASN1 LIBRARY ASN1Tests) +esp32_unit_test(NAME testChipCrypto LIBRARY ChipCryptoTests EXTRA_LIBRARIES -lChipCertTestVectors) +esp32_unit_test(NAME testCore LIBRARY CoreTests) +esp32_unit_test(NAME testInetLayer LIBRARY InetLayerTests) +esp32_unit_test(NAME testRetransmit LIBRARY RetransmitTests) +esp32_unit_test(NAME testSystemLayer LIBRARY SystemLayerTests) + + +# allow other tools to discover what images are available without grepping for '.img' +string (REPLACE ";" "\n" BUILT_IMAGES "${ESP32_TEST_IMAGES}") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_images.txt" "${BUILT_IMAGES}") diff --git a/src/test_driver/esp32/Makefile b/src/test_driver/esp32/Makefile deleted file mode 100644 index f9f19c729c574f..00000000000000 --- a/src/test_driver/esp32/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# -# This is a project Makefile. It is assumed the directory this Makefile resides in is a -# project subdirectory. -# - -PROJECT_NAME := chip-tests - -CXXFLAGS += -DCHIP_SUPPORT_FOREIGN_TEST_DRIVERS -DCHIP_TARGET_STYLE_EMBEDDED -Wno-deprecated-declarations - -CXXFLAGS += -DLWIP_IPV6_SCOPES=0 -std=gnu++14 -CPPFLAGS += -DLWIP_IPV6_SCOPES=0 -DCHIP_HAVE_CONFIG_H -CFLAGS += -DLWIP_IPV6_SCOPES=0 -std=gnu11 - -EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/third_party/connectedhomeip/config/esp32/components - -include $(IDF_PATH)/make/project.mk - -esp32_elf_builder: all - mkdir -p build/chip/ - echo "#!/bin/sh" > build/chip/esp32_elf_builder.sh - echo set -e >> build/chip/esp32_elf_builder.sh - echo set -x >> build/chip/esp32_elf_builder.sh - echo $(CXX) $(CXXFLAGS) $(CPPFLAGS) -L$(PROJECT_PATH)/build/chip/lib -Wl,--whole-archive '$$1' -Wl,--no-whole-archive \ - -lnlunit-test $(LDFLAGS) -lnlfaultinjection '$$2' -o $(PROJECT_PATH)/build/chip-tests.elf -Wl,-Map=$(APP_MAP) >> build/chip/esp32_elf_builder.sh - echo $(ESPTOOLPY) elf2image $(ESPTOOL_FLASH_OPTIONS) $(ESPTOOL_ELF2IMAGE_OPTIONS) \ - -o $(PROJECT_PATH)/build/chip/chip-tests.bin $(PROJECT_PATH)/build/chip-tests.elf >> build/chip/esp32_elf_builder.sh - ln -sf $(PROJECT_PATH)/build/partitions.bin $(PROJECT_PATH)/build/chip/partitions.bin - mkdir -p build/chip/bootloader - ln -sf $(PROJECT_PATH)/build/bootloader/bootloader.bin $(PROJECT_PATH)/build/chip/bootloader.bin - ln -sf $(PROJECT_PATH)/idf.sh $(PROJECT_PATH)/build/chip/env.sh diff --git a/src/test_driver/esp32/cmake/esp32_unit_tests.cmake b/src/test_driver/esp32/cmake/esp32_unit_tests.cmake new file mode 100644 index 00000000000000..62abc5fba42934 --- /dev/null +++ b/src/test_driver/esp32/cmake/esp32_unit_tests.cmake @@ -0,0 +1,100 @@ + +# Defines a stand-alone elf unit test that can be executed in QEMU +# +# Parameters: +# NAME - the elf file name +# LIBRARY - the library that contains the registered unit tests. +# for libASN1Tests.a use ASN1Tests as name. +# EXTRA_LIBRAIRES - what else to add to link libraries, generally dependencies +# of $LIBRARY +# +# The list ESP32_TEST_IMAGES keeps track of all output images that could +# be used for testing +# +# TODO: several paths are hard-coded here and could use some updates: +# - always links to idf::main +# - assumes esp-idf/chip/lib is where the built libraries reside +# - assumes a "dummy.c" source exists to be able to "add_executable" +macro(esp32_unit_test) + cmake_parse_arguments( + UNIT_TEST + "" # options + "NAME;LIBRARY" # one value arguments + "EXTRA_LIBRARIES" # multi value arguments + ${ARGN} + ) + + ######################## Elf binary ####################### + + add_executable(${UNIT_TEST_NAME} dummy.c) + + target_link_directories(${UNIT_TEST_NAME} PUBLIC + ${CMAKE_CURRENT_BINARY_DIR}/esp-idf/chip/lib + ) + + target_link_libraries(${UNIT_TEST_NAME} PUBLIC + idf::main + -Wl,--whole-archive ${UNIT_TEST_LIBRARY} -Wl,--no-whole-archive + ${UNIT_TEST_EXTRA_LIBRARIES} + nlunit-test + nlfaultinjection + ) + + add_dependencies(${UNIT_TEST_NAME} idf::main) + add_dependencies(${UNIT_TEST_NAME} idf::chip) + # TODO: + # - this does NOT properly handle dependencies on UNIT_TEST_LIBRARY and such, + # so changes in the tests themselves will not re-gen + + idf_build_executable(${UNIT_TEST_NAME}) + + ######################## flashable image ####################### + + # This is very hacky: ESP build system will generate this, but only for the FIRST + # executable that is used + + add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME}.bin_timestamp" + COMMAND ${ESPTOOLPY} elf2image ${ESPTOOLPY_FLASH_OPTIONS} ${esptool_elf2image_args} + -o "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME}.bin" "${UNIT_TEST_NAME}" + COMMAND ${CMAKE_COMMAND} -E echo "Generated ${UNIT_TEST_NAME}.bin" + COMMAND ${CMAKE_COMMAND} -E md5sum "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME}" > "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME}.bin_timestamp" + DEPENDS ${UNIT_TEST_NAME} + VERBATIM + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating binary image from ${UNIT_TEST_NAME}" + ) + add_custom_target(gen_binary_${UNIT_TEST_NAME} ALL DEPENDS "${build_dir}/${UNIT_TEST_NAME}.bin_timestamp") + + + ###################### Image executable in QEMU ################# + + + # A runnable image is a 4MB file with: + # bootloader at 0x1000 + # partition table at 0x8000 + # image at 0x10000 + add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME}.img_timestamp" + + COMMAND dd if=/dev/zero bs=1024 count=4096 of=${UNIT_TEST_NAME}.img + COMMAND dd if=${CMAKE_CURRENT_BINARY_DIR}/bootloader/bootloader.bin bs=1 seek=4096 of=${UNIT_TEST_NAME}.img conv=notrunc + COMMAND dd if=${CMAKE_CURRENT_BINARY_DIR}/partition_table/partition-table.bin bs=1 seek=32768 of=${UNIT_TEST_NAME}.img conv=notrunc + COMMAND dd if=${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME}.bin bs=1 seek=65536 of=${UNIT_TEST_NAME}.img conv=notrunc + + COMMAND ${CMAKE_COMMAND} -E echo "Generated ${UNIT_TEST_NAME}.img" + COMMAND ${CMAKE_COMMAND} -E md5sum "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME}.img" > "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_TEST_NAME}.img_timestamp" + + DEPENDS gen_binary_${UNIT_TEST_NAME} + VERBATIM + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating binary image from ${UNIT_TEST_NAME}" + ) + add_custom_target(gen_image_${UNIT_TEST_NAME} ALL DEPENDS "${build_dir}/${UNIT_TEST_NAME}.img_timestamp") + + LIST(APPEND ESP32_TEST_IMAGES ${UNIT_TEST_NAME}.img) + + + # IMAGE CAN BE RUN AS + # $QEMU_ESP32 -nographic -no-reboot -machine esp32 -drive file=out/esp32-qemu-tests/testASN1.img,if=mtd,format=raw +endmacro() diff --git a/src/test_driver/esp32/dummy.c b/src/test_driver/esp32/dummy.c new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/src/test_driver/esp32/main/CMakeLists.txt b/src/test_driver/esp32/main/CMakeLists.txt new file mode 100644 index 00000000000000..ded51eb78bee8c --- /dev/null +++ b/src/test_driver/esp32/main/CMakeLists.txt @@ -0,0 +1,42 @@ +# +# Copyright (c) 2021 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# (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-app/esp32/main/component.mk +set(PRIV_INCLUDE_DIRS_LIST + "${CMAKE_CURRENT_LIST_DIR}/include" +) + +set(SRC_DIRS_LIST + "${CMAKE_CURRENT_LIST_DIR}" +) + +set(EXTRA_COMPONENT_DIRS + "${CMAKE_CURRENT_LIST_DIR}/../third_party/connectedhomeip/config/esp32/components" + "${IDF_PATH}/examples/common_components" +) + +if (CONFIG_OPENTHREAD_ENABLED) + list(APPEND PRIV_REQUIRES_LIST openthread) +endif() + +idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} + SRC_DIRS ${SRC_DIRS_LIST} + PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) + +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) +target_compile_options(${COMPONENT_LIB} PRIVATE "-DLWIP_IPV6_SCOPES=0" "-DCHIP_HAVE_CONFIG_H") diff --git a/src/test_driver/esp32/main/component.mk b/src/test_driver/esp32/main/component.mk deleted file mode 100644 index e00ee9dea96ffc..00000000000000 --- a/src/test_driver/esp32/main/component.mk +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (c) 2020 Project CHIP Authors -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Description: -# Component makefile for the ESP32 demo application. -# -# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) - -COMPONENT_DEPENDS := chip diff --git a/src/test_driver/esp32/qemu_setup.sh b/src/test_driver/esp32/qemu_setup.sh deleted file mode 100755 index fac58a636271d7..00000000000000 --- a/src/test_driver/esp32/qemu_setup.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash -# -# -# 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. -# -# -# Description: -# This is a utility script that compiles ESP32 QEMU and sets it up -# for testing. -# - -here=$(cd "$(dirname "$0")" && pwd) - -set -e - -die() { - echo "${me:?}: *** ERROR: " "${*}" - exit 1 -} - -# move to the example folder, I don't work anywhere else -cd "$here" || die 'ack!, where am I?!?' - -# shellcheck source=/dev/null -source idf.sh -rm -f ./build/sdkconfig -SDKCONFIG=./build/sdkconfig SDKCONFIG_DEFAULTS=sdkconfig_qemu.defaults idf make defconfig -SDKCONFIG=./build/sdkconfig idf make -j8 esp32_elf_builder diff --git a/src/test_driver/esp32/run_qemu_image.py b/src/test_driver/esp32/run_qemu_image.py new file mode 100755 index 00000000000000..d871083a0c1c77 --- /dev/null +++ b/src/test_driver/esp32/run_qemu_image.py @@ -0,0 +1,133 @@ +#!/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 coloredlogs +import click +import logging +import os +import sys +import subprocess + +# Supported log levels, mapping string values required for argument +# parsing into logging constants +__LOG_LEVELS__ = { + 'debug': logging.DEBUG, + 'info': logging.INFO, + 'warn': logging.WARN, + 'fatal': logging.FATAL, +} + + +@click.command() +@click.option( + '--log-level', + default='INFO', + type=click.Choice(__LOG_LEVELS__.keys(), case_sensitive=False), + help='Determines the verbosity of script output.') +@click.option( + '--no-log-timestamps', + default=False, + is_flag=True, + help='Skip timestaps in log output') +@click.option( + '--image', + default=[], + multiple=True, + help='What images to execute (will be executed one after another)' +) +@click.option( + '--file-image-list', + default=None, + help='Read the images from the given file (contains images one per line)' +) +@click.option( + '--qemu', + default=os.environ.get('QEMU_ESP32', 'qemu-system-xtensa'), + help='QEMU binary to run (generally path to qemu-system-xtensa)' +) +@click.option( + '--verbose', + default=False, + is_flag=True, + help='More verbose output') +def main(log_level, no_log_timestamps, image, file_image_list, qemu, verbose): + # Ensures somewhat pretty logging of what is going on + log_fmt = '%(asctime)s %(levelname)-7s %(message)s' + if no_log_timestamps: + log_fmt = '%(levelname)-7s %(message)s' + coloredlogs.install(level=__LOG_LEVELS__[log_level], fmt=log_fmt) + + image = list(image) + + if file_image_list: + logging.info("Reading image list from %s", file_image_list) + + basedir = os.path.dirname(file_image_list) + + with open(file_image_list, 'rt') as f: + for name in f.readlines(): + name = name.strip() + + image_path = name + if not os.path.isabs(name): + image_path = os.path.join(basedir, name) + + logging.info(" Found %s => %s", name, image_path) + image.append(image_path) + + # the list "image" contains all the images that need to run + for path in image: + logging.info("Executing image %s", path) + + status = subprocess.run([qemu, "-nographic", "-no-reboot", "-machine", "esp32", + "-drive", "file=%s,if=mtd,format=raw" % path], capture_output=True) + + # Encoding is NOT valid, but want to not try to decode potential + # invalid UTF-8 sequences. The strings we care about are ascii anyway + output = status.stdout.decode('ascii') + + try: + if status.returncode != 0: + raise Exception("Execution of %s failed with code %d" % + (path, status.returncode)) + + # Parse output of the unit test. Generally expect things like: + # Failed Tests: 0 / 5 + # Failed Asserts: 0 / 77 + # I (3034) CHIP-tests: CHIP test status: 0 + for line in output.split('\n'): + if line.startswith('Failed Tests:') and not line.startswith('Failed Tests: 0 /'): + raise Exception("Tests seem failed: %s" % line) + + if line.startswith('Failed Asserts:') and not line.startswith('Failed Asserts: 0 /'): + raise Exception("Asserts seem failed: %s" % line) + + if 'CHIP test status: ' in line and 'CHIP test status: 0' not in line: + raise Exception("CHIP test status is NOT 0: %s" % line) + + if verbose: + print("========== TEST OUTPUT BEGIN ============") + print(output) + print("========== TEST OUTPUT END ============") + + logging.info("Image %s PASSED", path) + except: + # make sure output is visible in stdout + print(output) + raise + + +if __name__ == '__main__': + main() diff --git a/src/test_driver/esp32/sdkconfig_qemu.defaults b/src/test_driver/esp32/sdkconfig_qemu.defaults index 6509c5ba7d9f2e..31a991644d1377 100644 --- a/src/test_driver/esp32/sdkconfig_qemu.defaults +++ b/src/test_driver/esp32/sdkconfig_qemu.defaults @@ -31,8 +31,8 @@ CONFIG_MBEDTLS_HARDWARE_MPI=n CONFIG_MBEDTLS_HARDWARE_SHA=n CONFIG_CHIP_TASK_STACK_SIZE=32768 CONFIG_ESP_MAIN_TASK_STACK_SIZE=32768 -CONFIG_ESP32_PANIC_PRINT_REBOOT=y -CONFIG_ESP32_PANIC_PRINT_HALT=n +CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y +CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=n # enable BT CONFIG_BT_ENABLED=n @@ -44,3 +44,8 @@ CONFIG_ENABLE_WIFI_AP=n # Use a custom partition table CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" + +# No watchdog - we run on the host and tests have timeouts +# Crypto tests generally take long enough for the watchdog to trigger +# otherwise. +CONFIG_ESP_TASK_WDT=n diff --git a/src/transport/CryptoContext.cpp b/src/transport/CryptoContext.cpp index b76c53ec89e388..c78bf8b7872d8c 100644 --- a/src/transport/CryptoContext.cpp +++ b/src/transport/CryptoContext.cpp @@ -184,7 +184,7 @@ CHIP_ERROR CryptoContext::Encrypt(const uint8_t * input, size_t input_length, ui KeyUsage usage = kR2IKey; // Message is encrypted before sending. If the secure session was created by session - // initiator, we'll use I2R key to encrypt the message that's being transmittted. + // initiator, we'll use I2R key to encrypt the message that's being transmitted. // Otherwise, we'll use R2I key, as the responder is sending the message. if (mSessionRole == SessionRole::kInitiator) { diff --git a/src/transport/MessageCounterManagerInterface.h b/src/transport/MessageCounterManagerInterface.h index 19368b256fe128..f13810a31e3981 100644 --- a/src/transport/MessageCounterManagerInterface.h +++ b/src/transport/MessageCounterManagerInterface.h @@ -31,13 +31,13 @@ class MessageCounterManagerInterface /** * Start sync if the sync procedure is not started yet. */ - virtual CHIP_ERROR StartSync(SessionHandle session, Transport::SecureSession * state) = 0; + virtual CHIP_ERROR StartSync(const SessionHandle & session, Transport::SecureSession * state) = 0; /** * Called when have received a message but session message counter is not synced. It will queue the message and start sync if * the sync procedure is not started yet. */ - virtual CHIP_ERROR QueueReceivedMessageAndStartSync(const PacketHeader & packetHeader, SessionHandle session, + virtual CHIP_ERROR QueueReceivedMessageAndStartSync(const PacketHeader & packetHeader, const SessionHandle & session, Transport::SecureSession * state, const Transport::PeerAddress & peerAddress, System::PacketBufferHandle && msgBuf) = 0; diff --git a/src/transport/PairingSession.cpp b/src/transport/PairingSession.cpp index c19d4251a97943..cbbd8bc0c73273 100644 --- a/src/transport/PairingSession.cpp +++ b/src/transport/PairingSession.cpp @@ -53,7 +53,7 @@ CHIP_ERROR PairingSession::DecodeMRPParametersIfPresent(TLV::Tag expectedTag, TL ChipLogDetail(SecureChannel, "Found MRP parameters in the message"); - // Both TLV elements in the strucutre are optional. If the first element is present, process it and move + // Both TLV elements in the structure are optional. If the first element is present, process it and move // the TLV reader to the next element. if (TLV::TagNumFromTag(tlvReader.GetTag()) == 1) { diff --git a/src/transport/PairingSession.h b/src/transport/PairingSession.h index 889cbb7607d3d8..22e13365d72b65 100644 --- a/src/transport/PairingSession.h +++ b/src/transport/PairingSession.h @@ -72,7 +72,7 @@ class DLL_EXPORT PairingSession * Derive a secure session from the paired session. The API will return error * if called before pairing is established. * - * @param session Referene to the secure session that will be + * @param session Reference to the secure session that will be * initialized once pairing is complete * @param role Role of the new session (initiator or responder) * @return CHIP_ERROR The result of session derivation diff --git a/src/transport/SecureSession.h b/src/transport/SecureSession.h index 9c9cbc627bdd91..84b0dbe85195fa 100644 --- a/src/transport/SecureSession.h +++ b/src/transport/SecureSession.h @@ -65,13 +65,11 @@ class SecureSession }; SecureSession(Type secureSessionType, uint16_t localSessionId, NodeId peerNodeId, CATValues peerCATs, uint16_t peerSessionId, - FabricIndex fabric, const ReliableMessageProtocolConfig & config, System::Clock::Timestamp currentTime) : + FabricIndex fabric, const ReliableMessageProtocolConfig & config) : mSecureSessionType(secureSessionType), mPeerNodeId(peerNodeId), mPeerCATs(peerCATs), mLocalSessionId(localSessionId), mPeerSessionId(peerSessionId), - mFabric(fabric), mMRPConfig(config) - { - SetLastActivityTime(currentTime); - } + mFabric(fabric), mLastActivityTime(System::SystemClock().GetMonotonicTimestamp()), mMRPConfig(config) + {} SecureSession(SecureSession &&) = delete; SecureSession(const SecureSession &) = delete; @@ -95,7 +93,7 @@ class SecureSession FabricIndex GetFabricIndex() const { return mFabric; } System::Clock::Timestamp GetLastActivityTime() const { return mLastActivityTime; } - void SetLastActivityTime(System::Clock::Timestamp value) { mLastActivityTime = value; } + void MarkActive() { mLastActivityTime = System::SystemClock().GetMonotonicTimestamp(); } CryptoContext & GetCryptoContext() { return mCryptoContext; } diff --git a/src/transport/SecureSessionTable.h b/src/transport/SecureSessionTable.h index 00392e70d9a479..a680ae050a0641 100644 --- a/src/transport/SecureSessionTable.h +++ b/src/transport/SecureSessionTable.h @@ -37,7 +37,7 @@ constexpr const uint16_t kAnyKeyId = 0xffff; * - handle session active time and expiration * - allocate and free space for sessions. */ -template +template class SecureSessionTable { public: @@ -64,8 +64,7 @@ class SecureSessionTable CATValues peerCATs, uint16_t peerSessionId, FabricIndex fabric, const ReliableMessageProtocolConfig & config) { - return mEntries.CreateObject(secureSessionType, localSessionId, peerNodeId, peerCATs, peerSessionId, fabric, config, - mTimeSource.GetMonotonicTimestamp()); + return mEntries.CreateObject(secureSessionType, localSessionId, peerNodeId, peerCATs, peerSessionId, fabric, config); } void ReleaseSession(SecureSession * session) { mEntries.ReleaseObject(session); } @@ -98,9 +97,6 @@ class SecureSessionTable return result; } - /// Convenience method to mark a session as active - void MarkSessionActive(SecureSession * state) { state->SetLastActivityTime(mTimeSource.GetMonotonicTimestamp()); } - /** * Iterates through all active sessions and expires any sessions with an idle time * larger than the given amount. @@ -110,9 +106,8 @@ class SecureSessionTable template void ExpireInactiveSessions(System::Clock::Timestamp maxIdleTime, Callback callback) { - const System::Clock::Timestamp currentTime = mTimeSource.GetMonotonicTimestamp(); mEntries.ForEachActiveObject([&](auto session) { - if (session->GetLastActivityTime() + maxIdleTime < currentTime) + if (session->GetLastActivityTime() + maxIdleTime < System::SystemClock().GetMonotonicTimestamp()) { callback(*session); ReleaseSession(session); @@ -121,11 +116,7 @@ class SecureSessionTable }); } - /// Allows access to the underlying time source used for keeping track of session active time - Time::TimeSource & GetTimeSource() { return mTimeSource; } - private: - Time::TimeSource mTimeSource; BitMapObjectPool mEntries; }; diff --git a/src/transport/SessionDelegate.h b/src/transport/SessionDelegate.h index 366b7d93b9f17d..bee1ab6970ea20 100644 --- a/src/transport/SessionDelegate.h +++ b/src/transport/SessionDelegate.h @@ -31,7 +31,7 @@ class DLL_EXPORT SessionReleaseDelegate * * @param session The handle to the secure session */ - virtual void OnSessionReleased(SessionHandle session) = 0; + virtual void OnSessionReleased(const SessionHandle & session) = 0; }; class DLL_EXPORT SessionRecoveryDelegate diff --git a/src/transport/SessionHandle.cpp b/src/transport/SessionHandle.cpp index 8e49b258def32c..eebed4f41e6e98 100644 --- a/src/transport/SessionHandle.cpp +++ b/src/transport/SessionHandle.cpp @@ -23,12 +23,33 @@ namespace chip { using namespace Transport; +using AuthMode = Access::AuthMode; using SubjectDescriptor = Access::SubjectDescriptor; SubjectDescriptor SessionHandle::GetSubjectDescriptor() const { - SubjectDescriptor subjectDescriptor = { .fabricIndex = mFabric }; - // TODO: fill subject descriptor with proper fields + SubjectDescriptor subjectDescriptor; + if (IsSecure()) + { + if (IsOperationalNodeId(mPeerNodeId)) + { + subjectDescriptor.authMode = AuthMode::kCase; + subjectDescriptor.subject = mPeerNodeId; + subjectDescriptor.fabricIndex = mFabric; + // TODO(#10243): add CATs + } + else if (IsPAKEKeyId(mPeerNodeId)) + { + subjectDescriptor.authMode = AuthMode::kPase; + subjectDescriptor.subject = mPeerNodeId; + // TODO(#10242): PASE *can* have fabric in some situations + } + else if (mGroupId.HasValue()) + { + subjectDescriptor.authMode = AuthMode::kGroup; + subjectDescriptor.subject = NodeIdFromGroupId(mGroupId.Value()); + } + } return subjectDescriptor; } diff --git a/src/transport/SessionHolder.h b/src/transport/SessionHolder.h index f5efbc3e375010..8210f8e5241d81 100644 --- a/src/transport/SessionHolder.h +++ b/src/transport/SessionHolder.h @@ -33,7 +33,7 @@ class SessionHolder : public SessionReleaseDelegate { public: SessionHolder() {} - SessionHolder(SessionHandle session) : mSession(session) {} + SessionHolder(const SessionHandle & session) : mSession(session) {} ~SessionHolder() { Release(); } SessionHolder(const SessionHolder &); @@ -41,7 +41,7 @@ class SessionHolder : public SessionReleaseDelegate SessionHolder(SessionHolder && that); SessionHolder operator=(SessionHolder && that); - void Grab(SessionHandle sessionHandle) + void Grab(const SessionHandle & sessionHandle) { Release(); mSession.SetValue(sessionHandle); @@ -51,13 +51,13 @@ class SessionHolder : public SessionReleaseDelegate // TODO: call this function when the underlying session is released // Implement SessionReleaseDelegate - void OnSessionReleased(SessionHandle session) override { Release(); } + void OnSessionReleased(const SessionHandle & session) override { Release(); } // Check whether the SessionHolder contains a session matching given session bool Contains(const SessionHandle & session) const { return mSession.HasValue() && mSession.Value() == session; } operator bool() const { return mSession.HasValue(); } - SessionHandle Get() const { return mSession.Value(); } + const SessionHandle & Get() const { return mSession.Value(); } Optional ToOptional() const { return mSession; } private: diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index f0e6078be8bbf4..cee779e8c09860 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -106,7 +106,7 @@ void SessionManager::Shutdown() mCB = nullptr; } -CHIP_ERROR SessionManager::PrepareMessage(SessionHandle sessionHandle, PayloadHeader & payloadHeader, +CHIP_ERROR SessionManager::PrepareMessage(const SessionHandle & sessionHandle, PayloadHeader & payloadHeader, System::PacketBufferHandle && message, EncryptedPacketBufferHandle & preparedMessage) { PacketHeader packetHeader; @@ -189,7 +189,8 @@ CHIP_ERROR SessionManager::PrepareMessage(SessionHandle sessionHandle, PayloadHe return CHIP_NO_ERROR; } -CHIP_ERROR SessionManager::SendPreparedMessage(SessionHandle sessionHandle, const EncryptedPacketBufferHandle & preparedMessage) +CHIP_ERROR SessionManager::SendPreparedMessage(const SessionHandle & sessionHandle, + const EncryptedPacketBufferHandle & preparedMessage) { VerifyOrReturnError(mState == State::kInitialized, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(!preparedMessage.IsNull(), CHIP_ERROR_INVALID_ARGUMENT); @@ -225,7 +226,7 @@ CHIP_ERROR SessionManager::SendPreparedMessage(SessionHandle sessionHandle, cons } // This marks any connection where we send data to as 'active' - mSecureSessions.MarkSessionActive(session); + session->MarkActive(); destination = &session->GetPeerAddress(); @@ -240,7 +241,7 @@ CHIP_ERROR SessionManager::SendPreparedMessage(SessionHandle sessionHandle, cons else { auto unauthenticated = sessionHandle.GetUnauthenticatedSession(); - mUnauthenticatedSessions.MarkSessionActive(unauthenticated); + unauthenticated->MarkActive(); destination = &unauthenticated->GetPeerAddress(); ChipLogProgress(Inet, @@ -265,7 +266,7 @@ CHIP_ERROR SessionManager::SendPreparedMessage(SessionHandle sessionHandle, cons } } -void SessionManager::ExpirePairing(SessionHandle sessionHandle) +void SessionManager::ExpirePairing(const SessionHandle & sessionHandle) { SecureSession * session = GetSecureSession(sessionHandle); if (session != nullptr) @@ -438,7 +439,7 @@ void SessionManager::MessageDispatch(const PacketHeader & packetHeader, const Tr } VerifyOrDie(err == CHIP_NO_ERROR); - mUnauthenticatedSessions.MarkSessionActive(session); + session->MarkActive(); PayloadHeader payloadHeader; ReturnOnFailure(payloadHeader.DecodeAndConsume(msg)); @@ -501,7 +502,7 @@ void SessionManager::SecureUnicastMessageDispatch(const PacketHeader & packetHea return; } - mSecureSessions.MarkSessionActive(session); + session->MarkActive(); if (isDuplicate == SessionMessageDelegate::DuplicateMessage::Yes && !payloadHeader.NeedsAck()) { @@ -627,12 +628,13 @@ void SessionManager::ExpiryTimerCallback(System::Layer * layer, void * param) // TODO(#2279): session expiration is currently disabled until rekeying is supported // the #ifdef should be removed after that. mgr->mSecureSessions.ExpireInactiveSessions( - CHIP_PEER_CONNECTION_TIMEOUT_MS, [this](const Transport::SecureSession & state1) { HandleConnectionExpired(state1); }); + System::SystemClock().GetMonotonicTimestamp(), System::Clock::Milliseconds32(CHIP_PEER_CONNECTION_TIMEOUT_MS), + [this](const Transport::SecureSession & state1) { HandleConnectionExpired(state1); }); #endif mgr->ScheduleExpiryTimer(); // re-schedule the oneshot timer } -SecureSession * SessionManager::GetSecureSession(SessionHandle session) +SecureSession * SessionManager::GetSecureSession(const SessionHandle & session) { if (session.mLocalSessionId.HasValue()) { diff --git a/src/transport/SessionManager.h b/src/transport/SessionManager.h index d2d52983cf5669..5dd8d0c9e58faa 100644 --- a/src/transport/SessionManager.h +++ b/src/transport/SessionManager.h @@ -134,16 +134,16 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate * 3. Encode the packet header and prepend it to message. * Returns a encrypted message in encryptedMessage. */ - CHIP_ERROR PrepareMessage(SessionHandle session, PayloadHeader & payloadHeader, System::PacketBufferHandle && msgBuf, + CHIP_ERROR PrepareMessage(const SessionHandle & session, PayloadHeader & payloadHeader, System::PacketBufferHandle && msgBuf, EncryptedPacketBufferHandle & encryptedMessage); /** * @brief * Send a prepared message to a currently connected peer. */ - CHIP_ERROR SendPreparedMessage(SessionHandle session, const EncryptedPacketBufferHandle & preparedMessage); + CHIP_ERROR SendPreparedMessage(const SessionHandle & session, const EncryptedPacketBufferHandle & preparedMessage); - Transport::SecureSession * GetSecureSession(SessionHandle session); + Transport::SecureSession * GetSecureSession(const SessionHandle & session); /// @brief Set the delegate for handling incoming messages. There can be only one message delegate (probably the /// ExchangeManager) @@ -190,7 +190,7 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate CHIP_ERROR NewPairing(SessionHolder & sessionHolder, const Optional & peerAddr, NodeId peerNodeId, PairingSession * pairing, CryptoContext::SessionRole direction, FabricIndex fabric); - void ExpirePairing(SessionHandle session); + void ExpirePairing(const SessionHandle & session); void ExpireAllPairings(NodeId peerNodeId, FabricIndex fabric); void ExpireAllPairingsForFabric(FabricIndex fabric); @@ -244,6 +244,7 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate } // TODO: this is a temporary solution for legacy tests which use nodeId to send packets + // and tv-casting-app that uses the TV's node ID to find the associated secure session SessionHandle FindSecureSessionForNode(NodeId peerNodeId); private: diff --git a/src/transport/SessionMessageDelegate.h b/src/transport/SessionMessageDelegate.h index afdae243971fef..d4aa40ef9d2a8c 100644 --- a/src/transport/SessionMessageDelegate.h +++ b/src/transport/SessionMessageDelegate.h @@ -50,9 +50,9 @@ class DLL_EXPORT SessionMessageDelegate * @param isDuplicate The message is a duplicate of previously received message * @param msgBuf The received message */ - virtual void OnMessageReceived(const PacketHeader & packetHeader, const PayloadHeader & payloadHeader, SessionHandle session, - const Transport::PeerAddress & source, DuplicateMessage isDuplicate, - System::PacketBufferHandle && msgBuf) = 0; + virtual void OnMessageReceived(const PacketHeader & packetHeader, const PayloadHeader & payloadHeader, + const SessionHandle & session, const Transport::PeerAddress & source, + DuplicateMessage isDuplicate, System::PacketBufferHandle && msgBuf) = 0; }; } // namespace chip diff --git a/src/transport/UnauthenticatedSessionTable.h b/src/transport/UnauthenticatedSessionTable.h index 55c1e126ec003a..c4ca79f1396cf1 100644 --- a/src/transport/UnauthenticatedSessionTable.h +++ b/src/transport/UnauthenticatedSessionTable.h @@ -49,7 +49,7 @@ class UnauthenticatedSession : public ReferenceCounted +template class UnauthenticatedSessionTable { public: @@ -114,15 +113,6 @@ class UnauthenticatedSessionTable } } - /// Mark a session as active - void MarkSessionActive(UnauthenticatedSessionHandle session) - { - session->SetLastActivityTime(mTimeSource.GetMonotonicTimestamp()); - } - - /// Allows access to the underlying time source used for keeping track of session active time - Time::TimeSource & GetTimeSource() { return mTimeSource; } - private: /** * Allocates a new session out of the internal resource pool. @@ -224,7 +214,6 @@ class UnauthenticatedSessionTable return false; } - Time::TimeSource mTimeSource; BitMapObjectPool mEntries; }; diff --git a/src/transport/raw/TCP.h b/src/transport/raw/TCP.h index 44292b2e131592..f6a09bc93f847e 100644 --- a/src/transport/raw/TCP.h +++ b/src/transport/raw/TCP.h @@ -281,7 +281,7 @@ class TCP : public TCPBase private: friend class TCPTest; TCPBase::ActiveConnectionState mConnectionsBuffer[kActiveConnectionsSize]; - PoolImpl mPendingPackets; + PoolImpl mPendingPackets; }; } // namespace Transport diff --git a/src/transport/raw/UDP.h b/src/transport/raw/UDP.h index 2ea712cf64208e..fcdc624eb06d81 100644 --- a/src/transport/raw/UDP.h +++ b/src/transport/raw/UDP.h @@ -19,7 +19,7 @@ /** * @file * This file defines the CHIP Connection object that maintains a UDP connection. - * It binds to any avaiable local addr and port and begins listening. + * It binds to any available local addr and port and begins listening. * */ diff --git a/src/transport/raw/tests/TestTCP.cpp b/src/transport/raw/tests/TestTCP.cpp index 15f7d3cfdcd507..787a1ed250c9fb 100644 --- a/src/transport/raw/tests/TestTCP.cpp +++ b/src/transport/raw/tests/TestTCP.cpp @@ -131,14 +131,6 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate // Should be able to send a message to itself by just calling send. err = tcp.SendMessage(Transport::PeerAddress::TCP(addr), std::move(buffer)); - if (err == CHIP_ERROR_POSIX(EADDRNOTAVAIL)) - { - // TODO(#2698): the underlying system does not support IPV6. This early return - // should be removed and error should be made fatal. - printf("%s:%u: System does NOT support IPV6.\n", __FILE__, __LINE__); - return; - } - NL_TEST_ASSERT(mSuite, err == CHIP_NO_ERROR); mContext.DriveIOUntil(chip::System::Clock::Seconds16(5), [this]() { return mReceiveHandlerCallCount != 0; }); @@ -401,7 +393,7 @@ void chip::Transport::TCPTest::CheckProcessReceivedBuffer(nlTestSuite * inSuite, NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, gMockTransportMgrDelegate.mReceiveHandlerCallCount == 1); - // Test a message in a chain of three packet buffers. The message length is split accross buffers. + // Test a message in a chain of three packet buffers. The message length is split across buffers. gMockTransportMgrDelegate.mReceiveHandlerCallCount = 0; NL_TEST_ASSERT(inSuite, testData[0].Init((const uint16_t[]){ 1, 122, 123, 0 })); err = tcp.ProcessReceivedBuffer(lEndPoint, lPeerAddress, std::move(testData[0].mHandle)); diff --git a/src/transport/raw/tests/TestUDP.cpp b/src/transport/raw/tests/TestUDP.cpp index 4652f4f5f6f963..f1621b723d9ec0 100644 --- a/src/transport/raw/tests/TestUDP.cpp +++ b/src/transport/raw/tests/TestUDP.cpp @@ -140,14 +140,6 @@ void CheckMessageTest(nlTestSuite * inSuite, void * inContext, const IPAddress & // Should be able to send a message to itself by just calling send. err = udp.SendMessage(Transport::PeerAddress::UDP(addr, udp.GetBoundPort()), std::move(buffer)); - if (err == CHIP_ERROR_POSIX(EADDRNOTAVAIL)) - { - // TODO(#2698): the underlying system does not support IPV6. This early return - // should be removed and error should be made fatal. - printf("%s:%u: System does NOT support IPV6.\n", __FILE__, __LINE__); - return; - } - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); ctx.DriveIOUntil(chip::System::Clock::Seconds16(1), []() { return ReceiveHandlerCallCount != 0; }); diff --git a/src/transport/retransmit/Cache.h b/src/transport/retransmit/Cache.h index 8c4251ced72206..5f2d7d55b8792d 100644 --- a/src/transport/retransmit/Cache.h +++ b/src/transport/retransmit/Cache.h @@ -50,7 +50,7 @@ struct Lifetime * PayloadType MUST provide a way to reference count, as the data will * preserved until the cache is freed: * - * PayloadType chip::Retransmit::Aquire(PayloadType&); + * PayloadType chip::Retransmit::Acquire(PayloadType&); * chip::Retransmit::Release(PayloadType&); */ template diff --git a/src/transport/retransmit/tests/TestCache.cpp b/src/transport/retransmit/tests/TestCache.cpp index 058688d67740df..aac0b424c37080 100644 --- a/src/transport/retransmit/tests/TestCache.cpp +++ b/src/transport/retransmit/tests/TestCache.cpp @@ -53,23 +53,23 @@ class IntPayloadTracker void Acquire(int value) { NL_TEST_ASSERT(mSuite, (value > 0) && value < kMaxPayloadValue); - mAquired.set(static_cast(value)); + mAcquired.set(static_cast(value)); } void Release(int value) { NL_TEST_ASSERT(mSuite, (value > 0) && value < kMaxPayloadValue); - NL_TEST_ASSERT(mSuite, mAquired.test(static_cast(value))); - mAquired.reset(static_cast(value)); + NL_TEST_ASSERT(mSuite, mAcquired.test(static_cast(value))); + mAcquired.reset(static_cast(value)); } - size_t Count() const { return mAquired.count(); } + size_t Count() const { return mAcquired.count(); } - bool IsAquired(int value) const { return mAquired.test(static_cast(value)); } + bool IsAcquired(int value) const { return mAcquired.test(static_cast(value)); } private: nlTestSuite * mSuite; - std::bitset mAquired; + std::bitset mAcquired; }; IntPayloadTracker gPayloadTracker; @@ -109,7 +109,7 @@ namespace { void TestNoOp(nlTestSuite * inSuite, void * inContext) { - // unused address cache should not do any aquire/release at any time + // unused address cache should not do any Acquire/release at any time NL_TEST_ASSERT(inSuite, gPayloadTracker.Count() == 0); { TestableCache test; @@ -212,12 +212,12 @@ void RemoveMatching(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, gPayloadTracker.Count() == 2); // keys 1 and 3 remain - NL_TEST_ASSERT(inSuite, gPayloadTracker.IsAquired(1)); - NL_TEST_ASSERT(inSuite, gPayloadTracker.IsAquired(4)); + NL_TEST_ASSERT(inSuite, gPayloadTracker.IsAcquired(1)); + NL_TEST_ASSERT(inSuite, gPayloadTracker.IsAcquired(4)); NL_TEST_ASSERT(inSuite, test.Remove(3) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, gPayloadTracker.IsAquired(1)); - NL_TEST_ASSERT(inSuite, !gPayloadTracker.IsAquired(4)); + NL_TEST_ASSERT(inSuite, gPayloadTracker.IsAcquired(1)); + NL_TEST_ASSERT(inSuite, !gPayloadTracker.IsAcquired(4)); } void FindMatching(nlTestSuite * inSuite, void * inContext) diff --git a/src/transport/tests/TestPairingSession.cpp b/src/transport/tests/TestPairingSession.cpp index 60cc82d41586fe..9c4b094f1b56ae 100644 --- a/src/transport/tests/TestPairingSession.cpp +++ b/src/transport/tests/TestPairingSession.cpp @@ -60,7 +60,8 @@ void PairingSessionEncodeDecodeMRPParams(nlTestSuite * inSuite, void * inContext writer.Init(buf.Retain()); TLV::TLVType outerContainerType = TLV::kTLVType_NotSpecified; - NL_TEST_ASSERT(inSuite, writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, + writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, PairingSession::EncodeMRPParameters(TLV::ContextTag(1), config, writer) == CHIP_NO_ERROR); @@ -71,7 +72,7 @@ void PairingSessionEncodeDecodeMRPParams(nlTestSuite * inSuite, void * inContext TLV::TLVType containerType = TLV::kTLVType_Structure; reader.Init(std::move(buf)); - NL_TEST_ASSERT(inSuite, reader.Next(containerType, TLV::AnonymousTag) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, reader.Next(containerType, TLV::AnonymousTag()) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, reader.EnterContainer(containerType) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, reader.Next() == CHIP_NO_ERROR); @@ -90,7 +91,8 @@ void PairingSessionTryDecodeMissingMRPParams(nlTestSuite * inSuite, void * inCon writer.Init(buf.Retain()); TLV::TLVType outerContainerType = TLV::kTLVType_NotSpecified; - NL_TEST_ASSERT(inSuite, writer.StartContainer(TLV::AnonymousTag, TLV::kTLVType_Structure, outerContainerType) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, + writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outerContainerType) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, writer.Put(TLV::ContextTag(1), static_cast(0x1234)) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, writer.EndContainer(outerContainerType) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, writer.Finalize(&buf) == CHIP_NO_ERROR); @@ -99,7 +101,7 @@ void PairingSessionTryDecodeMissingMRPParams(nlTestSuite * inSuite, void * inCon TLV::TLVType containerType = TLV::kTLVType_Structure; reader.Init(std::move(buf)); - NL_TEST_ASSERT(inSuite, reader.Next(containerType, TLV::AnonymousTag) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, reader.Next(containerType, TLV::AnonymousTag()) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, reader.EnterContainer(containerType) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, reader.Next() == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, session.DecodeMRPParametersIfPresent(TLV::ContextTag(2), reader) == CHIP_NO_ERROR); diff --git a/src/transport/tests/TestPeerConnections.cpp b/src/transport/tests/TestPeerConnections.cpp index ce603e28a86592..259defeb627574 100644 --- a/src/transport/tests/TestPeerConnections.cpp +++ b/src/transport/tests/TestPeerConnections.cpp @@ -63,8 +63,11 @@ const CATValues kPeer3CATs; void TestBasicFunctionality(nlTestSuite * inSuite, void * inContext) { SecureSession * statePtr; - SecureSessionTable<2, Time::Source::kTest> connections; - connections.GetTimeSource().SetMonotonicTimestamp(100_ms64); + SecureSessionTable<2> connections; + System::Clock::Internal::MockClock clock; + System::Clock::ClockBase * realClock = &System::SystemClock(); + System::Clock::Internal::SetSystemClockForTesting(&clock); + clock.SetMonotonic(100_ms64); CATValues peerCATs; // Node ID 1, peer key 1, local key 2 @@ -90,12 +93,16 @@ void TestBasicFunctionality(nlTestSuite * inSuite, void * inContext) statePtr = connections.CreateNewSecureSession(kPeer3SessionType, 6, kPeer3NodeId, kPeer3CATs, 5, 0 /* fabricIndex */, gDefaultMRPConfig); NL_TEST_ASSERT(inSuite, statePtr == nullptr); + System::Clock::Internal::SetSystemClockForTesting(realClock); } void TestFindByKeyId(nlTestSuite * inSuite, void * inContext) { SecureSession * statePtr; - SecureSessionTable<2, Time::Source::kTest> connections; + SecureSessionTable<2> connections; + System::Clock::Internal::MockClock clock; + System::Clock::ClockBase * realClock = &System::SystemClock(); + System::Clock::Internal::SetSystemClockForTesting(&clock); // Node ID 1, peer key 1, local key 2 statePtr = connections.CreateNewSecureSession(kPeer1SessionType, 2, kPeer1NodeId, kPeer1CATs, 1, 0 /* fabricIndex */, @@ -112,6 +119,8 @@ void TestFindByKeyId(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(3)); NL_TEST_ASSERT(inSuite, connections.FindSecureSessionByLocalKey(4)); + + System::Clock::Internal::SetSystemClockForTesting(realClock); } struct ExpiredCallInfo @@ -125,9 +134,13 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) { ExpiredCallInfo callInfo; SecureSession * statePtr; - SecureSessionTable<2, Time::Source::kTest> connections; + SecureSessionTable<2> connections; + + System::Clock::Internal::MockClock clock; + System::Clock::ClockBase * realClock = &System::SystemClock(); + System::Clock::Internal::SetSystemClockForTesting(&clock); - connections.GetTimeSource().SetMonotonicTimestamp(100_ms64); + clock.SetMonotonic(100_ms64); // Node ID 1, peer key 1, local key 2 statePtr = connections.CreateNewSecureSession(kPeer1SessionType, 2, kPeer1NodeId, kPeer1CATs, 1, 0 /* fabricIndex */, @@ -135,7 +148,7 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, statePtr != nullptr); statePtr->SetPeerAddress(kPeer1Addr); - connections.GetTimeSource().SetMonotonicTimestamp(200_ms64); + clock.SetMonotonic(200_ms64); // Node ID 2, peer key 3, local key 4 statePtr = connections.CreateNewSecureSession(kPeer2SessionType, 4, kPeer2NodeId, kPeer2CATs, 3, 0 /* fabricIndex */, gDefaultMRPConfig); @@ -143,7 +156,7 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) statePtr->SetPeerAddress(kPeer2Addr); // cannot add before expiry - connections.GetTimeSource().SetMonotonicTimestamp(300_ms64); + clock.SetMonotonic(300_ms64); statePtr = connections.CreateNewSecureSession(kPeer3SessionType, 6, kPeer3NodeId, kPeer3CATs, 5, 0 /* fabricIndex */, gDefaultMRPConfig); NL_TEST_ASSERT(inSuite, statePtr == nullptr); @@ -160,24 +173,24 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(2)); // now that the connections were expired, we can add peer3 - connections.GetTimeSource().SetMonotonicTimestamp(300_ms64); + clock.SetMonotonic(300_ms64); // Node ID 3, peer key 5, local key 6 statePtr = connections.CreateNewSecureSession(kPeer3SessionType, 6, kPeer3NodeId, kPeer3CATs, 5, 0 /* fabricIndex */, gDefaultMRPConfig); NL_TEST_ASSERT(inSuite, statePtr != nullptr); statePtr->SetPeerAddress(kPeer3Addr); - connections.GetTimeSource().SetMonotonicTimestamp(400_ms64); + clock.SetMonotonic(400_ms64); NL_TEST_ASSERT(inSuite, statePtr = connections.FindSecureSessionByLocalKey(4)); - connections.MarkSessionActive(statePtr); - NL_TEST_ASSERT(inSuite, statePtr->GetLastActivityTime() == connections.GetTimeSource().GetMonotonicTimestamp()); + statePtr->MarkActive(); + NL_TEST_ASSERT(inSuite, statePtr->GetLastActivityTime() == clock.GetMonotonicTimestamp()); // At this time: // Peer 3 active at time 300 // Peer 2 active at time 400 - connections.GetTimeSource().SetMonotonicTimestamp(500_ms64); + clock.SetMonotonic(500_ms64); callInfo.callCount = 0; connections.ExpireInactiveSessions(150_ms64, [&callInfo](const SecureSession & state) { callInfo.callCount++; @@ -202,7 +215,7 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(6)); // peer 1 and 2 are active - connections.GetTimeSource().SetMonotonicTimestamp(1000_ms64); + clock.SetMonotonic(1000_ms64); callInfo.callCount = 0; connections.ExpireInactiveSessions(100_ms64, [&callInfo](const SecureSession & state) { callInfo.callCount++; @@ -213,6 +226,8 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(2)); NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(4)); NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(6)); + + System::Clock::Internal::SetSystemClockForTesting(realClock); } } // namespace diff --git a/src/transport/tests/TestSessionManager.cpp b/src/transport/tests/TestSessionManager.cpp index db198f3fbae20f..b39cd4aa5d737c 100644 --- a/src/transport/tests/TestSessionManager.cpp +++ b/src/transport/tests/TestSessionManager.cpp @@ -62,7 +62,7 @@ const char LARGE_PAYLOAD[kMaxAppMessageLen + 1] = "test message"; class TestSessMgrCallback : public SessionReleaseDelegate, public SessionMessageDelegate { public: - void OnMessageReceived(const PacketHeader & header, const PayloadHeader & payloadHeader, SessionHandle session, + void OnMessageReceived(const PacketHeader & header, const PayloadHeader & payloadHeader, const SessionHandle & session, const Transport::PeerAddress & source, DuplicateMessage isDuplicate, System::PacketBufferHandle && msgBuf) override { @@ -84,7 +84,7 @@ class TestSessMgrCallback : public SessionReleaseDelegate, public SessionMessage ReceiveHandlerCallCount++; } - void OnSessionReleased(SessionHandle session) override { mOldConnectionDropped = true; } + void OnSessionReleased(const SessionHandle & session) override { mOldConnectionDropped = true; } bool mOldConnectionDropped = false; diff --git a/src/transport/tests/qemu_transport_tests.sh b/src/transport/tests/qemu_transport_tests.sh deleted file mode 120000 index 8fbe617c97a267..00000000000000 --- a/src/transport/tests/qemu_transport_tests.sh +++ /dev/null @@ -1 +0,0 @@ -../../../scripts/tools/qemu_run_test.sh \ No newline at end of file diff --git a/third_party/openthread/ot-qorvo b/third_party/openthread/ot-qorvo index fc44db085e6e3d..db1990748c4f80 160000 --- a/third_party/openthread/ot-qorvo +++ b/third_party/openthread/ot-qorvo @@ -1 +1 @@ -Subproject commit fc44db085e6e3d95496f91432038914c4a294cce +Subproject commit db1990748c4f801e75b2763ae492a1b37184d57a diff --git a/third_party/openthread/platforms/qpg/BUILD.gn b/third_party/openthread/platforms/qpg/BUILD.gn index b4a50f19a1d52d..f87607b062e249 100644 --- a/third_party/openthread/platforms/qpg/BUILD.gn +++ b/third_party/openthread/platforms/qpg/BUILD.gn @@ -19,8 +19,7 @@ import("//build_overrides/qpg_sdk.gni") import("${qpg_sdk_build_root}/qpg_sdk.gni") # QPGxxxx settings and OT glue code -openthread_qpg_family = "qpg6100" # pointing to qpg6100 for now, until ot-qorvo - # is updated with qpg6105 files +openthread_qpg_family = "${qpg_target_ic}" openthread_qpg_root = "${chip_root}/third_party/openthread/ot-qorvo" config("openthread_qpg_config") { diff --git a/third_party/zap/repo b/third_party/zap/repo index 3a351d88489f2d..d22a17a54c0b16 160000 --- a/third_party/zap/repo +++ b/third_party/zap/repo @@ -1 +1 @@ -Subproject commit 3a351d88489f2d77de469e52a216dc02b4f92d92 +Subproject commit d22a17a54c0b16379acbb31ecc6d6d8092df4218 diff --git a/zzz_generated/README.md b/zzz_generated/README.md deleted file mode 100644 index 5c4e3c3779e678..00000000000000 --- a/zzz_generated/README.md +++ /dev/null @@ -1,5 +0,0 @@ -### Generated files - -This folder contains generated zap source files. The unusual name (starting with -zzz) is to make alphabetical sorting show generated files at the end of file -diffs to make code review easier. diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index a00849135e4baa..d38955ee000f25 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -664,6 +664,74 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace GeneralCommissioning +namespace GroupKeyManagement { + +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::KeySetRead::Id: { + Commands::KeySetRead::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupKeyManagementClusterKeySetReadCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::KeySetReadAllIndices::Id: { + Commands::KeySetReadAllIndices::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupKeyManagementClusterKeySetReadAllIndicesCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::KeySetRemove::Id: { + Commands::KeySetRemove::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupKeyManagementClusterKeySetRemoveCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::KeySetWrite::Id: { + Commands::KeySetWrite::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfGroupKeyManagementClusterKeySetWriteCallback(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 GroupKeyManagement + namespace Groups { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -1185,6 +1253,48 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace OtaSoftwareUpdateProvider +namespace OtaSoftwareUpdateRequestor { + +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::AnnounceOtaProvider::Id: { + Commands::AnnounceOtaProvider::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = + emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback(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 OtaSoftwareUpdateRequestor + namespace OnOff { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -1207,6 +1317,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } break; } + case Commands::OffWithEffect::Id: { + Commands::OffWithEffect::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfOnOffClusterOffWithEffectCallback(apCommandObj, aCommandPath, commandData); + } + break; + } case Commands::On::Id: { Commands::On::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); @@ -1216,6 +1335,24 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } break; } + case Commands::OnWithRecallGlobalScene::Id: { + Commands::OnWithRecallGlobalScene::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfOnOffClusterOnWithRecallGlobalSceneCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::OnWithTimedOff::Id: { + Commands::OnWithTimedOff::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfOnOffClusterOnWithTimedOffCallback(apCommandObj, aCommandPath, commandData); + } + break; + } case Commands::Toggle::Id: { Commands::Toggle::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); @@ -1868,6 +2005,9 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::GeneralCommissioning::Id: Clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; + case Clusters::GroupKeyManagement::Id: + Clusters::GroupKeyManagement::DispatchServerCommand(apCommandObj, aCommandPath, aReader); + break; case Clusters::Groups::Id: Clusters::Groups::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; @@ -1892,6 +2032,9 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::OtaSoftwareUpdateProvider::Id: Clusters::OtaSoftwareUpdateProvider::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; + case Clusters::OtaSoftwareUpdateRequestor::Id: + Clusters::OtaSoftwareUpdateRequestor::DispatchServerCommand(apCommandObj, aCommandPath, aReader); + break; case Clusters::OnOff::Id: Clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h index 680e3956880da8..d940c9b06bfcad 100644 --- a/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h @@ -35,6 +35,7 @@ MatterBooleanStatePluginServerInitCallback(); \ MatterBridgedActionsPluginServerInitCallback(); \ MatterBridgedDeviceBasicPluginServerInitCallback(); \ + MatterChannelPluginServerInitCallback(); \ MatterColorControlPluginServerInitCallback(); \ MatterContentLauncherPluginServerInitCallback(); \ MatterDescriptorPluginServerInitCallback(); \ @@ -72,7 +73,6 @@ MatterScenesPluginServerInitCallback(); \ MatterSoftwareDiagnosticsPluginServerInitCallback(); \ MatterSwitchPluginServerInitCallback(); \ - MatterTvChannelPluginServerInitCallback(); \ MatterTargetNavigatorPluginServerInitCallback(); \ MatterTemperatureMeasurementPluginServerInitCallback(); \ MatterTestClusterPluginServerInitCallback(); \ diff --git a/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp b/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp index e3bf8404a56bf2..e609c8bf2420a3 100644 --- a/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp @@ -68,6 +68,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID: emberAfBridgedDeviceBasicClusterInitCallback(endpoint); break; + case ZCL_CHANNEL_CLUSTER_ID: + emberAfChannelClusterInitCallback(endpoint); + break; case ZCL_COLOR_CONTROL_CLUSTER_ID: emberAfColorControlClusterInitCallback(endpoint); break; @@ -179,9 +182,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_SWITCH_CLUSTER_ID: emberAfSwitchClusterInitCallback(endpoint); break; - case ZCL_TV_CHANNEL_CLUSTER_ID: - emberAfTvChannelClusterInitCallback(endpoint); - break; case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: emberAfTargetNavigatorClusterInitCallback(endpoint); break; @@ -283,6 +283,11 @@ void __attribute__((weak)) emberAfBridgedDeviceBasicClusterInitCallback(Endpoint // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfChannelClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfColorControlClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -468,11 +473,6 @@ void __attribute__((weak)) emberAfSwitchClusterInitCallback(EndpointId endpoint) // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfTvChannelClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfTargetNavigatorClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 962979b7b6ae59..c373f6ee379d3f 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -275,67 +275,44 @@ /* 628 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x03, \ \ - /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ - \ - /* 632 - groups, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 886 - group keys, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ /* Endpoint: 1, Cluster: On/Off (server), big-endian */ \ \ - /* 1140 - FeatureMap, */ \ + /* 632 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Power Source (server), big-endian */ \ \ - /* 1144 - BatteryVoltage, */ \ + /* 636 - BatteryVoltage, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1148 - BatteryTimeRemaining, */ \ + /* 640 - BatteryTimeRemaining, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1152 - ActiveBatteryFaults, */ \ + /* 644 - ActiveBatteryFaults, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1160 - FeatureMap, */ \ + /* 652 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Network Commissioning (server), big-endian */ \ + \ + /* 656 - Networks, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 668 - LastConnectErrorValue, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 672 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), big-endian */ \ \ - /* 1164 - FeatureMap, */ \ + /* 676 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), big-endian */ \ \ - /* 1168 - label list, */ \ + /* 680 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -353,49 +330,49 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), big-endian */ \ \ - /* 1422 - Description, */ \ + /* 934 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ /* Endpoint: 1, Cluster: Door Lock (server), big-endian */ \ \ - /* 1429 - Language, */ \ + /* 941 - Language, */ \ 2, 'e', 'n', \ \ - /* 1432 - AutoRelockTime, */ \ + /* 944 - AutoRelockTime, */ \ 0x00, 0x00, 0x00, 0x60, \ \ /* Endpoint: 1, Cluster: Window Covering (server), big-endian */ \ \ - /* 1436 - FeatureMap, */ \ + /* 948 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 1440 - LifetimeRunningHours, */ \ + /* 952 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 1443 - Power, */ \ + /* 955 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 1446 - LifetimeEnergyConsumed, */ \ + /* 958 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1450 - FeatureMap, */ \ + /* 962 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 1454 - FeatureMap, */ \ + /* 966 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 1458 - IAS CIE address, */ \ + /* 970 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: TV Channel (server), big-endian */ \ + /* Endpoint: 1, Cluster: Channel (server), big-endian */ \ \ - /* 1466 - channel list, */ \ + /* 978 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -413,7 +390,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 1720 - target navigator list, */ \ + /* 1232 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -431,24 +408,24 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), big-endian */ \ \ - /* 1974 - start time, */ \ + /* 1486 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 1982 - duration, */ \ + /* 1494 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1990 - playback speed, */ \ + /* 1502 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1994 - seek range end, */ \ + /* 1506 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2002 - seek range start, */ \ + /* 1514 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 2010 - media input list, */ \ + /* 1522 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -466,7 +443,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 2264 - accepts header list, */ \ + /* 1776 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -482,12 +459,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2518 - supported streaming protocols, */ \ + /* 2030 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Audio Output (server), big-endian */ \ \ - /* 2522 - audio output list, */ \ + /* 2034 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -505,7 +482,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 2776 - application launcher list, */ \ + /* 2288 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -521,63 +498,69 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: Application Basic (server), big-endian */ \ + \ + /* 2542 - allowed vendor list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 3030 - bitmap32, */ \ + /* 2574 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3034 - bitmap64, */ \ + /* 2578 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3042 - int24u, */ \ + /* 2586 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3045 - int32u, */ \ + /* 2589 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3049 - int40u, */ \ + /* 2593 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3054 - int48u, */ \ + /* 2598 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3060 - int56u, */ \ + /* 2604 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3067 - int64u, */ \ + /* 2611 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3075 - int24s, */ \ + /* 2619 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3078 - int32s, */ \ + /* 2622 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3082 - int40s, */ \ + /* 2626 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3087 - int48s, */ \ + /* 2631 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3093 - int56s, */ \ + /* 2637 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3100 - int64s, */ \ + /* 2644 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3108 - float_single, */ \ + /* 2652 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3112 - float_double, */ \ + /* 2656 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3120 - epoch_us, */ \ + /* 2664 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3128 - epoch_s, */ \ + /* 2672 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3132 - list_long_octet_string, */ \ + /* 2676 - list_long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -632,65 +615,65 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4132 - nullable_bitmap32, */ \ + /* 3676 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4136 - nullable_bitmap64, */ \ + /* 3680 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4144 - nullable_int24u, */ \ + /* 3688 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 4147 - nullable_int32u, */ \ + /* 3691 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4151 - nullable_int40u, */ \ + /* 3695 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4156 - nullable_int48u, */ \ + /* 3700 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4162 - nullable_int56u, */ \ + /* 3706 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4169 - nullable_int64u, */ \ + /* 3713 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4177 - nullable_int24s, */ \ + /* 3721 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 4180 - nullable_int32s, */ \ + /* 3724 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4184 - nullable_int40s, */ \ + /* 3728 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4189 - nullable_int48s, */ \ + /* 3733 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4195 - nullable_int56s, */ \ + /* 3739 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4202 - nullable_int64s, */ \ + /* 3746 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4210 - nullable_float_single, */ \ + /* 3754 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4214 - nullable_float_double, */ \ + /* 3758 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), big-endian */ \ \ - /* 4222 - measurement type, */ \ + /* 3766 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4226 - total active power, */ \ + /* 3770 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), big-endian */ \ \ - /* 4230 - FeatureMap, */ \ + /* 3774 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -946,67 +929,44 @@ /* 628 - FeatureMap, */ \ 0x03, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ - \ - /* 632 - groups, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 886 - group keys, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ /* Endpoint: 1, Cluster: On/Off (server), little-endian */ \ \ - /* 1140 - FeatureMap, */ \ + /* 632 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Power Source (server), little-endian */ \ \ - /* 1144 - BatteryVoltage, */ \ + /* 636 - BatteryVoltage, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1148 - BatteryTimeRemaining, */ \ + /* 640 - BatteryTimeRemaining, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1152 - ActiveBatteryFaults, */ \ + /* 644 - ActiveBatteryFaults, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1160 - FeatureMap, */ \ + /* 652 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Network Commissioning (server), little-endian */ \ + \ + /* 656 - Networks, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 668 - LastConnectErrorValue, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 672 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Switch (server), little-endian */ \ \ - /* 1164 - FeatureMap, */ \ + /* 676 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Fixed Label (server), little-endian */ \ \ - /* 1168 - label list, */ \ + /* 680 - label list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1024,49 +984,49 @@ \ /* Endpoint: 1, Cluster: Mode Select (server), little-endian */ \ \ - /* 1422 - Description, */ \ + /* 934 - Description, */ \ 6, 'C', 'o', 'f', 'f', 'e', 'e', \ \ /* Endpoint: 1, Cluster: Door Lock (server), little-endian */ \ \ - /* 1429 - Language, */ \ + /* 941 - Language, */ \ 2, 'e', 'n', \ \ - /* 1432 - AutoRelockTime, */ \ + /* 944 - AutoRelockTime, */ \ 0x60, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Window Covering (server), little-endian */ \ \ - /* 1436 - FeatureMap, */ \ + /* 948 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 1440 - LifetimeRunningHours, */ \ + /* 952 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 1443 - Power, */ \ + /* 955 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 1446 - LifetimeEnergyConsumed, */ \ + /* 958 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1450 - FeatureMap, */ \ + /* 962 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 1454 - FeatureMap, */ \ + /* 966 - FeatureMap, */ \ 0x0B, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 1458 - IAS CIE address, */ \ + /* 970 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: TV Channel (server), little-endian */ \ + /* Endpoint: 1, Cluster: Channel (server), little-endian */ \ \ - /* 1466 - channel list, */ \ + /* 978 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1084,7 +1044,7 @@ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 1720 - target navigator list, */ \ + /* 1232 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1102,24 +1062,24 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), little-endian */ \ \ - /* 1974 - start time, */ \ + /* 1486 - start time, */ \ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1982 - duration, */ \ + /* 1494 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 1990 - playback speed, */ \ + /* 1502 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 1994 - seek range end, */ \ + /* 1506 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2002 - seek range start, */ \ + /* 1514 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 2010 - media input list, */ \ + /* 1522 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1137,7 +1097,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 2264 - accepts header list, */ \ + /* 1776 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1153,12 +1113,12 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2518 - supported streaming protocols, */ \ + /* 2030 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Audio Output (server), little-endian */ \ \ - /* 2522 - audio output list, */ \ + /* 2034 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1176,7 +1136,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 2776 - application launcher list, */ \ + /* 2288 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1192,63 +1152,69 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: Application Basic (server), little-endian */ \ + \ + /* 2542 - allowed vendor list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 3030 - bitmap32, */ \ + /* 2574 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3034 - bitmap64, */ \ + /* 2578 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3042 - int24u, */ \ + /* 2586 - int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 3045 - int32u, */ \ + /* 2589 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3049 - int40u, */ \ + /* 2593 - int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3054 - int48u, */ \ + /* 2598 - int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3060 - int56u, */ \ + /* 2604 - int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3067 - int64u, */ \ + /* 2611 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3075 - int24s, */ \ + /* 2619 - int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 3078 - int32s, */ \ + /* 2622 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3082 - int40s, */ \ + /* 2626 - int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3087 - int48s, */ \ + /* 2631 - int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3093 - int56s, */ \ + /* 2637 - int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3100 - int64s, */ \ + /* 2644 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3108 - float_single, */ \ + /* 2652 - float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3112 - float_double, */ \ + /* 2656 - float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3120 - epoch_us, */ \ + /* 2664 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3128 - epoch_s, */ \ + /* 2672 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 3132 - list_long_octet_string, */ \ + /* 2676 - list_long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1303,71 +1269,71 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4132 - nullable_bitmap32, */ \ + /* 3676 - nullable_bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4136 - nullable_bitmap64, */ \ + /* 3680 - nullable_bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4144 - nullable_int24u, */ \ + /* 3688 - nullable_int24u, */ \ 0x00, 0x00, 0x00, \ \ - /* 4147 - nullable_int32u, */ \ + /* 3691 - nullable_int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4151 - nullable_int40u, */ \ + /* 3695 - nullable_int40u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4156 - nullable_int48u, */ \ + /* 3700 - nullable_int48u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4162 - nullable_int56u, */ \ + /* 3706 - nullable_int56u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4169 - nullable_int64u, */ \ + /* 3713 - nullable_int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4177 - nullable_int24s, */ \ + /* 3721 - nullable_int24s, */ \ 0x00, 0x00, 0x00, \ \ - /* 4180 - nullable_int32s, */ \ + /* 3724 - nullable_int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4184 - nullable_int40s, */ \ + /* 3728 - nullable_int40s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4189 - nullable_int48s, */ \ + /* 3733 - nullable_int48s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4195 - nullable_int56s, */ \ + /* 3739 - nullable_int56s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4202 - nullable_int64s, */ \ + /* 3746 - nullable_int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4210 - nullable_float_single, */ \ + /* 3754 - nullable_float_single, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4214 - nullable_float_double, */ \ + /* 3758 - nullable_float_double, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), little-endian */ \ \ - /* 4222 - measurement type, */ \ + /* 3766 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4226 - total active power, */ \ + /* 3770 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), little-endian */ \ \ - /* 4230 - FeatureMap, */ \ + /* 3774 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (142) +#define GENERATED_DEFAULTS_COUNT (144) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -1446,21 +1412,21 @@ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0xFEFF }, /* start up color temperature mireds */ \ \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ - { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* range_restricted_int8u */ \ - { (uint16_t) 0x0, (uint16_t) -0x28, (uint16_t) 0x32 }, /* range_restricted_int8s */ \ - { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* range_restricted_int16u */ \ - { (uint16_t) 0x0, (uint16_t) -0x96, (uint16_t) 0xC8 }, /* range_restricted_int16s */ \ - { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* nullable_range_restricted_int8u */ \ - { (uint16_t) 0x0, (uint16_t) -0x28, (uint16_t) 0x32 }, /* nullable_range_restricted_int8s */ \ - { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* nullable_range_restricted_int16u */ \ + { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* range_restricted_int8u */ \ + { (uint16_t) -0x14, (uint16_t) -0x28, (uint16_t) 0x32 }, /* range_restricted_int8s */ \ + { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* range_restricted_int16u */ \ + { (uint16_t) -0x64, (uint16_t) -0x96, (uint16_t) 0xC8 }, /* range_restricted_int16s */ \ + { (uint16_t) 0x46, (uint16_t) 0x14, (uint16_t) 0x64 }, /* nullable_range_restricted_int8u */ \ + { (uint16_t) -0x14, (uint16_t) -0x28, (uint16_t) 0x32 }, /* nullable_range_restricted_int8s */ \ + { (uint16_t) 0xC8, (uint16_t) 0x64, (uint16_t) 0x3E8 }, /* nullable_range_restricted_int16u */ \ { \ - (uint16_t) 0x0, (uint16_t) -0x96, (uint16_t) 0xC8 \ + (uint16_t) - 0x64, (uint16_t) -0x96, (uint16_t) 0xC8 \ } /* nullable_range_restricted_int16s */ \ } #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 586 +#define GENERATED_ATTRIBUTE_COUNT 601 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1522,9 +1488,12 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ - { 0x0001, ZAP_TYPE(OCTET_STRING), 17, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* default ota provider */ \ - { 0x0002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* update possible */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* DefaultOtaProviders */ \ + { 0x0001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* UpdatePossible */ \ + { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* UpdateState */ \ + { 0x0003, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* UpdateStateProgress */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Sources */ \ @@ -1686,17 +1655,21 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(886) }, /* group keys */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* groupKeyMap */ \ + { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* groupTable */ \ + { 0x0002, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* maxGroupsPerFabric */ \ + { 0x0003, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ + ZAP_EMPTY_DEFAULT() }, /* maxGroupKeysPerFabric */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ @@ -1728,7 +1701,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1140) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ @@ -1785,35 +1758,48 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Power Source (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Status */ \ - { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Order */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_EMPTY_DEFAULT() }, /* Description */ \ - { 0x000B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1144) }, /* BatteryVoltage */ \ - { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryPercentRemaining */ \ - { 0x000D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1148) }, /* BatteryTimeRemaining */ \ - { 0x000E, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeLevel */ \ - { 0x0012, ZAP_TYPE(ARRAY), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1152) }, /* ActiveBatteryFaults */ \ - { 0x001A, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeState */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1160) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Status */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Order */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 61, 0, ZAP_EMPTY_DEFAULT() }, /* Description */ \ + { 0x000B, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(636) }, /* BatteryVoltage */ \ + { 0x000C, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryPercentRemaining */ \ + { 0x000D, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(640) }, /* BatteryTimeRemaining */ \ + { 0x000E, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeLevel */ \ + { 0x0012, ZAP_TYPE(ARRAY), 8, 0, ZAP_LONG_DEFAULTS_INDEX(644) }, /* ActiveBatteryFaults */ \ + { 0x001A, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* BatteryChargeState */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(652) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + \ + /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ + { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* MaxNetworks */ \ + { 0x0001, ZAP_TYPE(ARRAY), 12, 0, ZAP_LONG_DEFAULTS_INDEX(656) }, /* Networks */ \ + { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ScanMaxTimeSeconds */ \ + { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* ConnectMaxTimeSeconds */ \ + { 0x0004, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* InterfaceEnabled */ \ + { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkingStatus */ \ + { 0x0006, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* LastNetworkID */ \ + { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(668) }, /* LastConnectErrorValue */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(672) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Switch (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* number of positions */ \ - { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* current position */ \ - { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* multi press max */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1164) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* number of positions */ \ + { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* current position */ \ + { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(2) }, /* multi press max */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(676) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1168) }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(680) }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Boolean State (server) */ \ { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* StateValue */ \ @@ -1824,7 +1810,7 @@ { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(0) }, /* SupportedModes */ \ { 0x0002, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnMode */ \ { 0x0003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* StartUpMode */ \ - { 0x0004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(1422) }, /* Description */ \ + { 0x0004, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(934) }, /* Description */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ @@ -1837,8 +1823,8 @@ { 0x0017, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(6) }, /* MaxPINCodeLength */ \ { 0x0018, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(6) }, /* MinPINCodeLength */ \ { 0x001B, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* CredentialRulesSupport */ \ - { 0x0021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1429) }, /* Language */ \ - { 0x0023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1432) }, /* AutoRelockTime */ \ + { 0x0021, ZAP_TYPE(CHAR_STRING), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(941) }, /* Language */ \ + { 0x0023, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(944) }, /* AutoRelockTime */ \ { 0x0024, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(5) }, /* SoundVolume */ \ { 0x0025, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -1854,27 +1840,33 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x7FFF) }, /* CurrentPositionLift */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x7FFF) }, /* CurrentPositionTilt */ \ - { 0x0007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x03) }, /* ConfigStatus */ \ - { 0x0008, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(50) }, /* CurrentPositionLiftPercentage */ \ - { 0x0009, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(50) }, /* CurrentPositionTiltPercentage */ \ - { 0x000A, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationalStatus */ \ - { 0x000B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(500) }, /* TargetPositionLiftPercent100ths */ \ - { 0x000C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(500) }, /* TargetPositionTiltPercent100ths */ \ - { 0x000D, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* EndProductType */ \ - { 0x000E, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(500) }, /* CurrentPositionLiftPercent100ths */ \ - { 0x000F, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(500) }, /* CurrentPositionTiltPercent100ths */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x7FFF) }, /* CurrentPositionLift */ \ + { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x7FFF) }, /* CurrentPositionTilt */ \ + { 0x0007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x03) }, /* ConfigStatus */ \ + { 0x0008, ZAP_TYPE(PERCENT), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(50) }, /* CurrentPositionLiftPercentage */ \ + { 0x0009, ZAP_TYPE(PERCENT), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(50) }, /* CurrentPositionTiltPercentage */ \ + { 0x000A, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationalStatus */ \ + { 0x000B, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(500) }, /* TargetPositionLiftPercent100ths */ \ + { 0x000C, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(500) }, /* TargetPositionTiltPercent100ths */ \ + { 0x000D, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* EndProductType */ \ + { 0x000E, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(500) }, /* CurrentPositionLiftPercent100ths */ \ + { 0x000F, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(500) }, /* CurrentPositionTiltPercent100ths */ \ { 0x0010, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitLift */ \ { 0x0011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitLift */ \ { 0x0012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitTilt */ \ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ { 0x0017, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* Mode */ \ - { 0x001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1436) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(9) }, /* Mode */ \ + { 0x001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(948) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* barrier moving state */ \ @@ -1903,17 +1895,17 @@ { 0x0013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ { 0x0015, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1440) }, /* LifetimeRunningHours */ \ - { 0x0016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(1443) }, /* Power */ \ + ZAP_LONG_DEFAULTS_INDEX(952) }, /* LifetimeRunningHours */ \ + { 0x0016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(955) }, /* Power */ \ { 0x0017, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(1446) }, /* LifetimeEnergyConsumed */ \ + ZAP_LONG_DEFAULTS_INDEX(958) }, /* LifetimeEnergyConsumed */ \ { 0x0020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(10) }, /* OperationMode */ \ { 0x0021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(11) }, /* ControlMode */ \ - { 0x0022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1450) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(11) }, /* ControlMode */ \ + { 0x0022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(962) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* local temperature */ \ @@ -1938,12 +1930,12 @@ { 0x001B, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(17) }, /* control sequence of operation */ \ { 0x001C, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_MIN_MAX_DEFAULTS_INDEX(18) }, /* system mode */ \ - { 0x0020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ - { 0x0021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ - { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1454) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ + ZAP_MIN_MAX_DEFAULTS_INDEX(18) }, /* system mode */ \ + { 0x0020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ + { 0x0021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ + { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(966) }, /* FeatureMap */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -2060,37 +2052,37 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* zone state */ \ - { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ - { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ - { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1458) }, /* IAS CIE address */ \ - { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* zone state */ \ + { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ + { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ + { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(970) }, /* IAS CIE address */ \ + { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* wake on lan mac address */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1466) }, /* channel list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Channel (server) */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(978) }, /* channel list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1720) }, /* target navigator list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1232) }, /* target navigator list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current navigator target */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1974) }, /* start time */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1982) }, /* duration */ \ - { 0x0004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1990) }, /* playback speed */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1994) }, /* seek range end */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2002) }, /* seek range start */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ + { 0x0001, ZAP_TYPE(EPOCH_US), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1486) }, /* start time */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1494) }, /* duration */ \ + { 0x0004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(1502) }, /* playback speed */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1506) }, /* seek range end */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(1514) }, /* seek range start */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2010) }, /* media input list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1522) }, /* media input list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -2101,28 +2093,29 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2264) }, /* accepts header list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1776) }, /* accept header list */ \ { 0x0001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2518) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(2030) }, /* supported streaming protocols */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2522) }, /* audio output list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2034) }, /* audio output list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2776) }, /* application launcher list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2288) }, /* application launcher list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ + { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ + { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ + { 0x0006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ + { 0x0007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2542) }, /* allowed vendor list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Account Login (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -2131,28 +2124,28 @@ { 0x0000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x0001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3030) }, /* bitmap32 */ \ - { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3034) }, /* bitmap64 */ \ + { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2574) }, /* bitmap32 */ \ + { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2578) }, /* bitmap64 */ \ { 0x0005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x0006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x0007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3042) }, /* int24u */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3045) }, /* int32u */ \ - { 0x0009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3049) }, /* int40u */ \ - { 0x000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3054) }, /* int48u */ \ - { 0x000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3060) }, /* int56u */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3067) }, /* int64u */ \ + { 0x0007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2586) }, /* int24u */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2589) }, /* int32u */ \ + { 0x0009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2593) }, /* int40u */ \ + { 0x000A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2598) }, /* int48u */ \ + { 0x000B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2604) }, /* int56u */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2611) }, /* int64u */ \ { 0x000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3075) }, /* int24s */ \ - { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3078) }, /* int32s */ \ - { 0x0011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3082) }, /* int40s */ \ - { 0x0012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3087) }, /* int48s */ \ - { 0x0013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3093) }, /* int56s */ \ - { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3100) }, /* int64s */ \ + { 0x000F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2619) }, /* int24s */ \ + { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2622) }, /* int32s */ \ + { 0x0011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2626) }, /* int40s */ \ + { 0x0012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2631) }, /* int48s */ \ + { 0x0013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2637) }, /* int56s */ \ + { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2644) }, /* int64s */ \ { 0x0015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x0016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ - { 0x0017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3108) }, /* float_single */ \ - { 0x0018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3112) }, /* float_double */ \ + { 0x0017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2652) }, /* float_single */ \ + { 0x0018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2656) }, /* float_double */ \ { 0x0019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* octet_string */ \ { 0x001A, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* list_int8u */ \ @@ -2165,8 +2158,8 @@ { 0x001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* char_string */ \ { 0x001F, ZAP_TYPE(LONG_CHAR_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_char_string */ \ - { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3120) }, /* epoch_us */ \ - { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(3128) }, /* epoch_s */ \ + { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2664) }, /* epoch_us */ \ + { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2672) }, /* epoch_s */ \ { 0x0022, ZAP_TYPE(VENDOR_ID), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* vendor_id */ \ { 0x0023, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* list_nullables_and_optionals_struct */ \ @@ -2181,7 +2174,7 @@ ZAP_MIN_MAX_DEFAULTS_INDEX(33) }, /* range_restricted_int16u */ \ { 0x0029, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(34) }, /* range_restricted_int16s */ \ - { 0x002A, ZAP_TYPE(ARRAY), 1000, 0, ZAP_LONG_DEFAULTS_INDEX(3132) }, /* list_long_octet_string */ \ + { 0x002A, ZAP_TYPE(ARRAY), 1000, 0, ZAP_LONG_DEFAULTS_INDEX(2676) }, /* list_long_octet_string */ \ { 0x0030, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(MUST_USE_TIMED_WRITE), \ ZAP_EMPTY_DEFAULT() }, /* timed_write_boolean */ \ { 0x8000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -2191,49 +2184,49 @@ { 0x8002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_bitmap16 */ \ { 0x8003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4132) }, /* nullable_bitmap32 */ \ + ZAP_LONG_DEFAULTS_INDEX(3676) }, /* nullable_bitmap32 */ \ { 0x8004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4136) }, /* nullable_bitmap64 */ \ + ZAP_LONG_DEFAULTS_INDEX(3680) }, /* nullable_bitmap64 */ \ { 0x8005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8u */ \ { 0x8006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16u */ \ { 0x8007, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4144) }, /* nullable_int24u */ \ + ZAP_LONG_DEFAULTS_INDEX(3688) }, /* nullable_int24u */ \ { 0x8008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4147) }, /* nullable_int32u */ \ + ZAP_LONG_DEFAULTS_INDEX(3691) }, /* nullable_int32u */ \ { 0x8009, ZAP_TYPE(INT40U), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4151) }, /* nullable_int40u */ \ + ZAP_LONG_DEFAULTS_INDEX(3695) }, /* nullable_int40u */ \ { 0x800A, ZAP_TYPE(INT48U), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4156) }, /* nullable_int48u */ \ + ZAP_LONG_DEFAULTS_INDEX(3700) }, /* nullable_int48u */ \ { 0x800B, ZAP_TYPE(INT56U), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4162) }, /* nullable_int56u */ \ + ZAP_LONG_DEFAULTS_INDEX(3706) }, /* nullable_int56u */ \ { 0x800C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4169) }, /* nullable_int64u */ \ + ZAP_LONG_DEFAULTS_INDEX(3713) }, /* nullable_int64u */ \ { 0x800D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int8s */ \ { 0x800E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_int16s */ \ { 0x800F, ZAP_TYPE(INT24S), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4177) }, /* nullable_int24s */ \ + ZAP_LONG_DEFAULTS_INDEX(3721) }, /* nullable_int24s */ \ { 0x8010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4180) }, /* nullable_int32s */ \ + ZAP_LONG_DEFAULTS_INDEX(3724) }, /* nullable_int32s */ \ { 0x8011, ZAP_TYPE(INT40S), 5, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4184) }, /* nullable_int40s */ \ + ZAP_LONG_DEFAULTS_INDEX(3728) }, /* nullable_int40s */ \ { 0x8012, ZAP_TYPE(INT48S), 6, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4189) }, /* nullable_int48s */ \ + ZAP_LONG_DEFAULTS_INDEX(3733) }, /* nullable_int48s */ \ { 0x8013, ZAP_TYPE(INT56S), 7, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4195) }, /* nullable_int56s */ \ + ZAP_LONG_DEFAULTS_INDEX(3739) }, /* nullable_int56s */ \ { 0x8014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4202) }, /* nullable_int64s */ \ + ZAP_LONG_DEFAULTS_INDEX(3746) }, /* nullable_int64s */ \ { 0x8015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum8 */ \ { 0x8016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_SIMPLE_DEFAULT(0) }, /* nullable_enum16 */ \ { 0x8017, ZAP_TYPE(SINGLE), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4210) }, /* nullable_float_single */ \ + ZAP_LONG_DEFAULTS_INDEX(3754) }, /* nullable_float_single */ \ { 0x8018, ZAP_TYPE(DOUBLE), 8, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(4214) }, /* nullable_float_double */ \ + ZAP_LONG_DEFAULTS_INDEX(3758) }, /* nullable_float_double */ \ { 0x8019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ ZAP_EMPTY_DEFAULT() }, /* nullable_octet_string */ \ { 0x801E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ @@ -2258,8 +2251,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4222) }, /* measurement type */ \ - { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4226) }, /* total active power */ \ + { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3766) }, /* measurement type */ \ + { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3770) }, /* total active power */ \ { 0x0505, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xffff) }, /* rms voltage */ \ { 0x0506, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage min */ \ { 0x0507, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage max */ \ @@ -2281,7 +2274,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4230) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(3774) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ @@ -2324,6 +2317,7 @@ }; \ const EmberAfGenericClusterFunction chipFuncArrayDoorLockServer[] = { \ (EmberAfGenericClusterFunction) MatterDoorLockClusterServerAttributeChangedCallback, \ + (EmberAfGenericClusterFunction) MatterDoorLockClusterServerPreAttributeChangedCallback, \ }; \ const EmberAfGenericClusterFunction chipFuncArrayPumpConfigurationAndControlServer[] = { \ (EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerInitCallback, \ @@ -2348,7 +2342,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 72 +#define GENERATED_CLUSTER_COUNT 73 #define GENERATED_CLUSTERS \ { \ { 0x0003, \ @@ -2382,246 +2376,250 @@ 0x0029, ZAP_ATTRIBUTE_INDEX(34), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ { \ - 0x002A, ZAP_ATTRIBUTE_INDEX(35), 3, 20, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002A, ZAP_ATTRIBUTE_INDEX(35), 5, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ { \ - 0x002E, ZAP_ATTRIBUTE_INDEX(38), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002E, ZAP_ATTRIBUTE_INDEX(40), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(40), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0030, ZAP_ATTRIBUTE_INDEX(42), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(46), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0031, ZAP_ATTRIBUTE_INDEX(48), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { \ - 0x0032, ZAP_ATTRIBUTE_INDEX(56), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0032, ZAP_ATTRIBUTE_INDEX(58), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ { \ - 0x0033, ZAP_ATTRIBUTE_INDEX(56), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0033, ZAP_ATTRIBUTE_INDEX(58), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(65), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(67), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(71), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(73), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(136), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(138), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(151), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(153), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(162), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(164), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(166), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(168), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x003F, ZAP_ATTRIBUTE_INDEX(172), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003F, ZAP_ATTRIBUTE_INDEX(174), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(175), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(179), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x0041, ZAP_ATTRIBUTE_INDEX(177), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0041, ZAP_ATTRIBUTE_INDEX(181), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(179), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(183), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(183), \ + ZAP_ATTRIBUTE_INDEX(187), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x0004, \ - ZAP_ATTRIBUTE_INDEX(186), \ + ZAP_ATTRIBUTE_INDEX(190), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x0005, \ - ZAP_ATTRIBUTE_INDEX(188), \ + ZAP_ATTRIBUTE_INDEX(192), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(194), \ + ZAP_ATTRIBUTE_INDEX(198), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x0007, ZAP_ATTRIBUTE_INDEX(201), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0007, ZAP_ATTRIBUTE_INDEX(205), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(204), \ + ZAP_ATTRIBUTE_INDEX(208), \ 15, \ 23, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x000F, ZAP_ATTRIBUTE_INDEX(219), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x000F, ZAP_ATTRIBUTE_INDEX(223), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(223), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(227), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x001E, ZAP_ATTRIBUTE_INDEX(228), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001E, ZAP_ATTRIBUTE_INDEX(232), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { \ - 0x0025, ZAP_ATTRIBUTE_INDEX(229), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0025, ZAP_ATTRIBUTE_INDEX(233), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ { \ - 0x002F, ZAP_ATTRIBUTE_INDEX(233), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002F, ZAP_ATTRIBUTE_INDEX(237), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Power Source (server) */ \ { \ - 0x0039, ZAP_ATTRIBUTE_INDEX(244), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0031, ZAP_ATTRIBUTE_INDEX(248), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: Network Commissioning (server) */ \ + { \ + 0x0039, ZAP_ATTRIBUTE_INDEX(258), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ { \ - 0x003B, ZAP_ATTRIBUTE_INDEX(245), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003B, ZAP_ATTRIBUTE_INDEX(259), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Switch (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(250), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(264), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ { \ - 0x0041, ZAP_ATTRIBUTE_INDEX(252), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0041, ZAP_ATTRIBUTE_INDEX(266), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: User Label (server) */ \ { \ - 0x0045, ZAP_ATTRIBUTE_INDEX(254), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0045, ZAP_ATTRIBUTE_INDEX(268), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Boolean State (server) */ \ { \ - 0x0050, ZAP_ATTRIBUTE_INDEX(256), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0050, ZAP_ATTRIBUTE_INDEX(270), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Mode Select (server) */ \ { 0x0101, \ - ZAP_ATTRIBUTE_INDEX(262), \ + ZAP_ATTRIBUTE_INDEX(276), \ 19, \ 29, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | \ + ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(281), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(295), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(301), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0103, ZAP_ATTRIBUTE_INDEX(315), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ 0x0200, \ - ZAP_ATTRIBUTE_INDEX(306), \ + ZAP_ATTRIBUTE_INDEX(320), \ 26, \ 54, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { 0x0201, \ - ZAP_ATTRIBUTE_INDEX(332), \ + ZAP_ATTRIBUTE_INDEX(346), \ 19, \ 34, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayThermostatServer }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { \ 0x0204, \ - ZAP_ATTRIBUTE_INDEX(351), \ + ZAP_ATTRIBUTE_INDEX(365), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayThermostatUserInterfaceConfigurationServer \ }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(355), \ + ZAP_ATTRIBUTE_INDEX(369), \ 53, \ 341, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0400, ZAP_ATTRIBUTE_INDEX(408), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(422), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(414), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(428), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(419), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(433), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(423), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(437), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(428), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(442), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(433), \ + ZAP_ATTRIBUTE_INDEX(447), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(437), \ + ZAP_ATTRIBUTE_INDEX(451), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(443), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(457), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(445), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ + 0x0504, ZAP_ATTRIBUTE_INDEX(459), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(447), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(461), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(450), 7, 39, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(464), 7, 39, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(457), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(471), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(460), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(474), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(461), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(475), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(462), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(476), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(465), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(479), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(468), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(482), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(470), 7, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(484), 8, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(477), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(492), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(478), 78, 3285, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(493), 78, 3285, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(556), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(571), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { 0x0004, \ - ZAP_ATTRIBUTE_INDEX(568), \ + ZAP_ATTRIBUTE_INDEX(583), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 2, Cluster: Groups (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(570), \ + ZAP_ATTRIBUTE_INDEX(585), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(577), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(592), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(582), \ + ZAP_ATTRIBUTE_INDEX(597), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2633,7 +2631,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 23, 1988 }, { ZAP_CLUSTER_INDEX(23), 45, 6078 }, { ZAP_CLUSTER_INDEX(68), 4, 21 }, \ + { ZAP_CLUSTER_INDEX(0), 23, 1465 }, { ZAP_CLUSTER_INDEX(23), 46, 6170 }, { ZAP_CLUSTER_INDEX(69), 4, 21 }, \ } // Largest attribute size is needed for various buffers @@ -2643,7 +2641,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (689) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (8087) +#define ATTRIBUTE_MAX_SIZE (7656) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/all-clusters-app/zap-generated/gen_config.h b/zzz_generated/all-clusters-app/zap-generated/gen_config.h index 146562cb706c90..0484734aa48c82 100644 --- a/zzz_generated/all-clusters-app/zap-generated/gen_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/gen_config.h @@ -42,6 +42,7 @@ #define EMBER_AF_BOOLEAN_STATE_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_BRIDGED_ACTIONS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_BRIDGED_DEVICE_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_CONTENT_LAUNCH_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (3) @@ -64,7 +65,7 @@ #define EMBER_AF_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_MODE_SELECT_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OTA_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OCCUPANCY_SENSING_CLUSTER_SERVER_ENDPOINT_COUNT (2) @@ -79,7 +80,6 @@ #define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SWITCH_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_TV_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TEST_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -158,6 +158,11 @@ #define EMBER_AF_PLUGIN_BRIDGED_DEVICE_BASIC_SERVER #define EMBER_AF_PLUGIN_BRIDGED_DEVICE_BASIC +// Use this macro to check if the server side of the Channel cluster is included +#define ZCL_USING_CHANNEL_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_CHANNEL_SERVER +#define EMBER_AF_PLUGIN_CHANNEL + // Use this macro to check if the server side of the Color Control cluster is included #define ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER @@ -355,11 +360,6 @@ #define EMBER_AF_PLUGIN_SWITCH_SERVER #define EMBER_AF_PLUGIN_SWITCH -// Use this macro to check if the server side of the TV Channel cluster is included -#define ZCL_USING_TV_CHANNEL_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_TV_CHANNEL_SERVER -#define EMBER_AF_PLUGIN_TV_CHANNEL - // Use this macro to check if the server side of the Target Navigator cluster is included #define ZCL_USING_TARGET_NAVIGATOR_CLUSTER_SERVER #define EMBER_AF_PLUGIN_TARGET_NAVIGATOR_SERVER diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index d8e7b831abcbb4..7a0630ee166f04 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -28,6 +28,21 @@ #include "enums.h" +// Struct for Dimension +typedef struct _Dimension +{ + double width; + double height; + uint8_t metric; +} Dimension; + +// Struct for AdditionalInfo +typedef struct _AdditionalInfo +{ + chip::CharSpan name; + chip::CharSpan value; +} AdditionalInfo; + // Struct for SimpleStruct typedef struct _SimpleStruct { @@ -84,68 +99,59 @@ typedef struct _DoubleNestedStructList /* TYPE WARNING: array array defaults to */ uint8_t * a; } DoubleNestedStructList; -// Struct for ContentLaunchDimension -typedef struct _ContentLaunchDimension -{ - double width; - double height; - uint8_t metric; -} ContentLaunchDimension; - -// Struct for ContentLaunchAdditionalInfo -typedef struct _ContentLaunchAdditionalInfo -{ - chip::CharSpan name; - chip::CharSpan value; -} ContentLaunchAdditionalInfo; - -// Struct for ContentLaunchParamater -typedef struct _ContentLaunchParamater +// Struct for Parameter +typedef struct _Parameter { uint8_t type; chip::CharSpan value; /* TYPE WARNING: array array defaults to */ uint8_t * externalIDList; -} ContentLaunchParamater; +} Parameter; -// Struct for ContentLaunchStyleInformation -typedef struct _ContentLaunchStyleInformation +// Struct for ContentSearch +typedef struct _ContentSearch +{ + /* TYPE WARNING: array array defaults to */ uint8_t * parameterList; +} ContentSearch; + +// Struct for StyleInformation +typedef struct _StyleInformation { chip::CharSpan imageUrl; chip::CharSpan color; - ContentLaunchDimension size; -} ContentLaunchStyleInformation; + Dimension size; +} StyleInformation; -// Struct for ContentLaunchBrandingInformation -typedef struct _ContentLaunchBrandingInformation +// Struct for BrandingInformation +typedef struct _BrandingInformation { chip::CharSpan providerName; - ContentLaunchStyleInformation background; - ContentLaunchStyleInformation logo; - ContentLaunchStyleInformation progressBar; - ContentLaunchStyleInformation splash; - ContentLaunchStyleInformation waterMark; -} ContentLaunchBrandingInformation; + StyleInformation background; + StyleInformation logo; + StyleInformation progressBar; + StyleInformation splash; + StyleInformation waterMark; +} BrandingInformation; -// Struct for ApplicationLauncherApp -typedef struct _ApplicationLauncherApp +// Struct for Application +typedef struct _Application { uint16_t catalogVendorId; chip::CharSpan applicationId; -} ApplicationLauncherApp; +} Application; -// Struct for ApplicationLauncherEndpoint -typedef struct _ApplicationLauncherEndpoint +// Struct for ApplicationEP +typedef struct _ApplicationEP { - ApplicationLauncherApp application; + Application application; chip::CharSpan endpoint; -} ApplicationLauncherEndpoint; +} ApplicationEP; // Struct for Target typedef struct _Target { - uint32_t Cluster; - uint16_t Endpoint; - uint32_t DeviceType; + chip::ClusterId Cluster; + chip::EndpointId Endpoint; + chip::DeviceTypeId DeviceType; } Target; // Struct for AccessControlEntry @@ -169,21 +175,6 @@ typedef struct _ActionStruct uint8_t Status; } ActionStruct; -// Struct for ApplicationBasicApp -typedef struct _ApplicationBasicApp -{ - uint16_t catalogVendorId; - chip::CharSpan applicationId; -} ApplicationBasicApp; - -// Struct for AudioOutputInfo -typedef struct _AudioOutputInfo -{ - uint8_t index; - uint8_t outputType; - chip::CharSpan name; -} AudioOutputInfo; - // Struct for BasicCommissioningInfoType typedef struct _BasicCommissioningInfoType { @@ -204,6 +195,16 @@ typedef struct _BatFaultChangeType /* TYPE WARNING: array array defaults to */ uint8_t * previous; } BatFaultChangeType; +// Struct for ChannelInfo +typedef struct _ChannelInfo +{ + uint16_t majorNumber; + uint16_t minorNumber; + chip::CharSpan name; + chip::CharSpan callSign; + chip::CharSpan affiliateCallSign; +} ChannelInfo; + // Struct for DeviceType typedef struct _DeviceType { @@ -245,23 +246,35 @@ typedef struct _FabricDescriptor chip::CharSpan Label; } FabricDescriptor; +// Struct for GroupInfo +typedef struct _GroupInfo +{ + uint16_t fabricIndex; + uint16_t groupId; + /* TYPE WARNING: array array defaults to */ uint8_t * endpoints; + chip::CharSpan groupName; +} GroupInfo; + // Struct for GroupKey typedef struct _GroupKey { - uint16_t VendorId; - uint16_t GroupKeyIndex; - chip::ByteSpan GroupKeyRoot; - uint64_t GroupKeyEpochStartTime; - uint8_t GroupKeySecurityPolicy; + uint16_t fabricIndex; + uint16_t groupId; + uint16_t groupKeySetID; } GroupKey; -// Struct for GroupState -typedef struct _GroupState +// Struct for GroupKeySet +typedef struct _GroupKeySet { - uint16_t VendorId; - uint16_t VendorGroupId; - uint16_t GroupKeySetIndex; -} GroupState; + uint16_t groupKeySetID; + uint8_t securityPolicy; + chip::ByteSpan epochKey0; + uint64_t epochStartTime0; + chip::ByteSpan epochKey1; + uint64_t epochStartTime1; + chip::ByteSpan epochKey2; + uint64_t epochStartTime2; +} GroupKeySet; // Struct for IasAceZoneStatusResult typedef struct _IasAceZoneStatusResult @@ -270,6 +283,15 @@ typedef struct _IasAceZoneStatusResult uint16_t zoneStatus; } IasAceZoneStatusResult; +// Struct for InputInfo +typedef struct _InputInfo +{ + uint8_t index; + uint8_t inputType; + chip::CharSpan name; + chip::CharSpan description; +} InputInfo; + // Struct for LabelStruct typedef struct _LabelStruct { @@ -277,21 +299,14 @@ typedef struct _LabelStruct chip::CharSpan value; } LabelStruct; -// Struct for MediaInputInfo -typedef struct _MediaInputInfo +// Struct for LineupInfo +typedef struct _LineupInfo { - uint8_t index; - uint8_t inputType; - chip::CharSpan name; - chip::CharSpan description; -} MediaInputInfo; - -// Struct for MediaPlaybackPosition -typedef struct _MediaPlaybackPosition -{ - uint64_t updatedAt; - uint64_t position; -} MediaPlaybackPosition; + chip::CharSpan operatorName; + chip::CharSpan lineupName; + chip::CharSpan postalCode; + uint8_t lineupInfoType; +} LineupInfo; // Struct for ModeOptionStruct typedef struct _ModeOptionStruct @@ -308,13 +323,6 @@ typedef struct _NOCStruct chip::ByteSpan NOC; } NOCStruct; -// Struct for NavigateTargetTargetInfo -typedef struct _NavigateTargetTargetInfo -{ - uint8_t identifier; - chip::CharSpan name; -} NavigateTargetTargetInfo; - // Struct for NeighborTable typedef struct _NeighborTable { @@ -376,6 +384,21 @@ typedef struct _OperationalDatasetComponents bool ChannelMaskPresent; } OperationalDatasetComponents; +// Struct for OutputInfo +typedef struct _OutputInfo +{ + uint8_t index; + uint8_t outputType; + chip::CharSpan name; +} OutputInfo; + +// Struct for PlaybackPosition +typedef struct _PlaybackPosition +{ + uint64_t updatedAt; + uint64_t position; +} PlaybackPosition; + // Struct for PowerProfileRecord typedef struct _PowerProfileRecord { @@ -385,6 +408,14 @@ typedef struct _PowerProfileRecord uint8_t powerProfileState; } PowerProfileRecord; +// Struct for ProviderLocation +typedef struct _ProviderLocation +{ + chip::FabricIndex FabricIndex; + chip::NodeId ProviderNodeID; + chip::EndpointId Endpoint; +} ProviderLocation; + // Struct for ReadAttributeStatusRecord typedef struct _ReadAttributeStatusRecord { @@ -461,6 +492,13 @@ typedef struct _SoftwareFault chip::ByteSpan FaultRecording; } SoftwareFault; +// Struct for TargetInfo +typedef struct _TargetInfo +{ + uint8_t identifier; + chip::CharSpan name; +} TargetInfo; + // Struct for TestListStructOctet typedef struct _TestListStructOctet { @@ -502,33 +540,14 @@ typedef struct _TransferredPhase uint16_t maxActivationDelay; } TransferredPhase; -// Struct for TvChannelInfo -typedef struct _TvChannelInfo -{ - uint16_t majorNumber; - uint16_t minorNumber; - chip::CharSpan name; - chip::CharSpan callSign; - chip::CharSpan affiliateCallSign; -} TvChannelInfo; - -// Struct for TvChannelLineupInfo -typedef struct _TvChannelLineupInfo -{ - chip::CharSpan operatorName; - chip::CharSpan lineupName; - chip::CharSpan postalCode; - uint8_t lineupInfoType; -} TvChannelLineupInfo; - // Struct for WiFiInterfaceScanResult typedef struct _WiFiInterfaceScanResult { uint8_t Security; chip::ByteSpan SSID; chip::ByteSpan BSSID; - uint8_t Channel; - uint32_t WiFiBand; + uint16_t Channel; + uint8_t WiFiBand; int8_t RSSI; } WiFiInterfaceScanResult; diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index ad86368560140c..23c0e496087fca 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -317,8 +317,10 @@ // Client attributes // Server attributes -#define ZCL_DEFAULT_OTA_PROVIDER_ATTRIBUTE_ID (0x0001) -#define ZCL_UPDATE_POSSIBLE_ATTRIBUTE_ID (0x0002) +#define ZCL_DEFAULT_OTA_PROVIDERS_ATTRIBUTE_ID (0x0000) +#define ZCL_UPDATE_POSSIBLE_ATTRIBUTE_ID (0x0001) +#define ZCL_UPDATE_STATE_ATTRIBUTE_ID (0x0002) +#define ZCL_UPDATE_STATE_PROGRESS_ATTRIBUTE_ID (0x0003) // Attribute ids for cluster: Localization Configuration @@ -600,8 +602,10 @@ // Client attributes // Server attributes -#define ZCL_GROUPS_ATTRIBUTE_ID (0x0000) -#define ZCL_GROUPKEYS_ATTRIBUTE_ID (0x0001) +#define ZCL_GROUP_KEY_MAP_ATTRIBUTE_ID (0x0000) +#define ZCL_GROUP_TABLE_ATTRIBUTE_ID (0x0001) +#define ZCL_MAX_GROUPS_PER_FABRIC_ATTRIBUTE_ID (0x0002) +#define ZCL_MAX_GROUP_KEYS_PER_FABRIC_ATTRIBUTE_ID (0x0003) // Attribute ids for cluster: Fixed Label @@ -740,12 +744,7 @@ #define ZCL_WC_INSTALLED_CLOSED_LIMIT_LIFT_ATTRIBUTE_ID (0x0011) #define ZCL_WC_INSTALLED_OPEN_LIMIT_TILT_ATTRIBUTE_ID (0x0012) #define ZCL_WC_INSTALLED_CLOSED_LIMIT_TILT_ATTRIBUTE_ID (0x0013) -#define ZCL_WC_VELOCITY_LIFT_ATTRIBUTE_ID (0x0014) -#define ZCL_WC_ACCELERATION_TIME_LIFT_ATTRIBUTE_ID (0x0015) -#define ZCL_WC_DECELERATION_TIME_LIFT_ATTRIBUTE_ID (0x0016) #define ZCL_WC_MODE_ATTRIBUTE_ID (0x0017) -#define ZCL_WC_INTERMEDIATE_SETPOINTS_LIFT_ATTRIBUTE_ID (0x0018) -#define ZCL_WC_INTERMEDIATE_SETPOINTS_TILT_ATTRIBUTE_ID (0x0019) #define ZCL_WC_SAFETY_STATUS_ATTRIBUTE_ID (0x001A) // Attribute ids for cluster: Barrier Control @@ -1361,14 +1360,14 @@ // Server attributes #define ZCL_WAKE_ON_LAN_MAC_ADDRESS_ATTRIBUTE_ID (0x0000) -// Attribute ids for cluster: TV Channel +// Attribute ids for cluster: Channel // Client attributes // Server attributes -#define ZCL_TV_CHANNEL_LIST_ATTRIBUTE_ID (0x0000) -#define ZCL_TV_CHANNEL_LINEUP_ATTRIBUTE_ID (0x0001) -#define ZCL_TV_CHANNEL_CURRENT_CHANNEL_ATTRIBUTE_ID (0x0002) +#define ZCL_CHANNEL_LIST_ATTRIBUTE_ID (0x0000) +#define ZCL_CHANNEL_LINEUP_ATTRIBUTE_ID (0x0001) +#define ZCL_CHANNEL_CURRENT_CHANNEL_ATTRIBUTE_ID (0x0002) // Attribute ids for cluster: Target Navigator @@ -1416,7 +1415,7 @@ // Client attributes // Server attributes -#define ZCL_CONTENT_LAUNCHER_ACCEPTS_HEADER_ATTRIBUTE_ID (0x0000) +#define ZCL_CONTENT_LAUNCHER_ACCEPT_HEADER_ATTRIBUTE_ID (0x0000) #define ZCL_CONTENT_LAUNCHER_SUPPORTED_STREAMING_PROTOCOLS_ATTRIBUTE_ID (0x0001) // Attribute ids for cluster: Audio Output @@ -1447,6 +1446,7 @@ #define ZCL_APPLICATION_APP_ATTRIBUTE_ID (0x0004) #define ZCL_APPLICATION_STATUS_ATTRIBUTE_ID (0x0005) #define ZCL_APPLICATION_VERSION_ATTRIBUTE_ID (0x0006) +#define ZCL_APPLICATION_ALLOWED_VENDOR_LIST_ATTRIBUTE_ID (0x0007) // Attribute ids for cluster: Account Login 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 f198a0ce5a77c1..a859b22d8a7e7c 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 @@ -42,26 +42,28 @@ namespace MainsVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -71,26 +73,28 @@ namespace MainsFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -100,26 +104,28 @@ namespace MainsAlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -129,26 +135,28 @@ namespace MainsVoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -158,26 +166,28 @@ namespace MainsVoltageMaxThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -187,26 +197,28 @@ namespace MainsVoltageDwellTrip { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -216,26 +228,28 @@ namespace BatteryVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -245,26 +259,28 @@ namespace BatteryPercentageRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -304,26 +320,28 @@ namespace BatterySize { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -333,26 +351,28 @@ namespace BatteryAhrRating { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -362,26 +382,28 @@ namespace BatteryQuantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -391,26 +413,28 @@ namespace BatteryRatedVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -420,26 +444,28 @@ namespace BatteryAlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -449,26 +475,28 @@ namespace BatteryVoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -478,26 +506,28 @@ namespace BatteryVoltageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -507,26 +537,28 @@ namespace BatteryVoltageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -536,26 +568,28 @@ namespace BatteryVoltageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -565,26 +599,28 @@ namespace BatteryPercentageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -594,26 +630,28 @@ namespace BatteryPercentageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -623,26 +661,28 @@ namespace BatteryPercentageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -652,26 +692,28 @@ namespace BatteryPercentageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -681,26 +723,28 @@ namespace BatteryAlarmState { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -710,26 +754,28 @@ namespace Battery2Voltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -739,26 +785,28 @@ namespace Battery2PercentageRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -798,26 +846,28 @@ namespace Battery2Size { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -827,26 +877,28 @@ namespace Battery2AhrRating { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -856,26 +908,28 @@ namespace Battery2Quantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -885,26 +939,28 @@ namespace Battery2RatedVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -914,26 +970,28 @@ namespace Battery2AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -943,26 +1001,28 @@ namespace Battery2VoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -972,26 +1032,28 @@ namespace Battery2VoltageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1001,26 +1063,28 @@ namespace Battery2VoltageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1030,26 +1094,28 @@ namespace Battery2VoltageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1059,26 +1125,28 @@ namespace Battery2PercentageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1088,26 +1156,28 @@ namespace Battery2PercentageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1117,26 +1187,28 @@ namespace Battery2PercentageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1146,26 +1218,28 @@ namespace Battery2PercentageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1175,26 +1249,28 @@ namespace Battery2AlarmState { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -1204,26 +1280,28 @@ namespace Battery3Voltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1233,26 +1311,28 @@ namespace Battery3PercentageRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1292,26 +1372,28 @@ namespace Battery3Size { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -1321,26 +1403,28 @@ namespace Battery3AhrRating { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1350,26 +1434,28 @@ namespace Battery3Quantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1379,26 +1465,28 @@ namespace Battery3RatedVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1408,26 +1496,28 @@ namespace Battery3AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1437,26 +1527,28 @@ namespace Battery3VoltageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1466,26 +1558,28 @@ namespace Battery3VoltageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1495,26 +1589,28 @@ namespace Battery3VoltageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1524,26 +1620,28 @@ namespace Battery3VoltageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1553,26 +1651,28 @@ namespace Battery3PercentageMinThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1582,26 +1682,28 @@ namespace Battery3PercentageThreshold1 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1611,26 +1713,28 @@ namespace Battery3PercentageThreshold2 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1640,26 +1744,28 @@ namespace Battery3PercentageThreshold3 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -1669,26 +1775,28 @@ namespace Battery3AlarmState { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -1698,26 +1806,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -1727,26 +1837,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1762,27 +1874,29 @@ namespace CurrentTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -1793,27 +1907,29 @@ namespace MinTempExperienced { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -1824,27 +1940,29 @@ namespace MaxTempExperienced { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -1855,27 +1973,29 @@ namespace OverTempTotalDwell { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -1886,27 +2006,29 @@ namespace DeviceTempAlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1917,27 +2039,29 @@ namespace LowTempThreshold { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -1948,27 +2072,29 @@ namespace HighTempThreshold { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -1979,27 +2105,29 @@ namespace LowTempDwellTripPoint { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } @@ -2010,27 +2138,29 @@ namespace HighTempDwellTripPoint { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } @@ -2041,27 +2171,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -2072,27 +2204,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2109,26 +2243,28 @@ namespace IdentifyTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2138,26 +2274,28 @@ namespace IdentifyType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2167,26 +2305,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -2196,26 +2336,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2231,26 +2373,28 @@ namespace NameSupport { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Groups::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Groups::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -2260,26 +2404,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Groups::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Groups::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -2289,26 +2435,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Groups::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Groups::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2324,26 +2472,28 @@ namespace SceneCount { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2353,26 +2503,28 @@ namespace CurrentScene { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2382,26 +2534,28 @@ namespace CurrentGroup { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2411,26 +2565,28 @@ namespace SceneValid { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2440,26 +2596,28 @@ namespace NameSupport { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -2469,26 +2627,28 @@ namespace LastConfiguredBy { EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_NODE_ID_ATTRIBUTE_TYPE); } @@ -2498,26 +2658,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -2527,26 +2689,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2562,26 +2726,28 @@ namespace OnOff { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2591,26 +2757,28 @@ namespace GlobalSceneControl { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2620,26 +2788,28 @@ namespace OnTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2649,26 +2819,28 @@ namespace OffWaitTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2678,26 +2850,28 @@ namespace StartUpOnOff { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2707,26 +2881,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -2736,26 +2912,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2771,26 +2949,28 @@ namespace SwitchType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2800,26 +2980,28 @@ namespace SwitchActions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2829,26 +3011,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -2858,26 +3042,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2893,26 +3079,28 @@ namespace CurrentLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2922,26 +3110,28 @@ namespace RemainingTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2951,26 +3141,28 @@ namespace MinLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2980,26 +3172,28 @@ namespace MaxLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -3009,26 +3203,28 @@ namespace CurrentFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3038,26 +3234,28 @@ namespace MinFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3067,26 +3265,28 @@ namespace MaxFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3096,26 +3296,28 @@ namespace Options { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -3125,26 +3327,28 @@ namespace OnOffTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3154,41 +3358,44 @@ namespace OnLevel { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -3204,41 +3411,44 @@ namespace OnTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -3254,41 +3464,44 @@ namespace OffTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -3304,41 +3517,44 @@ namespace DefaultMoveRate { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -3354,26 +3570,28 @@ namespace StartUpCurrentLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -3383,26 +3601,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -3412,26 +3632,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3447,26 +3669,28 @@ namespace AlarmCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Alarms::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Alarms::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3476,26 +3700,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Alarms::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Alarms::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -3505,26 +3731,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Alarms::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Alarms::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3540,26 +3768,28 @@ namespace Time { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } @@ -3569,26 +3799,28 @@ namespace TimeStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -3598,26 +3830,28 @@ namespace TimeZone { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -3627,26 +3861,28 @@ namespace DstStart { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3656,26 +3892,28 @@ namespace DstEnd { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3685,26 +3923,28 @@ namespace DstShift { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -3714,26 +3954,28 @@ namespace StandardTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3743,26 +3985,28 @@ namespace LocalTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3772,26 +4016,28 @@ namespace LastSetTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } @@ -3801,26 +4047,28 @@ namespace ValidUntilTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } @@ -3830,26 +4078,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -3859,26 +4109,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3984,26 +4236,28 @@ namespace OutOfService { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4013,26 +4267,28 @@ namespace Polarity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -4042,26 +4298,28 @@ namespace PresentValue { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4071,26 +4329,28 @@ namespace Reliability { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -4100,26 +4360,28 @@ namespace StatusFlags { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -4129,26 +4391,28 @@ namespace ApplicationType { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -4158,26 +4422,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -4187,26 +4453,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4222,26 +4490,28 @@ namespace TotalProfileNum { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -4251,26 +4521,28 @@ namespace MultipleScheduling { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4280,26 +4552,28 @@ namespace EnergyFormatting { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -4309,26 +4583,28 @@ namespace EnergyRemote { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -4338,26 +4614,28 @@ namespace ScheduleMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -4367,26 +4645,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -4396,26 +4676,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4431,26 +4713,28 @@ namespace StartTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4460,26 +4744,28 @@ namespace FinishTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4489,26 +4775,28 @@ namespace RemainingTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4518,26 +4806,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -4547,26 +4837,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4582,26 +4874,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -4611,26 +4905,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4646,26 +4942,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Descriptor::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Descriptor::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -4675,26 +4973,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Descriptor::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Descriptor::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4710,26 +5010,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Binding::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Binding::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -4739,26 +5041,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Binding::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Binding::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4774,26 +5078,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AccessControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AccessControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -4803,26 +5109,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AccessControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AccessControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4838,26 +5146,28 @@ namespace CheckInInterval { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -4867,26 +5177,28 @@ namespace LongPollInterval { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -4896,26 +5208,28 @@ namespace ShortPollInterval { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4925,26 +5239,28 @@ namespace FastPollTimeout { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -4954,26 +5270,28 @@ namespace CheckInIntervalMin { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -4983,26 +5301,28 @@ namespace LongPollIntervalMin { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -5012,26 +5332,28 @@ namespace FastPollTimeoutMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5041,26 +5363,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -5070,26 +5394,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5135,26 +5461,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedActions::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BridgedActions::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -5164,26 +5492,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedActions::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BridgedActions::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5199,26 +5529,28 @@ namespace InteractionModelVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5258,26 +5590,28 @@ namespace VendorID { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5317,26 +5651,28 @@ namespace ProductID { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5406,26 +5742,28 @@ namespace HardwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5465,26 +5803,28 @@ namespace SoftwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -5674,26 +6014,28 @@ namespace LocalConfigDisabled { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -5703,26 +6045,28 @@ namespace Reachable { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -5762,26 +6106,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -5791,26 +6137,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5826,27 +6174,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateProvider::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateProvider::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -5857,27 +6207,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateProvider::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateProvider::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5889,94 +6241,152 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace OtaSoftwareUpdateRequestor { namespace Attributes { -namespace DefaultOtaProvider { +namespace UpdatePossible { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - uint8_t zclString[16 + 1]; + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = - emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, zclString, sizeof(zclString)); + emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(length); + *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[16 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, zclString, - ZCL_OCTET_STRING_ATTRIBUTE_TYPE); + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); } -} // namespace DefaultOtaProvider +} // namespace UpdatePossible -namespace UpdatePossible { +namespace UpdateState { -EmberAfStatus Get(chip::EndpointId endpoint, bool * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, bool value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -} // namespace UpdatePossible +} // namespace UpdateState + +namespace UpdateStateProgress { + +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (Traits::IsNullValue(temp)) + { + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); + } + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace UpdateStateProgress namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -5987,27 +6397,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6023,27 +6435,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LocalizationConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LocalizationConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -6054,27 +6468,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LocalizationConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LocalizationConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6090,26 +6506,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LocalizationTimeFormat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LocalizationTimeFormat::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -6119,26 +6537,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LocalizationTimeFormat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LocalizationTimeFormat::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6154,26 +6574,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LocalizationUnit::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LocalizationUnit::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -6183,26 +6605,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LocalizationUnit::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LocalizationUnit::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6218,26 +6642,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSourceConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSourceConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -6247,26 +6673,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSourceConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSourceConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6282,26 +6710,28 @@ namespace Status { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6311,26 +6741,28 @@ namespace Order { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6370,26 +6802,28 @@ namespace WiredAssessedInputVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -6399,26 +6833,28 @@ namespace WiredAssessedInputFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -6428,26 +6864,28 @@ namespace WiredCurrentType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6457,26 +6895,28 @@ namespace WiredAssessedCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -6486,26 +6926,28 @@ namespace WiredNominalVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -6515,26 +6957,28 @@ namespace WiredMaximumCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -6544,26 +6988,28 @@ namespace WiredPresent { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -6573,26 +7019,28 @@ namespace BatteryVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -6602,26 +7050,28 @@ namespace BatteryPercentRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6631,26 +7081,28 @@ namespace BatteryTimeRemaining { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -6660,26 +7112,28 @@ namespace BatteryChargeLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6689,26 +7143,28 @@ namespace BatteryReplacementNeeded { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -6718,26 +7174,28 @@ namespace BatteryReplaceability { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6747,26 +7205,28 @@ namespace BatteryPresent { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -6806,26 +7266,28 @@ namespace BatteryCommonDesignation { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -6895,26 +7357,28 @@ namespace BatteryApprovedChemistry { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -6924,26 +7388,28 @@ namespace BatteryCapacity { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -6953,26 +7419,28 @@ namespace BatteryQuantity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6982,26 +7450,28 @@ namespace BatteryChargeState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -7011,26 +7481,28 @@ namespace BatteryTimeToFullCharge { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -7040,26 +7512,28 @@ namespace BatteryFunctionalWhileCharging { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -7069,26 +7543,28 @@ namespace BatteryChargingCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -7098,26 +7574,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -7127,26 +7605,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7162,26 +7642,28 @@ namespace Breadcrumb { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -7191,26 +7673,28 @@ namespace RegulatoryConfig { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -7220,26 +7704,28 @@ namespace LocationCapability { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -7249,26 +7735,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -7278,26 +7766,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7313,26 +7803,28 @@ namespace MaxNetworks { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7342,26 +7834,28 @@ namespace ScanMaxTimeSeconds { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7371,26 +7865,28 @@ namespace ConnectMaxTimeSeconds { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7400,26 +7896,28 @@ namespace InterfaceEnabled { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -7427,28 +7925,30 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) namespace LastNetworkingStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -7490,26 +7990,28 @@ namespace LastConnectErrorValue { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -7519,26 +8021,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -7548,26 +8052,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NetworkCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7583,26 +8089,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DiagnosticLogs::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DiagnosticLogs::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -7612,26 +8120,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DiagnosticLogs::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DiagnosticLogs::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7647,26 +8157,28 @@ namespace RebootCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7676,26 +8188,28 @@ namespace UpTime { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -7705,26 +8219,28 @@ namespace TotalOperationalHours { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -7734,26 +8250,28 @@ namespace BootReasons { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -7763,26 +8281,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -7792,26 +8312,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7827,26 +8349,28 @@ namespace CurrentHeapFree { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -7856,26 +8380,28 @@ namespace CurrentHeapUsed { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -7885,26 +8411,28 @@ namespace CurrentHeapHighWatermark { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -7914,26 +8442,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -7943,26 +8473,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7978,26 +8510,28 @@ namespace Channel { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8007,26 +8541,28 @@ namespace RoutingRole { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -8068,26 +8604,28 @@ namespace PanId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8097,26 +8635,28 @@ namespace ExtendedPanId { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -8158,26 +8698,28 @@ namespace OverrunCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -8187,26 +8729,28 @@ namespace PartitionId { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8216,26 +8760,28 @@ namespace Weighting { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -8245,26 +8791,28 @@ namespace DataVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -8274,26 +8822,28 @@ namespace StableDataVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -8303,26 +8853,28 @@ namespace LeaderRouterId { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -8332,26 +8884,28 @@ namespace DetachedRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8361,26 +8915,28 @@ namespace ChildRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8390,26 +8946,28 @@ namespace RouterRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8419,26 +8977,28 @@ namespace LeaderRoleCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8448,26 +9008,28 @@ namespace AttachAttemptCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8477,26 +9039,28 @@ namespace PartitionIdChangeCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8506,26 +9070,28 @@ namespace BetterPartitionAttachAttemptCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8535,26 +9101,28 @@ namespace ParentChangeCount { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -8564,26 +9132,28 @@ namespace TxTotalCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8593,26 +9163,28 @@ namespace TxUnicastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8622,26 +9194,28 @@ namespace TxBroadcastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8651,26 +9225,28 @@ namespace TxAckRequestedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8680,26 +9256,28 @@ namespace TxAckedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8709,26 +9287,28 @@ namespace TxNoAckRequestedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8738,26 +9318,28 @@ namespace TxDataCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8767,26 +9349,28 @@ namespace TxDataPollCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8796,26 +9380,28 @@ namespace TxBeaconCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8825,26 +9411,28 @@ namespace TxBeaconRequestCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8854,26 +9442,28 @@ namespace TxOtherCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8883,26 +9473,28 @@ namespace TxRetryCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8912,26 +9504,28 @@ namespace TxDirectMaxRetryExpiryCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8941,26 +9535,28 @@ namespace TxIndirectMaxRetryExpiryCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8970,26 +9566,28 @@ namespace TxErrCcaCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -8999,26 +9597,28 @@ namespace TxErrAbortCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9028,26 +9628,28 @@ namespace TxErrBusyChannelCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9057,26 +9659,28 @@ namespace RxTotalCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9086,26 +9690,28 @@ namespace RxUnicastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9115,26 +9721,28 @@ namespace RxBroadcastCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9144,26 +9752,28 @@ namespace RxDataCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9173,26 +9783,28 @@ namespace RxDataPollCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9202,26 +9814,28 @@ namespace RxBeaconCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9231,26 +9845,28 @@ namespace RxBeaconRequestCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9260,26 +9876,28 @@ namespace RxOtherCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9289,26 +9907,28 @@ namespace RxAddressFilteredCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9318,26 +9938,28 @@ namespace RxDestAddrFilteredCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9347,26 +9969,28 @@ namespace RxDuplicatedCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9376,26 +10000,28 @@ namespace RxErrNoFrameCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9405,26 +10031,28 @@ namespace RxErrUnknownNeighborCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9434,26 +10062,28 @@ namespace RxErrInvalidSrcAddrCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9463,26 +10093,28 @@ namespace RxErrSecCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9492,26 +10124,28 @@ namespace RxErrFcsCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9521,26 +10155,28 @@ namespace RxErrOtherCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9550,26 +10186,28 @@ namespace ActiveTimestamp { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -9579,26 +10217,28 @@ namespace PendingTimestamp { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -9608,26 +10248,28 @@ namespace Delay { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9669,26 +10311,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -9698,26 +10342,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -9765,26 +10411,28 @@ namespace SecurityType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -9794,26 +10442,28 @@ namespace WiFiVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -9823,26 +10473,28 @@ namespace ChannelNumber { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -9852,26 +10504,28 @@ namespace Rssi { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -9881,26 +10535,28 @@ namespace BeaconLostCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9910,26 +10566,28 @@ namespace BeaconRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9939,26 +10597,28 @@ namespace PacketMulticastRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9968,26 +10628,28 @@ namespace PacketMulticastTxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -9997,26 +10659,28 @@ namespace PacketUnicastRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -10026,26 +10690,28 @@ namespace PacketUnicastTxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -10055,26 +10721,28 @@ namespace CurrentMaxRate { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10084,26 +10752,28 @@ namespace OverrunCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10113,26 +10783,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -10142,26 +10814,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10177,27 +10851,29 @@ namespace PHYRate { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -10207,27 +10883,29 @@ namespace FullDuplex { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -10238,27 +10916,29 @@ namespace PacketRxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10268,27 +10948,29 @@ namespace PacketTxCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10298,27 +10980,29 @@ namespace TxErrCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10328,27 +11012,29 @@ namespace CollisionCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10358,27 +11044,29 @@ namespace OverrunCount { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10388,27 +11076,29 @@ namespace CarrierDetect { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -10419,27 +11109,29 @@ namespace TimeSinceReset { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -10449,27 +11141,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -10480,27 +11174,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10516,26 +11212,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -10545,26 +11243,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TimeSynchronization::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10610,26 +11310,28 @@ namespace VendorID { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10699,26 +11401,28 @@ namespace HardwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10758,26 +11462,28 @@ namespace SoftwareVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -10968,26 +11674,28 @@ namespace Reachable { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -11027,26 +11735,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11056,26 +11766,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11091,26 +11803,28 @@ namespace NumberOfPositions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -11120,26 +11834,28 @@ namespace CurrentPosition { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -11149,26 +11865,28 @@ namespace MultiPressMax { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -11178,26 +11896,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11207,26 +11927,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11242,27 +11964,29 @@ namespace WindowStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -11272,27 +11996,29 @@ namespace AdminFabricIndex { EmberAfStatus Get(chip::EndpointId endpoint, chip::FabricIndex * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::FabricIndex value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, writable, ZCL_FABRIC_IDX_ATTRIBUTE_TYPE); } @@ -11303,27 +12029,29 @@ namespace AdminVendorId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11333,27 +12061,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11364,27 +12094,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AdministratorCommissioning::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11400,26 +12132,28 @@ namespace SupportedFabrics { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -11429,26 +12163,28 @@ namespace CommissionedFabrics { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -11458,26 +12194,28 @@ namespace CurrentFabricIndex { EmberAfStatus Get(chip::EndpointId endpoint, chip::FabricIndex * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::FabricIndex value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, writable, ZCL_FABRIC_IDX_ATTRIBUTE_TYPE); } @@ -11487,26 +12225,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11516,26 +12256,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11547,30 +12289,94 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace GroupKeyManagement { namespace Attributes { +namespace MaxGroupsPerFabric { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace MaxGroupsPerFabric + +namespace MaxGroupKeysPerFabric { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace MaxGroupKeysPerFabric + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11580,26 +12386,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::GroupKeyManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11615,26 +12423,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FixedLabel::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FixedLabel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11644,26 +12454,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FixedLabel::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FixedLabel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11679,26 +12491,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::UserLabel::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::UserLabel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11708,26 +12522,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::UserLabel::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::UserLabel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11743,26 +12559,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ProxyConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ProxyConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11772,26 +12590,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ProxyConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ProxyConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11807,26 +12627,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ProxyDiscovery::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ProxyDiscovery::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11836,26 +12658,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ProxyDiscovery::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ProxyDiscovery::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11871,26 +12695,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ProxyValid::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ProxyValid::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11900,26 +12726,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ProxyValid::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ProxyValid::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11935,26 +12763,28 @@ namespace StateValue { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BooleanState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BooleanState::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -11964,26 +12794,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BooleanState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BooleanState::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -11993,26 +12825,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BooleanState::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BooleanState::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12028,26 +12862,28 @@ namespace CurrentMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -12057,26 +12893,28 @@ namespace OnMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -12086,26 +12924,28 @@ namespace StartUpMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -12145,26 +12985,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -12174,26 +13016,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12209,26 +13053,28 @@ namespace PhysicalClosedLimit { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12238,26 +13084,28 @@ namespace MotorStepSize { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -12267,26 +13115,28 @@ namespace Status { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -12296,26 +13146,28 @@ namespace ClosedLimit { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12325,26 +13177,28 @@ namespace Mode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -12354,26 +13208,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -12383,26 +13239,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12416,43 +13274,47 @@ namespace Attributes { namespace LockState { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockState value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -12466,28 +13328,30 @@ EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable namespace LockType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockType * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockType value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -12497,26 +13361,28 @@ namespace ActuatorEnabled { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -12524,43 +13390,47 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) namespace DoorState { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlDoorState value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -12576,26 +13446,28 @@ namespace DoorOpenEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -12605,26 +13477,28 @@ namespace DoorClosedEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -12634,26 +13508,28 @@ namespace OpenPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12663,26 +13539,28 @@ namespace NumberOfLogRecordsSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12692,26 +13570,28 @@ namespace NumberOfTotalUsersSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12721,26 +13601,28 @@ namespace NumberOfPINUsersSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12750,26 +13632,28 @@ namespace NumberOfRFIDUsersSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12779,26 +13663,28 @@ namespace NumberOfWeekDaySchedulesSupportedPerUser { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12808,26 +13694,28 @@ namespace NumberOfYearDaySchedulesSupportedPerUser { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12837,26 +13725,28 @@ namespace NumberOfHolidaySchedulesSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12866,26 +13756,28 @@ namespace MaxPINCodeLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -12895,26 +13787,28 @@ namespace MinPINCodeLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -12924,26 +13818,28 @@ namespace MaxRFIDCodeLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -12953,26 +13849,28 @@ namespace MinRFIDCodeLength { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -12982,26 +13880,28 @@ namespace CredentialRulesSupport { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -13011,26 +13911,28 @@ namespace EnableLogging { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -13070,26 +13972,28 @@ namespace LEDSettings { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -13099,26 +14003,28 @@ namespace AutoRelockTime { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -13128,26 +14034,28 @@ namespace SoundVolume { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -13155,28 +14063,30 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace OperatingMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlOperatingMode * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlOperatingMode value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -13186,26 +14096,28 @@ namespace SupportedOperatingModes { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -13215,26 +14127,28 @@ namespace DefaultConfigurationRegister { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -13244,26 +14158,28 @@ namespace EnableLocalProgramming { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -13273,26 +14189,28 @@ namespace EnableOneTouchLocking { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -13302,26 +14220,28 @@ namespace EnableInsideStatusLED { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -13331,26 +14251,28 @@ namespace EnablePrivacyModeButton { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -13360,26 +14282,28 @@ namespace LocalProgrammingFeatures { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -13389,26 +14313,28 @@ namespace WrongCodeEntryLimit { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -13418,26 +14344,28 @@ namespace UserCodeTemporaryDisableTime { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -13447,26 +14375,28 @@ namespace SendPINOverTheAir { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -13476,26 +14406,28 @@ namespace RequirePINforRemoteOperation { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -13505,26 +14437,28 @@ namespace ExpiringUserTimeout { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13534,26 +14468,28 @@ namespace AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -13563,26 +14499,28 @@ namespace KeypadOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -13592,26 +14530,28 @@ namespace RemoteOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -13621,26 +14561,28 @@ namespace ManualOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -13650,26 +14592,28 @@ namespace RFIDOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -13679,26 +14623,28 @@ namespace KeypadProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -13708,26 +14654,28 @@ namespace RemoteProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -13737,26 +14685,28 @@ namespace RFIDProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -13766,26 +14716,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -13795,26 +14747,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13830,26 +14784,28 @@ namespace Type { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -13859,26 +14815,28 @@ namespace PhysicalClosedLimitLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13888,26 +14846,28 @@ namespace PhysicalClosedLimitTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -13915,86 +14875,136 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace CurrentPositionLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace CurrentPositionLift namespace CurrentPositionTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = NumericAttributeTraits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + } // namespace CurrentPositionTilt namespace NumberOfActuationsLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -14004,26 +15014,28 @@ namespace NumberOfActuationsTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -14033,26 +15045,28 @@ namespace ConfigStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -14060,58 +15074,106 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace CurrentPositionLiftPercentage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = NumericAttributeTraits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); } } // namespace CurrentPositionLiftPercentage namespace CurrentPositionTiltPercentage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = NumericAttributeTraits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); } } // namespace CurrentPositionTiltPercentage @@ -14120,26 +15182,28 @@ namespace OperationalStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -14147,58 +15211,106 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace TargetPositionLiftPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = NumericAttributeTraits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent100ths value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); } } // namespace TargetPositionLiftPercent100ths namespace TargetPositionTiltPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = NumericAttributeTraits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent100ths value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE); +} + +EmberAfStatus SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE); +} + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); } } // namespace TargetPositionTiltPercent100ths @@ -14207,26 +15319,28 @@ namespace EndProductType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -14234,378 +15348,291 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace CurrentPositionLiftPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = NumericAttributeTraits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) -{ - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace CurrentPositionLiftPercent100ths - -namespace CurrentPositionTiltPercent100ths { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) -{ - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + else { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = NumericAttributeTraits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent100ths value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE); } -} // namespace CurrentPositionTiltPercent100ths - -namespace InstalledOpenLimitLift { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = NumericAttributeTraits::StorageToWorking(temp); - return status; + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + return SetNull(endpoint); } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + + return Set(endpoint, value.Value()); } -} // namespace InstalledOpenLimitLift +} // namespace CurrentPositionLiftPercent100ths -namespace InstalledClosedLimitLift { +namespace CurrentPositionTiltPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (Traits::IsNullValue(temp)) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + value.SetNull(); + } + else + { + value.SetNonNull() = Traits::StorageToWorking(temp); } - *value = NumericAttributeTraits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent100ths value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE); } -} // namespace InstalledClosedLimitLift - -namespace InstalledOpenLimitTilt { - -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = NumericAttributeTraits::StorageToWorking(temp); - return status; + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_PERCENT100THS_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) + +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + if (value.IsNull()) { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + return SetNull(endpoint); } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + + return Set(endpoint, value.Value()); } -} // namespace InstalledOpenLimitTilt +} // namespace CurrentPositionTiltPercent100ths -namespace InstalledClosedLimitTilt { +namespace InstalledOpenLimitLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace InstalledClosedLimitTilt +} // namespace InstalledOpenLimitLift -namespace VelocityLift { +namespace InstalledClosedLimitLift { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace VelocityLift +} // namespace InstalledClosedLimitLift -namespace AccelerationTimeLift { +namespace InstalledOpenLimitTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace AccelerationTimeLift +} // namespace InstalledOpenLimitTilt -namespace DecelerationTimeLift { +namespace InstalledClosedLimitTilt { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace DecelerationTimeLift +} // namespace InstalledClosedLimitTilt namespace Mode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Mode -namespace IntermediateSetpointsLift { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) -{ - uint8_t zclString[254 + 1]; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 254); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) -{ - static_assert(254 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[254 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -} // namespace IntermediateSetpointsLift - -namespace IntermediateSetpointsTilt { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) -{ - uint8_t zclString[254 + 1]; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 254); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) -{ - static_assert(254 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[254 + 1]; - emberAfCopyInt8u(zclString, 0, static_cast(value.size())); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -} // namespace IntermediateSetpointsTilt - namespace SafetyStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -14615,26 +15642,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -14644,26 +15673,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -14679,26 +15710,28 @@ namespace BarrierMovingState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -14708,26 +15741,28 @@ namespace BarrierSafetyStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -14737,26 +15772,28 @@ namespace BarrierCapabilities { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -14766,26 +15803,28 @@ namespace BarrierOpenEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -14795,26 +15834,28 @@ namespace BarrierCloseEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -14824,26 +15865,28 @@ namespace BarrierCommandOpenEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -14853,26 +15896,28 @@ namespace BarrierCommandCloseEvents { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -14882,26 +15927,28 @@ namespace BarrierOpenPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -14911,26 +15958,28 @@ namespace BarrierClosePeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -14940,26 +15989,28 @@ namespace BarrierPosition { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -14969,26 +16020,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -14998,26 +16051,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15033,27 +16088,29 @@ namespace MaxPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -15064,27 +16121,29 @@ namespace MaxSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15095,27 +16154,29 @@ namespace MaxFlow { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15126,27 +16187,29 @@ namespace MinConstPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -15157,27 +16220,29 @@ namespace MaxConstPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -15188,27 +16253,29 @@ namespace MinCompPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -15219,27 +16286,29 @@ namespace MaxCompPressure { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -15250,27 +16319,29 @@ namespace MinConstSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15281,27 +16352,29 @@ namespace MaxConstSpeed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15312,27 +16385,29 @@ namespace MinConstFlow { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15343,27 +16418,29 @@ namespace MaxConstFlow { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15374,27 +16451,29 @@ namespace MinConstTemp { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -15405,27 +16484,29 @@ namespace MaxConstTemp { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -15436,27 +16517,29 @@ namespace PumpStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -15467,27 +16550,29 @@ namespace EffectiveOperationMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -15497,27 +16582,29 @@ namespace EffectiveControlMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -15527,27 +16614,29 @@ namespace Capacity { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -15558,27 +16647,29 @@ namespace Speed { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15589,44 +16680,47 @@ namespace LifetimeRunningHours { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits>::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits>::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits>::StorageType value; - NumericAttributeTraits>::SetNull(value); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -15642,27 +16736,29 @@ namespace Power { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } @@ -15673,44 +16769,47 @@ namespace LifetimeEnergyConsumed { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -15726,27 +16825,29 @@ namespace OperationMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -15756,27 +16857,29 @@ namespace ControlMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -15786,27 +16889,29 @@ namespace AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -15817,27 +16922,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -15848,27 +16955,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -15885,26 +16994,28 @@ namespace LocalTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -15914,26 +17025,28 @@ namespace OutdoorTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -15943,26 +17056,28 @@ namespace Occupancy { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -15972,26 +17087,28 @@ namespace AbsMinHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16001,26 +17118,28 @@ namespace AbsMaxHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16030,26 +17149,28 @@ namespace AbsMinCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16059,26 +17180,28 @@ namespace AbsMaxCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16088,26 +17211,28 @@ namespace PiCoolingDemand { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -16117,26 +17242,28 @@ namespace PiHeatingDemand { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -16146,26 +17273,28 @@ namespace HvacSystemTypeConfiguration { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -16175,26 +17304,28 @@ namespace LocalTemperatureCalibration { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -16204,26 +17335,28 @@ namespace OccupiedCoolingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16233,26 +17366,28 @@ namespace OccupiedHeatingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16262,26 +17397,28 @@ namespace UnoccupiedCoolingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16291,26 +17428,28 @@ namespace UnoccupiedHeatingSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16320,26 +17459,28 @@ namespace MinHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16349,26 +17490,28 @@ namespace MaxHeatSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16378,26 +17521,28 @@ namespace MinCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16407,26 +17552,28 @@ namespace MaxCoolSetpointLimit { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16436,26 +17583,28 @@ namespace MinSetpointDeadBand { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -16465,26 +17614,28 @@ namespace RemoteSensing { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -16494,26 +17645,28 @@ namespace ControlSequenceOfOperation { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -16523,26 +17676,28 @@ namespace SystemMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -16552,26 +17707,28 @@ namespace AlarmMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -16581,26 +17738,28 @@ namespace ThermostatRunningMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -16610,26 +17769,28 @@ namespace StartOfWeek { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -16639,26 +17800,28 @@ namespace NumberOfWeeklyTransitions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -16668,26 +17831,28 @@ namespace NumberOfDailyTransitions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -16697,26 +17862,28 @@ namespace TemperatureSetpointHold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -16726,26 +17893,28 @@ namespace TemperatureSetpointHoldDuration { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -16755,26 +17924,28 @@ namespace ThermostatProgrammingOperationMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -16784,26 +17955,28 @@ namespace ThermostatRunningState { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -16813,26 +17986,28 @@ namespace SetpointChangeSource { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -16842,26 +18017,28 @@ namespace SetpointChangeAmount { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -16871,26 +18048,28 @@ namespace SetpointChangeSourceTimestamp { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } @@ -16900,26 +18079,28 @@ namespace AcType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -16929,26 +18110,28 @@ namespace AcCapacity { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -16958,26 +18141,28 @@ namespace AcRefrigerantType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -16987,26 +18172,28 @@ namespace AcCompressor { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17016,26 +18203,28 @@ namespace AcErrorCode { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -17045,26 +18234,28 @@ namespace AcLouverPosition { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17074,26 +18265,28 @@ namespace AcCoilTemperature { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -17103,26 +18296,28 @@ namespace AcCapacityFormat { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17132,26 +18327,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -17161,26 +18358,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -17196,26 +18395,28 @@ namespace FanMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17225,26 +18426,28 @@ namespace FanModeSequence { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17254,26 +18457,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -17283,26 +18488,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -17318,26 +18525,28 @@ namespace RelativeHumidity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -17347,26 +18556,28 @@ namespace DehumidificationCooling { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -17376,26 +18587,28 @@ namespace RhDehumidificationSetpoint { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -17405,26 +18618,28 @@ namespace RelativeHumidityMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17434,26 +18649,28 @@ namespace DehumidificationLockout { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17463,26 +18680,28 @@ namespace DehumidificationHysteresis { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -17492,26 +18711,28 @@ namespace DehumidificationMaxCool { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -17521,26 +18742,28 @@ namespace RelativeHumidityDisplay { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17550,26 +18773,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -17579,26 +18804,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -17614,27 +18841,29 @@ namespace TemperatureDisplayMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17645,27 +18874,29 @@ namespace KeypadLockout { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17676,27 +18907,29 @@ namespace ScheduleProgrammingVisibility { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17707,27 +18940,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -17738,27 +18973,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -17775,26 +19012,28 @@ namespace CurrentHue { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -17804,26 +19043,28 @@ namespace CurrentSaturation { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -17833,26 +19074,28 @@ namespace RemainingTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -17862,26 +19105,28 @@ namespace CurrentX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -17891,26 +19136,28 @@ namespace CurrentY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -17920,26 +19167,28 @@ namespace DriftCompensation { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -17979,26 +19228,28 @@ namespace ColorTemperature { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18008,26 +19259,28 @@ namespace ColorMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -18037,26 +19290,28 @@ namespace ColorControlOptions { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -18066,26 +19321,28 @@ namespace NumberOfPrimaries { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -18095,26 +19352,28 @@ namespace Primary1X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18124,26 +19383,28 @@ namespace Primary1Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18153,26 +19414,28 @@ namespace Primary1Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -18182,26 +19445,28 @@ namespace Primary2X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18211,26 +19476,28 @@ namespace Primary2Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18240,26 +19507,28 @@ namespace Primary2Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -18269,26 +19538,28 @@ namespace Primary3X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18298,26 +19569,28 @@ namespace Primary3Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18327,26 +19600,28 @@ namespace Primary3Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -18356,26 +19631,28 @@ namespace Primary4X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18385,26 +19662,28 @@ namespace Primary4Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18414,26 +19693,28 @@ namespace Primary4Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -18443,26 +19724,28 @@ namespace Primary5X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18472,26 +19755,28 @@ namespace Primary5Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18501,26 +19786,28 @@ namespace Primary5Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -18530,26 +19817,28 @@ namespace Primary6X { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18559,26 +19848,28 @@ namespace Primary6Y { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18588,26 +19879,28 @@ namespace Primary6Intensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -18617,26 +19910,28 @@ namespace WhitePointX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18646,26 +19941,28 @@ namespace WhitePointY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18675,26 +19972,28 @@ namespace ColorPointRX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18704,26 +20003,28 @@ namespace ColorPointRY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18733,26 +20034,28 @@ namespace ColorPointRIntensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -18762,26 +20065,28 @@ namespace ColorPointGX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18791,26 +20096,28 @@ namespace ColorPointGY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18820,26 +20127,28 @@ namespace ColorPointGIntensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -18849,26 +20158,28 @@ namespace ColorPointBX { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18878,26 +20189,28 @@ namespace ColorPointBY { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18907,26 +20220,28 @@ namespace ColorPointBIntensity { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -18936,26 +20251,28 @@ namespace EnhancedCurrentHue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -18965,26 +20282,28 @@ namespace EnhancedColorMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -18994,26 +20313,28 @@ namespace ColorLoopActive { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -19023,26 +20344,28 @@ namespace ColorLoopDirection { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -19052,26 +20375,28 @@ namespace ColorLoopTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -19081,26 +20406,28 @@ namespace ColorLoopStartEnhancedHue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -19110,26 +20437,28 @@ namespace ColorLoopStoredEnhancedHue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -19139,26 +20468,28 @@ namespace ColorCapabilities { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -19168,26 +20499,28 @@ namespace ColorTempPhysicalMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -19197,26 +20530,28 @@ namespace ColorTempPhysicalMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -19226,26 +20561,28 @@ namespace CoupleColorTempToLevelMinMireds { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -19255,26 +20592,28 @@ namespace StartUpColorTemperatureMireds { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -19284,26 +20623,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -19313,26 +20654,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -19348,26 +20691,28 @@ namespace PhysicalMinLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -19377,26 +20722,28 @@ namespace PhysicalMaxLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -19406,26 +20753,28 @@ namespace BallastStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -19435,26 +20784,28 @@ namespace MinLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -19464,26 +20815,28 @@ namespace MaxLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -19493,26 +20846,28 @@ namespace PowerOnLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -19522,26 +20877,28 @@ namespace PowerOnFadeTime { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -19551,26 +20908,28 @@ namespace IntrinsicBallastFactor { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -19580,26 +20939,28 @@ namespace BallastFactorAdjustment { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -19609,26 +20970,28 @@ namespace LampQuality { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -19700,26 +21063,28 @@ namespace LampRatedHours { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } @@ -19729,26 +21094,28 @@ namespace LampBurnHours { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } @@ -19758,26 +21125,28 @@ namespace LampAlarmMode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -19787,26 +21156,28 @@ namespace LampBurnHoursTripPoint { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } @@ -19816,26 +21187,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -19845,26 +21218,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -19880,41 +21255,44 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -19930,41 +21308,44 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -19980,41 +21361,44 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -20030,26 +21414,28 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20059,41 +21445,44 @@ namespace LightSensorType { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -20109,26 +21498,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -20138,26 +21529,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20173,26 +21566,28 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20202,26 +21597,28 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20231,26 +21628,28 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20260,26 +21659,28 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20289,26 +21690,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -20318,26 +21721,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20353,26 +21758,28 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20382,26 +21789,28 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20411,26 +21820,28 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20440,26 +21851,28 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20469,26 +21882,28 @@ namespace ScaledValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20498,26 +21913,28 @@ namespace MinScaledValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20527,26 +21944,28 @@ namespace MaxScaledValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20556,26 +21975,28 @@ namespace ScaledTolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20585,26 +22006,28 @@ namespace Scale { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -20614,26 +22037,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -20643,26 +22068,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20678,26 +22105,28 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20707,26 +22136,28 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20736,26 +22167,28 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -20765,26 +22198,28 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20794,26 +22229,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -20823,26 +22260,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20858,27 +22297,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20889,27 +22330,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20920,27 +22363,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20951,27 +22396,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -20982,27 +22429,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -21013,27 +22462,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -21050,26 +22501,28 @@ namespace Occupancy { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -21079,26 +22532,28 @@ namespace OccupancySensorType { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -21108,26 +22563,28 @@ namespace OccupancySensorTypeBitmap { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -21137,26 +22594,28 @@ namespace PirOccupiedToUnoccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -21166,26 +22625,28 @@ namespace PirUnoccupiedToOccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -21195,26 +22656,28 @@ namespace PirUnoccupiedToOccupiedThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -21224,26 +22687,28 @@ namespace UltrasonicOccupiedToUnoccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -21253,26 +22718,28 @@ namespace UltrasonicUnoccupiedToOccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -21282,26 +22749,28 @@ namespace UltrasonicUnoccupiedToOccupiedThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -21311,26 +22780,28 @@ namespace PhysicalContactOccupiedToUnoccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -21340,26 +22811,28 @@ namespace PhysicalContactUnoccupiedToOccupiedDelay { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -21369,26 +22842,28 @@ namespace PhysicalContactUnoccupiedToOccupiedThreshold { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -21398,26 +22873,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -21427,26 +22904,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -21462,27 +22941,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21493,27 +22974,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21524,27 +23007,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21555,27 +23040,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21586,27 +23073,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -21617,27 +23106,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -21654,27 +23145,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21685,27 +23178,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21716,27 +23211,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21747,27 +23244,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21778,27 +23277,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -21809,27 +23310,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -21846,27 +23349,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21877,27 +23382,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21908,27 +23415,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21939,27 +23448,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -21970,27 +23481,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -22001,27 +23514,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -22038,27 +23553,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22069,27 +23586,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22100,27 +23619,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22131,27 +23652,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22162,27 +23685,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -22193,27 +23718,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -22230,27 +23757,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22261,27 +23790,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22292,27 +23823,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22323,27 +23856,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22354,27 +23889,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -22385,27 +23922,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -22422,27 +23961,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22453,27 +23994,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22484,27 +24027,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22515,27 +24060,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22546,27 +24093,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -22577,27 +24126,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -22614,27 +24165,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22645,27 +24198,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22676,27 +24231,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22707,27 +24264,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22738,27 +24297,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -22769,27 +24330,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -22806,27 +24369,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22837,27 +24402,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22868,27 +24435,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22899,27 +24468,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -22930,27 +24501,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -22961,27 +24534,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -22998,27 +24573,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23029,27 +24606,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23060,27 +24639,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23091,27 +24672,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23122,27 +24705,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -23153,27 +24738,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -23190,27 +24777,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23221,27 +24810,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23252,27 +24843,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23283,27 +24876,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23314,27 +24909,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -23345,27 +24942,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -23382,27 +24981,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23413,27 +25014,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23444,27 +25047,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23475,27 +25080,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23506,27 +25113,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -23537,27 +25146,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -23574,27 +25185,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23605,27 +25218,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23636,27 +25251,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23667,27 +25284,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23698,27 +25317,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -23729,27 +25350,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -23766,27 +25389,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23797,27 +25422,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23828,27 +25455,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23859,27 +25488,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23890,27 +25521,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -23921,27 +25554,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -23958,27 +25593,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -23989,27 +25626,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24020,27 +25659,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24051,27 +25692,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24082,27 +25725,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -24113,27 +25758,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -24150,27 +25797,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24181,27 +25830,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24212,27 +25863,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24243,27 +25896,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24274,27 +25929,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -24305,27 +25962,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -24342,27 +26001,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24373,27 +26034,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24404,27 +26067,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24435,27 +26100,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24466,27 +26133,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -24497,27 +26166,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -24534,27 +26205,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24565,27 +26238,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24596,27 +26271,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24627,27 +26304,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24658,27 +26337,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -24689,27 +26370,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -24726,27 +26409,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24757,27 +26442,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24788,27 +26475,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24819,27 +26508,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24850,27 +26541,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -24881,27 +26574,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -24918,27 +26613,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24949,27 +26646,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -24980,27 +26679,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25011,27 +26712,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25042,27 +26745,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -25073,27 +26778,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -25110,27 +26817,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25141,27 +26850,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25172,27 +26883,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25203,27 +26916,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25234,27 +26949,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -25265,27 +26982,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -25302,27 +27021,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25333,27 +27054,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25364,27 +27087,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25395,27 +27120,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25426,27 +27153,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -25457,27 +27186,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -25494,27 +27225,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25525,27 +27258,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25556,27 +27291,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25587,27 +27324,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25618,27 +27357,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -25649,27 +27390,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -25686,27 +27429,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25717,27 +27462,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25748,27 +27495,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25779,27 +27528,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25810,27 +27561,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -25841,27 +27594,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -25878,27 +27633,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25909,27 +27666,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25940,27 +27699,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -25971,27 +27732,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26002,27 +27765,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -26033,27 +27798,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -26070,27 +27837,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26101,27 +27870,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26132,27 +27903,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26163,27 +27936,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26194,27 +27969,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -26225,27 +28002,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -26262,27 +28041,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26293,27 +28074,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26324,27 +28107,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26355,27 +28140,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26386,27 +28173,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -26417,27 +28206,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -26454,27 +28245,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26485,27 +28278,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26516,27 +28311,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26547,27 +28344,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26578,27 +28377,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -26609,27 +28410,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -26646,27 +28449,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26677,27 +28482,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26708,27 +28515,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26739,27 +28548,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26770,27 +28581,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -26801,27 +28614,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -26838,27 +28653,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26869,27 +28686,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26900,27 +28719,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26931,27 +28752,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -26962,27 +28785,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -26993,27 +28818,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -27030,27 +28857,29 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -27061,27 +28890,29 @@ namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -27092,27 +28923,29 @@ namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -27123,27 +28956,29 @@ namespace Tolerance { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -27154,27 +28989,29 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -27185,27 +29022,29 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -27222,26 +29061,28 @@ namespace ZoneState { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -27251,26 +29092,28 @@ namespace ZoneType { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE); } @@ -27280,26 +29123,28 @@ namespace ZoneStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -27309,26 +29154,28 @@ namespace IasCieAddress { EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_NODE_ID_ATTRIBUTE_TYPE); } @@ -27338,26 +29185,28 @@ namespace ZoneId { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -27367,26 +29216,28 @@ namespace NumberOfZoneSensitivityLevelsSupported { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -27396,26 +29247,28 @@ namespace CurrentZoneSensitivityLevel { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -27425,26 +29278,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -27454,26 +29309,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -27489,26 +29346,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasAce::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasAce::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -27518,26 +29377,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasAce::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasAce::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -27553,26 +29414,28 @@ namespace MaxDuration { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasWd::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasWd::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -27582,26 +29445,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasWd::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasWd::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -27611,26 +29476,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::IasWd::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::IasWd::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -27676,26 +29543,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WakeOnLan::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -27705,26 +29574,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WakeOnLan::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::WakeOnLan::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -27733,34 +29604,36 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace WakeOnLan -namespace TvChannel { +namespace Channel { namespace Attributes { namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TvChannel::Id, Id, readable, sizeof(temp)); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Channel::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::TvChannel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -27769,33 +29642,35 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TvChannel::Id, Id, readable, sizeof(temp)); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Channel::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::TvChannel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::Channel::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace TvChannel +} // namespace Channel namespace TargetNavigator { namespace Attributes { @@ -27804,26 +29679,28 @@ namespace CurrentNavigatorTarget { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -27833,26 +29710,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -27862,26 +29741,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -27895,28 +29776,30 @@ namespace Attributes { namespace PlaybackState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -27926,27 +29809,29 @@ namespace StartTime { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE); } } // namespace StartTime @@ -27955,26 +29840,28 @@ namespace Duration { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -27984,26 +29871,28 @@ namespace PlaybackSpeed { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -28013,26 +29902,28 @@ namespace SeekRangeEnd { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -28042,26 +29933,28 @@ namespace SeekRangeStart { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -28071,26 +29964,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -28100,26 +29995,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28135,26 +30032,28 @@ namespace CurrentMediaInput { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -28164,26 +30063,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -28193,26 +30094,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MediaInput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MediaInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28228,26 +30131,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LowPower::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -28257,26 +30162,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::LowPower::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::LowPower::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28292,26 +30199,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::KeypadInput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -28321,26 +30230,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::KeypadInput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::KeypadInput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28356,26 +30267,28 @@ namespace SupportedStreamingProtocols { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -28385,26 +30298,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -28414,26 +30329,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ContentLauncher::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ContentLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28449,26 +30366,28 @@ namespace CurrentAudioOutput { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -28478,26 +30397,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -28507,26 +30428,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28542,26 +30465,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -28571,26 +30496,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28636,26 +30563,28 @@ namespace VendorId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28695,26 +30624,28 @@ namespace ProductId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28722,28 +30653,30 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace ApplicationStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -28783,26 +30716,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -28812,26 +30747,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28847,26 +30784,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AccountLogin::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -28876,26 +30815,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::AccountLogin::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::AccountLogin::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -28911,26 +30852,28 @@ namespace Boolean { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -28940,26 +30883,28 @@ namespace Bitmap8 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -28969,26 +30914,28 @@ namespace Bitmap16 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -28998,26 +30945,28 @@ namespace Bitmap32 { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -29027,26 +30976,28 @@ namespace Bitmap64 { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP64_ATTRIBUTE_TYPE); } @@ -29056,26 +31007,28 @@ namespace Int8u { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -29085,26 +31038,28 @@ namespace Int16u { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -29114,26 +31069,28 @@ namespace Int24u { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } @@ -29143,26 +31100,28 @@ namespace Int32u { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -29172,26 +31131,28 @@ namespace Int40u { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT40U_ATTRIBUTE_TYPE); } @@ -29201,26 +31162,28 @@ namespace Int48u { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT48U_ATTRIBUTE_TYPE); } @@ -29230,26 +31193,28 @@ namespace Int56u { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT56U_ATTRIBUTE_TYPE); } @@ -29259,26 +31224,28 @@ namespace Int64u { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -29288,26 +31255,28 @@ namespace Int8s { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -29317,26 +31286,28 @@ namespace Int16s { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -29346,26 +31317,28 @@ namespace Int24s { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT24S_ATTRIBUTE_TYPE); } @@ -29375,26 +31348,28 @@ namespace Int32s { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -29404,26 +31379,28 @@ namespace Int40s { EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT40S_ATTRIBUTE_TYPE); } @@ -29433,26 +31410,28 @@ namespace Int48s { EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT48S_ATTRIBUTE_TYPE); } @@ -29462,26 +31441,28 @@ namespace Int56s { EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT56S_ATTRIBUTE_TYPE); } @@ -29491,26 +31472,28 @@ namespace Int64s { EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); } @@ -29520,26 +31503,28 @@ namespace Enum8 { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -29549,26 +31534,28 @@ namespace Enum16 { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE); } @@ -29578,26 +31565,28 @@ namespace FloatSingle { EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -29607,26 +31596,28 @@ namespace FloatDouble { EmberAfStatus Get(chip::EndpointId endpoint, double * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, double value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_DOUBLE_ATTRIBUTE_TYPE); } @@ -29756,26 +31747,28 @@ namespace EpochUs { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_EPOCH_US_ATTRIBUTE_TYPE); } @@ -29785,26 +31778,28 @@ namespace EpochS { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } @@ -29814,26 +31809,28 @@ namespace VendorId { EmberAfStatus Get(chip::EndpointId endpoint, chip::VendorId * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_VENDOR_ID_ATTRIBUTE_TYPE); } @@ -29841,28 +31838,30 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value) namespace EnumAttr { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::TestCluster::SimpleEnum * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::TestCluster::SimpleEnum value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -29872,26 +31871,28 @@ namespace RangeRestrictedInt8u { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -29901,26 +31902,28 @@ namespace RangeRestrictedInt8s { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -29930,26 +31933,28 @@ namespace RangeRestrictedInt16u { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -29959,26 +31964,28 @@ namespace RangeRestrictedInt16s { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -29988,26 +31995,28 @@ namespace TimedWriteBoolean { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -30017,26 +32026,28 @@ namespace Unsupported { EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -30046,41 +32057,44 @@ namespace NullableBoolean { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30096,41 +32110,44 @@ namespace NullableBitmap8 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30146,41 +32163,44 @@ namespace NullableBitmap16 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30196,41 +32216,44 @@ namespace NullableBitmap32 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30246,41 +32269,44 @@ namespace NullableBitmap64 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP64_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP64_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30296,41 +32322,44 @@ namespace NullableInt8u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30346,41 +32375,44 @@ namespace NullableInt16u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30396,41 +32428,44 @@ namespace NullableInt24u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits>::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits>::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits>::StorageType value; - NumericAttributeTraits>::SetNull(value); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT24U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30446,41 +32481,44 @@ namespace NullableInt32u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30496,41 +32534,44 @@ namespace NullableInt40u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits>::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits>::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT40U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits>::StorageType value; - NumericAttributeTraits>::SetNull(value); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT40U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30546,41 +32587,44 @@ namespace NullableInt48u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits>::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits>::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT48U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits>::StorageType value; - NumericAttributeTraits>::SetNull(value); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT48U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30596,41 +32640,44 @@ namespace NullableInt56u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits>::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits>::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT56U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits>::StorageType value; - NumericAttributeTraits>::SetNull(value); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT56U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30646,41 +32693,44 @@ namespace NullableInt64u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30696,41 +32746,44 @@ namespace NullableInt8s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30746,41 +32799,44 @@ namespace NullableInt16s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30796,41 +32852,44 @@ namespace NullableInt24s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits>::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits>::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT24S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits>::StorageType value; - NumericAttributeTraits>::SetNull(value); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT24S_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30846,41 +32905,44 @@ namespace NullableInt32s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30896,41 +32958,44 @@ namespace NullableInt40s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits>::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits>::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT40S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits>::StorageType value; - NumericAttributeTraits>::SetNull(value); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT40S_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30946,41 +33011,44 @@ namespace NullableInt48s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits>::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits>::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT48S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits>::StorageType value; - NumericAttributeTraits>::SetNull(value); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT48S_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -30996,41 +33064,44 @@ namespace NullableInt56s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits>::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits>::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT56S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits>::StorageType value; - NumericAttributeTraits>::SetNull(value); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits>; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT56S_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31046,41 +33117,44 @@ namespace NullableInt64s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT64S_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31096,41 +33170,44 @@ namespace NullableEnum8 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31146,41 +33223,44 @@ namespace NullableEnum16 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM16_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31196,41 +33276,44 @@ namespace NullableFloatSingle { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, float value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_SINGLE_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31246,41 +33329,44 @@ namespace NullableFloatDouble { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, double value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_DOUBLE_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_DOUBLE_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31328,7 +33414,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31376,7 +33462,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31390,43 +33476,47 @@ EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::TestCluster::SimpleEnum value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31442,41 +33532,44 @@ namespace NullableRangeRestrictedInt8u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31492,41 +33585,44 @@ namespace NullableRangeRestrictedInt8s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31542,41 +33638,44 @@ namespace NullableRangeRestrictedInt16u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31592,41 +33691,44 @@ namespace NullableRangeRestrictedInt16s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (NumericAttributeTraits::IsNullValue(temp)) + if (Traits::IsNullValue(temp)) { value.SetNull(); } else { - value.SetNonNull() = NumericAttributeTraits::StorageToWorking(temp); + value.SetNonNull() = Traits::StorageToWorking(temp); } return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } EmberAfStatus SetNull(chip::EndpointId endpoint) { - NumericAttributeTraits::StorageType value; - NumericAttributeTraits::SetNull(value); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(value); + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) { if (value.IsNull()) { @@ -31642,26 +33744,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -31671,26 +33775,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -31706,26 +33812,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Messaging::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Messaging::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -31735,26 +33843,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Messaging::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::Messaging::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -31770,26 +33880,28 @@ namespace BasicIdentification { EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT56U_ATTRIBUTE_TYPE); } @@ -31831,26 +33943,28 @@ namespace CompanyId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -31892,26 +34006,28 @@ namespace BrandId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -32081,26 +34197,28 @@ namespace ProductTypeId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -32110,26 +34228,28 @@ namespace CecedSpecificationVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -32139,26 +34259,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -32168,26 +34290,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -32234,26 +34358,28 @@ namespace MeterTypeId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -32263,26 +34389,28 @@ namespace DataQualityId { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -32509,26 +34637,28 @@ namespace AvailablePower { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT24S_ATTRIBUTE_TYPE); } @@ -32538,26 +34668,28 @@ namespace PowerThreshold { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - NumericAttributeTraits>::StorageType temp; - uint8_t * readable = NumericAttributeTraits>::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits>; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits>::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - if (!NumericAttributeTraits>::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits>; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits>::StorageType storageValue; - NumericAttributeTraits>::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits>::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT24S_ATTRIBUTE_TYPE); } @@ -32567,26 +34699,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -32596,26 +34730,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -32631,26 +34767,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceEventsAndAlert::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceEventsAndAlert::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -32660,26 +34798,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceEventsAndAlert::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceEventsAndAlert::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -32695,26 +34835,28 @@ namespace LogMaxSize { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -32724,26 +34866,28 @@ namespace LogQueueMaxSize { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -32753,26 +34897,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -32782,26 +34928,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -32817,26 +34965,28 @@ namespace MeasurementType { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -32846,26 +34996,28 @@ namespace DcVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -32875,26 +35027,28 @@ namespace DcVoltageMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -32904,26 +35058,28 @@ namespace DcVoltageMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -32933,26 +35089,28 @@ namespace DcCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -32962,26 +35120,28 @@ namespace DcCurrentMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -32991,26 +35151,28 @@ namespace DcCurrentMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33020,26 +35182,28 @@ namespace DcPower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33049,26 +35213,28 @@ namespace DcPowerMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33078,26 +35244,28 @@ namespace DcPowerMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33107,26 +35275,28 @@ namespace DcVoltageMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33136,26 +35306,28 @@ namespace DcVoltageDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33165,26 +35337,28 @@ namespace DcCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33194,26 +35368,28 @@ namespace DcCurrentDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33223,26 +35399,28 @@ namespace DcPowerMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33252,26 +35430,28 @@ namespace DcPowerDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33281,26 +35461,28 @@ namespace AcFrequency { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33310,26 +35492,28 @@ namespace AcFrequencyMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33339,26 +35523,28 @@ namespace AcFrequencyMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33368,26 +35554,28 @@ namespace NeutralCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33397,26 +35585,28 @@ namespace TotalActivePower { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -33426,26 +35616,28 @@ namespace TotalReactivePower { EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -33455,26 +35647,28 @@ namespace TotalApparentPower { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -33484,26 +35678,28 @@ namespace Measured1stHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33513,26 +35709,28 @@ namespace Measured3rdHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33542,26 +35740,28 @@ namespace Measured5thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33571,26 +35771,28 @@ namespace Measured7thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33600,26 +35802,28 @@ namespace Measured9thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33629,26 +35833,28 @@ namespace Measured11thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33658,26 +35864,28 @@ namespace MeasuredPhase1stHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33687,26 +35895,28 @@ namespace MeasuredPhase3rdHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33716,26 +35926,28 @@ namespace MeasuredPhase5thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33745,26 +35957,28 @@ namespace MeasuredPhase7thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33774,26 +35988,28 @@ namespace MeasuredPhase9thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33803,26 +36019,28 @@ namespace MeasuredPhase11thHarmonicCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -33832,26 +36050,28 @@ namespace AcFrequencyMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33861,26 +36081,28 @@ namespace AcFrequencyDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -33890,26 +36112,28 @@ namespace PowerMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -33919,26 +36143,28 @@ namespace PowerDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -33948,26 +36174,28 @@ namespace HarmonicCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -33977,26 +36205,28 @@ namespace PhaseHarmonicCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -34006,26 +36236,28 @@ namespace InstantaneousVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34035,26 +36267,28 @@ namespace InstantaneousLineCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34064,26 +36298,28 @@ namespace InstantaneousActiveCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34093,26 +36329,28 @@ namespace InstantaneousReactiveCurrent { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34122,26 +36360,28 @@ namespace InstantaneousPower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34151,26 +36391,28 @@ namespace RmsVoltage { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34180,26 +36422,28 @@ namespace RmsVoltageMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34209,26 +36453,28 @@ namespace RmsVoltageMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34238,26 +36484,28 @@ namespace RmsCurrent { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34267,26 +36515,28 @@ namespace RmsCurrentMin { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34296,26 +36546,28 @@ namespace RmsCurrentMax { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34325,26 +36577,28 @@ namespace ActivePower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34354,26 +36608,28 @@ namespace ActivePowerMin { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34383,26 +36639,28 @@ namespace ActivePowerMax { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34412,26 +36670,28 @@ namespace ReactivePower { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34441,26 +36701,28 @@ namespace ApparentPower { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34470,26 +36732,28 @@ namespace PowerFactor { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -34499,26 +36763,28 @@ namespace AverageRmsVoltageMeasurementPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34528,26 +36794,28 @@ namespace AverageRmsUnderVoltageCounter { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34557,26 +36825,28 @@ namespace RmsExtremeOverVoltagePeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34586,26 +36856,28 @@ namespace RmsExtremeUnderVoltagePeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34615,26 +36887,28 @@ namespace RmsVoltageSagPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34644,26 +36918,28 @@ namespace RmsVoltageSwellPeriod { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34673,26 +36949,28 @@ namespace AcVoltageMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34702,26 +36980,28 @@ namespace AcVoltageDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34731,26 +37011,28 @@ namespace AcCurrentMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34760,26 +37042,28 @@ namespace AcCurrentDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34789,26 +37073,28 @@ namespace AcPowerMultiplier { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34818,26 +37104,28 @@ namespace AcPowerDivisor { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -34847,26 +37135,28 @@ namespace OverloadAlarmsMask { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -34876,26 +37166,28 @@ namespace VoltageOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34905,26 +37197,28 @@ namespace CurrentOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34934,26 +37228,28 @@ namespace AcOverloadAlarmsMask { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -34963,26 +37259,28 @@ namespace AcVoltageOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -34992,26 +37290,28 @@ namespace AcCurrentOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35021,26 +37321,28 @@ namespace AcActivePowerOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35050,26 +37352,28 @@ namespace AcReactivePowerOverload { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35079,26 +37383,28 @@ namespace AverageRmsOverVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35108,26 +37414,28 @@ namespace AverageRmsUnderVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35137,26 +37445,28 @@ namespace RmsExtremeOverVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35166,26 +37476,28 @@ namespace RmsExtremeUnderVoltage { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35195,26 +37507,28 @@ namespace RmsVoltageSag { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35224,26 +37538,28 @@ namespace RmsVoltageSwell { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35253,26 +37569,28 @@ namespace LineCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35282,26 +37600,28 @@ namespace ActiveCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35311,26 +37631,28 @@ namespace ReactiveCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35340,26 +37662,28 @@ namespace RmsVoltagePhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35369,26 +37693,28 @@ namespace RmsVoltageMinPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35398,26 +37724,28 @@ namespace RmsVoltageMaxPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35427,26 +37755,28 @@ namespace RmsCurrentPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35456,26 +37786,28 @@ namespace RmsCurrentMinPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35485,26 +37817,28 @@ namespace RmsCurrentMaxPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35514,26 +37848,28 @@ namespace ActivePowerPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35543,26 +37879,28 @@ namespace ActivePowerMinPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35572,26 +37910,28 @@ namespace ActivePowerMaxPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35601,26 +37941,28 @@ namespace ReactivePowerPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35630,26 +37972,28 @@ namespace ApparentPowerPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35659,26 +38003,28 @@ namespace PowerFactorPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -35688,26 +38034,28 @@ namespace AverageRmsVoltageMeasurementPeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35717,26 +38065,28 @@ namespace AverageRmsOverVoltageCounterPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35746,26 +38096,28 @@ namespace AverageRmsUnderVoltageCounterPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35775,26 +38127,28 @@ namespace RmsExtremeOverVoltagePeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35804,26 +38158,28 @@ namespace RmsExtremeUnderVoltagePeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35833,26 +38189,28 @@ namespace RmsVoltageSagPeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35862,26 +38220,28 @@ namespace RmsVoltageSwellPeriodPhaseB { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35891,26 +38251,28 @@ namespace LineCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -35920,26 +38282,28 @@ namespace ActiveCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35949,26 +38313,28 @@ namespace ReactiveCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -35978,26 +38344,28 @@ namespace RmsVoltagePhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36007,26 +38375,28 @@ namespace RmsVoltageMinPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36036,26 +38406,28 @@ namespace RmsVoltageMaxPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36065,26 +38437,28 @@ namespace RmsCurrentPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36094,26 +38468,28 @@ namespace RmsCurrentMinPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36123,26 +38499,28 @@ namespace RmsCurrentMaxPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36152,26 +38530,28 @@ namespace ActivePowerPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -36181,26 +38561,28 @@ namespace ActivePowerMinPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -36210,26 +38592,28 @@ namespace ActivePowerMaxPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -36239,26 +38623,28 @@ namespace ReactivePowerPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -36268,26 +38654,28 @@ namespace ApparentPowerPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36297,26 +38685,28 @@ namespace PowerFactorPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -36326,26 +38716,28 @@ namespace AverageRmsVoltageMeasurementPeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36355,26 +38747,28 @@ namespace AverageRmsOverVoltageCounterPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36384,26 +38778,28 @@ namespace AverageRmsUnderVoltageCounterPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36413,26 +38809,28 @@ namespace RmsExtremeOverVoltagePeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36442,26 +38840,28 @@ namespace RmsExtremeUnderVoltagePeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36471,26 +38871,28 @@ namespace RmsVoltageSagPeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36500,26 +38902,28 @@ namespace RmsVoltageSwellPeriodPhaseC { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -36529,26 +38933,28 @@ namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -36558,26 +38964,28 @@ namespace ClusterRevision { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - NumericAttributeTraits::StorageType temp; - uint8_t * readable = NumericAttributeTraits::ToAttributeStoreRepresentation(temp); + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, temp)) + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - *value = NumericAttributeTraits::StorageToWorking(temp); + *value = Traits::StorageToWorking(temp); return status; } EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - if (!NumericAttributeTraits::CanRepresentValue(/* isNullable = */ false, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; } - NumericAttributeTraits::StorageType storageValue; - NumericAttributeTraits::WorkingToStorage(value, storageValue); - uint8_t * writable = NumericAttributeTraits::ToAttributeStoreRepresentation(storageValue); + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 98542cd1c87708..f2f6c84aa35382 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 @@ -24,6 +24,7 @@ #pragma once +#include #include #include #include @@ -606,28 +607,28 @@ namespace OnLevel { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace OnLevel namespace OnTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace OnTransitionTime namespace OffTransitionTime { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace OffTransitionTime namespace DefaultMoveRate { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace DefaultMoveRate namespace StartUpCurrentLevel { @@ -1134,16 +1135,24 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); namespace OtaSoftwareUpdateRequestor { namespace Attributes { -namespace DefaultOtaProvider { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); -} // namespace DefaultOtaProvider - namespace UpdatePossible { EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace UpdatePossible +namespace UpdateState { +EmberAfStatus Get(chip::EndpointId endpoint, + chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum * value); // UpdateStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum value); +} // namespace UpdateState + +namespace UpdateStateProgress { +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +} // namespace UpdateStateProgress + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); @@ -1432,8 +1441,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace InterfaceEnabled namespace LastNetworkingStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // NetworkCommissioningStatus -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus * value); // NetworkCommissioningStatus +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus value); } // namespace LastNetworkingStatus namespace LastNetworkID { @@ -2193,6 +2203,16 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); namespace GroupKeyManagement { namespace Attributes { +namespace MaxGroupsPerFabric { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace MaxGroupsPerFabric + +namespace MaxGroupKeysPerFabric { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace MaxGroupKeysPerFabric + namespace FeatureMap { EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); @@ -2388,15 +2408,17 @@ namespace DoorLock { namespace Attributes { namespace LockState { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // DlLockState -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable & value); // DlLockState +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockState value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value); } // namespace LockState namespace LockType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // DlLockType -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockType * value); // DlLockType +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlLockType value); } // namespace LockType namespace ActuatorEnabled { @@ -2405,10 +2427,12 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace ActuatorEnabled namespace DoorState { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // DlDoorState -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable & value); // DlDoorState +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlDoorState value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value); } // namespace DoorState namespace DoorOpenEvents { @@ -2512,8 +2536,8 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SoundVolume namespace OperatingMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // DlOperatingMode -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlOperatingMode * value); // DlOperatingMode +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlOperatingMode value); } // namespace OperatingMode namespace SupportedOperatingModes { @@ -2648,13 +2672,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PhysicalClosedLimitTilt namespace CurrentPositionLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace CurrentPositionLift namespace CurrentPositionTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace CurrentPositionTilt namespace NumberOfActuationsLift { @@ -2673,13 +2701,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ConfigStatus namespace CurrentPositionLiftPercentage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // Percent +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace CurrentPositionLiftPercentage namespace CurrentPositionTiltPercentage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // Percent +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace CurrentPositionTiltPercentage namespace OperationalStatus { @@ -2688,13 +2720,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace OperationalStatus namespace TargetPositionLiftPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // Percent100ths +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent100ths value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace TargetPositionLiftPercent100ths namespace TargetPositionTiltPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // Percent100ths +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent100ths value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace TargetPositionTiltPercent100ths namespace EndProductType { @@ -2703,13 +2739,17 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace EndProductType namespace CurrentPositionLiftPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // Percent100ths +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent100ths value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace CurrentPositionLiftPercent100ths namespace CurrentPositionTiltPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // Percent100ths +EmberAfStatus Set(chip::EndpointId endpoint, chip::Percent100ths value); +EmberAfStatus SetNull(chip::EndpointId endpoint); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace CurrentPositionTiltPercent100ths namespace InstalledOpenLimitLift { @@ -2732,36 +2772,11 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace InstalledClosedLimitTilt -namespace VelocityLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace VelocityLift - -namespace AccelerationTimeLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace AccelerationTimeLift - -namespace DecelerationTimeLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); -} // namespace DecelerationTimeLift - namespace Mode { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Mode -namespace IntermediateSetpointsLift { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); -} // namespace IntermediateSetpointsLift - -namespace IntermediateSetpointsTilt { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); -} // namespace IntermediateSetpointsTilt - namespace SafetyStatus { EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); @@ -2943,7 +2958,7 @@ namespace LifetimeRunningHours { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int24u EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace LifetimeRunningHours namespace Power { @@ -2955,7 +2970,7 @@ namespace LifetimeEnergyConsumed { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int32u EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace LifetimeEnergyConsumed namespace OperationMode { @@ -3709,21 +3724,21 @@ namespace MeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace MeasuredValue namespace MinMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace MaxMeasuredValue namespace Tolerance { @@ -3735,7 +3750,7 @@ namespace LightSensorType { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // enum8 EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace LightSensorType namespace FeatureMap { @@ -5185,7 +5200,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace WakeOnLan -namespace TvChannel { +namespace Channel { namespace Attributes { namespace FeatureMap { @@ -5199,7 +5214,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision } // namespace Attributes -} // namespace TvChannel +} // namespace Channel namespace TargetNavigator { namespace Attributes { @@ -5226,12 +5241,12 @@ namespace MediaPlayback { namespace Attributes { namespace PlaybackState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum * value); // PlaybackStateEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value); } // namespace PlaybackState namespace StartTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // epoch_us EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace StartTime @@ -5403,8 +5418,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ProductId namespace ApplicationStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum * value); // ApplicationStatusEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value); } // namespace ApplicationStatus namespace ApplicationVersion { @@ -5605,8 +5621,8 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value); } // namespace VendorId namespace EnumAttr { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // SimpleEnum -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, chip::app::Clusters::TestCluster::SimpleEnum * value); // SimpleEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::TestCluster::SimpleEnum value); } // namespace EnumAttr namespace RangeRestrictedInt8u { @@ -5643,224 +5659,226 @@ namespace NullableBoolean { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // boolean EmberAfStatus Set(chip::EndpointId endpoint, bool value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableBoolean namespace NullableBitmap8 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap8 EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableBitmap8 namespace NullableBitmap16 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap16 EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableBitmap16 namespace NullableBitmap32 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap32 EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableBitmap32 namespace NullableBitmap64 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap64 EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableBitmap64 namespace NullableInt8u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt8u namespace NullableInt16u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt16u namespace NullableInt24u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int24u EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt24u namespace NullableInt32u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int32u EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt32u namespace NullableInt40u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int40u EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt40u namespace NullableInt48u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int48u EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt48u namespace NullableInt56u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int56u EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt56u namespace NullableInt64u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int64u EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt64u namespace NullableInt8s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8s EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt8s namespace NullableInt16s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16s EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt16s namespace NullableInt24s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int24s EmberAfStatus Set(chip::EndpointId endpoint, int32_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt24s namespace NullableInt32s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int32s EmberAfStatus Set(chip::EndpointId endpoint, int32_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt32s namespace NullableInt40s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int40s EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt40s namespace NullableInt48s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int48s EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt48s namespace NullableInt56s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int56s EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt56s namespace NullableInt64s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int64s EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableInt64s namespace NullableEnum8 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // enum8 EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableEnum8 namespace NullableEnum16 { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // enum16 EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableEnum16 namespace NullableFloatSingle { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // single EmberAfStatus Set(chip::EndpointId endpoint, float value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableFloatSingle namespace NullableFloatDouble { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // double EmberAfStatus Set(chip::EndpointId endpoint, double value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableFloatDouble namespace NullableOctetString { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // octet_string EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableOctetString namespace NullableCharString { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableCharString namespace NullableEnumAttr { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // SimpleEnum -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable & value); // SimpleEnum +EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::TestCluster::SimpleEnum value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value); } // namespace NullableEnumAttr namespace NullableRangeRestrictedInt8u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableRangeRestrictedInt8u namespace NullableRangeRestrictedInt8s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int8s EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableRangeRestrictedInt8s namespace NullableRangeRestrictedInt16u { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableRangeRestrictedInt16u namespace NullableRangeRestrictedInt16s { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // int16s EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace NullableRangeRestrictedInt16s namespace FeatureMap { 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 a49d1d373232ac..040d705f7ad673 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -837,13 +837,13 @@ void emberAfIasWdClusterInitCallback(chip::EndpointId endpoint); */ void emberAfWakeOnLanClusterInitCallback(chip::EndpointId endpoint); -/** @brief TV Channel Cluster Init +/** @brief Channel Cluster Init * * Cluster Init * * @param endpoint Endpoint that is being initialized */ -void emberAfTvChannelClusterInitCallback(chip::EndpointId endpoint); +void emberAfChannelClusterInitCallback(chip::EndpointId endpoint); /** @brief Target Navigator Cluster Init * @@ -11376,42 +11376,42 @@ void emberAfWakeOnLanClusterServerTickCallback(chip::EndpointId endpoint); void emberAfWakeOnLanClusterClientTickCallback(chip::EndpointId endpoint); // -// TV Channel Cluster +// Channel Cluster // -/** @brief TV Channel Cluster Server Init +/** @brief Channel Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfTvChannelClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfChannelClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief TV Channel Cluster Client Init +/** @brief Channel Cluster Client Init * * Client Init * * @param endpoint Endpoint that is being initialized */ -void emberAfTvChannelClusterClientInitCallback(chip::EndpointId endpoint); +void emberAfChannelClusterClientInitCallback(chip::EndpointId endpoint); -/** @brief TV Channel Cluster Server Attribute Changed +/** @brief Channel Cluster Server Attribute Changed * * Server Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterTvChannelClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); +void MatterChannelClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief TV Channel Cluster Client Attribute Changed +/** @brief Channel Cluster Client Attribute Changed * * Client Attribute Changed * * @param attributePath Concrete attribute path that changed */ -void MatterTvChannelClusterClientAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); +void MatterChannelClusterClientAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); -/** @brief TV Channel Cluster Server Message Sent +/** @brief Channel Cluster Server Message Sent * * Server Message Sent * @@ -11421,10 +11421,10 @@ void MatterTvChannelClusterClientAttributeChangedCallback(const chip::app::Concr * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTvChannelClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfChannelClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); -/** @brief TV Channel Cluster Client Message Sent +/** @brief Channel Cluster Client Message Sent * * Client Message Sent * @@ -11434,10 +11434,10 @@ void emberAfTvChannelClusterServerMessageSentCallback(const chip::MessageSendDes * @param message The message that was sent * @param status The status of the sent message */ -void emberAfTvChannelClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, - uint16_t msgLen, uint8_t * message, EmberStatus status); +void emberAfChannelClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, EmberApsFrame * apsFrame, + uint16_t msgLen, uint8_t * message, EmberStatus status); -/** @brief TV Channel Cluster Server Pre Attribute Changed +/** @brief Channel Cluster Server Pre Attribute Changed * * Server Pre Attribute Changed * @@ -11447,10 +11447,10 @@ void emberAfTvChannelClusterClientMessageSentCallback(const chip::MessageSendDes * @param value Attribute value */ chip::Protocols::InteractionModel::Status -MatterTvChannelClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +MatterChannelClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief TV Channel Cluster Client Pre Attribute Changed +/** @brief Channel Cluster Client Pre Attribute Changed * * Client Pre Attribute Changed * @@ -11460,24 +11460,24 @@ MatterTvChannelClusterServerPreAttributeChangedCallback(const chip::app::Concret * @param value Attribute value */ chip::Protocols::InteractionModel::Status -MatterTvChannelClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); +MatterChannelClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); -/** @brief TV Channel Cluster Server Tick +/** @brief Channel Cluster Server Tick * * Server Tick * * @param endpoint Endpoint that is being served */ -void emberAfTvChannelClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfChannelClusterServerTickCallback(chip::EndpointId endpoint); -/** @brief TV Channel Cluster Client Tick +/** @brief Channel Cluster Client Tick * * Client Tick * * @param endpoint Endpoint that is being served */ -void emberAfTvChannelClusterClientTickCallback(chip::EndpointId endpoint); +void emberAfChannelClusterClientTickCallback(chip::EndpointId endpoint); // // Target Navigator Cluster @@ -13856,18 +13856,6 @@ bool emberAfBasicClusterMfgSpecificPingCallback( bool emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::DecodableType & commandData); -/** - * @brief OTA Software Update Provider Cluster ApplyUpdateRequest Command callback (from client) - */ -bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::DecodableType & commandData); -/** - * @brief OTA Software Update Provider Cluster NotifyUpdateApplied Command callback (from client) - */ -bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::DecodableType & commandData); /** * @brief OTA Software Update Provider Cluster QueryImageResponse Command callback (from server) */ @@ -13875,12 +13863,24 @@ bool emberAfOtaSoftwareUpdateProviderClusterQueryImageResponseCallback( chip::EndpointId endpoint, chip::app::CommandSender * commandObj, uint8_t status, uint32_t delayedActionTime, chip::CharSpan imageURI, uint32_t softwareVersion, chip::CharSpan softwareVersionString, chip::ByteSpan updateToken, bool userConsentNeeded, chip::ByteSpan metadataForRequestor); +/** + * @brief OTA Software Update Provider Cluster ApplyUpdateRequest Command callback (from client) + */ +bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::DecodableType & commandData); /** * @brief OTA Software Update Provider Cluster ApplyUpdateResponse Command callback (from server) */ bool emberAfOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, uint8_t action, uint32_t delayedActionTime); +/** + * @brief OTA Software Update Provider Cluster NotifyUpdateApplied Command callback (from client) + */ +bool emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::DecodableType & commandData); /** * @brief OTA Software Update Requestor Cluster AnnounceOtaProvider Command callback (from client) */ @@ -14124,6 +14124,42 @@ bool emberAfOperationalCredentialsClusterAddTrustedRootCertificateCallback( bool emberAfOperationalCredentialsClusterRemoveTrustedRootCertificateCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OperationalCredentials::Commands::RemoveTrustedRootCertificate::DecodableType & commandData); +/** + * @brief Group Key Management Cluster KeySetWrite Command callback (from client) + */ +bool emberAfGroupKeyManagementClusterKeySetWriteCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::DecodableType & commandData); +/** + * @brief Group Key Management Cluster KeySetRead Command callback (from client) + */ +bool emberAfGroupKeyManagementClusterKeySetReadCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::DecodableType & commandData); +/** + * @brief Group Key Management Cluster KeySetReadResponse Command callback (from server) + */ +bool emberAfGroupKeyManagementClusterKeySetReadResponseCallback( + chip::EndpointId endpoint, chip::app::CommandSender * commandObj, + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType groupKeySet); +/** + * @brief Group Key Management Cluster KeySetRemove Command callback (from client) + */ +bool emberAfGroupKeyManagementClusterKeySetRemoveCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::DecodableType & commandData); +/** + * @brief Group Key Management Cluster KeySetReadAllIndices Command callback (from client) + */ +bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::DecodableType & commandData); +/** + * @brief Group Key Management Cluster KeySetReadAllIndicesResponse Command callback (from server) + */ +bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback( + chip::EndpointId endpoint, chip::app::CommandSender * commandObj, + /* TYPE WARNING: array array defaults to */ uint8_t * groupKeySetIDs); /** * @brief Mode Select Cluster ChangeToMode Command callback (from client) */ @@ -14769,297 +14805,226 @@ bool emberAfIasWdClusterStartWarningCallback(chip::app::CommandHandler * command bool emberAfIasWdClusterSquawkCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::IasWd::Commands::Squawk::DecodableType & commandData); /** - * @brief TV Channel Cluster ChangeChannel Command callback (from client) + * @brief Channel Cluster ChangeChannelRequest Command callback (from client) */ -bool emberAfTvChannelClusterChangeChannelCallback( +bool emberAfChannelClusterChangeChannelRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::TvChannel::Commands::ChangeChannel::DecodableType & commandData); + const chip::app::Clusters::Channel::Commands::ChangeChannelRequest::DecodableType & commandData); /** - * @brief TV Channel Cluster ChangeChannelResponse Command callback (from server) + * @brief Channel Cluster ChangeChannelResponse Command callback (from server) */ -bool emberAfTvChannelClusterChangeChannelResponseCallback( +bool emberAfChannelClusterChangeChannelResponseCallback( chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - chip::app::Clusters::TvChannel::Structs::TvChannelInfo::DecodableType channelMatch, uint8_t errorType); + chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType channelMatch, uint8_t errorType); /** - * @brief TV Channel Cluster ChangeChannelByNumber Command callback (from client) + * @brief Channel Cluster ChangeChannelByNumberRequest Command callback (from client) */ -bool emberAfTvChannelClusterChangeChannelByNumberCallback( +bool emberAfChannelClusterChangeChannelByNumberRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::TvChannel::Commands::ChangeChannelByNumber::DecodableType & commandData); + const chip::app::Clusters::Channel::Commands::ChangeChannelByNumberRequest::DecodableType & commandData); /** - * @brief TV Channel Cluster SkipChannel Command callback (from client) + * @brief Channel Cluster SkipChannelRequest Command callback (from client) */ -bool emberAfTvChannelClusterSkipChannelCallback( +bool emberAfChannelClusterSkipChannelRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::TvChannel::Commands::SkipChannel::DecodableType & commandData); + const chip::app::Clusters::Channel::Commands::SkipChannelRequest::DecodableType & commandData); /** - * @brief Target Navigator Cluster NavigateTarget Command callback (from client) + * @brief Target Navigator Cluster NavigateTargetRequest Command callback (from client) */ -bool emberAfTargetNavigatorClusterNavigateTargetCallback( +bool emberAfTargetNavigatorClusterNavigateTargetRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::DecodableType & commandData); + const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetRequest::DecodableType & commandData); /** * @brief Target Navigator Cluster NavigateTargetResponse Command callback (from server) */ bool emberAfTargetNavigatorClusterNavigateTargetResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, uint8_t status, chip::CharSpan data); /** - * @brief Media Playback Cluster MediaPlay Command callback (from client) + * @brief Media Playback Cluster PlayRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaPlayCallback( +bool emberAfMediaPlaybackClusterPlayRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaPlay::DecodableType & commandData); -/** - * @brief Media Playback Cluster MediaPlayResponse Command callback (from server) - */ -bool emberAfMediaPlaybackClusterMediaPlayResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); + const chip::app::Clusters::MediaPlayback::Commands::PlayRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaPause Command callback (from client) + * @brief Media Playback Cluster PauseRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaPauseCallback( +bool emberAfMediaPlaybackClusterPauseRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaPause::DecodableType & commandData); -/** - * @brief Media Playback Cluster MediaPauseResponse Command callback (from server) - */ -bool emberAfMediaPlaybackClusterMediaPauseResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); + const chip::app::Clusters::MediaPlayback::Commands::PauseRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaStop Command callback (from client) + * @brief Media Playback Cluster StopRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaStopCallback( +bool emberAfMediaPlaybackClusterStopRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaStop::DecodableType & commandData); -/** - * @brief Media Playback Cluster MediaStopResponse Command callback (from server) - */ -bool emberAfMediaPlaybackClusterMediaStopResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); + const chip::app::Clusters::MediaPlayback::Commands::StopRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaStartOver Command callback (from client) + * @brief Media Playback Cluster StartOverRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaStartOverCallback( +bool emberAfMediaPlaybackClusterStartOverRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaStartOver::DecodableType & commandData); + const chip::app::Clusters::MediaPlayback::Commands::StartOverRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaStartOverResponse Command callback (from server) + * @brief Media Playback Cluster PreviousRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaStartOverResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); -/** - * @brief Media Playback Cluster MediaPrevious Command callback (from client) - */ -bool emberAfMediaPlaybackClusterMediaPreviousCallback( +bool emberAfMediaPlaybackClusterPreviousRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaPrevious::DecodableType & commandData); + const chip::app::Clusters::MediaPlayback::Commands::PreviousRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaPreviousResponse Command callback (from server) + * @brief Media Playback Cluster NextRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaPreviousResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); -/** - * @brief Media Playback Cluster MediaNext Command callback (from client) - */ -bool emberAfMediaPlaybackClusterMediaNextCallback( +bool emberAfMediaPlaybackClusterNextRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaNext::DecodableType & commandData); -/** - * @brief Media Playback Cluster MediaNextResponse Command callback (from server) - */ -bool emberAfMediaPlaybackClusterMediaNextResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); + const chip::app::Clusters::MediaPlayback::Commands::NextRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaRewind Command callback (from client) + * @brief Media Playback Cluster RewindRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaRewindCallback( +bool emberAfMediaPlaybackClusterRewindRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaRewind::DecodableType & commandData); -/** - * @brief Media Playback Cluster MediaRewindResponse Command callback (from server) - */ -bool emberAfMediaPlaybackClusterMediaRewindResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); + const chip::app::Clusters::MediaPlayback::Commands::RewindRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaFastForward Command callback (from client) + * @brief Media Playback Cluster FastForwardRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaFastForwardCallback( +bool emberAfMediaPlaybackClusterFastForwardRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaFastForward::DecodableType & commandData); -/** - * @brief Media Playback Cluster MediaFastForwardResponse Command callback (from server) - */ -bool emberAfMediaPlaybackClusterMediaFastForwardResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); + const chip::app::Clusters::MediaPlayback::Commands::FastForwardRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaSkipForward Command callback (from client) + * @brief Media Playback Cluster SkipForwardRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaSkipForwardCallback( +bool emberAfMediaPlaybackClusterSkipForwardRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForward::DecodableType & commandData); + const chip::app::Clusters::MediaPlayback::Commands::SkipForwardRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaSkipForwardResponse Command callback (from server) + * @brief Media Playback Cluster SkipBackwardRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); -/** - * @brief Media Playback Cluster MediaSkipBackward Command callback (from client) - */ -bool emberAfMediaPlaybackClusterMediaSkipBackwardCallback( +bool emberAfMediaPlaybackClusterSkipBackwardRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackward::DecodableType & commandData); + const chip::app::Clusters::MediaPlayback::Commands::SkipBackwardRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaSkipBackwardResponse Command callback (from server) + * @brief Media Playback Cluster PlaybackResponse Command callback (from server) */ -bool emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); +bool emberAfMediaPlaybackClusterPlaybackResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, + uint8_t status); /** - * @brief Media Playback Cluster MediaSeek Command callback (from client) + * @brief Media Playback Cluster SeekRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaSeekCallback( +bool emberAfMediaPlaybackClusterSeekRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaPlayback::Commands::MediaSeek::DecodableType & commandData); + const chip::app::Clusters::MediaPlayback::Commands::SeekRequest::DecodableType & commandData); /** - * @brief Media Playback Cluster MediaSeekResponse Command callback (from server) + * @brief Media Input Cluster SelectInputRequest Command callback (from client) */ -bool emberAfMediaPlaybackClusterMediaSeekResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus); -/** - * @brief Media Input Cluster SelectInput Command callback (from client) - */ -bool emberAfMediaInputClusterSelectInputCallback( +bool emberAfMediaInputClusterSelectInputRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaInput::Commands::SelectInput::DecodableType & commandData); + const chip::app::Clusters::MediaInput::Commands::SelectInputRequest::DecodableType & commandData); /** - * @brief Media Input Cluster ShowInputStatus Command callback (from client) + * @brief Media Input Cluster ShowInputStatusRequest Command callback (from client) */ -bool emberAfMediaInputClusterShowInputStatusCallback( +bool emberAfMediaInputClusterShowInputStatusRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaInput::Commands::ShowInputStatus::DecodableType & commandData); + const chip::app::Clusters::MediaInput::Commands::ShowInputStatusRequest::DecodableType & commandData); /** - * @brief Media Input Cluster HideInputStatus Command callback (from client) + * @brief Media Input Cluster HideInputStatusRequest Command callback (from client) */ -bool emberAfMediaInputClusterHideInputStatusCallback( +bool emberAfMediaInputClusterHideInputStatusRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaInput::Commands::HideInputStatus::DecodableType & commandData); + const chip::app::Clusters::MediaInput::Commands::HideInputStatusRequest::DecodableType & commandData); /** - * @brief Media Input Cluster RenameInput Command callback (from client) + * @brief Media Input Cluster RenameInputRequest Command callback (from client) */ -bool emberAfMediaInputClusterRenameInputCallback( +bool emberAfMediaInputClusterRenameInputRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::MediaInput::Commands::RenameInput::DecodableType & commandData); + const chip::app::Clusters::MediaInput::Commands::RenameInputRequest::DecodableType & commandData); /** * @brief Low Power Cluster Sleep Command callback (from client) */ bool emberAfLowPowerClusterSleepCallback(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::LowPower::Commands::Sleep::DecodableType & commandData); /** - * @brief Keypad Input Cluster SendKey Command callback (from client) + * @brief Keypad Input Cluster SendKeyRequest Command callback (from client) */ -bool emberAfKeypadInputClusterSendKeyCallback( +bool emberAfKeypadInputClusterSendKeyRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::KeypadInput::Commands::SendKey::DecodableType & commandData); + const chip::app::Clusters::KeypadInput::Commands::SendKeyRequest::DecodableType & commandData); /** * @brief Keypad Input Cluster SendKeyResponse Command callback (from server) */ bool emberAfKeypadInputClusterSendKeyResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, uint8_t status); /** - * @brief Content Launcher Cluster LaunchContent Command callback (from client) + * @brief Content Launcher Cluster LaunchContentRequest Command callback (from client) */ -bool emberAfContentLauncherClusterLaunchContentCallback( +bool emberAfContentLauncherClusterLaunchContentRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ContentLauncher::Commands::LaunchContent::DecodableType & commandData); -/** - * @brief Content Launcher Cluster LaunchContentResponse Command callback (from server) - */ -bool emberAfContentLauncherClusterLaunchContentResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t contentLaunchStatus, chip::CharSpan data); + const chip::app::Clusters::ContentLauncher::Commands::LaunchContentRequest::DecodableType & commandData); /** - * @brief Content Launcher Cluster LaunchURL Command callback (from client) + * @brief Content Launcher Cluster LaunchURLRequest Command callback (from client) */ -bool emberAfContentLauncherClusterLaunchURLCallback( +bool emberAfContentLauncherClusterLaunchURLRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ContentLauncher::Commands::LaunchURL::DecodableType & commandData); + const chip::app::Clusters::ContentLauncher::Commands::LaunchURLRequest::DecodableType & commandData); /** - * @brief Content Launcher Cluster LaunchURLResponse Command callback (from server) + * @brief Content Launcher Cluster LaunchResponse Command callback (from server) */ -bool emberAfContentLauncherClusterLaunchURLResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t contentLaunchStatus, chip::CharSpan data); +bool emberAfContentLauncherClusterLaunchResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, + uint8_t status, chip::CharSpan data); /** - * @brief Audio Output Cluster SelectOutput Command callback (from client) + * @brief Audio Output Cluster SelectOutputRequest Command callback (from client) */ -bool emberAfAudioOutputClusterSelectOutputCallback( +bool emberAfAudioOutputClusterSelectOutputRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::AudioOutput::Commands::SelectOutput::DecodableType & commandData); + const chip::app::Clusters::AudioOutput::Commands::SelectOutputRequest::DecodableType & commandData); /** - * @brief Audio Output Cluster RenameOutput Command callback (from client) + * @brief Audio Output Cluster RenameOutputRequest Command callback (from client) */ -bool emberAfAudioOutputClusterRenameOutputCallback( +bool emberAfAudioOutputClusterRenameOutputRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::AudioOutput::Commands::RenameOutput::DecodableType & commandData); + const chip::app::Clusters::AudioOutput::Commands::RenameOutputRequest::DecodableType & commandData); /** - * @brief Application Launcher Cluster LaunchApp Command callback (from client) + * @brief Application Launcher Cluster LaunchAppRequest Command callback (from client) */ -bool emberAfApplicationLauncherClusterLaunchAppCallback( +bool emberAfApplicationLauncherClusterLaunchAppRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::DecodableType & commandData); -/** - * @brief Application Launcher Cluster LaunchAppResponse Command callback (from server) - */ -bool emberAfApplicationLauncherClusterLaunchAppResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t status, chip::CharSpan data); + const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppRequest::DecodableType & commandData); /** - * @brief Application Launcher Cluster StopApp Command callback (from client) + * @brief Application Launcher Cluster StopAppRequest Command callback (from client) */ -bool emberAfApplicationLauncherClusterStopAppCallback( +bool emberAfApplicationLauncherClusterStopAppRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ApplicationLauncher::Commands::StopApp::DecodableType & commandData); -/** - * @brief Application Launcher Cluster StopAppResponse Command callback (from server) - */ -bool emberAfApplicationLauncherClusterStopAppResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t status, chip::CharSpan data); + const chip::app::Clusters::ApplicationLauncher::Commands::StopAppRequest::DecodableType & commandData); /** - * @brief Application Launcher Cluster HideApp Command callback (from client) + * @brief Application Launcher Cluster HideAppRequest Command callback (from client) */ -bool emberAfApplicationLauncherClusterHideAppCallback( +bool emberAfApplicationLauncherClusterHideAppRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ApplicationLauncher::Commands::HideApp::DecodableType & commandData); + const chip::app::Clusters::ApplicationLauncher::Commands::HideAppRequest::DecodableType & commandData); /** - * @brief Application Launcher Cluster HideAppResponse Command callback (from server) + * @brief Application Launcher Cluster LauncherResponse Command callback (from server) */ -bool emberAfApplicationLauncherClusterHideAppResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, - uint8_t status, chip::CharSpan data); +bool emberAfApplicationLauncherClusterLauncherResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, + uint8_t status, chip::CharSpan data); /** - * @brief Application Basic Cluster ChangeStatus Command callback (from client) + * @brief Account Login Cluster GetSetupPINRequest Command callback (from client) */ -bool emberAfApplicationBasicClusterChangeStatusCallback( +bool emberAfAccountLoginClusterGetSetupPINRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ApplicationBasic::Commands::ChangeStatus::DecodableType & commandData); -/** - * @brief Account Login Cluster GetSetupPIN Command callback (from client) - */ -bool emberAfAccountLoginClusterGetSetupPINCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::DecodableType & commandData); + const chip::app::Clusters::AccountLogin::Commands::GetSetupPINRequest::DecodableType & commandData); /** * @brief Account Login Cluster GetSetupPINResponse Command callback (from server) */ bool emberAfAccountLoginClusterGetSetupPINResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, chip::CharSpan setupPIN); /** - * @brief Account Login Cluster Login Command callback (from client) + * @brief Account Login Cluster LoginRequest Command callback (from client) */ -bool emberAfAccountLoginClusterLoginCallback(chip::app::CommandHandler * commandObj, - const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::AccountLogin::Commands::Login::DecodableType & commandData); +bool emberAfAccountLoginClusterLoginRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::AccountLogin::Commands::LoginRequest::DecodableType & commandData); /** - * @brief Account Login Cluster Logout Command callback (from client) + * @brief Account Login Cluster LogoutRequest Command callback (from client) */ -bool emberAfAccountLoginClusterLogoutCallback( +bool emberAfAccountLoginClusterLogoutRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::AccountLogin::Commands::Logout::DecodableType & commandData); + const chip::app::Clusters::AccountLogin::Commands::LogoutRequest::DecodableType & commandData); /** * @brief Test Cluster Cluster Test Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h b/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h index 99c87b1f349b7c..1f3bd616d38308 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h +++ b/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h @@ -217,8 +217,8 @@ void __attribute__((weak)) MatterIasWdPluginClientInitCallback() {} void MatterIasWdPluginServerInitCallback(); void __attribute__((weak)) MatterWakeOnLanPluginClientInitCallback() {} void MatterWakeOnLanPluginServerInitCallback(); -void __attribute__((weak)) MatterTvChannelPluginClientInitCallback() {} -void MatterTvChannelPluginServerInitCallback(); +void __attribute__((weak)) MatterChannelPluginClientInitCallback() {} +void MatterChannelPluginServerInitCallback(); void __attribute__((weak)) MatterTargetNavigatorPluginClientInitCallback() {} void MatterTargetNavigatorPluginServerInitCallback(); void __attribute__((weak)) MatterMediaPlaybackPluginClientInitCallback() {} diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h index 11539caeb01ba5..a5808bc36e11f8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h @@ -319,8 +319,8 @@ static constexpr chip::ClusterId ZCL_IAS_WD_CLUSTER_ID = 0x0502; // Definitions for cluster: Wake on LAN static constexpr chip::ClusterId ZCL_WAKE_ON_LAN_CLUSTER_ID = 0x0503; -// Definitions for cluster: TV Channel -static constexpr chip::ClusterId ZCL_TV_CHANNEL_CLUSTER_ID = 0x0504; +// Definitions for cluster: Channel +static constexpr chip::ClusterId ZCL_CHANNEL_CLUSTER_ID = 0x0504; // Definitions for cluster: Target Navigator static constexpr chip::ClusterId ZCL_TARGET_NAVIGATOR_CLUSTER_ID = 0x0505; 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 8af4792ee8e875..be254177301560 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 @@ -5835,13 +5835,21 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace QueryImage. -namespace ApplyUpdateRequest { +namespace QueryImageResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDelayedActionTime)), delayedActionTime)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kImageURI)), imageURI)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSoftwareVersion)), softwareVersion)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSoftwareVersionString)), softwareVersionString)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUpdateToken)), updateToken)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNewVersion)), newVersion)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserConsentNeeded)), userConsentNeeded)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMetadataForRequestor)), metadataForRequestor)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -5857,11 +5865,29 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, status)); + break; + case to_underlying(Fields::kDelayedActionTime): + ReturnErrorOnFailure(DataModel::Decode(reader, delayedActionTime)); + break; + case to_underlying(Fields::kImageURI): + ReturnErrorOnFailure(DataModel::Decode(reader, imageURI)); + break; + case to_underlying(Fields::kSoftwareVersion): + ReturnErrorOnFailure(DataModel::Decode(reader, softwareVersion)); + break; + case to_underlying(Fields::kSoftwareVersionString): + ReturnErrorOnFailure(DataModel::Decode(reader, softwareVersionString)); + break; case to_underlying(Fields::kUpdateToken): ReturnErrorOnFailure(DataModel::Decode(reader, updateToken)); break; - case to_underlying(Fields::kNewVersion): - ReturnErrorOnFailure(DataModel::Decode(reader, newVersion)); + case to_underlying(Fields::kUserConsentNeeded): + ReturnErrorOnFailure(DataModel::Decode(reader, userConsentNeeded)); + break; + case to_underlying(Fields::kMetadataForRequestor): + ReturnErrorOnFailure(DataModel::Decode(reader, metadataForRequestor)); break; default: break; @@ -5872,14 +5898,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ApplyUpdateRequest. -namespace NotifyUpdateApplied { +} // namespace QueryImageResponse. +namespace ApplyUpdateRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUpdateToken)), updateToken)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSoftwareVersion)), softwareVersion)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNewVersion)), newVersion)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -5898,8 +5924,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) case to_underlying(Fields::kUpdateToken): ReturnErrorOnFailure(DataModel::Decode(reader, updateToken)); break; - case to_underlying(Fields::kSoftwareVersion): - ReturnErrorOnFailure(DataModel::Decode(reader, softwareVersion)); + case to_underlying(Fields::kNewVersion): + ReturnErrorOnFailure(DataModel::Decode(reader, newVersion)); break; default: break; @@ -5910,22 +5936,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace NotifyUpdateApplied. -namespace QueryImageResponse { +} // namespace ApplyUpdateRequest. +namespace ApplyUpdateResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAction)), action)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDelayedActionTime)), delayedActionTime)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kImageURI)), imageURI)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSoftwareVersion)), softwareVersion)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSoftwareVersionString)), softwareVersionString)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUpdateToken)), updateToken)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserConsentNeeded)), userConsentNeeded)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMetadataForRequestor)), metadataForRequestor)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -5941,30 +5959,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, status)); + case to_underlying(Fields::kAction): + ReturnErrorOnFailure(DataModel::Decode(reader, action)); break; case to_underlying(Fields::kDelayedActionTime): ReturnErrorOnFailure(DataModel::Decode(reader, delayedActionTime)); break; - case to_underlying(Fields::kImageURI): - ReturnErrorOnFailure(DataModel::Decode(reader, imageURI)); - break; - case to_underlying(Fields::kSoftwareVersion): - ReturnErrorOnFailure(DataModel::Decode(reader, softwareVersion)); - break; - case to_underlying(Fields::kSoftwareVersionString): - ReturnErrorOnFailure(DataModel::Decode(reader, softwareVersionString)); - break; - case to_underlying(Fields::kUpdateToken): - ReturnErrorOnFailure(DataModel::Decode(reader, updateToken)); - break; - case to_underlying(Fields::kUserConsentNeeded): - ReturnErrorOnFailure(DataModel::Decode(reader, userConsentNeeded)); - break; - case to_underlying(Fields::kMetadataForRequestor): - ReturnErrorOnFailure(DataModel::Decode(reader, metadataForRequestor)); - break; default: break; } @@ -5974,14 +5974,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace QueryImageResponse. -namespace ApplyUpdateResponse { +} // namespace ApplyUpdateResponse. +namespace NotifyUpdateApplied { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAction)), action)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDelayedActionTime)), delayedActionTime)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUpdateToken)), updateToken)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSoftwareVersion)), softwareVersion)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -5997,11 +5997,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kAction): - ReturnErrorOnFailure(DataModel::Decode(reader, action)); + case to_underlying(Fields::kUpdateToken): + ReturnErrorOnFailure(DataModel::Decode(reader, updateToken)); break; - case to_underlying(Fields::kDelayedActionTime): - ReturnErrorOnFailure(DataModel::Decode(reader, delayedActionTime)); + case to_underlying(Fields::kSoftwareVersion): + ReturnErrorOnFailure(DataModel::Decode(reader, softwareVersion)); break; default: break; @@ -6012,7 +6012,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ApplyUpdateResponse. +} // namespace NotifyUpdateApplied. } // namespace Commands namespace Attributes { @@ -6042,6 +6042,52 @@ namespace Events { } // namespace OtaSoftwareUpdateProvider namespace OtaSoftwareUpdateRequestor { +namespace Structs { +namespace ProviderLocation { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kProviderNodeID)), providerNodeID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEndpoint)), endpoint)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); + break; + case to_underlying(Fields::kProviderNodeID): + ReturnErrorOnFailure(DataModel::Decode(reader, providerNodeID)); + break; + case to_underlying(Fields::kEndpoint): + ReturnErrorOnFailure(DataModel::Decode(reader, endpoint)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} + +} // namespace ProviderLocation +} // namespace Structs namespace Commands { namespace AnnounceOtaProvider { @@ -6049,11 +6095,12 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kProviderLocation)), providerLocation)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kProviderNodeId)), providerNodeId)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kVendorId)), vendorId)); ReturnErrorOnFailure( DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAnnouncementReason)), announcementReason)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMetadataForNode)), metadataForNode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEndpoint)), endpoint)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -6069,8 +6116,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kProviderLocation): - ReturnErrorOnFailure(DataModel::Decode(reader, providerLocation)); + case to_underlying(Fields::kProviderNodeId): + ReturnErrorOnFailure(DataModel::Decode(reader, providerNodeId)); break; case to_underlying(Fields::kVendorId): ReturnErrorOnFailure(DataModel::Decode(reader, vendorId)); @@ -6081,6 +6128,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) case to_underlying(Fields::kMetadataForNode): ReturnErrorOnFailure(DataModel::Decode(reader, metadataForNode)); break; + case to_underlying(Fields::kEndpoint): + ReturnErrorOnFailure(DataModel::Decode(reader, endpoint)); + break; default: break; } @@ -6098,12 +6148,18 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::DefaultOtaProvider::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, defaultOtaProvider)); + case Attributes::DefaultOtaProviders::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, defaultOtaProviders)); break; case Attributes::UpdatePossible::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, updatePossible)); break; + case Attributes::UpdateState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, updateState)); + break; + case Attributes::UpdateStateProgress::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, updateStateProgress)); + break; case Attributes::AttributeList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); break; @@ -10160,18 +10216,15 @@ namespace Events { } // namespace OperationalCredentials namespace GroupKeyManagement { namespace Structs { -namespace GroupKey { +namespace GroupInfo { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kVendorId)), vendorId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeyIndex)), groupKeyIndex)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeyRoot)), groupKeyRoot)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeyEpochStartTime)), groupKeyEpochStartTime)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySecurityPolicy)), groupKeySecurityPolicy)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupId)), groupId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEndpoints)), endpoints)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupName)), groupName)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10188,20 +10241,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kVendorId): - ReturnErrorOnFailure(DataModel::Decode(reader, vendorId)); - break; - case to_underlying(Fields::kGroupKeyIndex): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeyIndex)); + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); break; - case to_underlying(Fields::kGroupKeyRoot): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeyRoot)); + case to_underlying(Fields::kGroupId): + ReturnErrorOnFailure(DataModel::Decode(reader, groupId)); break; - case to_underlying(Fields::kGroupKeyEpochStartTime): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeyEpochStartTime)); + case to_underlying(Fields::kEndpoints): + ReturnErrorOnFailure(DataModel::Decode(reader, endpoints)); break; - case to_underlying(Fields::kGroupKeySecurityPolicy): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySecurityPolicy)); + case to_underlying(Fields::kGroupName): + ReturnErrorOnFailure(DataModel::Decode(reader, groupName)); break; default: break; @@ -10213,15 +10263,15 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace GroupKey -namespace GroupState { +} // namespace GroupInfo +namespace GroupKey { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kVendorId)), vendorId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kVendorGroupId)), vendorGroupId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetIndex)), groupKeySetIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupId)), groupId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetID)), groupKeySetID)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10238,14 +10288,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kVendorId): - ReturnErrorOnFailure(DataModel::Decode(reader, vendorId)); + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); break; - case to_underlying(Fields::kVendorGroupId): - ReturnErrorOnFailure(DataModel::Decode(reader, vendorGroupId)); + case to_underlying(Fields::kGroupId): + ReturnErrorOnFailure(DataModel::Decode(reader, groupId)); break; - case to_underlying(Fields::kGroupKeySetIndex): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetIndex)); + case to_underlying(Fields::kGroupKeySetID): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetID)); break; default: break; @@ -10257,53 +10307,20 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace GroupState -} // namespace Structs - -namespace Commands { -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::Groups::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, groups)); - break; - case Attributes::GroupKeys::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, groupKeys)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - - return CHIP_NO_ERROR; -} -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace GroupKeyManagement -namespace FixedLabel { -namespace Structs { -namespace LabelStruct { +} // namespace GroupKey +namespace GroupKeySet { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLabel)), label)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kValue)), value)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetID)), groupKeySetID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSecurityPolicy)), securityPolicy)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochKey0)), epochKey0)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochStartTime0)), epochStartTime0)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochKey1)), epochKey1)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochStartTime1)), epochStartTime1)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochKey2)), epochKey2)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEpochStartTime2)), epochStartTime2)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10320,11 +10337,29 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, label)); + case to_underlying(Fields::kGroupKeySetID): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetID)); break; - case to_underlying(Fields::kValue): - ReturnErrorOnFailure(DataModel::Decode(reader, value)); + case to_underlying(Fields::kSecurityPolicy): + ReturnErrorOnFailure(DataModel::Decode(reader, securityPolicy)); + break; + case to_underlying(Fields::kEpochKey0): + ReturnErrorOnFailure(DataModel::Decode(reader, epochKey0)); + break; + case to_underlying(Fields::kEpochStartTime0): + ReturnErrorOnFailure(DataModel::Decode(reader, epochStartTime0)); + break; + case to_underlying(Fields::kEpochKey1): + ReturnErrorOnFailure(DataModel::Decode(reader, epochKey1)); + break; + case to_underlying(Fields::kEpochStartTime1): + ReturnErrorOnFailure(DataModel::Decode(reader, epochStartTime1)); + break; + case to_underlying(Fields::kEpochKey2): + ReturnErrorOnFailure(DataModel::Decode(reader, epochKey2)); + break; + case to_underlying(Fields::kEpochStartTime2): + ReturnErrorOnFailure(DataModel::Decode(reader, epochStartTime2)); break; default: break; @@ -10336,51 +10371,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace LabelStruct +} // namespace GroupKeySet } // namespace Structs namespace Commands { -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +namespace KeySetWrite { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { - switch (path.mAttributeId) - { - case Attributes::LabelList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, labelList)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - - return CHIP_NO_ERROR; -} -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace FixedLabel -namespace UserLabel { -namespace Structs { -namespace LabelStruct { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLabel)), label)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kValue)), value)); - ReturnErrorOnFailure(writer.EndContainer(outer)); + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySet)), groupKeySet)); + ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10389,18 +10390,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, label)); - break; - case to_underlying(Fields::kValue): - ReturnErrorOnFailure(DataModel::Decode(reader, value)); + case to_underlying(Fields::kGroupKeySet): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySet)); break; default: break; @@ -10411,172 +10408,47 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } - -} // namespace LabelStruct -} // namespace Structs - -namespace Commands { -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::LabelList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, labelList)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - - return CHIP_NO_ERROR; -} -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace UserLabel -namespace ProxyConfiguration { - -namespace Commands { -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - - return CHIP_NO_ERROR; -} -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace ProxyConfiguration -namespace ProxyDiscovery { - -namespace Commands { -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - - return CHIP_NO_ERROR; -} -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace ProxyDiscovery -namespace ProxyValid { - -namespace Commands { -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +} // namespace KeySetWrite. +namespace KeySetRead { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { - switch (path.mAttributeId) - { - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetID)), groupKeySetID)); + ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace ProxyValid -namespace BooleanState { -namespace Commands { -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { - switch (path.mAttributeId) + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) { - case Attributes::StateValue::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, stateValue)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kGroupKeySetID): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetID)); + break; + default: + break; + } } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Attributes - -namespace Events { -namespace StateChange { +} // namespace KeySetRead. +namespace KeySetReadResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStateValue)), stateValue)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySet)), groupKeySet)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10592,8 +10464,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kStateValue): - ReturnErrorOnFailure(DataModel::Decode(reader, stateValue)); + case to_underlying(Fields::kGroupKeySet): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySet)); break; default: break; @@ -10604,20 +10476,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace StateChange. -} // namespace Events - -} // namespace BooleanState -namespace ModeSelect { -namespace Structs { -namespace ModeOptionStruct { +} // namespace KeySetReadResponse. +namespace KeySetRemove { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLabel)), label)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMode)), mode)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSemanticTag)), semanticTag)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetID)), groupKeySetID)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10627,21 +10492,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, label)); - break; - case to_underlying(Fields::kMode): - ReturnErrorOnFailure(DataModel::Decode(reader, mode)); - break; - case to_underlying(Fields::kSemanticTag): - ReturnErrorOnFailure(DataModel::Decode(reader, semanticTag)); + case to_underlying(Fields::kGroupKeySetID): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetID)); break; default: break; @@ -10652,15 +10510,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } - -} // namespace ModeOptionStruct -namespace SemanticTag { +} // namespace KeySetRemove. +namespace KeySetReadAllIndices { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMfgCode)), mfgCode)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kValue)), value)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetIDs)), groupKeySetIDs)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10670,18 +10526,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMfgCode): - ReturnErrorOnFailure(DataModel::Decode(reader, mfgCode)); - break; - case to_underlying(Fields::kValue): - ReturnErrorOnFailure(DataModel::Decode(reader, value)); + case to_underlying(Fields::kGroupKeySetIDs): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetIDs)); break; default: break; @@ -10692,17 +10544,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } - -} // namespace SemanticTag -} // namespace Structs - -namespace Commands { -namespace ChangeToMode { +} // namespace KeySetReadAllIndices. +namespace KeySetReadAllIndicesResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNewMode)), newMode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kGroupKeySetIDs)), groupKeySetIDs)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10718,8 +10566,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kNewMode): - ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); + case to_underlying(Fields::kGroupKeySetIDs): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeySetIDs)); break; default: break; @@ -10730,7 +10578,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ChangeToMode. +} // namespace KeySetReadAllIndicesResponse. } // namespace Commands namespace Attributes { @@ -10738,20 +10586,17 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::CurrentMode::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, currentMode)); + case Attributes::GroupKeyMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, groupKeyMap)); break; - case Attributes::SupportedModes::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); - break; - case Attributes::OnMode::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, onMode)); + case Attributes::GroupTable::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, groupTable)); break; - case Attributes::StartUpMode::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, startUpMode)); + case Attributes::MaxGroupsPerFabric::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, maxGroupsPerFabric)); break; - case Attributes::Description::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, description)); + case Attributes::MaxGroupKeysPerFabric::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, maxGroupKeysPerFabric)); break; case Attributes::AttributeList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); @@ -10773,31 +10618,61 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events { } // namespace Events -} // namespace ModeSelect -namespace ShadeConfiguration { - -namespace Commands { -} // namespace Commands - -namespace Attributes { +} // namespace GroupKeyManagement +namespace FixedLabel { +namespace Structs { +namespace LabelStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLabel)), label)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kValue)), value)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, label)); + break; + case to_underlying(Fields::kValue): + ReturnErrorOnFailure(DataModel::Decode(reader, value)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} + +} // namespace LabelStruct +} // namespace Structs + +namespace Commands { +} // namespace Commands + +namespace Attributes { CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) { switch (path.mAttributeId) { - case Attributes::PhysicalClosedLimit::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, physicalClosedLimit)); - break; - case Attributes::MotorStepSize::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, motorStepSize)); - break; - case Attributes::Status::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, status)); - break; - case Attributes::ClosedLimit::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, closedLimit)); - break; - case Attributes::Mode::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, mode)); + case Attributes::LabelList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, labelList)); break; case Attributes::AttributeList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); @@ -10819,16 +10694,16 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events { } // namespace Events -} // namespace ShadeConfiguration -namespace DoorLock { +} // namespace FixedLabel +namespace UserLabel { namespace Structs { -namespace DlCredential { +namespace LabelStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCredentialType)), credentialType)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCredentialIndex)), credentialIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLabel)), label)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kValue)), value)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10845,11 +10720,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kCredentialType): - ReturnErrorOnFailure(DataModel::Decode(reader, credentialType)); + case to_underlying(Fields::kLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, label)); break; - case to_underlying(Fields::kCredentialIndex): - ReturnErrorOnFailure(DataModel::Decode(reader, credentialIndex)); + case to_underlying(Fields::kValue): + ReturnErrorOnFailure(DataModel::Decode(reader, value)); break; default: break; @@ -10861,16 +10736,171 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace DlCredential +} // namespace LabelStruct } // namespace Structs namespace Commands { -namespace LockDoor { +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::LabelList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, labelList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace UserLabel +namespace ProxyConfiguration { + +namespace Commands { +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace ProxyConfiguration +namespace ProxyDiscovery { + +namespace Commands { +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace ProxyDiscovery +namespace ProxyValid { + +namespace Commands { +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace ProxyValid +namespace BooleanState { + +namespace Commands { +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::StateValue::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, stateValue)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +namespace StateChange { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPinCode)), pinCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStateValue)), stateValue)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10886,8 +10916,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kPinCode): - ReturnErrorOnFailure(DataModel::Decode(reader, pinCode)); + case to_underlying(Fields::kStateValue): + ReturnErrorOnFailure(DataModel::Decode(reader, stateValue)); break; default: break; @@ -10898,14 +10928,21 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace LockDoor. -namespace UnlockDoor { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPinCode)), pinCode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); +} // namespace StateChange. +} // namespace Events + +} // namespace BooleanState +namespace ModeSelect { +namespace Structs { +namespace ModeOptionStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLabel)), label)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMode)), mode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSemanticTag)), semanticTag)); + ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10914,14 +10951,21 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kPinCode): - ReturnErrorOnFailure(DataModel::Decode(reader, pinCode)); + case to_underlying(Fields::kLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, label)); + break; + case to_underlying(Fields::kMode): + ReturnErrorOnFailure(DataModel::Decode(reader, mode)); + break; + case to_underlying(Fields::kSemanticTag): + ReturnErrorOnFailure(DataModel::Decode(reader, semanticTag)); break; default: break; @@ -10932,14 +10976,15 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace UnlockDoor. -namespace UnlockWithTimeout { + +} // namespace ModeOptionStruct +namespace SemanticTag { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTimeout)), timeout)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPinCode)), pinCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMfgCode)), mfgCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kValue)), value)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10949,17 +10994,18 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kTimeout): - ReturnErrorOnFailure(DataModel::Decode(reader, timeout)); + case to_underlying(Fields::kMfgCode): + ReturnErrorOnFailure(DataModel::Decode(reader, mfgCode)); break; - case to_underlying(Fields::kPinCode): - ReturnErrorOnFailure(DataModel::Decode(reader, pinCode)); + case to_underlying(Fields::kValue): + ReturnErrorOnFailure(DataModel::Decode(reader, value)); break; default: break; @@ -10970,13 +11016,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace UnlockWithTimeout. -namespace GetLogRecord { + +} // namespace SemanticTag +} // namespace Structs + +namespace Commands { +namespace ChangeToMode { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLogIndex)), logIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNewMode)), newMode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -10992,8 +11042,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kLogIndex): - ReturnErrorOnFailure(DataModel::Decode(reader, logIndex)); + case to_underlying(Fields::kNewMode): + ReturnErrorOnFailure(DataModel::Decode(reader, newMode)); break; default: break; @@ -11004,20 +11054,105 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetLogRecord. -namespace GetLogRecordResponse { +} // namespace ChangeToMode. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::CurrentMode::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, currentMode)); + break; + case Attributes::SupportedModes::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, supportedModes)); + break; + case Attributes::OnMode::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, onMode)); + break; + case Attributes::StartUpMode::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, startUpMode)); + break; + case Attributes::Description::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, description)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace ModeSelect +namespace ShadeConfiguration { + +namespace Commands { +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::PhysicalClosedLimit::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, physicalClosedLimit)); + break; + case Attributes::MotorStepSize::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, motorStepSize)); + break; + case Attributes::Status::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, status)); + break; + case Attributes::ClosedLimit::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, closedLimit)); + break; + case Attributes::Mode::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, mode)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace ShadeConfiguration +namespace DoorLock { +namespace Structs { +namespace DlCredential { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLogEntryId)), logEntryId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTimestamp)), timestamp)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEventType)), eventType)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSource)), source)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEventIdOrAlarmCode)), eventIdOrAlarmCode)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserId)), userId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPin)), pin)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCredentialType)), credentialType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCredentialIndex)), credentialIndex)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11027,32 +11162,18 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kLogEntryId): - ReturnErrorOnFailure(DataModel::Decode(reader, logEntryId)); - break; - case to_underlying(Fields::kTimestamp): - ReturnErrorOnFailure(DataModel::Decode(reader, timestamp)); - break; - case to_underlying(Fields::kEventType): - ReturnErrorOnFailure(DataModel::Decode(reader, eventType)); - break; - case to_underlying(Fields::kSource): - ReturnErrorOnFailure(DataModel::Decode(reader, source)); - break; - case to_underlying(Fields::kEventIdOrAlarmCode): - ReturnErrorOnFailure(DataModel::Decode(reader, eventIdOrAlarmCode)); - break; - case to_underlying(Fields::kUserId): - ReturnErrorOnFailure(DataModel::Decode(reader, userId)); + case to_underlying(Fields::kCredentialType): + ReturnErrorOnFailure(DataModel::Decode(reader, credentialType)); break; - case to_underlying(Fields::kPin): - ReturnErrorOnFailure(DataModel::Decode(reader, pin)); + case to_underlying(Fields::kCredentialIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, credentialIndex)); break; default: break; @@ -11063,16 +11184,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetLogRecordResponse. -namespace SetPINCode { + +} // namespace DlCredential +} // namespace Structs + +namespace Commands { +namespace LockDoor { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserId)), userId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserStatus)), userStatus)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserType)), userType)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPin)), pin)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPinCode)), pinCode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11088,17 +11210,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kUserId): - ReturnErrorOnFailure(DataModel::Decode(reader, userId)); - break; - case to_underlying(Fields::kUserStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, userStatus)); - break; - case to_underlying(Fields::kUserType): - ReturnErrorOnFailure(DataModel::Decode(reader, userType)); - break; - case to_underlying(Fields::kPin): - ReturnErrorOnFailure(DataModel::Decode(reader, pin)); + case to_underlying(Fields::kPinCode): + ReturnErrorOnFailure(DataModel::Decode(reader, pinCode)); break; default: break; @@ -11109,13 +11222,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace SetPINCode. -namespace GetPINCode { +} // namespace LockDoor. +namespace UnlockDoor { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserId)), userId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPinCode)), pinCode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11131,8 +11244,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kUserId): - ReturnErrorOnFailure(DataModel::Decode(reader, userId)); + case to_underlying(Fields::kPinCode): + ReturnErrorOnFailure(DataModel::Decode(reader, pinCode)); break; default: break; @@ -11143,16 +11256,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetPINCode. -namespace GetPINCodeResponse { +} // namespace UnlockDoor. +namespace UnlockWithTimeout { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserId)), userId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserStatus)), userStatus)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserType)), userType)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPin)), pin)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTimeout)), timeout)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPinCode)), pinCode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -11168,17 +11279,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kUserId): - ReturnErrorOnFailure(DataModel::Decode(reader, userId)); - break; - case to_underlying(Fields::kUserStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, userStatus)); - break; - case to_underlying(Fields::kUserType): - ReturnErrorOnFailure(DataModel::Decode(reader, userType)); + case to_underlying(Fields::kTimeout): + ReturnErrorOnFailure(DataModel::Decode(reader, timeout)); break; - case to_underlying(Fields::kPin): - ReturnErrorOnFailure(DataModel::Decode(reader, pin)); + case to_underlying(Fields::kPinCode): + ReturnErrorOnFailure(DataModel::Decode(reader, pinCode)); break; default: break; @@ -11189,9 +11294,228 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetPINCodeResponse. -namespace ClearPINCode { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +} // namespace UnlockWithTimeout. +namespace GetLogRecord { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLogIndex)), logIndex)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kLogIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, logIndex)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace GetLogRecord. +namespace GetLogRecordResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLogEntryId)), logEntryId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTimestamp)), timestamp)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEventType)), eventType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSource)), source)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEventIdOrAlarmCode)), eventIdOrAlarmCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserId)), userId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPin)), pin)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kLogEntryId): + ReturnErrorOnFailure(DataModel::Decode(reader, logEntryId)); + break; + case to_underlying(Fields::kTimestamp): + ReturnErrorOnFailure(DataModel::Decode(reader, timestamp)); + break; + case to_underlying(Fields::kEventType): + ReturnErrorOnFailure(DataModel::Decode(reader, eventType)); + break; + case to_underlying(Fields::kSource): + ReturnErrorOnFailure(DataModel::Decode(reader, source)); + break; + case to_underlying(Fields::kEventIdOrAlarmCode): + ReturnErrorOnFailure(DataModel::Decode(reader, eventIdOrAlarmCode)); + break; + case to_underlying(Fields::kUserId): + ReturnErrorOnFailure(DataModel::Decode(reader, userId)); + break; + case to_underlying(Fields::kPin): + ReturnErrorOnFailure(DataModel::Decode(reader, pin)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace GetLogRecordResponse. +namespace SetPINCode { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserId)), userId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserStatus)), userStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserType)), userType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPin)), pin)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kUserId): + ReturnErrorOnFailure(DataModel::Decode(reader, userId)); + break; + case to_underlying(Fields::kUserStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, userStatus)); + break; + case to_underlying(Fields::kUserType): + ReturnErrorOnFailure(DataModel::Decode(reader, userType)); + break; + case to_underlying(Fields::kPin): + ReturnErrorOnFailure(DataModel::Decode(reader, pin)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace SetPINCode. +namespace GetPINCode { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserId)), userId)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kUserId): + ReturnErrorOnFailure(DataModel::Decode(reader, userId)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace GetPINCode. +namespace GetPINCodeResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserId)), userId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserStatus)), userStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUserType)), userType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPin)), pin)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kUserId): + ReturnErrorOnFailure(DataModel::Decode(reader, userId)); + break; + case to_underlying(Fields::kUserStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, userStatus)); + break; + case to_underlying(Fields::kUserType): + ReturnErrorOnFailure(DataModel::Decode(reader, userType)); + break; + case to_underlying(Fields::kPin): + ReturnErrorOnFailure(DataModel::Decode(reader, pin)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace GetPINCodeResponse. +namespace ClearPINCode { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); @@ -13426,24 +13750,9 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre case Attributes::InstalledClosedLimitTilt::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, installedClosedLimitTilt)); break; - case Attributes::VelocityLift::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, velocityLift)); - break; - case Attributes::AccelerationTimeLift::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, accelerationTimeLift)); - break; - case Attributes::DecelerationTimeLift::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, decelerationTimeLift)); - break; case Attributes::Mode::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, mode)); break; - case Attributes::IntermediateSetpointsLift::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, intermediateSetpointsLift)); - break; - case Attributes::IntermediateSetpointsTilt::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, intermediateSetpointsTilt)); - break; case Attributes::SafetyStatus::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, safetyStatus)); break; @@ -17573,578 +17882,23 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return CHIP_NO_ERROR; } -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace SodiumConcentrationMeasurement -namespace IasZone { - -namespace Commands { -namespace ZoneEnrollResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEnrollResponseCode)), enrollResponseCode)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kEnrollResponseCode): - ReturnErrorOnFailure(DataModel::Decode(reader, enrollResponseCode)); - break; - case to_underlying(Fields::kZoneId): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ZoneEnrollResponse. -namespace ZoneStatusChangeNotification { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatus)), zoneStatus)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kExtendedStatus)), extendedStatus)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDelay)), delay)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kZoneStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatus)); - break; - case to_underlying(Fields::kExtendedStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, extendedStatus)); - break; - case to_underlying(Fields::kZoneId): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); - break; - case to_underlying(Fields::kDelay): - ReturnErrorOnFailure(DataModel::Decode(reader, delay)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ZoneStatusChangeNotification. -namespace InitiateNormalOperationMode { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace InitiateNormalOperationMode. -namespace ZoneEnrollRequest { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneType)), zoneType)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kManufacturerCode)), manufacturerCode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kZoneType): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneType)); - break; - case to_underlying(Fields::kManufacturerCode): - ReturnErrorOnFailure(DataModel::Decode(reader, manufacturerCode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ZoneEnrollRequest. -namespace InitiateTestMode { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTestModeDuration)), testModeDuration)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCurrentZoneSensitivityLevel)), - currentZoneSensitivityLevel)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kTestModeDuration): - ReturnErrorOnFailure(DataModel::Decode(reader, testModeDuration)); - break; - case to_underlying(Fields::kCurrentZoneSensitivityLevel): - ReturnErrorOnFailure(DataModel::Decode(reader, currentZoneSensitivityLevel)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace InitiateTestMode. -namespace InitiateNormalOperationModeResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace InitiateNormalOperationModeResponse. -namespace InitiateTestModeResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace InitiateTestModeResponse. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::ZoneState::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneState)); - break; - case Attributes::ZoneType::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneType)); - break; - case Attributes::ZoneStatus::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatus)); - break; - case Attributes::IasCieAddress::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, iasCieAddress)); - break; - case Attributes::ZoneId::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); - break; - case Attributes::NumberOfZoneSensitivityLevelsSupported::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, numberOfZoneSensitivityLevelsSupported)); - break; - case Attributes::CurrentZoneSensitivityLevel::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, currentZoneSensitivityLevel)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - - return CHIP_NO_ERROR; -} -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace IasZone -namespace IasAce { -namespace Structs { -namespace IasAceZoneStatusResult { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatus)), zoneStatus)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kZoneId): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); - break; - case to_underlying(Fields::kZoneStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatus)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} - -} // namespace IasAceZoneStatusResult -} // namespace Structs - -namespace Commands { -namespace Arm { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArmMode)), armMode)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArmDisarmCode)), armDisarmCode)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kArmMode): - ReturnErrorOnFailure(DataModel::Decode(reader, armMode)); - break; - case to_underlying(Fields::kArmDisarmCode): - ReturnErrorOnFailure(DataModel::Decode(reader, armDisarmCode)); - break; - case to_underlying(Fields::kZoneId): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace Arm. -namespace ArmResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArmNotification)), armNotification)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kArmNotification): - ReturnErrorOnFailure(DataModel::Decode(reader, armNotification)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ArmResponse. -namespace Bypass { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNumberOfZones)), numberOfZones)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneIds)), zoneIds)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArmDisarmCode)), armDisarmCode)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kNumberOfZones): - ReturnErrorOnFailure(DataModel::Decode(reader, numberOfZones)); - break; - case to_underlying(Fields::kZoneIds): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneIds)); - break; - case to_underlying(Fields::kArmDisarmCode): - ReturnErrorOnFailure(DataModel::Decode(reader, armDisarmCode)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace Bypass. -namespace GetZoneIdMapResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection0)), section0)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection1)), section1)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection2)), section2)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection3)), section3)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection4)), section4)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection5)), section5)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection6)), section6)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection7)), section7)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection8)), section8)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection9)), section9)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection10)), section10)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection11)), section11)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection12)), section12)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection13)), section13)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection14)), section14)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection15)), section15)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kSection0): - ReturnErrorOnFailure(DataModel::Decode(reader, section0)); - break; - case to_underlying(Fields::kSection1): - ReturnErrorOnFailure(DataModel::Decode(reader, section1)); - break; - case to_underlying(Fields::kSection2): - ReturnErrorOnFailure(DataModel::Decode(reader, section2)); - break; - case to_underlying(Fields::kSection3): - ReturnErrorOnFailure(DataModel::Decode(reader, section3)); - break; - case to_underlying(Fields::kSection4): - ReturnErrorOnFailure(DataModel::Decode(reader, section4)); - break; - case to_underlying(Fields::kSection5): - ReturnErrorOnFailure(DataModel::Decode(reader, section5)); - break; - case to_underlying(Fields::kSection6): - ReturnErrorOnFailure(DataModel::Decode(reader, section6)); - break; - case to_underlying(Fields::kSection7): - ReturnErrorOnFailure(DataModel::Decode(reader, section7)); - break; - case to_underlying(Fields::kSection8): - ReturnErrorOnFailure(DataModel::Decode(reader, section8)); - break; - case to_underlying(Fields::kSection9): - ReturnErrorOnFailure(DataModel::Decode(reader, section9)); - break; - case to_underlying(Fields::kSection10): - ReturnErrorOnFailure(DataModel::Decode(reader, section10)); - break; - case to_underlying(Fields::kSection11): - ReturnErrorOnFailure(DataModel::Decode(reader, section11)); - break; - case to_underlying(Fields::kSection12): - ReturnErrorOnFailure(DataModel::Decode(reader, section12)); - break; - case to_underlying(Fields::kSection13): - ReturnErrorOnFailure(DataModel::Decode(reader, section13)); - break; - case to_underlying(Fields::kSection14): - ReturnErrorOnFailure(DataModel::Decode(reader, section14)); - break; - case to_underlying(Fields::kSection15): - ReturnErrorOnFailure(DataModel::Decode(reader, section15)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace GetZoneIdMapResponse. -namespace Emergency { +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace SodiumConcentrationMeasurement +namespace IasZone { + +namespace Commands { +namespace ZoneEnrollResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEnrollResponseCode)), enrollResponseCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18160,6 +17914,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kEnrollResponseCode): + ReturnErrorOnFailure(DataModel::Decode(reader, enrollResponseCode)); + break; + case to_underlying(Fields::kZoneId): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); + break; default: break; } @@ -18169,16 +17929,16 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Emergency. -namespace GetZoneInformationResponse { +} // namespace ZoneEnrollResponse. +namespace ZoneStatusChangeNotification { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatus)), zoneStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kExtendedStatus)), extendedStatus)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneType)), zoneType)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kIeeeAddress)), ieeeAddress)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneLabel)), zoneLabel)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDelay)), delay)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18194,17 +17954,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kZoneId): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); + case to_underlying(Fields::kZoneStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatus)); break; - case to_underlying(Fields::kZoneType): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneType)); + case to_underlying(Fields::kExtendedStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, extendedStatus)); break; - case to_underlying(Fields::kIeeeAddress): - ReturnErrorOnFailure(DataModel::Decode(reader, ieeeAddress)); + case to_underlying(Fields::kZoneId): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); break; - case to_underlying(Fields::kZoneLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneLabel)); + case to_underlying(Fields::kDelay): + ReturnErrorOnFailure(DataModel::Decode(reader, delay)); break; default: break; @@ -18215,8 +17975,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetZoneInformationResponse. -namespace Fire { +} // namespace ZoneStatusChangeNotification. +namespace InitiateNormalOperationMode { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -18245,17 +18005,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Fire. -namespace ZoneStatusChanged { +} // namespace InitiateNormalOperationMode. +namespace ZoneEnrollRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatus)), zoneStatus)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAudibleNotification)), audibleNotification)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneLabel)), zoneLabel)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneType)), zoneType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kManufacturerCode)), manufacturerCode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18271,17 +18028,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kZoneId): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); - break; - case to_underlying(Fields::kZoneStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatus)); - break; - case to_underlying(Fields::kAudibleNotification): - ReturnErrorOnFailure(DataModel::Decode(reader, audibleNotification)); + case to_underlying(Fields::kZoneType): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneType)); break; - case to_underlying(Fields::kZoneLabel): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneLabel)); + case to_underlying(Fields::kManufacturerCode): + ReturnErrorOnFailure(DataModel::Decode(reader, manufacturerCode)); break; default: break; @@ -18292,12 +18043,15 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ZoneStatusChanged. -namespace Panic { +} // namespace ZoneEnrollRequest. +namespace InitiateTestMode { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTestModeDuration)), testModeDuration)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCurrentZoneSensitivityLevel)), + currentZoneSensitivityLevel)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18313,6 +18067,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kTestModeDuration): + ReturnErrorOnFailure(DataModel::Decode(reader, testModeDuration)); + break; + case to_underlying(Fields::kCurrentZoneSensitivityLevel): + ReturnErrorOnFailure(DataModel::Decode(reader, currentZoneSensitivityLevel)); + break; default: break; } @@ -18322,17 +18082,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Panic. -namespace PanelStatusChanged { +} // namespace InitiateTestMode. +namespace InitiateNormalOperationModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPanelStatus)), panelStatus)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSecondsRemaining)), secondsRemaining)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAudibleNotification)), audibleNotification)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAlarmStatus)), alarmStatus)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18348,18 +18103,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kPanelStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, panelStatus)); - break; - case to_underlying(Fields::kSecondsRemaining): - ReturnErrorOnFailure(DataModel::Decode(reader, secondsRemaining)); - break; - case to_underlying(Fields::kAudibleNotification): - ReturnErrorOnFailure(DataModel::Decode(reader, audibleNotification)); - break; - case to_underlying(Fields::kAlarmStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, alarmStatus)); - break; default: break; } @@ -18369,8 +18112,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace PanelStatusChanged. -namespace GetZoneIdMap { +} // namespace InitiateNormalOperationModeResponse. +namespace InitiateTestModeResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -18399,17 +18142,65 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetZoneIdMap. -namespace GetPanelStatusResponse { +} // namespace InitiateTestModeResponse. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::ZoneState::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneState)); + break; + case Attributes::ZoneType::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneType)); + break; + case Attributes::ZoneStatus::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatus)); + break; + case Attributes::IasCieAddress::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, iasCieAddress)); + break; + case Attributes::ZoneId::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); + break; + case Attributes::NumberOfZoneSensitivityLevelsSupported::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, numberOfZoneSensitivityLevelsSupported)); + break; + case Attributes::CurrentZoneSensitivityLevel::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, currentZoneSensitivityLevel)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace IasZone +namespace IasAce { +namespace Structs { +namespace IasAceZoneStatusResult { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPanelStatus)), panelStatus)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSecondsRemaining)), secondsRemaining)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAudibleNotification)), audibleNotification)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAlarmStatus)), alarmStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatus)), zoneStatus)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18419,23 +18210,18 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kPanelStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, panelStatus)); - break; - case to_underlying(Fields::kSecondsRemaining): - ReturnErrorOnFailure(DataModel::Decode(reader, secondsRemaining)); - break; - case to_underlying(Fields::kAudibleNotification): - ReturnErrorOnFailure(DataModel::Decode(reader, audibleNotification)); + case to_underlying(Fields::kZoneId): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); break; - case to_underlying(Fields::kAlarmStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, alarmStatus)); + case to_underlying(Fields::kZoneStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatus)); break; default: break; @@ -18446,12 +18232,18 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetPanelStatusResponse. -namespace GetZoneInformation { + +} // namespace IasAceZoneStatusResult +} // namespace Structs + +namespace Commands { +namespace Arm { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArmMode)), armMode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArmDisarmCode)), armDisarmCode)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; @@ -18468,6 +18260,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kArmMode): + ReturnErrorOnFailure(DataModel::Decode(reader, armMode)); + break; + case to_underlying(Fields::kArmDisarmCode): + ReturnErrorOnFailure(DataModel::Decode(reader, armDisarmCode)); + break; case to_underlying(Fields::kZoneId): ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); break; @@ -18480,14 +18278,49 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetZoneInformation. -namespace SetBypassedZoneList { +} // namespace Arm. +namespace ArmResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArmNotification)), armNotification)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kArmNotification): + ReturnErrorOnFailure(DataModel::Decode(reader, armNotification)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace ArmResponse. +namespace Bypass { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNumberOfZones)), numberOfZones)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneIds)), zoneIds)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArmDisarmCode)), armDisarmCode)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18509,6 +18342,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) case to_underlying(Fields::kZoneIds): ReturnErrorOnFailure(DataModel::Decode(reader, zoneIds)); break; + case to_underlying(Fields::kArmDisarmCode): + ReturnErrorOnFailure(DataModel::Decode(reader, armDisarmCode)); + break; default: break; } @@ -18518,12 +18354,28 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace SetBypassedZoneList. -namespace GetPanelStatus { +} // namespace Bypass. +namespace GetZoneIdMapResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection0)), section0)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection1)), section1)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection2)), section2)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection3)), section3)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection4)), section4)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection5)), section5)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection6)), section6)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection7)), section7)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection8)), section8)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection9)), section9)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection10)), section10)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection11)), section11)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection12)), section12)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection13)), section13)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection14)), section14)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSection15)), section15)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18539,6 +18391,54 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kSection0): + ReturnErrorOnFailure(DataModel::Decode(reader, section0)); + break; + case to_underlying(Fields::kSection1): + ReturnErrorOnFailure(DataModel::Decode(reader, section1)); + break; + case to_underlying(Fields::kSection2): + ReturnErrorOnFailure(DataModel::Decode(reader, section2)); + break; + case to_underlying(Fields::kSection3): + ReturnErrorOnFailure(DataModel::Decode(reader, section3)); + break; + case to_underlying(Fields::kSection4): + ReturnErrorOnFailure(DataModel::Decode(reader, section4)); + break; + case to_underlying(Fields::kSection5): + ReturnErrorOnFailure(DataModel::Decode(reader, section5)); + break; + case to_underlying(Fields::kSection6): + ReturnErrorOnFailure(DataModel::Decode(reader, section6)); + break; + case to_underlying(Fields::kSection7): + ReturnErrorOnFailure(DataModel::Decode(reader, section7)); + break; + case to_underlying(Fields::kSection8): + ReturnErrorOnFailure(DataModel::Decode(reader, section8)); + break; + case to_underlying(Fields::kSection9): + ReturnErrorOnFailure(DataModel::Decode(reader, section9)); + break; + case to_underlying(Fields::kSection10): + ReturnErrorOnFailure(DataModel::Decode(reader, section10)); + break; + case to_underlying(Fields::kSection11): + ReturnErrorOnFailure(DataModel::Decode(reader, section11)); + break; + case to_underlying(Fields::kSection12): + ReturnErrorOnFailure(DataModel::Decode(reader, section12)); + break; + case to_underlying(Fields::kSection13): + ReturnErrorOnFailure(DataModel::Decode(reader, section13)); + break; + case to_underlying(Fields::kSection14): + ReturnErrorOnFailure(DataModel::Decode(reader, section14)); + break; + case to_underlying(Fields::kSection15): + ReturnErrorOnFailure(DataModel::Decode(reader, section15)); + break; default: break; } @@ -18548,14 +18448,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetPanelStatus. -namespace BypassResponse { +} // namespace GetZoneIdMapResponse. +namespace Emergency { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNumberOfZones)), numberOfZones)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kBypassResult)), bypassResult)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18571,12 +18469,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kNumberOfZones): - ReturnErrorOnFailure(DataModel::Decode(reader, numberOfZones)); - break; - case to_underlying(Fields::kBypassResult): - ReturnErrorOnFailure(DataModel::Decode(reader, bypassResult)); - break; default: break; } @@ -18586,12 +18478,16 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace BypassResponse. -namespace GetBypassedZoneList { +} // namespace Emergency. +namespace GetZoneInformationResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneType)), zoneType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kIeeeAddress)), ieeeAddress)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneLabel)), zoneLabel)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18607,6 +18503,18 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kZoneId): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); + break; + case to_underlying(Fields::kZoneType): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneType)); + break; + case to_underlying(Fields::kIeeeAddress): + ReturnErrorOnFailure(DataModel::Decode(reader, ieeeAddress)); + break; + case to_underlying(Fields::kZoneLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneLabel)); + break; default: break; } @@ -18616,16 +18524,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetBypassedZoneList. -namespace GetZoneStatusResponse { +} // namespace GetZoneInformationResponse. +namespace Fire { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatusComplete)), zoneStatusComplete)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNumberOfZones)), numberOfZones)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatusResult)), zoneStatusResult)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18641,15 +18545,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kZoneStatusComplete): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatusComplete)); - break; - case to_underlying(Fields::kNumberOfZones): - ReturnErrorOnFailure(DataModel::Decode(reader, numberOfZones)); - break; - case to_underlying(Fields::kZoneStatusResult): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatusResult)); - break; default: break; } @@ -18659,18 +18554,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetZoneStatusResponse. -namespace GetZoneStatus { +} // namespace Fire. +namespace ZoneStatusChanged { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStartingZoneId)), startingZoneId)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMaxNumberOfZoneIds)), maxNumberOfZoneIds)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatus)), zoneStatus)); ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatusMaskFlag)), zoneStatusMaskFlag)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatusMask)), zoneStatusMask)); + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAudibleNotification)), audibleNotification)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneLabel)), zoneLabel)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18686,17 +18580,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kStartingZoneId): - ReturnErrorOnFailure(DataModel::Decode(reader, startingZoneId)); + case to_underlying(Fields::kZoneId): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); break; - case to_underlying(Fields::kMaxNumberOfZoneIds): - ReturnErrorOnFailure(DataModel::Decode(reader, maxNumberOfZoneIds)); + case to_underlying(Fields::kZoneStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatus)); break; - case to_underlying(Fields::kZoneStatusMaskFlag): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatusMaskFlag)); + case to_underlying(Fields::kAudibleNotification): + ReturnErrorOnFailure(DataModel::Decode(reader, audibleNotification)); break; - case to_underlying(Fields::kZoneStatusMask): - ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatusMask)); + case to_underlying(Fields::kZoneLabel): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneLabel)); break; default: break; @@ -18707,47 +18601,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetZoneStatus. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - - return CHIP_NO_ERROR; -} -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace IasAce -namespace IasWd { - -namespace Commands { -namespace StartWarning { +} // namespace ZoneStatusChanged. +namespace Panic { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kWarningInfo)), warningInfo)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kWarningDuration)), warningDuration)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStrobeDutyCycle)), strobeDutyCycle)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStrobeLevel)), strobeLevel)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18763,18 +18622,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kWarningInfo): - ReturnErrorOnFailure(DataModel::Decode(reader, warningInfo)); - break; - case to_underlying(Fields::kWarningDuration): - ReturnErrorOnFailure(DataModel::Decode(reader, warningDuration)); - break; - case to_underlying(Fields::kStrobeDutyCycle): - ReturnErrorOnFailure(DataModel::Decode(reader, strobeDutyCycle)); - break; - case to_underlying(Fields::kStrobeLevel): - ReturnErrorOnFailure(DataModel::Decode(reader, strobeLevel)); - break; default: break; } @@ -18784,13 +18631,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace StartWarning. -namespace Squawk { +} // namespace Panic. +namespace PanelStatusChanged { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSquawkInfo)), squawkInfo)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPanelStatus)), panelStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSecondsRemaining)), secondsRemaining)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAudibleNotification)), audibleNotification)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAlarmStatus)), alarmStatus)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18806,8 +18657,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kSquawkInfo): - ReturnErrorOnFailure(DataModel::Decode(reader, squawkInfo)); + case to_underlying(Fields::kPanelStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, panelStatus)); + break; + case to_underlying(Fields::kSecondsRemaining): + ReturnErrorOnFailure(DataModel::Decode(reader, secondsRemaining)); + break; + case to_underlying(Fields::kAudibleNotification): + ReturnErrorOnFailure(DataModel::Decode(reader, audibleNotification)); + break; + case to_underlying(Fields::kAlarmStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, alarmStatus)); break; default: break; @@ -18818,84 +18678,47 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Squawk. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +} // namespace PanelStatusChanged. +namespace GetZoneIdMap { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { - switch (path.mAttributeId) - { - case Attributes::MaxDuration::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, maxDuration)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; - } - - return CHIP_NO_ERROR; -} -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace IasWd -namespace WakeOnLan { - -namespace Commands { -} // namespace Commands + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { - switch (path.mAttributeId) + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) { - case Attributes::WakeOnLanMacAddress::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, wakeOnLanMacAddress)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace WakeOnLan -namespace TvChannel { -namespace Structs { -namespace TvChannelInfo { +} // namespace GetZoneIdMap. +namespace GetPanelStatusResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMajorNumber)), majorNumber)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMinorNumber)), minorNumber)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kName)), name)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCallSign)), callSign)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAffiliateCallSign)), affiliateCallSign)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPanelStatus)), panelStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSecondsRemaining)), secondsRemaining)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAudibleNotification)), audibleNotification)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAlarmStatus)), alarmStatus)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18905,27 +18728,23 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMajorNumber): - ReturnErrorOnFailure(DataModel::Decode(reader, majorNumber)); - break; - case to_underlying(Fields::kMinorNumber): - ReturnErrorOnFailure(DataModel::Decode(reader, minorNumber)); + case to_underlying(Fields::kPanelStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, panelStatus)); break; - case to_underlying(Fields::kName): - ReturnErrorOnFailure(DataModel::Decode(reader, name)); + case to_underlying(Fields::kSecondsRemaining): + ReturnErrorOnFailure(DataModel::Decode(reader, secondsRemaining)); break; - case to_underlying(Fields::kCallSign): - ReturnErrorOnFailure(DataModel::Decode(reader, callSign)); + case to_underlying(Fields::kAudibleNotification): + ReturnErrorOnFailure(DataModel::Decode(reader, audibleNotification)); break; - case to_underlying(Fields::kAffiliateCallSign): - ReturnErrorOnFailure(DataModel::Decode(reader, affiliateCallSign)); + case to_underlying(Fields::kAlarmStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, alarmStatus)); break; default: break; @@ -18936,17 +18755,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } - -} // namespace TvChannelInfo -namespace TvChannelLineupInfo { +} // namespace GetPanelStatusResponse. +namespace GetZoneInformation { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOperatorName)), operatorName)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLineupName)), lineupName)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPostalCode)), postalCode)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLineupInfoType)), lineupInfoType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneId)), zoneId)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -18956,24 +18771,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kOperatorName): - ReturnErrorOnFailure(DataModel::Decode(reader, operatorName)); - break; - case to_underlying(Fields::kLineupName): - ReturnErrorOnFailure(DataModel::Decode(reader, lineupName)); - break; - case to_underlying(Fields::kPostalCode): - ReturnErrorOnFailure(DataModel::Decode(reader, postalCode)); - break; - case to_underlying(Fields::kLineupInfoType): - ReturnErrorOnFailure(DataModel::Decode(reader, lineupInfoType)); + case to_underlying(Fields::kZoneId): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneId)); break; default: break; @@ -18984,17 +18789,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } - -} // namespace TvChannelLineupInfo -} // namespace Structs - -namespace Commands { -namespace ChangeChannel { +} // namespace GetZoneInformation. +namespace SetBypassedZoneList { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMatch)), match)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNumberOfZones)), numberOfZones)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneIds)), zoneIds)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19010,8 +18812,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMatch): - ReturnErrorOnFailure(DataModel::Decode(reader, match)); + case to_underlying(Fields::kNumberOfZones): + ReturnErrorOnFailure(DataModel::Decode(reader, numberOfZones)); + break; + case to_underlying(Fields::kZoneIds): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneIds)); break; default: break; @@ -19022,14 +18827,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ChangeChannel. -namespace ChangeChannelResponse { +} // namespace SetBypassedZoneList. +namespace GetPanelStatus { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kChannelMatch)), channelMatch)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kErrorType)), errorType)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19045,12 +18848,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kChannelMatch): - ReturnErrorOnFailure(DataModel::Decode(reader, channelMatch)); - break; - case to_underlying(Fields::kErrorType): - ReturnErrorOnFailure(DataModel::Decode(reader, errorType)); - break; default: break; } @@ -19060,14 +18857,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ChangeChannelResponse. -namespace ChangeChannelByNumber { +} // namespace GetPanelStatus. +namespace BypassResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMajorNumber)), majorNumber)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMinorNumber)), minorNumber)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNumberOfZones)), numberOfZones)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kBypassResult)), bypassResult)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19083,11 +18880,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMajorNumber): - ReturnErrorOnFailure(DataModel::Decode(reader, majorNumber)); + case to_underlying(Fields::kNumberOfZones): + ReturnErrorOnFailure(DataModel::Decode(reader, numberOfZones)); break; - case to_underlying(Fields::kMinorNumber): - ReturnErrorOnFailure(DataModel::Decode(reader, minorNumber)); + case to_underlying(Fields::kBypassResult): + ReturnErrorOnFailure(DataModel::Decode(reader, bypassResult)); break; default: break; @@ -19098,13 +18895,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ChangeChannelByNumber. -namespace SkipChannel { +} // namespace BypassResponse. +namespace GetBypassedZoneList { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCount)), count)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19120,9 +18916,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kCount): - ReturnErrorOnFailure(DataModel::Decode(reader, count)); - break; default: break; } @@ -19132,53 +18925,61 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace SkipChannel. -} // namespace Commands +} // namespace GetBypassedZoneList. +namespace GetZoneStatusResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatusComplete)), zoneStatusComplete)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNumberOfZones)), numberOfZones)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatusResult)), zoneStatusResult)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { - switch (path.mAttributeId) + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) { - case Attributes::ChannelList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, channelList)); - break; - case Attributes::ChannelLineup::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, channelLineup)); - break; - case Attributes::CurrentChannel::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, currentChannel)); - break; - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); - break; - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); - break; - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); - break; - default: - break; + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kZoneStatusComplete): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatusComplete)); + break; + case to_underlying(Fields::kNumberOfZones): + ReturnErrorOnFailure(DataModel::Decode(reader, numberOfZones)); + break; + case to_underlying(Fields::kZoneStatusResult): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatusResult)); + break; + default: + break; + } } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Attributes - -namespace Events { -} // namespace Events - -} // namespace TvChannel -namespace TargetNavigator { -namespace Structs { -namespace NavigateTargetTargetInfo { +} // namespace GetZoneStatusResponse. +namespace GetZoneStatus { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kIdentifier)), identifier)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kName)), name)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStartingZoneId)), startingZoneId)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMaxNumberOfZoneIds)), maxNumberOfZoneIds)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatusMaskFlag)), zoneStatusMaskFlag)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kZoneStatusMask)), zoneStatusMask)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19188,40 +18989,74 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); + ReturnErrorOnFailure(reader.EnterContainer(outer)); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kIdentifier): - ReturnErrorOnFailure(DataModel::Decode(reader, identifier)); + case to_underlying(Fields::kStartingZoneId): + ReturnErrorOnFailure(DataModel::Decode(reader, startingZoneId)); break; - case to_underlying(Fields::kName): - ReturnErrorOnFailure(DataModel::Decode(reader, name)); + case to_underlying(Fields::kMaxNumberOfZoneIds): + ReturnErrorOnFailure(DataModel::Decode(reader, maxNumberOfZoneIds)); + break; + case to_underlying(Fields::kZoneStatusMaskFlag): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatusMaskFlag)); + break; + case to_underlying(Fields::kZoneStatusMask): + ReturnErrorOnFailure(DataModel::Decode(reader, zoneStatusMask)); break; default: break; } } - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace GetZoneStatus. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + return CHIP_NO_ERROR; } +} // namespace Attributes -} // namespace NavigateTargetTargetInfo -} // namespace Structs +namespace Events { +} // namespace Events + +} // namespace IasAce +namespace IasWd { namespace Commands { -namespace NavigateTarget { +namespace StartWarning { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTarget)), target)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kData)), data)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kWarningInfo)), warningInfo)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kWarningDuration)), warningDuration)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStrobeDutyCycle)), strobeDutyCycle)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStrobeLevel)), strobeLevel)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19237,11 +19072,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kTarget): - ReturnErrorOnFailure(DataModel::Decode(reader, target)); + case to_underlying(Fields::kWarningInfo): + ReturnErrorOnFailure(DataModel::Decode(reader, warningInfo)); break; - case to_underlying(Fields::kData): - ReturnErrorOnFailure(DataModel::Decode(reader, data)); + case to_underlying(Fields::kWarningDuration): + ReturnErrorOnFailure(DataModel::Decode(reader, warningDuration)); + break; + case to_underlying(Fields::kStrobeDutyCycle): + ReturnErrorOnFailure(DataModel::Decode(reader, strobeDutyCycle)); + break; + case to_underlying(Fields::kStrobeLevel): + ReturnErrorOnFailure(DataModel::Decode(reader, strobeLevel)); break; default: break; @@ -19252,14 +19093,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace NavigateTarget. -namespace NavigateTargetResponse { +} // namespace StartWarning. +namespace Squawk { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kData)), data)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSquawkInfo)), squawkInfo)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19275,11 +19115,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, status)); - break; - case to_underlying(Fields::kData): - ReturnErrorOnFailure(DataModel::Decode(reader, data)); + case to_underlying(Fields::kSquawkInfo): + ReturnErrorOnFailure(DataModel::Decode(reader, squawkInfo)); break; default: break; @@ -19290,7 +19127,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace NavigateTargetResponse. +} // namespace Squawk. } // namespace Commands namespace Attributes { @@ -19298,11 +19135,42 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::TargetNavigatorList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, targetNavigatorList)); + case Attributes::MaxDuration::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, maxDuration)); break; - case Attributes::CurrentNavigatorTarget::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, currentNavigatorTarget)); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace IasWd +namespace WakeOnLan { + +namespace Commands { +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::WakeOnLanMacAddress::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, wakeOnLanMacAddress)); break; case Attributes::AttributeList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); @@ -19324,16 +19192,19 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events { } // namespace Events -} // namespace TargetNavigator -namespace MediaPlayback { +} // namespace WakeOnLan +namespace Channel { namespace Structs { -namespace MediaPlaybackPosition { +namespace ChannelInfo { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUpdatedAt)), updatedAt)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPosition)), position)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMajorNumber)), majorNumber)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMinorNumber)), minorNumber)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kName)), name)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCallSign)), callSign)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAffiliateCallSign)), affiliateCallSign)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19350,11 +19221,20 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kUpdatedAt): - ReturnErrorOnFailure(DataModel::Decode(reader, updatedAt)); + case to_underlying(Fields::kMajorNumber): + ReturnErrorOnFailure(DataModel::Decode(reader, majorNumber)); break; - case to_underlying(Fields::kPosition): - ReturnErrorOnFailure(DataModel::Decode(reader, position)); + case to_underlying(Fields::kMinorNumber): + ReturnErrorOnFailure(DataModel::Decode(reader, minorNumber)); + break; + case to_underlying(Fields::kName): + ReturnErrorOnFailure(DataModel::Decode(reader, name)); + break; + case to_underlying(Fields::kCallSign): + ReturnErrorOnFailure(DataModel::Decode(reader, callSign)); + break; + case to_underlying(Fields::kAffiliateCallSign): + ReturnErrorOnFailure(DataModel::Decode(reader, affiliateCallSign)); break; default: break; @@ -19366,15 +19246,16 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace MediaPlaybackPosition -} // namespace Structs - -namespace Commands { -namespace MediaPlay { +} // namespace ChannelInfo +namespace LineupInfo { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOperatorName)), operatorName)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLineupName)), lineupName)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPostalCode)), postalCode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kLineupInfoType)), lineupInfoType)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19384,12 +19265,25 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kOperatorName): + ReturnErrorOnFailure(DataModel::Decode(reader, operatorName)); + break; + case to_underlying(Fields::kLineupName): + ReturnErrorOnFailure(DataModel::Decode(reader, lineupName)); + break; + case to_underlying(Fields::kPostalCode): + ReturnErrorOnFailure(DataModel::Decode(reader, postalCode)); + break; + case to_underlying(Fields::kLineupInfoType): + ReturnErrorOnFailure(DataModel::Decode(reader, lineupInfoType)); + break; default: break; } @@ -19399,14 +19293,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaPlay. -namespace MediaPlayResponse { + +} // namespace LineupInfo +} // namespace Structs + +namespace Commands { +namespace ChangeChannelRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMatch)), match)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19422,8 +19319,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); + case to_underlying(Fields::kMatch): + ReturnErrorOnFailure(DataModel::Decode(reader, match)); break; default: break; @@ -19434,12 +19331,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaPlayResponse. -namespace MediaPause { +} // namespace ChangeChannelRequest. +namespace ChangeChannelResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kChannelMatch)), channelMatch)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kErrorType)), errorType)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19455,6 +19354,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kChannelMatch): + ReturnErrorOnFailure(DataModel::Decode(reader, channelMatch)); + break; + case to_underlying(Fields::kErrorType): + ReturnErrorOnFailure(DataModel::Decode(reader, errorType)); + break; default: break; } @@ -19464,14 +19369,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaPause. -namespace MediaPauseResponse { +} // namespace ChangeChannelResponse. +namespace ChangeChannelByNumberRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMajorNumber)), majorNumber)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMinorNumber)), minorNumber)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19487,8 +19392,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); + case to_underlying(Fields::kMajorNumber): + ReturnErrorOnFailure(DataModel::Decode(reader, majorNumber)); + break; + case to_underlying(Fields::kMinorNumber): + ReturnErrorOnFailure(DataModel::Decode(reader, minorNumber)); break; default: break; @@ -19499,12 +19407,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaPauseResponse. -namespace MediaStop { +} // namespace ChangeChannelByNumberRequest. +namespace SkipChannelRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCount)), count)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19520,6 +19429,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kCount): + ReturnErrorOnFailure(DataModel::Decode(reader, count)); + break; default: break; } @@ -19529,47 +19441,53 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaStop. -namespace MediaStopResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} +} // namespace SkipChannelRequest. +} // namespace Commands -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) { - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) + switch (path.mAttributeId) { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); - break; - default: - break; - } + case Attributes::ChannelList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, channelList)); + break; + case Attributes::ChannelLineup::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, channelLineup)); + break; + case Attributes::CurrentChannel::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, currentChannel)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; } - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaStopResponse. -namespace MediaStartOver { +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace Channel +namespace TargetNavigator { +namespace Structs { +namespace TargetInfo { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kIdentifier)), identifier)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kName)), name)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19579,12 +19497,19 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kIdentifier): + ReturnErrorOnFailure(DataModel::Decode(reader, identifier)); + break; + case to_underlying(Fields::kName): + ReturnErrorOnFailure(DataModel::Decode(reader, name)); + break; default: break; } @@ -19594,14 +19519,18 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaStartOver. -namespace MediaStartOverResponse { + +} // namespace TargetInfo +} // namespace Structs + +namespace Commands { +namespace NavigateTargetRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTarget)), target)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kData)), data)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19617,8 +19546,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); + case to_underlying(Fields::kTarget): + ReturnErrorOnFailure(DataModel::Decode(reader, target)); + break; + case to_underlying(Fields::kData): + ReturnErrorOnFailure(DataModel::Decode(reader, data)); break; default: break; @@ -19629,12 +19561,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaStartOverResponse. -namespace MediaPrevious { +} // namespace NavigateTargetRequest. +namespace NavigateTargetResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kData)), data)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19650,6 +19584,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { + case to_underlying(Fields::kStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, status)); + break; + case to_underlying(Fields::kData): + ReturnErrorOnFailure(DataModel::Decode(reader, data)); + break; default: break; } @@ -19659,14 +19599,50 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaPrevious. -namespace MediaPreviousResponse { +} // namespace NavigateTargetResponse. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::TargetNavigatorList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, targetNavigatorList)); + break; + case Attributes::CurrentNavigatorTarget::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, currentNavigatorTarget)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace TargetNavigator +namespace MediaPlayback { +namespace Structs { +namespace PlaybackPosition { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kUpdatedAt)), updatedAt)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPosition)), position)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19676,14 +19652,18 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVType outer; VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); while ((err = reader.Next()) == CHIP_NO_ERROR) { VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); + case to_underlying(Fields::kUpdatedAt): + ReturnErrorOnFailure(DataModel::Decode(reader, updatedAt)); + break; + case to_underlying(Fields::kPosition): + ReturnErrorOnFailure(DataModel::Decode(reader, position)); break; default: break; @@ -19694,8 +19674,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaPreviousResponse. -namespace MediaNext { + +} // namespace PlaybackPosition +} // namespace Structs + +namespace Commands { +namespace PlayRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -19724,14 +19708,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaNext. -namespace MediaNextResponse { +} // namespace PlayRequest. +namespace PauseRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19747,9 +19729,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); - break; default: break; } @@ -19759,8 +19738,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaNextResponse. -namespace MediaRewind { +} // namespace PauseRequest. +namespace StopRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -19789,14 +19768,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaRewind. -namespace MediaRewindResponse { +} // namespace StopRequest. +namespace StartOverRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19812,9 +19789,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); - break; default: break; } @@ -19824,8 +19798,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaRewindResponse. -namespace MediaFastForward { +} // namespace StartOverRequest. +namespace PreviousRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -19854,14 +19828,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaFastForward. -namespace MediaFastForwardResponse { +} // namespace PreviousRequest. +namespace NextRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19877,9 +19849,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); - break; default: break; } @@ -19889,14 +19858,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaFastForwardResponse. -namespace MediaSkipForward { +} // namespace NextRequest. +namespace RewindRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDeltaPositionMilliseconds)), deltaPositionMilliseconds)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19912,9 +19879,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kDeltaPositionMilliseconds): - ReturnErrorOnFailure(DataModel::Decode(reader, deltaPositionMilliseconds)); - break; default: break; } @@ -19924,14 +19888,12 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaSkipForward. -namespace MediaSkipForwardResponse { +} // namespace RewindRequest. +namespace FastForwardRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -19947,9 +19909,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); - break; default: break; } @@ -19959,8 +19918,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaSkipForwardResponse. -namespace MediaSkipBackward { +} // namespace FastForwardRequest. +namespace SkipForwardRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -19994,14 +19953,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaSkipBackward. -namespace MediaSkipBackwardResponse { +} // namespace SkipForwardRequest. +namespace SkipBackwardRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDeltaPositionMilliseconds)), deltaPositionMilliseconds)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -20017,8 +19976,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); + case to_underlying(Fields::kDeltaPositionMilliseconds): + ReturnErrorOnFailure(DataModel::Decode(reader, deltaPositionMilliseconds)); break; default: break; @@ -20029,13 +19988,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaSkipBackwardResponse. -namespace MediaSeek { +} // namespace SkipBackwardRequest. +namespace PlaybackResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPosition)), position)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -20051,8 +20010,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kPosition): - ReturnErrorOnFailure(DataModel::Decode(reader, position)); + case to_underlying(Fields::kStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, status)); break; default: break; @@ -20063,14 +20022,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaSeek. -namespace MediaSeekResponse { +} // namespace PlaybackResponse. +namespace SeekRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kMediaPlaybackStatus)), mediaPlaybackStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPosition)), position)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; } @@ -20086,8 +20044,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kMediaPlaybackStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, mediaPlaybackStatus)); + case to_underlying(Fields::kPosition): + ReturnErrorOnFailure(DataModel::Decode(reader, position)); break; default: break; @@ -20098,7 +20056,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace MediaSeekResponse. +} // namespace SeekRequest. } // namespace Commands namespace Attributes { @@ -20150,7 +20108,7 @@ namespace Events { } // namespace MediaPlayback namespace MediaInput { namespace Structs { -namespace MediaInputInfo { +namespace InputInfo { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20197,11 +20155,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace MediaInputInfo +} // namespace InputInfo } // namespace Structs namespace Commands { -namespace SelectInput { +namespace SelectInputRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20234,8 +20192,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace SelectInput. -namespace ShowInputStatus { +} // namespace SelectInputRequest. +namespace ShowInputStatusRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20264,8 +20222,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace ShowInputStatus. -namespace HideInputStatus { +} // namespace ShowInputStatusRequest. +namespace HideInputStatusRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20294,8 +20252,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace HideInputStatus. -namespace RenameInput { +} // namespace HideInputStatusRequest. +namespace RenameInputRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20332,7 +20290,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace RenameInput. +} // namespace RenameInputRequest. } // namespace Commands namespace Attributes { @@ -20431,7 +20389,7 @@ namespace Events { namespace KeypadInput { namespace Commands { -namespace SendKey { +namespace SendKeyRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20464,7 +20422,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace SendKey. +} // namespace SendKeyRequest. namespace SendKeyResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -20529,7 +20487,7 @@ namespace Events { } // namespace KeypadInput namespace ContentLauncher { namespace Structs { -namespace ContentLaunchDimension { +namespace Dimension { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20572,8 +20530,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace ContentLaunchDimension -namespace ContentLaunchAdditionalInfo { +} // namespace Dimension +namespace AdditionalInfo { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20612,8 +20570,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace ContentLaunchAdditionalInfo -namespace ContentLaunchParamater { +} // namespace AdditionalInfo +namespace Parameter { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20656,8 +20614,44 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace ContentLaunchParamater -namespace ContentLaunchStyleInformation { +} // namespace Parameter +namespace ContentSearch { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kParameterList)), parameterList)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kParameterList): + ReturnErrorOnFailure(DataModel::Decode(reader, parameterList)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} + +} // namespace ContentSearch +namespace StyleInformation { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20700,8 +20694,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace ContentLaunchStyleInformation -namespace ContentLaunchBrandingInformation { +} // namespace StyleInformation +namespace BrandingInformation { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20756,11 +20750,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace ContentLaunchBrandingInformation +} // namespace BrandingInformation } // namespace Structs namespace Commands { -namespace LaunchContent { +namespace LaunchContentRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20801,47 +20795,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace LaunchContent. -namespace LaunchContentResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kContentLaunchStatus)), contentLaunchStatus)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kData)), data)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kContentLaunchStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, contentLaunchStatus)); - break; - case to_underlying(Fields::kData): - ReturnErrorOnFailure(DataModel::Decode(reader, data)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace LaunchContentResponse. -namespace LaunchURL { +} // namespace LaunchContentRequest. +namespace LaunchURLRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -20883,14 +20838,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace LaunchURL. -namespace LaunchURLResponse { +} // namespace LaunchURLRequest. +namespace LaunchResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure( - DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kContentLaunchStatus)), contentLaunchStatus)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kData)), data)); ReturnErrorOnFailure(writer.EndContainer(outer)); return CHIP_NO_ERROR; @@ -20907,8 +20861,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); switch (TLV::TagNumFromTag(reader.GetTag())) { - case to_underlying(Fields::kContentLaunchStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, contentLaunchStatus)); + case to_underlying(Fields::kStatus): + ReturnErrorOnFailure(DataModel::Decode(reader, status)); break; case to_underlying(Fields::kData): ReturnErrorOnFailure(DataModel::Decode(reader, data)); @@ -20922,7 +20876,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace LaunchURLResponse. +} // namespace LaunchResponse. } // namespace Commands namespace Attributes { @@ -20930,8 +20884,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { switch (path.mAttributeId) { - case Attributes::AcceptsHeaderList::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, acceptsHeaderList)); + case Attributes::AcceptHeaderList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptHeaderList)); break; case Attributes::SupportedStreamingProtocols::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, supportedStreamingProtocols)); @@ -20959,7 +20913,7 @@ namespace Events { } // namespace ContentLauncher namespace AudioOutput { namespace Structs { -namespace AudioOutputInfo { +namespace OutputInfo { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21002,11 +20956,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace AudioOutputInfo +} // namespace OutputInfo } // namespace Structs namespace Commands { -namespace SelectOutput { +namespace SelectOutputRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21039,8 +20993,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace SelectOutput. -namespace RenameOutput { +} // namespace SelectOutputRequest. +namespace RenameOutputRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21077,7 +21031,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace RenameOutput. +} // namespace RenameOutputRequest. } // namespace Commands namespace Attributes { @@ -21114,7 +21068,7 @@ namespace Events { } // namespace AudioOutput namespace ApplicationLauncher { namespace Structs { -namespace ApplicationLauncherApp { +namespace Application { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21153,8 +21107,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace ApplicationLauncherApp -namespace ApplicationLauncherEndpoint { +} // namespace Application +namespace ApplicationEP { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21193,11 +21147,11 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace ApplicationLauncherEndpoint +} // namespace ApplicationEP } // namespace Structs namespace Commands { -namespace LaunchApp { +namespace LaunchAppRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21234,46 +21188,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace LaunchApp. -namespace LaunchAppResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kData)), data)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, status)); - break; - case to_underlying(Fields::kData): - ReturnErrorOnFailure(DataModel::Decode(reader, data)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace LaunchAppResponse. -namespace StopApp { +} // namespace LaunchAppRequest. +namespace StopAppRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21306,46 +21222,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace StopApp. -namespace StopAppResponse { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kData)), data)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, status)); - break; - case to_underlying(Fields::kData): - ReturnErrorOnFailure(DataModel::Decode(reader, data)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace StopAppResponse. -namespace HideApp { +} // namespace StopAppRequest. +namespace HideAppRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21378,8 +21256,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace HideApp. -namespace HideAppResponse { +} // namespace HideAppRequest. +namespace LauncherResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21416,7 +21294,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace HideAppResponse. +} // namespace LauncherResponse. } // namespace Commands namespace Attributes { @@ -21453,7 +21331,7 @@ namespace Events { } // namespace ApplicationLauncher namespace ApplicationBasic { namespace Structs { -namespace ApplicationBasicApp { +namespace Application { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21492,44 +21370,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -} // namespace ApplicationBasicApp +} // namespace Application } // namespace Structs namespace Commands { -namespace ChangeStatus { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kStatus)), status)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kStatus): - ReturnErrorOnFailure(DataModel::Decode(reader, status)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace ChangeStatus. } // namespace Commands namespace Attributes { @@ -21558,6 +21402,9 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre case Attributes::ApplicationVersion::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, applicationVersion)); break; + case Attributes::AllowedVendorList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, allowedVendorList)); + break; case Attributes::AttributeList::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); break; @@ -21582,7 +21429,7 @@ namespace Events { namespace AccountLogin { namespace Commands { -namespace GetSetupPIN { +namespace GetSetupPINRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21616,7 +21463,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace GetSetupPIN. +} // namespace GetSetupPINRequest. namespace GetSetupPINResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -21651,7 +21498,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace GetSetupPINResponse. -namespace Login { +namespace LoginRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21689,8 +21536,8 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Login. -namespace Logout { +} // namespace LoginRequest. +namespace LogoutRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { TLV::TLVType outer; @@ -21719,7 +21566,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(reader.ExitContainer(outer)); return CHIP_NO_ERROR; } -} // namespace Logout. +} // namespace LogoutRequest. } // namespace Commands namespace Attributes { 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 b8b2a224b1dc3e..bb4c23db05797d 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 @@ -728,9 +728,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PowerConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -949,9 +949,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::DeviceTemperatureConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -1236,9 +1236,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Identify::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -1701,9 +1701,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -2701,9 +2701,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -3088,9 +3088,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -3173,9 +3173,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::OnOffSwitchConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -3708,9 +3708,9 @@ struct TypeInfo namespace OnLevel { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnLevel::Id; } @@ -3720,9 +3720,9 @@ struct TypeInfo namespace OnTransitionTime { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OnTransitionTime::Id; } @@ -3732,9 +3732,9 @@ struct TypeInfo namespace OffTransitionTime { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OffTransitionTime::Id; } @@ -3744,9 +3744,9 @@ struct TypeInfo namespace DefaultMoveRate { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::DefaultMoveRate::Id; } @@ -3768,9 +3768,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -4083,9 +4083,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -4260,9 +4260,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Time::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -4434,9 +4434,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -5501,9 +5501,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -5958,9 +5958,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -6017,9 +6017,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PulseWidthModulation::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -6096,9 +6096,10 @@ namespace Attributes { namespace DeviceList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Descriptor::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::DeviceList::Id; } @@ -6108,9 +6109,9 @@ struct TypeInfo namespace ServerList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Descriptor::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ServerList::Id; } @@ -6120,9 +6121,9 @@ struct TypeInfo namespace ClientList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Descriptor::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ClientList::Id; } @@ -6132,9 +6133,9 @@ struct TypeInfo namespace PartsList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Descriptor::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::PartsList::Id; } @@ -6144,9 +6145,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Descriptor::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -6304,9 +6305,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -6383,9 +6384,9 @@ enum class Fields struct Type { public: - DataModel::Nullable cluster; - DataModel::Nullable endpoint; - DataModel::Nullable deviceType; + DataModel::Nullable cluster; + DataModel::Nullable endpoint; + DataModel::Nullable deviceType; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -6457,9 +6458,11 @@ namespace Attributes { namespace Acl { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Acl::Id; } @@ -6469,9 +6472,11 @@ struct TypeInfo namespace Extension { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Extension::Id; } @@ -6481,9 +6486,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -6811,9 +6816,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -7488,9 +7493,11 @@ namespace Attributes { namespace ActionList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ActionList::Id; } @@ -7500,9 +7507,11 @@ struct TypeInfo namespace EndpointList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::BridgedActions::Structs::EndpointListStruct::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::EndpointList::Id; } @@ -7524,9 +7533,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::BridgedActions::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -7935,9 +7944,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -8037,7 +8046,7 @@ struct DecodableType }; } // namespace StartUp namespace ShutDown { -static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical; static constexpr EventId kEventId = 0x00000001; enum class Fields @@ -8172,25 +8181,25 @@ struct Type; struct DecodableType; } // namespace QueryImage -namespace ApplyUpdateRequest { +namespace QueryImageResponse { struct Type; struct DecodableType; -} // namespace ApplyUpdateRequest +} // namespace QueryImageResponse -namespace NotifyUpdateApplied { +namespace ApplyUpdateRequest { struct Type; struct DecodableType; -} // namespace NotifyUpdateApplied +} // namespace ApplyUpdateRequest -namespace QueryImageResponse { +namespace ApplyUpdateResponse { struct Type; struct DecodableType; -} // namespace QueryImageResponse +} // namespace ApplyUpdateResponse -namespace ApplyUpdateResponse { +namespace NotifyUpdateApplied { struct Type; struct DecodableType; -} // namespace ApplyUpdateResponse +} // namespace NotifyUpdateApplied } // namespace Commands @@ -8248,26 +8257,38 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace QueryImage -namespace ApplyUpdateRequest { +namespace QueryImageResponse { enum class Fields { - kUpdateToken = 0, - kNewVersion = 1, + kStatus = 0, + kDelayedActionTime = 1, + kImageURI = 2, + kSoftwareVersion = 3, + kSoftwareVersionString = 4, + kUpdateToken = 5, + kUserConsentNeeded = 6, + kMetadataForRequestor = 7, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateRequest::Id; } + static constexpr CommandId GetCommandId() { return Commands::QueryImageResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } - chip::ByteSpan updateToken; - uint32_t newVersion; + OTAQueryStatus status; + Optional delayedActionTime; + Optional imageURI; + Optional softwareVersion; + Optional softwareVersionString; + Optional updateToken; + Optional userConsentNeeded; + Optional metadataForRequestor; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType; + using ResponseType = DataModel::NullObjectType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -8275,34 +8296,40 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateRequest::Id; } + static constexpr CommandId GetCommandId() { return Commands::QueryImageResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } - chip::ByteSpan updateToken; - uint32_t newVersion; + OTAQueryStatus status; + Optional delayedActionTime; + Optional imageURI; + Optional softwareVersion; + Optional softwareVersionString; + Optional updateToken; + Optional userConsentNeeded; + Optional metadataForRequestor; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ApplyUpdateRequest -namespace NotifyUpdateApplied { +}; // namespace QueryImageResponse +namespace ApplyUpdateRequest { enum class Fields { - kUpdateToken = 0, - kSoftwareVersion = 1, + kUpdateToken = 0, + kNewVersion = 1, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::NotifyUpdateApplied::Id; } + static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } chip::ByteSpan updateToken; - uint32_t softwareVersion; + uint32_t newVersion; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -8310,42 +8337,30 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::NotifyUpdateApplied::Id; } + static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } chip::ByteSpan updateToken; - uint32_t softwareVersion; + uint32_t newVersion; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace NotifyUpdateApplied -namespace QueryImageResponse { +}; // namespace ApplyUpdateRequest +namespace ApplyUpdateResponse { enum class Fields { - kStatus = 0, - kDelayedActionTime = 1, - kImageURI = 2, - kSoftwareVersion = 3, - kSoftwareVersionString = 4, - kUpdateToken = 5, - kUserConsentNeeded = 6, - kMetadataForRequestor = 7, + kAction = 0, + kDelayedActionTime = 1, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::QueryImageResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } - OTAQueryStatus status; - Optional delayedActionTime; - Optional imageURI; - Optional softwareVersion; - Optional softwareVersionString; - Optional updateToken; - Optional userConsentNeeded; - Optional metadataForRequestor; + OTAApplyUpdateAction action; + uint32_t delayedActionTime; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -8357,36 +8372,30 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::QueryImageResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } - OTAQueryStatus status; - Optional delayedActionTime; - Optional imageURI; - Optional softwareVersion; - Optional softwareVersionString; - Optional updateToken; - Optional userConsentNeeded; - Optional metadataForRequestor; + OTAApplyUpdateAction action; + uint32_t delayedActionTime; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace QueryImageResponse -namespace ApplyUpdateResponse { +}; // namespace ApplyUpdateResponse +namespace NotifyUpdateApplied { enum class Fields { - kAction = 0, - kDelayedActionTime = 1, + kUpdateToken = 0, + kSoftwareVersion = 1, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::NotifyUpdateApplied::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } - OTAApplyUpdateAction action; - uint32_t delayedActionTime; + chip::ByteSpan updateToken; + uint32_t softwareVersion; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -8398,14 +8407,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::NotifyUpdateApplied::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } - OTAApplyUpdateAction action; - uint32_t delayedActionTime; + chip::ByteSpan updateToken; + uint32_t softwareVersion; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ApplyUpdateResponse +}; // namespace NotifyUpdateApplied } // namespace Commands namespace Attributes { @@ -8413,9 +8422,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -8511,6 +8520,32 @@ enum class UpdateStateEnum : uint8_t using UpdateStateEnum = EmberAfUpdateStateEnum; #endif +namespace Structs { +namespace ProviderLocation { +enum class Fields +{ + kFabricIndex = 0, + kProviderNodeID = 1, + kEndpoint = 2, +}; + +struct Type +{ +public: + chip::FabricIndex fabricIndex; + chip::NodeId providerNodeID; + chip::EndpointId endpoint; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); + bool MatchesFabricIndex(FabricIndex fabricIndex_) const { return fabricIndex == fabricIndex_; } +}; + +using DecodableType = Type; + +} // namespace ProviderLocation +} // namespace Structs + namespace Commands { // Forward-declarations so we can reference these later. @@ -8525,10 +8560,11 @@ namespace Commands { namespace AnnounceOtaProvider { enum class Fields { - kProviderLocation = 0, + kProviderNodeId = 0, kVendorId = 1, kAnnouncementReason = 2, kMetadataForNode = 3, + kEndpoint = 4, }; struct Type @@ -8538,10 +8574,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::AnnounceOtaProvider::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } - chip::NodeId providerLocation; + chip::NodeId providerNodeId; chip::VendorId vendorId; OTAAnnouncementReason announcementReason; Optional metadataForNode; + chip::EndpointId endpoint; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -8556,10 +8593,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::AnnounceOtaProvider::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } - chip::NodeId providerLocation; + chip::NodeId providerNodeId; chip::VendorId vendorId; OTAAnnouncementReason announcementReason; Optional metadataForNode; + chip::EndpointId endpoint; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace AnnounceOtaProvider @@ -8567,18 +8605,20 @@ struct DecodableType namespace Attributes { -namespace DefaultOtaProvider { +namespace DefaultOtaProviders { struct TypeInfo { - using Type = chip::ByteSpan; - using DecodableType = chip::ByteSpan; - using DecodableArgType = chip::ByteSpan; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DefaultOtaProvider::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::DefaultOtaProviders::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace DefaultOtaProvider +} // namespace DefaultOtaProviders namespace UpdatePossible { struct TypeInfo { @@ -8591,12 +8631,36 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace UpdatePossible +namespace UpdateState { +struct TypeInfo +{ + using Type = chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum; + using DecodableType = chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum; + using DecodableArgType = chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::UpdateState::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace UpdateState +namespace UpdateStateProgress { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::UpdateStateProgress::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace UpdateStateProgress namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -8636,8 +8700,10 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::DefaultOtaProvider::TypeInfo::DecodableType defaultOtaProvider; + Attributes::DefaultOtaProviders::TypeInfo::DecodableType defaultOtaProviders; Attributes::UpdatePossible::TypeInfo::DecodableType updatePossible; + Attributes::UpdateState::TypeInfo::DecodableType updateState; + Attributes::UpdateStateProgress::TypeInfo::DecodableType updateStateProgress; Attributes::AttributeList::TypeInfo::DecodableType attributeList; Attributes::FeatureMap::TypeInfo::DecodableType featureMap; Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision; @@ -8664,10 +8730,10 @@ struct Type static constexpr EventId GetEventId() { return kEventId; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } - UpdateStateEnum previousState; + DataModel::Nullable previousState; UpdateStateEnum newState; ChangeReasonEnum reason; - uint32_t targetSoftwareVersion; + DataModel::Nullable targetSoftwareVersion; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -8679,10 +8745,10 @@ struct DecodableType static constexpr EventId GetEventId() { return kEventId; } static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } - UpdateStateEnum previousState; + DataModel::Nullable previousState; UpdateStateEnum newState; ChangeReasonEnum reason; - uint32_t targetSoftwareVersion; + DataModel::Nullable targetSoftwareVersion; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -8745,7 +8811,7 @@ struct Type uint32_t softwareVersion; uint64_t bytesDownloaded; uint8_t progressPercent; - int64_t platformCode; + DataModel::Nullable platformCode; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -8760,7 +8826,7 @@ struct DecodableType uint32_t softwareVersion; uint64_t bytesDownloaded; uint8_t progressPercent; - int64_t platformCode; + DataModel::Nullable platformCode; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -8774,9 +8840,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::LocalizationConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -8830,9 +8896,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::LocalizationTimeFormat::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -8886,9 +8952,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::LocalizationUnit::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -8942,9 +9008,9 @@ namespace Attributes { namespace Sources { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PowerSourceConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Sources::Id; } @@ -8954,9 +9020,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PowerSourceConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -9140,9 +9206,9 @@ struct TypeInfo namespace ActiveWiredFaults { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ActiveWiredFaults::Id; } @@ -9236,9 +9302,9 @@ struct TypeInfo namespace ActiveBatteryFaults { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ActiveBatteryFaults::Id; } @@ -9380,9 +9446,9 @@ struct TypeInfo namespace ActiveBatteryChargeFaults { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ActiveBatteryChargeFaults::Id; } @@ -9392,9 +9458,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -9783,9 +9849,12 @@ struct TypeInfo namespace BasicCommissioningInfoList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::BasicCommissioningInfoList::Id; } @@ -9819,9 +9888,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -9890,6 +9959,15 @@ enum class NetworkCommissioningStatus : uint8_t kIPBindFailed = 0x0B, kUnknownError = 0x0C, }; +// Enum for WiFiBand +enum class WiFiBand : uint8_t +{ + k2g4 = 0x00, + k3g65 = 0x01, + k5g = 0x02, + k6g = 0x03, + k60g = 0x04, +}; namespace Structs { namespace NetworkInfo { @@ -9961,8 +10039,8 @@ struct Type uint8_t security; chip::ByteSpan ssid; chip::ByteSpan bssid; - uint8_t channel; - uint32_t wiFiBand; + uint16_t channel; + WiFiBand wiFiBand; int8_t rssi; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -10078,8 +10156,8 @@ struct Type NetworkCommissioningStatus networkingStatus; chip::CharSpan debugText; - DataModel::List wiFiScanResults; - DataModel::List threadScanResults; + Optional> wiFiScanResults; + Optional> threadScanResults; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -10096,8 +10174,8 @@ struct DecodableType NetworkCommissioningStatus networkingStatus; chip::CharSpan debugText; - DataModel::DecodableList wiFiScanResults; - DataModel::DecodableList threadScanResults; + Optional> wiFiScanResults; + Optional> threadScanResults; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ScanNetworksResponse @@ -10374,9 +10452,11 @@ struct TypeInfo namespace Networks { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Networks::Id; } @@ -10422,9 +10502,9 @@ struct TypeInfo namespace LastNetworkingStatus { struct TypeInfo { - using Type = NetworkCommissioningStatus; - using DecodableType = NetworkCommissioningStatus; - using DecodableArgType = NetworkCommissioningStatus; + using Type = chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus; + using DecodableType = chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus; + using DecodableArgType = chip::app::Clusters::NetworkCommissioning::NetworkCommissioningStatus; static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LastNetworkingStatus::Id; } @@ -10458,9 +10538,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -10641,9 +10721,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::DiagnosticLogs::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -10812,9 +10892,11 @@ namespace Attributes { namespace NetworkInterfaces { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NetworkInterfaces::Id; } @@ -10872,9 +10954,9 @@ struct TypeInfo namespace ActiveHardwareFaults { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ActiveHardwareFaults::Id; } @@ -10884,9 +10966,9 @@ struct TypeInfo namespace ActiveRadioFaults { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ActiveRadioFaults::Id; } @@ -10896,9 +10978,9 @@ struct TypeInfo namespace ActiveNetworkFaults { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ActiveNetworkFaults::Id; } @@ -10908,9 +10990,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::GeneralDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -11207,9 +11289,11 @@ namespace Attributes { namespace ThreadMetrics { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::SoftwareDiagnostics::Structs::ThreadMetrics::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::SoftwareDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ThreadMetrics::Id; } @@ -11255,9 +11339,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::SoftwareDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -11649,9 +11733,11 @@ struct TypeInfo namespace NeighborTableList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::NeighborTable::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NeighborTableList::Id; } @@ -11661,9 +11747,11 @@ struct TypeInfo namespace RouteTableList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::RouteTable::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::RouteTableList::Id; } @@ -12273,9 +12361,11 @@ struct TypeInfo namespace SecurityPolicy { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::SecurityPolicy::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SecurityPolicy::Id; } @@ -12297,9 +12387,12 @@ struct TypeInfo namespace OperationalDatasetComponents { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List< + const chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::Type>; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDiagnostics::Structs::OperationalDatasetComponents::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OperationalDatasetComponents::Id; } @@ -12309,9 +12402,10 @@ struct TypeInfo namespace ActiveNetworkFaultsList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ActiveNetworkFaultsList::Id; } @@ -12321,9 +12415,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -12718,9 +12812,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -13060,9 +13154,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::EthernetNetworkDiagnostics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -13125,9 +13219,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TimeSynchronization::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -13501,9 +13595,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasic::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -13608,9 +13702,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -14092,9 +14186,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::AdministratorCommissioning::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -14738,9 +14832,11 @@ namespace Attributes { namespace FabricsList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::FabricsList::Id; } @@ -14774,9 +14870,9 @@ struct TypeInfo namespace TrustedRootCertificates { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::TrustedRootCertificates::Id; } @@ -14798,9 +14894,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -14861,24 +14957,51 @@ enum class GroupKeySecurityPolicy : uint8_t }; namespace Structs { +namespace GroupInfo { +enum class Fields +{ + kFabricIndex = 0, + kGroupId = 1, + kEndpoints = 2, + kGroupName = 3, +}; + +struct Type +{ +public: + uint16_t fabricIndex; + uint16_t groupId; + DataModel::List endpoints; + chip::CharSpan groupName; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + uint16_t fabricIndex; + uint16_t groupId; + DataModel::DecodableList endpoints; + chip::CharSpan groupName; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace GroupInfo namespace GroupKey { enum class Fields { - kVendorId = 1, - kGroupKeyIndex = 2, - kGroupKeyRoot = 3, - kGroupKeyEpochStartTime = 4, - kGroupKeySecurityPolicy = 5, + kFabricIndex = 0, + kGroupId = 1, + kGroupKeySetID = 2, }; struct Type { public: - uint16_t vendorId; - uint16_t groupKeyIndex; - chip::ByteSpan groupKeyRoot; - uint64_t groupKeyEpochStartTime; - GroupKeySecurityPolicy groupKeySecurityPolicy; + uint16_t fabricIndex; + uint16_t groupId; + uint16_t groupKeySetID; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -14887,20 +15010,30 @@ struct Type using DecodableType = Type; } // namespace GroupKey -namespace GroupState { +namespace GroupKeySet { enum class Fields { - kVendorId = 1, - kVendorGroupId = 2, - kGroupKeySetIndex = 3, + kGroupKeySetID = 0, + kSecurityPolicy = 1, + kEpochKey0 = 2, + kEpochStartTime0 = 3, + kEpochKey1 = 4, + kEpochStartTime1 = 5, + kEpochKey2 = 6, + kEpochStartTime2 = 7, }; struct Type { public: - uint16_t vendorId; - uint16_t vendorGroupId; - uint16_t groupKeySetIndex; + uint16_t groupKeySetID; + GroupKeySecurityPolicy securityPolicy; + chip::ByteSpan epochKey0; + uint64_t epochStartTime0; + chip::ByteSpan epochKey1; + uint64_t epochStartTime1; + chip::ByteSpan epochKey2; + uint64_t epochStartTime2; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -14908,41 +15041,299 @@ struct Type using DecodableType = Type; -} // namespace GroupState +} // namespace GroupKeySet } // namespace Structs +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace KeySetWrite { +struct Type; +struct DecodableType; +} // namespace KeySetWrite + +namespace KeySetRead { +struct Type; +struct DecodableType; +} // namespace KeySetRead + +namespace KeySetReadResponse { +struct Type; +struct DecodableType; +} // namespace KeySetReadResponse + +namespace KeySetRemove { +struct Type; +struct DecodableType; +} // namespace KeySetRemove + +namespace KeySetReadAllIndices { +struct Type; +struct DecodableType; +} // namespace KeySetReadAllIndices + +namespace KeySetReadAllIndicesResponse { +struct Type; +struct DecodableType; +} // namespace KeySetReadAllIndicesResponse + +} // namespace Commands + +namespace Commands { +namespace KeySetWrite { +enum class Fields +{ + kGroupKeySet = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetWrite::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + Structs::GroupKeySet::Type groupKeySet; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetWrite::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + Structs::GroupKeySet::DecodableType groupKeySet; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetWrite +namespace KeySetRead { +enum class Fields +{ + kGroupKeySetID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetRead::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + uint16_t groupKeySetID; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetRead::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + uint16_t groupKeySetID; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetRead +namespace KeySetReadResponse { +enum class Fields +{ + kGroupKeySet = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetReadResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + Structs::GroupKeySet::Type groupKeySet; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetReadResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + Structs::GroupKeySet::DecodableType groupKeySet; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetReadResponse +namespace KeySetRemove { +enum class Fields +{ + kGroupKeySetID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetRemove::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + uint16_t groupKeySetID; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetRemove::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + uint16_t groupKeySetID; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetRemove +namespace KeySetReadAllIndices { +enum class Fields +{ + kGroupKeySetIDs = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetReadAllIndices::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + DataModel::List groupKeySetIDs; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetReadAllIndices::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + DataModel::DecodableList groupKeySetIDs; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetReadAllIndices +namespace KeySetReadAllIndicesResponse { +enum class Fields +{ + kGroupKeySetIDs = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::KeySetReadAllIndicesResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + DataModel::List groupKeySetIDs; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::KeySetReadAllIndicesResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + + DataModel::DecodableList groupKeySetIDs; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace KeySetReadAllIndicesResponse +} // namespace Commands + namespace Attributes { -namespace Groups { +namespace GroupKeyMap { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Groups::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::GroupKeyMap::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace Groups -namespace GroupKeys { +} // namespace GroupKeyMap +namespace GroupTable { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::GroupTable::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace GroupTable +namespace MaxGroupsPerFabric { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxGroupsPerFabric::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxGroupsPerFabric +namespace MaxGroupKeysPerFabric { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::GroupKeys::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxGroupKeysPerFabric::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace GroupKeys +} // namespace MaxGroupKeysPerFabric namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::GroupKeyManagement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -14982,8 +15373,10 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Groups::TypeInfo::DecodableType groups; - Attributes::GroupKeys::TypeInfo::DecodableType groupKeys; + Attributes::GroupKeyMap::TypeInfo::DecodableType groupKeyMap; + Attributes::GroupTable::TypeInfo::DecodableType groupTable; + Attributes::MaxGroupsPerFabric::TypeInfo::DecodableType maxGroupsPerFabric; + Attributes::MaxGroupKeysPerFabric::TypeInfo::DecodableType maxGroupKeysPerFabric; Attributes::AttributeList::TypeInfo::DecodableType attributeList; Attributes::FeatureMap::TypeInfo::DecodableType featureMap; Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision; @@ -15021,9 +15414,10 @@ namespace Attributes { namespace LabelList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::FixedLabel::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LabelList::Id; } @@ -15033,9 +15427,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::FixedLabel::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -15113,9 +15507,10 @@ namespace Attributes { namespace LabelList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::UserLabel::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LabelList::Id; } @@ -15125,9 +15520,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::UserLabel::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -15182,9 +15577,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ProxyConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -15238,9 +15633,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ProxyDiscovery::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -15294,9 +15689,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ProxyValid::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -15362,9 +15757,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::BooleanState::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -15556,9 +15951,11 @@ struct TypeInfo namespace SupportedModes { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedModes::Id; } @@ -15604,9 +16001,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -15725,9 +16122,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ShadeConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -18099,9 +18496,9 @@ namespace Attributes { namespace LockState { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LockState::Id; } @@ -18111,9 +18508,9 @@ struct TypeInfo namespace LockType { struct TypeInfo { - using Type = DlLockType; - using DecodableType = DlLockType; - using DecodableArgType = DlLockType; + using Type = chip::app::Clusters::DoorLock::DlLockType; + using DecodableType = chip::app::Clusters::DoorLock::DlLockType; + using DecodableArgType = chip::app::Clusters::DoorLock::DlLockType; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LockType::Id; } @@ -18135,9 +18532,9 @@ struct TypeInfo namespace DoorState { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::DoorState::Id; } @@ -18387,9 +18784,9 @@ struct TypeInfo namespace OperatingMode { struct TypeInfo { - using Type = DlOperatingMode; - using DecodableType = DlOperatingMode; - using DecodableArgType = DlOperatingMode; + using Type = chip::app::Clusters::DoorLock::DlOperatingMode; + using DecodableType = chip::app::Clusters::DoorLock::DlOperatingMode; + using DecodableArgType = chip::app::Clusters::DoorLock::DlOperatingMode; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::OperatingMode::Id; } @@ -18639,9 +19036,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -18965,6 +19362,16 @@ enum class WcConfigStatus : uint8_t kTiltEncoderControlled = 0x40, }; +// Bitmap for WcFeature +enum class WcFeature : uint32_t +{ + kLift = 0x1, + kTilt = 0x2, + kPositionAwareLift = 0x4, + kAbsolutePosition = 0x8, + kPositionAwareTilt = 0x10, +}; + // Bitmap for WcMode enum class WcMode : uint8_t { @@ -18999,16 +19406,6 @@ enum class WcSafetyStatus : uint16_t kProtection = 0x800, }; -// Bitmap for WindowCoveringFeature -enum class WindowCoveringFeature : uint32_t -{ - kLift = 0x1, - kTilt = 0x2, - kPositionAwareLift = 0x4, - kAbsolutePosition = 0x8, - kPositionAwareTilt = 0x10, -}; - namespace Commands { // Forward-declarations so we can reference these later. @@ -19180,8 +19577,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::GoToLiftPercentage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } - uint8_t liftPercentageValue; - uint16_t liftPercent100thsValue; + chip::Percent liftPercentageValue; + chip::Percent100ths liftPercent100thsValue; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -19196,8 +19593,8 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::GoToLiftPercentage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } - uint8_t liftPercentageValue; - uint16_t liftPercent100thsValue; + chip::Percent liftPercentageValue; + chip::Percent100ths liftPercent100thsValue; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GoToLiftPercentage @@ -19247,8 +19644,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::GoToTiltPercentage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } - uint8_t tiltPercentageValue; - uint16_t tiltPercent100thsValue; + chip::Percent tiltPercentageValue; + chip::Percent100ths tiltPercent100thsValue; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -19263,8 +19660,8 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::GoToTiltPercentage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } - uint8_t tiltPercentageValue; - uint16_t tiltPercent100thsValue; + chip::Percent tiltPercentageValue; + chip::Percent100ths tiltPercent100thsValue; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GoToTiltPercentage @@ -19311,9 +19708,9 @@ struct TypeInfo namespace CurrentPositionLift { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionLift::Id; } @@ -19323,9 +19720,9 @@ struct TypeInfo namespace CurrentPositionTilt { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionTilt::Id; } @@ -19371,9 +19768,9 @@ struct TypeInfo namespace CurrentPositionLiftPercentage { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionLiftPercentage::Id; } @@ -19383,9 +19780,9 @@ struct TypeInfo namespace CurrentPositionTiltPercentage { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionTiltPercentage::Id; } @@ -19407,9 +19804,9 @@ struct TypeInfo namespace TargetPositionLiftPercent100ths { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::TargetPositionLiftPercent100ths::Id; } @@ -19419,9 +19816,9 @@ struct TypeInfo namespace TargetPositionTiltPercent100ths { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::TargetPositionTiltPercent100ths::Id; } @@ -19443,9 +19840,9 @@ struct TypeInfo namespace CurrentPositionLiftPercent100ths { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionLiftPercent100ths::Id; } @@ -19455,9 +19852,9 @@ struct TypeInfo namespace CurrentPositionTiltPercent100ths { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentPositionTiltPercent100ths::Id; } @@ -19512,42 +19909,6 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace InstalledClosedLimitTilt -namespace VelocityLift { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::VelocityLift::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace VelocityLift -namespace AccelerationTimeLift { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AccelerationTimeLift::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AccelerationTimeLift -namespace DecelerationTimeLift { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DecelerationTimeLift::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DecelerationTimeLift namespace Mode { struct TypeInfo { @@ -19560,30 +19921,6 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace Mode -namespace IntermediateSetpointsLift { -struct TypeInfo -{ - using Type = chip::ByteSpan; - using DecodableType = chip::ByteSpan; - using DecodableArgType = chip::ByteSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::IntermediateSetpointsLift::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace IntermediateSetpointsLift -namespace IntermediateSetpointsTilt { -struct TypeInfo -{ - using Type = chip::ByteSpan; - using DecodableType = chip::ByteSpan; - using DecodableArgType = chip::ByteSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::IntermediateSetpointsTilt::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace IntermediateSetpointsTilt namespace SafetyStatus { struct TypeInfo { @@ -19599,9 +19936,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -19661,12 +19998,7 @@ struct TypeInfo Attributes::InstalledClosedLimitLift::TypeInfo::DecodableType installedClosedLimitLift; Attributes::InstalledOpenLimitTilt::TypeInfo::DecodableType installedOpenLimitTilt; Attributes::InstalledClosedLimitTilt::TypeInfo::DecodableType installedClosedLimitTilt; - Attributes::VelocityLift::TypeInfo::DecodableType velocityLift; - Attributes::AccelerationTimeLift::TypeInfo::DecodableType accelerationTimeLift; - Attributes::DecelerationTimeLift::TypeInfo::DecodableType decelerationTimeLift; Attributes::Mode::TypeInfo::DecodableType mode; - Attributes::IntermediateSetpointsLift::TypeInfo::DecodableType intermediateSetpointsLift; - Attributes::IntermediateSetpointsTilt::TypeInfo::DecodableType intermediateSetpointsTilt; Attributes::SafetyStatus::TypeInfo::DecodableType safetyStatus; Attributes::AttributeList::TypeInfo::DecodableType attributeList; Attributes::FeatureMap::TypeInfo::DecodableType featureMap; @@ -19880,9 +20212,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -20194,9 +20526,9 @@ struct TypeInfo namespace LifetimeRunningHours { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LifetimeRunningHours::Id; } @@ -20218,9 +20550,9 @@ struct TypeInfo namespace LifetimeEnergyConsumed { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LifetimeEnergyConsumed::Id; } @@ -20266,9 +20598,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -21682,9 +22014,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -21805,9 +22137,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::FanControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -21959,9 +22291,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::DehumidificationControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -22059,9 +22391,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ThermostatUserInterfaceConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -23790,9 +24122,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -24090,9 +24422,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -24168,9 +24500,9 @@ namespace Attributes { namespace MeasuredValue { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::MeasuredValue::Id; } @@ -24180,9 +24512,9 @@ struct TypeInfo namespace MinMeasuredValue { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::MinMeasuredValue::Id; } @@ -24192,9 +24524,9 @@ struct TypeInfo namespace MaxMeasuredValue { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::MaxMeasuredValue::Id; } @@ -24216,9 +24548,9 @@ struct TypeInfo namespace LightSensorType { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LightSensorType::Id; } @@ -24228,9 +24560,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -24337,9 +24669,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TemperatureMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -24505,9 +24837,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::PressureMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -24618,9 +24950,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::FlowMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -24726,9 +25058,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::RelativeHumidityMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -24930,9 +25262,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::OccupancySensing::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -25047,9 +25379,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::CarbonMonoxideConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -25155,9 +25487,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::CarbonDioxideConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -25263,9 +25595,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::EthyleneConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -25371,9 +25703,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::EthyleneOxideConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -25479,9 +25811,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::HydrogenConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -25587,9 +25919,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::HydrogenSulphideConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -25695,9 +26027,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::NitricOxideConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -25803,9 +26135,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::NitrogenDioxideConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -25911,9 +26243,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::OxygenConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -26019,9 +26351,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::OzoneConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -26127,9 +26459,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::SulfurDioxideConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -26235,9 +26567,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::DissolvedOxygenConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -26343,9 +26675,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::BromateConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -26451,9 +26783,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ChloraminesConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -26559,9 +26891,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ChlorineConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -26667,9 +26999,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::FecalColiformAndEColiConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -26775,9 +27107,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::FluorideConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -26883,9 +27215,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::HaloaceticAcidsConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -26991,9 +27323,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TotalTrihalomethanesConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -27099,9 +27431,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TotalColiformBacteriaConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -27207,9 +27539,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TurbidityConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -27315,9 +27647,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::CopperConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -27423,9 +27755,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::LeadConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -27531,9 +27863,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ManganeseConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -27639,9 +27971,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::SulfateConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -27747,9 +28079,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::BromodichloromethaneConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -27855,9 +28187,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::BromoformConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -27963,9 +28295,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ChlorodibromomethaneConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -28071,9 +28403,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ChloroformConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -28179,9 +28511,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::SodiumConcentrationMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -28651,9 +28983,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -29640,9 +29972,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -29815,9 +30147,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::IasWd::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -29884,9 +30216,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::WakeOnLan::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -29934,21 +30266,21 @@ struct TypeInfo }; } // namespace Attributes } // namespace WakeOnLan -namespace TvChannel { -// Enum for TvChannelErrorType -enum class TvChannelErrorType : uint8_t +namespace Channel { +// Enum for ErrorTypeEnum +enum class ErrorTypeEnum : uint8_t { kMultipleMatches = 0x00, kNoMatches = 0x01, }; -// Enum for TvChannelLineupInfoType -enum class TvChannelLineupInfoType : uint8_t +// Enum for LineupInfoTypeEnum +enum class LineupInfoTypeEnum : uint8_t { kMso = 0x00, }; namespace Structs { -namespace TvChannelInfo { +namespace ChannelInfo { enum class Fields { kMajorNumber = 1, @@ -29973,8 +30305,8 @@ struct Type using DecodableType = Type; -} // namespace TvChannelInfo -namespace TvChannelLineupInfo { +} // namespace ChannelInfo +namespace LineupInfo { enum class Fields { kOperatorName = 1, @@ -29989,7 +30321,7 @@ struct Type chip::CharSpan operatorName; chip::CharSpan lineupName; chip::CharSpan postalCode; - TvChannelLineupInfoType lineupInfoType; + LineupInfoTypeEnum lineupInfoType; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -29997,36 +30329,36 @@ struct Type using DecodableType = Type; -} // namespace TvChannelLineupInfo +} // namespace LineupInfo } // namespace Structs namespace Commands { // Forward-declarations so we can reference these later. -namespace ChangeChannel { +namespace ChangeChannelRequest { struct Type; struct DecodableType; -} // namespace ChangeChannel +} // namespace ChangeChannelRequest namespace ChangeChannelResponse { struct Type; struct DecodableType; } // namespace ChangeChannelResponse -namespace ChangeChannelByNumber { +namespace ChangeChannelByNumberRequest { struct Type; struct DecodableType; -} // namespace ChangeChannelByNumber +} // namespace ChangeChannelByNumberRequest -namespace SkipChannel { +namespace SkipChannelRequest { struct Type; struct DecodableType; -} // namespace SkipChannel +} // namespace SkipChannelRequest } // namespace Commands namespace Commands { -namespace ChangeChannel { +namespace ChangeChannelRequest { enum class Fields { kMatch = 0, @@ -30036,14 +30368,14 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeChannel::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeChannelRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } chip::CharSpan match; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType; + using ResponseType = Clusters::Channel::Commands::ChangeChannelResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -30051,13 +30383,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ChangeChannel::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeChannelRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } chip::CharSpan match; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ChangeChannel +}; // namespace ChangeChannelRequest namespace ChangeChannelResponse { enum class Fields { @@ -30070,10 +30402,10 @@ struct Type public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand static constexpr CommandId GetCommandId() { return Commands::ChangeChannelResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } - Structs::TvChannelInfo::Type channelMatch; - TvChannelErrorType errorType; + Structs::ChannelInfo::Type channelMatch; + ErrorTypeEnum errorType; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -30086,14 +30418,14 @@ struct DecodableType { public: static constexpr CommandId GetCommandId() { return Commands::ChangeChannelResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } - Structs::TvChannelInfo::DecodableType channelMatch; - TvChannelErrorType errorType; + Structs::ChannelInfo::DecodableType channelMatch; + ErrorTypeEnum errorType; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeChannelResponse -namespace ChangeChannelByNumber { +namespace ChangeChannelByNumberRequest { enum class Fields { kMajorNumber = 0, @@ -30104,8 +30436,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeChannelByNumber::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeChannelByNumberRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } uint16_t majorNumber; uint16_t minorNumber; @@ -30120,15 +30452,15 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ChangeChannelByNumber::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeChannelByNumberRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } uint16_t majorNumber; uint16_t minorNumber; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ChangeChannelByNumber -namespace SkipChannel { +}; // namespace ChangeChannelByNumberRequest +namespace SkipChannelRequest { enum class Fields { kCount = 0, @@ -30138,8 +30470,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::SkipChannel::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::SkipChannelRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } uint16_t count; @@ -30153,13 +30485,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::SkipChannel::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::SkipChannelRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } uint16_t count; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace SkipChannel +}; // namespace SkipChannelRequest } // namespace Commands namespace Attributes { @@ -30167,11 +30499,12 @@ namespace Attributes { namespace ChannelList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ChannelList::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -30179,11 +30512,11 @@ struct TypeInfo namespace ChannelLineup { struct TypeInfo { - using Type = Structs::TvChannelLineupInfo::Type; - using DecodableType = Structs::TvChannelLineupInfo::DecodableType; - using DecodableArgType = const Structs::TvChannelLineupInfo::DecodableType &; + using Type = chip::app::Clusters::Channel::Structs::LineupInfo::Type; + using DecodableType = chip::app::Clusters::Channel::Structs::LineupInfo::DecodableType; + using DecodableArgType = const chip::app::Clusters::Channel::Structs::LineupInfo::DecodableType &; - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ChannelLineup::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -30191,11 +30524,11 @@ struct TypeInfo namespace CurrentChannel { struct TypeInfo { - using Type = Structs::TvChannelInfo::Type; - using DecodableType = Structs::TvChannelInfo::DecodableType; - using DecodableArgType = const Structs::TvChannelInfo::DecodableType &; + using Type = chip::app::Clusters::Channel::Structs::ChannelInfo::Type; + using DecodableType = chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType; + using DecodableArgType = const chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType &; - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CurrentChannel::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -30203,11 +30536,11 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -30219,7 +30552,7 @@ struct TypeInfo using DecodableType = uint32_t; using DecodableArgType = uint32_t; - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::FeatureMap::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -30231,7 +30564,7 @@ struct TypeInfo using DecodableType = uint16_t; using DecodableArgType = uint16_t; - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ClusterRevision::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; @@ -30241,7 +30574,7 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Channel::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); @@ -30254,10 +30587,10 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace TvChannel +} // namespace Channel namespace TargetNavigator { -// Enum for NavigateTargetStatus -enum class NavigateTargetStatus : uint8_t +// Enum for StatusEnum +enum class StatusEnum : uint8_t { kSuccess = 0x00, kAppNotAvailable = 0x01, @@ -30265,7 +30598,7 @@ enum class NavigateTargetStatus : uint8_t }; namespace Structs { -namespace NavigateTargetTargetInfo { +namespace TargetInfo { enum class Fields { kIdentifier = 1, @@ -30284,16 +30617,16 @@ struct Type using DecodableType = Type; -} // namespace NavigateTargetTargetInfo +} // namespace TargetInfo } // namespace Structs namespace Commands { // Forward-declarations so we can reference these later. -namespace NavigateTarget { +namespace NavigateTargetRequest { struct Type; struct DecodableType; -} // namespace NavigateTarget +} // namespace NavigateTargetRequest namespace NavigateTargetResponse { struct Type; @@ -30303,7 +30636,7 @@ struct DecodableType; } // namespace Commands namespace Commands { -namespace NavigateTarget { +namespace NavigateTargetRequest { enum class Fields { kTarget = 0, @@ -30314,7 +30647,7 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::NavigateTarget::Id; } + static constexpr CommandId GetCommandId() { return Commands::NavigateTargetRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } uint8_t target; @@ -30330,14 +30663,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::NavigateTarget::Id; } + static constexpr CommandId GetCommandId() { return Commands::NavigateTargetRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } uint8_t target; chip::CharSpan data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace NavigateTarget +}; // namespace NavigateTargetRequest namespace NavigateTargetResponse { enum class Fields { @@ -30352,7 +30685,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::NavigateTargetResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } - NavigateTargetStatus status; + StatusEnum status; chip::CharSpan data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -30368,7 +30701,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::NavigateTargetResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } - NavigateTargetStatus status; + StatusEnum status; chip::CharSpan data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -30380,9 +30713,11 @@ namespace Attributes { namespace TargetNavigatorList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::TargetNavigatorList::Id; } @@ -30404,9 +30739,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -30456,25 +30791,16 @@ struct TypeInfo } // namespace Attributes } // namespace TargetNavigator namespace MediaPlayback { -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for MediaPlaybackState -enum class MediaPlaybackState : uint8_t +// Enum for PlaybackStateEnum +enum class PlaybackStateEnum : uint8_t { kPlaying = 0x00, kPaused = 0x01, kNotPlaying = 0x02, kBuffering = 0x03, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using MediaPlaybackState = EmberAfMediaPlaybackState; -#endif -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for MediaPlaybackStatus -enum class MediaPlaybackStatus : uint8_t +// Enum for StatusEnum +enum class StatusEnum : uint8_t { kSuccess = 0x00, kInvalidStateForCommand = 0x01, @@ -30483,12 +30809,9 @@ enum class MediaPlaybackStatus : uint8_t kSpeedOutOfRange = 0x04, kSeekOutOfRange = 0x05, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using MediaPlaybackStatus = EmberAfMediaPlaybackStatus; -#endif namespace Structs { -namespace MediaPlaybackPosition { +namespace PlaybackPosition { enum class Fields { kUpdatedAt = 1, @@ -30507,306 +30830,76 @@ struct Type using DecodableType = Type; -} // namespace MediaPlaybackPosition +} // namespace PlaybackPosition } // namespace Structs namespace Commands { // Forward-declarations so we can reference these later. -namespace MediaPlay { -struct Type; -struct DecodableType; -} // namespace MediaPlay - -namespace MediaPlayResponse { -struct Type; -struct DecodableType; -} // namespace MediaPlayResponse - -namespace MediaPause { -struct Type; -struct DecodableType; -} // namespace MediaPause - -namespace MediaPauseResponse { -struct Type; -struct DecodableType; -} // namespace MediaPauseResponse - -namespace MediaStop { -struct Type; -struct DecodableType; -} // namespace MediaStop - -namespace MediaStopResponse { -struct Type; -struct DecodableType; -} // namespace MediaStopResponse - -namespace MediaStartOver { -struct Type; -struct DecodableType; -} // namespace MediaStartOver - -namespace MediaStartOverResponse { -struct Type; -struct DecodableType; -} // namespace MediaStartOverResponse - -namespace MediaPrevious { -struct Type; -struct DecodableType; -} // namespace MediaPrevious - -namespace MediaPreviousResponse { +namespace PlayRequest { struct Type; struct DecodableType; -} // namespace MediaPreviousResponse +} // namespace PlayRequest -namespace MediaNext { +namespace PauseRequest { struct Type; struct DecodableType; -} // namespace MediaNext +} // namespace PauseRequest -namespace MediaNextResponse { +namespace StopRequest { struct Type; struct DecodableType; -} // namespace MediaNextResponse +} // namespace StopRequest -namespace MediaRewind { +namespace StartOverRequest { struct Type; struct DecodableType; -} // namespace MediaRewind +} // namespace StartOverRequest -namespace MediaRewindResponse { +namespace PreviousRequest { struct Type; struct DecodableType; -} // namespace MediaRewindResponse +} // namespace PreviousRequest -namespace MediaFastForward { +namespace NextRequest { struct Type; struct DecodableType; -} // namespace MediaFastForward +} // namespace NextRequest -namespace MediaFastForwardResponse { +namespace RewindRequest { struct Type; struct DecodableType; -} // namespace MediaFastForwardResponse +} // namespace RewindRequest -namespace MediaSkipForward { +namespace FastForwardRequest { struct Type; struct DecodableType; -} // namespace MediaSkipForward +} // namespace FastForwardRequest -namespace MediaSkipForwardResponse { +namespace SkipForwardRequest { struct Type; struct DecodableType; -} // namespace MediaSkipForwardResponse +} // namespace SkipForwardRequest -namespace MediaSkipBackward { +namespace SkipBackwardRequest { struct Type; struct DecodableType; -} // namespace MediaSkipBackward +} // namespace SkipBackwardRequest -namespace MediaSkipBackwardResponse { +namespace PlaybackResponse { struct Type; struct DecodableType; -} // namespace MediaSkipBackwardResponse +} // namespace PlaybackResponse -namespace MediaSeek { +namespace SeekRequest { struct Type; struct DecodableType; -} // namespace MediaSeek - -namespace MediaSeekResponse { -struct Type; -struct DecodableType; -} // namespace MediaSeekResponse +} // namespace SeekRequest } // namespace Commands namespace Commands { -namespace MediaPlay { -enum class Fields -{ -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaPlay::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::MediaPlay::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MediaPlay -namespace MediaPlayResponse { -enum class Fields -{ - kMediaPlaybackStatus = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaPlayResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::MediaPlayResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MediaPlayResponse -namespace MediaPause { -enum class Fields -{ -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaPause::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::MediaPause::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MediaPause -namespace MediaPauseResponse { -enum class Fields -{ - kMediaPlaybackStatus = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaPauseResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::MediaPauseResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MediaPauseResponse -namespace MediaStop { -enum class Fields -{ -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaStop::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::MediaStop::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MediaStop -namespace MediaStopResponse { -enum class Fields -{ - kMediaPlaybackStatus = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaStopResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::MediaStopResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MediaStopResponse -namespace MediaStartOver { +namespace PlayRequest { enum class Fields { }; @@ -30815,12 +30908,12 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaStartOver::Id; } + static constexpr CommandId GetCommandId() { return Commands::PlayRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -30828,30 +30921,27 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaStartOver::Id; } + static constexpr CommandId GetCommandId() { return Commands::PlayRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaStartOver -namespace MediaStartOverResponse { +}; // namespace PlayRequest +namespace PauseRequest { enum class Fields { - kMediaPlaybackStatus = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaStartOverResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::PauseRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -30859,14 +30949,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaStartOverResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::PauseRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaStartOverResponse -namespace MediaPrevious { +}; // namespace PauseRequest +namespace StopRequest { enum class Fields { }; @@ -30875,12 +30964,12 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaPrevious::Id; } + static constexpr CommandId GetCommandId() { return Commands::StopRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -30888,30 +30977,27 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaPrevious::Id; } + static constexpr CommandId GetCommandId() { return Commands::StopRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaPrevious -namespace MediaPreviousResponse { +}; // namespace StopRequest +namespace StartOverRequest { enum class Fields { - kMediaPlaybackStatus = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaPreviousResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::StartOverRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -30919,14 +31005,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaPreviousResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::StartOverRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaPreviousResponse -namespace MediaNext { +}; // namespace StartOverRequest +namespace PreviousRequest { enum class Fields { }; @@ -30935,103 +31020,12 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaNext::Id; } + static constexpr CommandId GetCommandId() { return Commands::PreviousRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::MediaNext::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MediaNext -namespace MediaNextResponse { -enum class Fields -{ - kMediaPlaybackStatus = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaNextResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::MediaNextResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MediaNextResponse -namespace MediaRewind { -enum class Fields -{ -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaRewind::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::MediaRewind::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MediaRewind -namespace MediaRewindResponse { -enum class Fields -{ - kMediaPlaybackStatus = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaRewindResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -31039,14 +31033,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaRewindResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::PreviousRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaRewindResponse -namespace MediaFastForward { +}; // namespace PreviousRequest +namespace NextRequest { enum class Fields { }; @@ -31055,12 +31048,12 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaFastForward::Id; } + static constexpr CommandId GetCommandId() { return Commands::NextRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -31068,30 +31061,27 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaFastForward::Id; } + static constexpr CommandId GetCommandId() { return Commands::NextRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaFastForward -namespace MediaFastForwardResponse { +}; // namespace NextRequest +namespace RewindRequest { enum class Fields { - kMediaPlaybackStatus = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaFastForwardResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::RewindRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -31099,31 +31089,27 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaFastForwardResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::RewindRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaFastForwardResponse -namespace MediaSkipForward { +}; // namespace RewindRequest +namespace FastForwardRequest { enum class Fields { - kDeltaPositionMilliseconds = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaSkipForward::Id; } + static constexpr CommandId GetCommandId() { return Commands::FastForwardRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - uint64_t deltaPositionMilliseconds; - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -31131,31 +31117,30 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaSkipForward::Id; } + static constexpr CommandId GetCommandId() { return Commands::FastForwardRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - uint64_t deltaPositionMilliseconds; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaSkipForward -namespace MediaSkipForwardResponse { +}; // namespace FastForwardRequest +namespace SkipForwardRequest { enum class Fields { - kMediaPlaybackStatus = 0, + kDeltaPositionMilliseconds = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaSkipForwardResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::SkipForwardRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; + uint64_t deltaPositionMilliseconds; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -31163,14 +31148,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaSkipForwardResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::SkipForwardRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; + uint64_t deltaPositionMilliseconds; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaSkipForwardResponse -namespace MediaSkipBackward { +}; // namespace SkipForwardRequest +namespace SkipBackwardRequest { enum class Fields { kDeltaPositionMilliseconds = 0, @@ -31180,14 +31165,14 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaSkipBackward::Id; } + static constexpr CommandId GetCommandId() { return Commands::SkipBackwardRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } uint64_t deltaPositionMilliseconds; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -31195,27 +31180,27 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaSkipBackward::Id; } + static constexpr CommandId GetCommandId() { return Commands::SkipBackwardRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } uint64_t deltaPositionMilliseconds; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaSkipBackward -namespace MediaSkipBackwardResponse { +}; // namespace SkipBackwardRequest +namespace PlaybackResponse { enum class Fields { - kMediaPlaybackStatus = 0, + kStatus = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaSkipBackwardResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::PlaybackResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; + StatusEnum status; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -31227,14 +31212,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaSkipBackwardResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::PlaybackResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - MediaPlaybackStatus mediaPlaybackStatus; + StatusEnum status; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaSkipBackwardResponse -namespace MediaSeek { +}; // namespace PlaybackResponse +namespace SeekRequest { enum class Fields { kPosition = 0, @@ -31244,14 +31229,14 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaSeek::Id; } + static constexpr CommandId GetCommandId() { return Commands::SeekRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } uint64_t position; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType; + using ResponseType = Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -31259,45 +31244,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::MediaSeek::Id; } + static constexpr CommandId GetCommandId() { return Commands::SeekRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } uint64_t position; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace MediaSeek -namespace MediaSeekResponse { -enum class Fields -{ - kMediaPlaybackStatus = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::MediaSeekResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::MediaSeekResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } - - MediaPlaybackStatus mediaPlaybackStatus; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace MediaSeekResponse +}; // namespace SeekRequest } // namespace Commands namespace Attributes { @@ -31305,9 +31258,9 @@ namespace Attributes { namespace PlaybackState { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::app::Clusters::MediaPlayback::PlaybackStateEnum; + using DecodableType = chip::app::Clusters::MediaPlayback::PlaybackStateEnum; + using DecodableArgType = chip::app::Clusters::MediaPlayback::PlaybackStateEnum; static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::PlaybackState::Id; } @@ -31341,9 +31294,9 @@ struct TypeInfo namespace Position { struct TypeInfo { - using Type = Structs::MediaPlaybackPosition::Type; - using DecodableType = Structs::MediaPlaybackPosition::DecodableType; - using DecodableArgType = const Structs::MediaPlaybackPosition::DecodableType &; + using Type = chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::Type; + using DecodableType = chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType; + using DecodableArgType = const chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType &; static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Position::Id; } @@ -31389,9 +31342,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -31446,11 +31399,8 @@ struct TypeInfo } // namespace Attributes } // namespace MediaPlayback namespace MediaInput { -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for MediaInputType -enum class MediaInputType : uint8_t +// Enum for InputTypeEnum +enum class InputTypeEnum : uint8_t { kInternal = 0x00, kAux = 0x01, @@ -31465,12 +31415,15 @@ enum class MediaInputType : uint8_t kUsb = 0x0A, kOther = 0x0B, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using MediaInputType = EmberAfMediaInputType; -#endif + +// Bitmap for MediaInputFeature +enum class MediaInputFeature : uint32_t +{ + kNameUpdates = 0x1, +}; namespace Structs { -namespace MediaInputInfo { +namespace InputInfo { enum class Fields { kIndex = 1, @@ -31483,7 +31436,7 @@ struct Type { public: uint8_t index; - MediaInputType inputType; + InputTypeEnum inputType; chip::CharSpan name; chip::CharSpan description; @@ -31493,36 +31446,36 @@ struct Type using DecodableType = Type; -} // namespace MediaInputInfo +} // namespace InputInfo } // namespace Structs namespace Commands { // Forward-declarations so we can reference these later. -namespace SelectInput { +namespace SelectInputRequest { struct Type; struct DecodableType; -} // namespace SelectInput +} // namespace SelectInputRequest -namespace ShowInputStatus { +namespace ShowInputStatusRequest { struct Type; struct DecodableType; -} // namespace ShowInputStatus +} // namespace ShowInputStatusRequest -namespace HideInputStatus { +namespace HideInputStatusRequest { struct Type; struct DecodableType; -} // namespace HideInputStatus +} // namespace HideInputStatusRequest -namespace RenameInput { +namespace RenameInputRequest { struct Type; struct DecodableType; -} // namespace RenameInput +} // namespace RenameInputRequest } // namespace Commands namespace Commands { -namespace SelectInput { +namespace SelectInputRequest { enum class Fields { kIndex = 0, @@ -31532,7 +31485,7 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::SelectInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SelectInputRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } uint8_t index; @@ -31547,14 +31500,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::SelectInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SelectInputRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } uint8_t index; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace SelectInput -namespace ShowInputStatus { +}; // namespace SelectInputRequest +namespace ShowInputStatusRequest { enum class Fields { }; @@ -31563,7 +31516,7 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ShowInputStatus::Id; } + static constexpr CommandId GetCommandId() { return Commands::ShowInputStatusRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -31576,13 +31529,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ShowInputStatus::Id; } + static constexpr CommandId GetCommandId() { return Commands::ShowInputStatusRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ShowInputStatus -namespace HideInputStatus { +}; // namespace ShowInputStatusRequest +namespace HideInputStatusRequest { enum class Fields { }; @@ -31591,7 +31544,7 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::HideInputStatus::Id; } + static constexpr CommandId GetCommandId() { return Commands::HideInputStatusRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -31604,13 +31557,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::HideInputStatus::Id; } + static constexpr CommandId GetCommandId() { return Commands::HideInputStatusRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace HideInputStatus -namespace RenameInput { +}; // namespace HideInputStatusRequest +namespace RenameInputRequest { enum class Fields { kIndex = 0, @@ -31621,7 +31574,7 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::RenameInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::RenameInputRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } uint8_t index; @@ -31637,14 +31590,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::RenameInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::RenameInputRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } uint8_t index; chip::CharSpan name; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace RenameInput +}; // namespace RenameInputRequest } // namespace Commands namespace Attributes { @@ -31652,9 +31605,10 @@ namespace Attributes { namespace MediaInputList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::MediaInputList::Id; } @@ -31676,9 +31630,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -31775,9 +31729,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::LowPower::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -31825,11 +31779,8 @@ struct TypeInfo } // namespace Attributes } // namespace LowPower namespace KeypadInput { -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for KeypadInputCecKeyCode -enum class KeypadInputCecKeyCode : uint8_t +// Enum for CecKeyCode +enum class CecKeyCode : uint8_t { kSelect = 0x00, kUp = 0x01, @@ -31918,30 +31869,29 @@ enum class KeypadInputCecKeyCode : uint8_t kF5 = 0x75, kData = 0x76, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using KeypadInputCecKeyCode = EmberAfKeypadInputCecKeyCode; -#endif -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for KeypadInputStatus -enum class KeypadInputStatus : uint8_t +// Enum for StatusEnum +enum class StatusEnum : uint8_t { kSuccess = 0x00, kUnsupportedKey = 0x01, kInvalidKeyInCurrentState = 0x02, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using KeypadInputStatus = EmberAfKeypadInputStatus; -#endif + +// Bitmap for KeypadInputFeature +enum class KeypadInputFeature : uint32_t +{ + kNavigationKeyCodes = 0x1, + kLocationKeys = 0x2, + kNumberKeys = 0x4, +}; namespace Commands { // Forward-declarations so we can reference these later. -namespace SendKey { +namespace SendKeyRequest { struct Type; struct DecodableType; -} // namespace SendKey +} // namespace SendKeyRequest namespace SendKeyResponse { struct Type; @@ -31951,7 +31901,7 @@ struct DecodableType; } // namespace Commands namespace Commands { -namespace SendKey { +namespace SendKeyRequest { enum class Fields { kKeyCode = 0, @@ -31961,10 +31911,10 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::SendKey::Id; } + static constexpr CommandId GetCommandId() { return Commands::SendKeyRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } - KeypadInputCecKeyCode keyCode; + CecKeyCode keyCode; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -31976,13 +31926,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::SendKey::Id; } + static constexpr CommandId GetCommandId() { return Commands::SendKeyRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } - KeypadInputCecKeyCode keyCode; + CecKeyCode keyCode; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace SendKey +}; // namespace SendKeyRequest namespace SendKeyResponse { enum class Fields { @@ -31996,7 +31946,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::SendKeyResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } - KeypadInputStatus status; + StatusEnum status; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -32011,7 +31961,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::SendKeyResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } - KeypadInputStatus status; + StatusEnum status; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SendKeyResponse @@ -32022,9 +31972,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -32072,14 +32022,14 @@ struct TypeInfo } // namespace Attributes } // namespace KeypadInput namespace ContentLauncher { -// Enum for ContentLaunchMetricType -enum class ContentLaunchMetricType : uint8_t +// Enum for MetricTypeEnum +enum class MetricTypeEnum : uint8_t { kPixels = 0x00, kPercentage = 0x01, }; -// Enum for ContentLaunchParameterEnum -enum class ContentLaunchParameterEnum : uint8_t +// Enum for ParameterEnum +enum class ParameterEnum : uint8_t { kActor = 0x00, kChannel = 0x01, @@ -32095,22 +32045,30 @@ enum class ContentLaunchParameterEnum : uint8_t kSportsTeam = 0x0B, kType = 0x0C, }; -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for ContentLaunchStatus -enum class ContentLaunchStatus : uint8_t +// Enum for StatusEnum +enum class StatusEnum : uint8_t { kSuccess = 0x00, kUrlNotAvailable = 0x01, kAuthFailed = 0x02, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using ContentLaunchStatus = EmberAfContentLaunchStatus; -#endif + +// Bitmap for ContentLauncherFeature +enum class ContentLauncherFeature : uint32_t +{ + kContentSearch = 0x1, + kURLPlayback = 0x2, +}; + +// Bitmap for SupportedStreamingProtocol +enum class SupportedStreamingProtocol : uint32_t +{ + kDash = 0x1, + kHls = 0x2, +}; namespace Structs { -namespace ContentLaunchDimension { +namespace Dimension { enum class Fields { kWidth = 1, @@ -32123,7 +32081,7 @@ struct Type public: double width; double height; - ContentLaunchMetricType metric; + MetricTypeEnum metric; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -32131,8 +32089,8 @@ struct Type using DecodableType = Type; -} // namespace ContentLaunchDimension -namespace ContentLaunchAdditionalInfo { +} // namespace Dimension +namespace AdditionalInfo { enum class Fields { kName = 1, @@ -32151,8 +32109,8 @@ struct Type using DecodableType = Type; -} // namespace ContentLaunchAdditionalInfo -namespace ContentLaunchParamater { +} // namespace AdditionalInfo +namespace Parameter { enum class Fields { kType = 1, @@ -32163,9 +32121,9 @@ enum class Fields struct Type { public: - ContentLaunchParameterEnum type; + ParameterEnum type; chip::CharSpan value; - DataModel::List externalIDList; + DataModel::List externalIDList; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -32173,14 +32131,36 @@ struct Type struct DecodableType { public: - ContentLaunchParameterEnum type; + ParameterEnum type; chip::CharSpan value; - DataModel::DecodableList externalIDList; + DataModel::DecodableList externalIDList; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace Parameter +namespace ContentSearch { +enum class Fields +{ + kParameterList = 1, +}; + +struct Type +{ +public: + DataModel::List parameterList; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + DataModel::DecodableList parameterList; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -} // namespace ContentLaunchParamater -namespace ContentLaunchStyleInformation { +} // namespace ContentSearch +namespace StyleInformation { enum class Fields { kImageUrl = 1, @@ -32193,7 +32173,7 @@ struct Type public: chip::CharSpan imageUrl; chip::CharSpan color; - Structs::ContentLaunchDimension::Type size; + Structs::Dimension::Type size; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -32201,8 +32181,8 @@ struct Type using DecodableType = Type; -} // namespace ContentLaunchStyleInformation -namespace ContentLaunchBrandingInformation { +} // namespace StyleInformation +namespace BrandingInformation { enum class Fields { kProviderName = 1, @@ -32217,11 +32197,11 @@ struct Type { public: chip::CharSpan providerName; - Structs::ContentLaunchStyleInformation::Type background; - Structs::ContentLaunchStyleInformation::Type logo; - Structs::ContentLaunchStyleInformation::Type progressBar; - Structs::ContentLaunchStyleInformation::Type splash; - Structs::ContentLaunchStyleInformation::Type waterMark; + Structs::StyleInformation::Type background; + Structs::StyleInformation::Type logo; + Structs::StyleInformation::Type progressBar; + Structs::StyleInformation::Type splash; + Structs::StyleInformation::Type waterMark; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -32229,36 +32209,31 @@ struct Type using DecodableType = Type; -} // namespace ContentLaunchBrandingInformation +} // namespace BrandingInformation } // namespace Structs namespace Commands { // Forward-declarations so we can reference these later. -namespace LaunchContent { -struct Type; -struct DecodableType; -} // namespace LaunchContent - -namespace LaunchContentResponse { +namespace LaunchContentRequest { struct Type; struct DecodableType; -} // namespace LaunchContentResponse +} // namespace LaunchContentRequest -namespace LaunchURL { +namespace LaunchURLRequest { struct Type; struct DecodableType; -} // namespace LaunchURL +} // namespace LaunchURLRequest -namespace LaunchURLResponse { +namespace LaunchResponse { struct Type; struct DecodableType; -} // namespace LaunchURLResponse +} // namespace LaunchResponse } // namespace Commands namespace Commands { -namespace LaunchContent { +namespace LaunchContentRequest { enum class Fields { kAutoPlay = 0, @@ -32270,16 +32245,16 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::LaunchContent::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchContentRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } bool autoPlay; chip::CharSpan data; - DataModel::List search; + DataModel::List search; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType; + using ResponseType = Clusters::ContentLauncher::Commands::LaunchResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -32287,51 +32262,16 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::LaunchContent::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchContentRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } bool autoPlay; chip::CharSpan data; - DataModel::DecodableList search; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace LaunchContent -namespace LaunchContentResponse { -enum class Fields -{ - kContentLaunchStatus = 0, - kData = 1, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::LaunchContentResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } - - ContentLaunchStatus contentLaunchStatus; - chip::CharSpan data; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::LaunchContentResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } - - ContentLaunchStatus contentLaunchStatus; - chip::CharSpan data; + DataModel::DecodableList search; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace LaunchContentResponse -namespace LaunchURL { +}; // namespace LaunchContentRequest +namespace LaunchURLRequest { enum class Fields { kContentURL = 0, @@ -32343,16 +32283,16 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::LaunchURL::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchURLRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } chip::CharSpan contentURL; chip::CharSpan displayString; - DataModel::List brandingInformation; + Structs::BrandingInformation::Type brandingInformation; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType; + using ResponseType = Clusters::ContentLauncher::Commands::LaunchResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -32360,30 +32300,30 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::LaunchURL::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchURLRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } chip::CharSpan contentURL; chip::CharSpan displayString; - DataModel::DecodableList brandingInformation; + Structs::BrandingInformation::DecodableType brandingInformation; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace LaunchURL -namespace LaunchURLResponse { +}; // namespace LaunchURLRequest +namespace LaunchResponse { enum class Fields { - kContentLaunchStatus = 0, - kData = 1, + kStatus = 0, + kData = 1, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::LaunchURLResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } - ContentLaunchStatus contentLaunchStatus; + StatusEnum status; chip::CharSpan data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -32396,30 +32336,30 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::LaunchURLResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } - ContentLaunchStatus contentLaunchStatus; + StatusEnum status; chip::CharSpan data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace LaunchURLResponse +}; // namespace LaunchResponse } // namespace Commands namespace Attributes { -namespace AcceptsHeaderList { +namespace AcceptHeaderList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcceptsHeaderList::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AcceptHeaderList::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace AcceptsHeaderList +} // namespace AcceptHeaderList namespace SupportedStreamingProtocols { struct TypeInfo { @@ -32435,9 +32375,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -32477,7 +32417,7 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::AcceptsHeaderList::TypeInfo::DecodableType acceptsHeaderList; + Attributes::AcceptHeaderList::TypeInfo::DecodableType acceptHeaderList; Attributes::SupportedStreamingProtocols::TypeInfo::DecodableType supportedStreamingProtocols; Attributes::AttributeList::TypeInfo::DecodableType attributeList; Attributes::FeatureMap::TypeInfo::DecodableType featureMap; @@ -32487,11 +32427,8 @@ struct TypeInfo } // namespace Attributes } // namespace ContentLauncher namespace AudioOutput { -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for AudioOutputType -enum class AudioOutputType : uint8_t +// Enum for OutputTypeEnum +enum class OutputTypeEnum : uint8_t { kHdmi = 0x00, kBt = 0x01, @@ -32500,12 +32437,15 @@ enum class AudioOutputType : uint8_t kInternal = 0x04, kOther = 0x05, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using AudioOutputType = EmberAfAudioOutputType; -#endif + +// Bitmap for AudiouOutputFeature +enum class AudiouOutputFeature : uint32_t +{ + kNameUpdates = 0x1, +}; namespace Structs { -namespace AudioOutputInfo { +namespace OutputInfo { enum class Fields { kIndex = 1, @@ -32517,7 +32457,7 @@ struct Type { public: uint8_t index; - AudioOutputType outputType; + OutputTypeEnum outputType; chip::CharSpan name; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -32526,26 +32466,26 @@ struct Type using DecodableType = Type; -} // namespace AudioOutputInfo +} // namespace OutputInfo } // namespace Structs namespace Commands { // Forward-declarations so we can reference these later. -namespace SelectOutput { +namespace SelectOutputRequest { struct Type; struct DecodableType; -} // namespace SelectOutput +} // namespace SelectOutputRequest -namespace RenameOutput { +namespace RenameOutputRequest { struct Type; struct DecodableType; -} // namespace RenameOutput +} // namespace RenameOutputRequest } // namespace Commands namespace Commands { -namespace SelectOutput { +namespace SelectOutputRequest { enum class Fields { kIndex = 0, @@ -32555,7 +32495,7 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::SelectOutput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SelectOutputRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AudioOutput::Id; } uint8_t index; @@ -32570,14 +32510,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::SelectOutput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SelectOutputRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AudioOutput::Id; } uint8_t index; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace SelectOutput -namespace RenameOutput { +}; // namespace SelectOutputRequest +namespace RenameOutputRequest { enum class Fields { kIndex = 0, @@ -32588,7 +32528,7 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::RenameOutput::Id; } + static constexpr CommandId GetCommandId() { return Commands::RenameOutputRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AudioOutput::Id; } uint8_t index; @@ -32604,14 +32544,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::RenameOutput::Id; } + static constexpr CommandId GetCommandId() { return Commands::RenameOutputRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AudioOutput::Id; } uint8_t index; chip::CharSpan name; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace RenameOutput +}; // namespace RenameOutputRequest } // namespace Commands namespace Attributes { @@ -32619,9 +32559,10 @@ namespace Attributes { namespace AudioOutputList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::AudioOutput::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AudioOutputList::Id; } @@ -32643,9 +32584,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::AudioOutput::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -32695,22 +32636,29 @@ struct TypeInfo } // namespace Attributes } // namespace AudioOutput namespace ApplicationLauncher { -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for ApplicationLauncherStatus -enum class ApplicationLauncherStatus : uint8_t +// Enum for StatusEnum +enum class StatusEnum : uint8_t { kSuccess = 0x00, kAppNotAvailable = 0x01, kSystemBusy = 0x02, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using ApplicationLauncherStatus = EmberAfApplicationLauncherStatus; -#endif + +// Bitmap for ApplicationLauncherFeature +enum class ApplicationLauncherFeature : uint32_t +{ + kApplicationPlatform = 0x1, +}; + +// Bitmap for ChannelFeature +enum class ChannelFeature : uint32_t +{ + kChannelList = 0x1, + kLineupInfo = 0x2, +}; namespace Structs { -namespace ApplicationLauncherApp { +namespace Application { enum class Fields { kCatalogVendorId = 1, @@ -32729,8 +32677,8 @@ struct Type using DecodableType = Type; -} // namespace ApplicationLauncherApp -namespace ApplicationLauncherEndpoint { +} // namespace Application +namespace ApplicationEP { enum class Fields { kApplication = 1, @@ -32740,7 +32688,7 @@ enum class Fields struct Type { public: - Structs::ApplicationLauncherApp::Type application; + Structs::Application::Type application; chip::CharSpan endpoint; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -32749,46 +32697,36 @@ struct Type using DecodableType = Type; -} // namespace ApplicationLauncherEndpoint +} // namespace ApplicationEP } // namespace Structs namespace Commands { // Forward-declarations so we can reference these later. -namespace LaunchApp { -struct Type; -struct DecodableType; -} // namespace LaunchApp - -namespace LaunchAppResponse { -struct Type; -struct DecodableType; -} // namespace LaunchAppResponse - -namespace StopApp { +namespace LaunchAppRequest { struct Type; struct DecodableType; -} // namespace StopApp +} // namespace LaunchAppRequest -namespace StopAppResponse { +namespace StopAppRequest { struct Type; struct DecodableType; -} // namespace StopAppResponse +} // namespace StopAppRequest -namespace HideApp { +namespace HideAppRequest { struct Type; struct DecodableType; -} // namespace HideApp +} // namespace HideAppRequest -namespace HideAppResponse { +namespace LauncherResponse { struct Type; struct DecodableType; -} // namespace HideAppResponse +} // namespace LauncherResponse } // namespace Commands namespace Commands { -namespace LaunchApp { +namespace LaunchAppRequest { enum class Fields { kData = 0, @@ -32799,50 +32737,15 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::LaunchApp::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - - chip::CharSpan data; - Structs::ApplicationLauncherApp::Type application; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::LaunchApp::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - - chip::CharSpan data; - Structs::ApplicationLauncherApp::DecodableType application; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace LaunchApp -namespace LaunchAppResponse { -enum class Fields -{ - kStatus = 0, - kData = 1, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::LaunchAppResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchAppRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - ApplicationLauncherStatus status; chip::CharSpan data; + Structs::Application::Type application; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -32850,15 +32753,15 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::LaunchAppResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchAppRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - ApplicationLauncherStatus status; chip::CharSpan data; + Structs::Application::DecodableType application; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace LaunchAppResponse -namespace StopApp { +}; // namespace LaunchAppRequest +namespace StopAppRequest { enum class Fields { kApplication = 0, @@ -32868,48 +32771,14 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::StopApp::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - - Structs::ApplicationLauncherApp::Type application; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = Clusters::ApplicationLauncher::Commands::StopAppResponse::DecodableType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::StopApp::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - - Structs::ApplicationLauncherApp::DecodableType application; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace StopApp -namespace StopAppResponse { -enum class Fields -{ - kStatus = 0, - kData = 1, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::StopAppResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::StopAppRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - ApplicationLauncherStatus status; - chip::CharSpan data; + Structs::Application::Type application; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -32917,15 +32786,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::StopAppResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::StopAppRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - ApplicationLauncherStatus status; - chip::CharSpan data; + Structs::Application::DecodableType application; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace StopAppResponse -namespace HideApp { +}; // namespace StopAppRequest +namespace HideAppRequest { enum class Fields { kApplication = 0, @@ -32935,14 +32803,14 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::HideApp::Id; } + static constexpr CommandId GetCommandId() { return Commands::HideAppRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - Structs::ApplicationLauncherApp::Type application; + Structs::Application::Type application; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - using ResponseType = Clusters::ApplicationLauncher::Commands::HideAppResponse::DecodableType; + using ResponseType = Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -32950,14 +32818,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::HideApp::Id; } + static constexpr CommandId GetCommandId() { return Commands::HideAppRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - Structs::ApplicationLauncherApp::DecodableType application; + Structs::Application::DecodableType application; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace HideApp -namespace HideAppResponse { +}; // namespace HideAppRequest +namespace LauncherResponse { enum class Fields { kStatus = 0, @@ -32968,10 +32836,10 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::HideAppResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::LauncherResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - ApplicationLauncherStatus status; + StatusEnum status; chip::CharSpan data; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -32984,14 +32852,14 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::HideAppResponse::Id; } + static constexpr CommandId GetCommandId() { return Commands::LauncherResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } - ApplicationLauncherStatus status; + StatusEnum status; chip::CharSpan data; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace HideAppResponse +}; // namespace LauncherResponse } // namespace Commands namespace Attributes { @@ -32999,9 +32867,9 @@ namespace Attributes { namespace ApplicationLauncherList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ApplicationLauncherList::Id; } @@ -33011,9 +32879,9 @@ struct TypeInfo namespace ApplicationLauncherApp { struct TypeInfo { - using Type = Structs::ApplicationLauncherEndpoint::Type; - using DecodableType = Structs::ApplicationLauncherEndpoint::DecodableType; - using DecodableArgType = const Structs::ApplicationLauncherEndpoint::DecodableType &; + using Type = chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::Type; + using DecodableType = chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType; + using DecodableArgType = const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType &; static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ApplicationLauncherApp::Id; } @@ -33023,9 +32891,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -33075,8 +32943,8 @@ struct TypeInfo } // namespace Attributes } // namespace ApplicationLauncher namespace ApplicationBasic { -// Enum for ApplicationBasicStatus -enum class ApplicationBasicStatus : uint8_t +// Enum for ApplicationStatusEnum +enum class ApplicationStatusEnum : uint8_t { kStopped = 0x00, kActiveVisibleFocus = 0x01, @@ -33085,7 +32953,7 @@ enum class ApplicationBasicStatus : uint8_t }; namespace Structs { -namespace ApplicationBasicApp { +namespace Application { enum class Fields { kCatalogVendorId = 1, @@ -33104,54 +32972,9 @@ struct Type using DecodableType = Type; -} // namespace ApplicationBasicApp +} // namespace Application } // namespace Structs -namespace Commands { -// Forward-declarations so we can reference these later. - -namespace ChangeStatus { -struct Type; -struct DecodableType; -} // namespace ChangeStatus - -} // namespace Commands - -namespace Commands { -namespace ChangeStatus { -enum class Fields -{ - kStatus = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ChangeStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ApplicationBasic::Id; } - - ApplicationBasicStatus status; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::ChangeStatus::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ApplicationBasic::Id; } - - ApplicationBasicStatus status; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace ChangeStatus -} // namespace Commands - namespace Attributes { namespace VendorName { @@ -33205,9 +33028,9 @@ struct TypeInfo namespace ApplicationApp { struct TypeInfo { - using Type = Structs::ApplicationBasicApp::Type; - using DecodableType = Structs::ApplicationBasicApp::DecodableType; - using DecodableArgType = const Structs::ApplicationBasicApp::DecodableType &; + using Type = chip::app::Clusters::ApplicationBasic::Structs::Application::Type; + using DecodableType = chip::app::Clusters::ApplicationBasic::Structs::Application::DecodableType; + using DecodableArgType = const chip::app::Clusters::ApplicationBasic::Structs::Application::DecodableType &; static constexpr ClusterId GetClusterId() { return Clusters::ApplicationBasic::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ApplicationApp::Id; } @@ -33217,9 +33040,9 @@ struct TypeInfo namespace ApplicationStatus { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum; + using DecodableType = chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum; + using DecodableArgType = chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum; static constexpr ClusterId GetClusterId() { return Clusters::ApplicationBasic::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ApplicationStatus::Id; } @@ -33238,12 +33061,24 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace ApplicationVersion +namespace AllowedVendorList { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::ApplicationBasic::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AllowedVendorList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AllowedVendorList namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ApplicationBasic::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -33290,6 +33125,7 @@ struct TypeInfo Attributes::ApplicationApp::TypeInfo::DecodableType applicationApp; Attributes::ApplicationStatus::TypeInfo::DecodableType applicationStatus; Attributes::ApplicationVersion::TypeInfo::DecodableType applicationVersion; + Attributes::AllowedVendorList::TypeInfo::DecodableType allowedVendorList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; Attributes::FeatureMap::TypeInfo::DecodableType featureMap; Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision; @@ -33302,30 +33138,30 @@ namespace AccountLogin { namespace Commands { // Forward-declarations so we can reference these later. -namespace GetSetupPIN { +namespace GetSetupPINRequest { struct Type; struct DecodableType; -} // namespace GetSetupPIN +} // namespace GetSetupPINRequest namespace GetSetupPINResponse { struct Type; struct DecodableType; } // namespace GetSetupPINResponse -namespace Login { +namespace LoginRequest { struct Type; struct DecodableType; -} // namespace Login +} // namespace LoginRequest -namespace Logout { +namespace LogoutRequest { struct Type; struct DecodableType; -} // namespace Logout +} // namespace LogoutRequest } // namespace Commands namespace Commands { -namespace GetSetupPIN { +namespace GetSetupPINRequest { enum class Fields { kTempAccountIdentifier = 0, @@ -33335,7 +33171,7 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::GetSetupPIN::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetSetupPINRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } chip::CharSpan tempAccountIdentifier; @@ -33344,19 +33180,19 @@ struct Type using ResponseType = Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType; - static constexpr bool MustUseTimedInvoke() { return false; } + static constexpr bool MustUseTimedInvoke() { return true; } }; struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::GetSetupPIN::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetSetupPINRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } chip::CharSpan tempAccountIdentifier; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace GetSetupPIN +}; // namespace GetSetupPINRequest namespace GetSetupPINResponse { enum class Fields { @@ -33376,7 +33212,7 @@ struct Type using ResponseType = DataModel::NullObjectType; - static constexpr bool MustUseTimedInvoke() { return false; } + static constexpr bool MustUseTimedInvoke() { return true; } }; struct DecodableType @@ -33389,7 +33225,7 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GetSetupPINResponse -namespace Login { +namespace LoginRequest { enum class Fields { kTempAccountIdentifier = 0, @@ -33400,7 +33236,7 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::Login::Id; } + static constexpr CommandId GetCommandId() { return Commands::LoginRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } chip::CharSpan tempAccountIdentifier; @@ -33416,15 +33252,15 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::Login::Id; } + static constexpr CommandId GetCommandId() { return Commands::LoginRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } chip::CharSpan tempAccountIdentifier; chip::CharSpan setupPIN; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace Login -namespace Logout { +}; // namespace LoginRequest +namespace LogoutRequest { enum class Fields { }; @@ -33433,25 +33269,25 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::Logout::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogoutRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; using ResponseType = DataModel::NullObjectType; - static constexpr bool MustUseTimedInvoke() { return false; } + static constexpr bool MustUseTimedInvoke() { return true; } }; struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::Logout::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogoutRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace Logout +}; // namespace LogoutRequest } // namespace Commands namespace Attributes { @@ -33459,9 +33295,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -35377,9 +35213,9 @@ struct TypeInfo namespace ListInt8u { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ListInt8u::Id; } @@ -35389,9 +35225,9 @@ struct TypeInfo namespace ListOctetString { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ListOctetString::Id; } @@ -35401,9 +35237,11 @@ struct TypeInfo namespace ListStructOctetString { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ListStructOctetString::Id; } @@ -35485,9 +35323,11 @@ struct TypeInfo namespace ListNullablesAndOptionalsStruct { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ListNullablesAndOptionalsStruct::Id; } @@ -35497,9 +35337,9 @@ struct TypeInfo namespace EnumAttr { struct TypeInfo { - using Type = SimpleEnum; - using DecodableType = SimpleEnum; - using DecodableArgType = SimpleEnum; + using Type = chip::app::Clusters::TestCluster::SimpleEnum; + using DecodableType = chip::app::Clusters::TestCluster::SimpleEnum; + using DecodableArgType = chip::app::Clusters::TestCluster::SimpleEnum; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::EnumAttr::Id; } @@ -35509,9 +35349,9 @@ struct TypeInfo namespace StructAttr { struct TypeInfo { - using Type = Structs::SimpleStruct::Type; - using DecodableType = Structs::SimpleStruct::DecodableType; - using DecodableArgType = const Structs::SimpleStruct::DecodableType &; + using Type = chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type; + using DecodableType = chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::StructAttr::Id; } @@ -35569,9 +35409,9 @@ struct TypeInfo namespace ListLongOctetString { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ListLongOctetString::Id; } @@ -35605,9 +35445,9 @@ struct TypeInfo namespace NullableBoolean { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBoolean::Id; } @@ -35617,9 +35457,9 @@ struct TypeInfo namespace NullableBitmap8 { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap8::Id; } @@ -35629,9 +35469,9 @@ struct TypeInfo namespace NullableBitmap16 { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap16::Id; } @@ -35641,9 +35481,9 @@ struct TypeInfo namespace NullableBitmap32 { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap32::Id; } @@ -35653,9 +35493,9 @@ struct TypeInfo namespace NullableBitmap64 { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap64::Id; } @@ -35665,9 +35505,9 @@ struct TypeInfo namespace NullableInt8u { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt8u::Id; } @@ -35677,9 +35517,9 @@ struct TypeInfo namespace NullableInt16u { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt16u::Id; } @@ -35689,9 +35529,9 @@ struct TypeInfo namespace NullableInt24u { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt24u::Id; } @@ -35701,9 +35541,9 @@ struct TypeInfo namespace NullableInt32u { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt32u::Id; } @@ -35713,9 +35553,9 @@ struct TypeInfo namespace NullableInt40u { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt40u::Id; } @@ -35725,9 +35565,9 @@ struct TypeInfo namespace NullableInt48u { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt48u::Id; } @@ -35737,9 +35577,9 @@ struct TypeInfo namespace NullableInt56u { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt56u::Id; } @@ -35749,9 +35589,9 @@ struct TypeInfo namespace NullableInt64u { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt64u::Id; } @@ -35761,9 +35601,9 @@ struct TypeInfo namespace NullableInt8s { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt8s::Id; } @@ -35773,9 +35613,9 @@ struct TypeInfo namespace NullableInt16s { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt16s::Id; } @@ -35785,9 +35625,9 @@ struct TypeInfo namespace NullableInt24s { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt24s::Id; } @@ -35797,9 +35637,9 @@ struct TypeInfo namespace NullableInt32s { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt32s::Id; } @@ -35809,9 +35649,9 @@ struct TypeInfo namespace NullableInt40s { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt40s::Id; } @@ -35821,9 +35661,9 @@ struct TypeInfo namespace NullableInt48s { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt48s::Id; } @@ -35833,9 +35673,9 @@ struct TypeInfo namespace NullableInt56s { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt56s::Id; } @@ -35845,9 +35685,9 @@ struct TypeInfo namespace NullableInt64s { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableInt64s::Id; } @@ -35857,9 +35697,9 @@ struct TypeInfo namespace NullableEnum8 { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableEnum8::Id; } @@ -35869,9 +35709,9 @@ struct TypeInfo namespace NullableEnum16 { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableEnum16::Id; } @@ -35881,9 +35721,9 @@ struct TypeInfo namespace NullableFloatSingle { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableFloatSingle::Id; } @@ -35893,9 +35733,9 @@ struct TypeInfo namespace NullableFloatDouble { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableFloatDouble::Id; } @@ -35905,9 +35745,9 @@ struct TypeInfo namespace NullableOctetString { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableOctetString::Id; } @@ -35917,9 +35757,9 @@ struct TypeInfo namespace NullableCharString { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableCharString::Id; } @@ -35929,9 +35769,9 @@ struct TypeInfo namespace NullableEnumAttr { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableEnumAttr::Id; } @@ -35941,9 +35781,10 @@ struct TypeInfo namespace NullableStruct { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableStruct::Id; } @@ -35953,9 +35794,9 @@ struct TypeInfo namespace NullableRangeRestrictedInt8u { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableRangeRestrictedInt8u::Id; } @@ -35965,9 +35806,9 @@ struct TypeInfo namespace NullableRangeRestrictedInt8s { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableRangeRestrictedInt8s::Id; } @@ -35977,9 +35818,9 @@ struct TypeInfo namespace NullableRangeRestrictedInt16u { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableRangeRestrictedInt16u::Id; } @@ -35989,9 +35830,9 @@ struct TypeInfo namespace NullableRangeRestrictedInt16s { struct TypeInfo { - using Type = DataModel::Nullable; - using DecodableType = DataModel::Nullable; - using DecodableArgType = const DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable; + using DecodableType = chip::app::DataModel::Nullable; + using DecodableArgType = const chip::app::DataModel::Nullable &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableRangeRestrictedInt16s::Id; } @@ -36001,9 +35842,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -36625,9 +36466,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -36825,9 +36666,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ApplianceIdentification::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -37037,9 +36878,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::MeterIdentification::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -37290,9 +37131,9 @@ namespace Attributes { namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -37620,9 +37461,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } @@ -39396,9 +39237,9 @@ struct TypeInfo namespace AttributeList { struct TypeInfo { - using Type = DataModel::List; - using DecodableType = DataModel::DecodableList; - using DecodableArgType = const DataModel::DecodableList &; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AttributeList::Id; } diff --git a/zzz_generated/app-common/app-common/zap-generated/command-id.h b/zzz_generated/app-common/app-common/zap-generated/command-id.h index 3044b854769259..26bfa4e6f87ffd 100644 --- a/zzz_generated/app-common/app-common/zap-generated/command-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/command-id.h @@ -160,10 +160,10 @@ // Commands for cluster: OTA Software Update Provider #define ZCL_QUERY_IMAGE_COMMAND_ID (0x00) -#define ZCL_APPLY_UPDATE_REQUEST_COMMAND_ID (0x01) -#define ZCL_NOTIFY_UPDATE_APPLIED_COMMAND_ID (0x02) -#define ZCL_QUERY_IMAGE_RESPONSE_COMMAND_ID (0x03) -#define ZCL_APPLY_UPDATE_RESPONSE_COMMAND_ID (0x04) +#define ZCL_QUERY_IMAGE_RESPONSE_COMMAND_ID (0x01) +#define ZCL_APPLY_UPDATE_REQUEST_COMMAND_ID (0x02) +#define ZCL_APPLY_UPDATE_RESPONSE_COMMAND_ID (0x03) +#define ZCL_NOTIFY_UPDATE_APPLIED_COMMAND_ID (0x04) // Commands for cluster: OTA Software Update Requestor #define ZCL_ANNOUNCE_OTA_PROVIDER_COMMAND_ID (0x00) @@ -229,6 +229,14 @@ #define ZCL_ADD_TRUSTED_ROOT_CERTIFICATE_COMMAND_ID (0x0B) #define ZCL_REMOVE_TRUSTED_ROOT_CERTIFICATE_COMMAND_ID (0x0C) +// Commands for cluster: Group Key Management +#define ZCL_KEY_SET_WRITE_COMMAND_ID (0x00) +#define ZCL_KEY_SET_READ_COMMAND_ID (0x01) +#define ZCL_KEY_SET_READ_RESPONSE_COMMAND_ID (0x02) +#define ZCL_KEY_SET_REMOVE_COMMAND_ID (0x03) +#define ZCL_KEY_SET_READ_ALL_INDICES_COMMAND_ID (0x04) +#define ZCL_KEY_SET_READ_ALL_INDICES_RESPONSE_COMMAND_ID (0x05) + // Commands for cluster: Mode Select #define ZCL_CHANGE_TO_MODE_COMMAND_ID (0x00) @@ -355,79 +363,63 @@ #define ZCL_START_WARNING_COMMAND_ID (0x00) #define ZCL_SQUAWK_COMMAND_ID (0x01) -// Commands for cluster: TV Channel -#define ZCL_CHANGE_CHANNEL_COMMAND_ID (0x00) -#define ZCL_CHANGE_CHANNEL_RESPONSE_COMMAND_ID (0x00) -#define ZCL_CHANGE_CHANNEL_BY_NUMBER_COMMAND_ID (0x01) -#define ZCL_SKIP_CHANNEL_COMMAND_ID (0x02) +// Commands for cluster: Channel +#define ZCL_CHANGE_CHANNEL_REQUEST_COMMAND_ID (0x00) +#define ZCL_CHANGE_CHANNEL_RESPONSE_COMMAND_ID (0x01) +#define ZCL_CHANGE_CHANNEL_BY_NUMBER_REQUEST_COMMAND_ID (0x02) +#define ZCL_SKIP_CHANNEL_REQUEST_COMMAND_ID (0x03) // Commands for cluster: Target Navigator -#define ZCL_NAVIGATE_TARGET_COMMAND_ID (0x00) -#define ZCL_NAVIGATE_TARGET_RESPONSE_COMMAND_ID (0x00) +#define ZCL_NAVIGATE_TARGET_REQUEST_COMMAND_ID (0x00) +#define ZCL_NAVIGATE_TARGET_RESPONSE_COMMAND_ID (0x01) // Commands for cluster: Media Playback -#define ZCL_MEDIA_PLAY_COMMAND_ID (0x00) -#define ZCL_MEDIA_PLAY_RESPONSE_COMMAND_ID (0x00) -#define ZCL_MEDIA_PAUSE_COMMAND_ID (0x01) -#define ZCL_MEDIA_PAUSE_RESPONSE_COMMAND_ID (0x01) -#define ZCL_MEDIA_STOP_COMMAND_ID (0x02) -#define ZCL_MEDIA_STOP_RESPONSE_COMMAND_ID (0x02) -#define ZCL_MEDIA_START_OVER_COMMAND_ID (0x03) -#define ZCL_MEDIA_START_OVER_RESPONSE_COMMAND_ID (0x03) -#define ZCL_MEDIA_PREVIOUS_COMMAND_ID (0x04) -#define ZCL_MEDIA_PREVIOUS_RESPONSE_COMMAND_ID (0x04) -#define ZCL_MEDIA_NEXT_COMMAND_ID (0x05) -#define ZCL_MEDIA_NEXT_RESPONSE_COMMAND_ID (0x05) -#define ZCL_MEDIA_REWIND_COMMAND_ID (0x06) -#define ZCL_MEDIA_REWIND_RESPONSE_COMMAND_ID (0x06) -#define ZCL_MEDIA_FAST_FORWARD_COMMAND_ID (0x07) -#define ZCL_MEDIA_FAST_FORWARD_RESPONSE_COMMAND_ID (0x07) -#define ZCL_MEDIA_SKIP_FORWARD_COMMAND_ID (0x08) -#define ZCL_MEDIA_SKIP_FORWARD_RESPONSE_COMMAND_ID (0x08) -#define ZCL_MEDIA_SKIP_BACKWARD_COMMAND_ID (0x09) -#define ZCL_MEDIA_SKIP_BACKWARD_RESPONSE_COMMAND_ID (0x09) -#define ZCL_MEDIA_SEEK_COMMAND_ID (0x0A) -#define ZCL_MEDIA_SEEK_RESPONSE_COMMAND_ID (0x0B) +#define ZCL_PLAY_REQUEST_COMMAND_ID (0x00) +#define ZCL_PAUSE_REQUEST_COMMAND_ID (0x01) +#define ZCL_STOP_REQUEST_COMMAND_ID (0x02) +#define ZCL_START_OVER_REQUEST_COMMAND_ID (0x03) +#define ZCL_PREVIOUS_REQUEST_COMMAND_ID (0x04) +#define ZCL_NEXT_REQUEST_COMMAND_ID (0x05) +#define ZCL_REWIND_REQUEST_COMMAND_ID (0x06) +#define ZCL_FAST_FORWARD_REQUEST_COMMAND_ID (0x07) +#define ZCL_SKIP_FORWARD_REQUEST_COMMAND_ID (0x08) +#define ZCL_SKIP_BACKWARD_REQUEST_COMMAND_ID (0x09) +#define ZCL_PLAYBACK_RESPONSE_COMMAND_ID (0x0A) +#define ZCL_SEEK_REQUEST_COMMAND_ID (0x0B) // Commands for cluster: Media Input -#define ZCL_SELECT_INPUT_COMMAND_ID (0x00) -#define ZCL_SHOW_INPUT_STATUS_COMMAND_ID (0x01) -#define ZCL_HIDE_INPUT_STATUS_COMMAND_ID (0x02) -#define ZCL_RENAME_INPUT_COMMAND_ID (0x03) +#define ZCL_SELECT_INPUT_REQUEST_COMMAND_ID (0x00) +#define ZCL_SHOW_INPUT_STATUS_REQUEST_COMMAND_ID (0x01) +#define ZCL_HIDE_INPUT_STATUS_REQUEST_COMMAND_ID (0x02) +#define ZCL_RENAME_INPUT_REQUEST_COMMAND_ID (0x03) // Commands for cluster: Low Power #define ZCL_SLEEP_COMMAND_ID (0x00) // Commands for cluster: Keypad Input -#define ZCL_SEND_KEY_COMMAND_ID (0x00) -#define ZCL_SEND_KEY_RESPONSE_COMMAND_ID (0x00) +#define ZCL_SEND_KEY_REQUEST_COMMAND_ID (0x00) +#define ZCL_SEND_KEY_RESPONSE_COMMAND_ID (0x01) // Commands for cluster: Content Launcher -#define ZCL_LAUNCH_CONTENT_COMMAND_ID (0x00) -#define ZCL_LAUNCH_CONTENT_RESPONSE_COMMAND_ID (0x00) -#define ZCL_LAUNCH_URL_COMMAND_ID (0x01) -#define ZCL_LAUNCH_URL_RESPONSE_COMMAND_ID (0x01) +#define ZCL_LAUNCH_CONTENT_REQUEST_COMMAND_ID (0x00) +#define ZCL_LAUNCH_URL_REQUEST_COMMAND_ID (0x01) +#define ZCL_LAUNCH_RESPONSE_COMMAND_ID (0x02) // Commands for cluster: Audio Output -#define ZCL_SELECT_OUTPUT_COMMAND_ID (0x00) -#define ZCL_RENAME_OUTPUT_COMMAND_ID (0x01) +#define ZCL_SELECT_OUTPUT_REQUEST_COMMAND_ID (0x00) +#define ZCL_RENAME_OUTPUT_REQUEST_COMMAND_ID (0x01) // Commands for cluster: Application Launcher -#define ZCL_LAUNCH_APP_COMMAND_ID (0x00) -#define ZCL_LAUNCH_APP_RESPONSE_COMMAND_ID (0x00) -#define ZCL_STOP_APP_COMMAND_ID (0x01) -#define ZCL_STOP_APP_RESPONSE_COMMAND_ID (0x01) -#define ZCL_HIDE_APP_COMMAND_ID (0x02) -#define ZCL_HIDE_APP_RESPONSE_COMMAND_ID (0x02) - -// Commands for cluster: Application Basic -#define ZCL_CHANGE_STATUS_COMMAND_ID (0x00) +#define ZCL_LAUNCH_APP_REQUEST_COMMAND_ID (0x00) +#define ZCL_STOP_APP_REQUEST_COMMAND_ID (0x01) +#define ZCL_HIDE_APP_REQUEST_COMMAND_ID (0x02) +#define ZCL_LAUNCHER_RESPONSE_COMMAND_ID (0x03) // Commands for cluster: Account Login -#define ZCL_GET_SETUP_PIN_COMMAND_ID (0x00) -#define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) -#define ZCL_LOGIN_COMMAND_ID (0x01) -#define ZCL_LOGOUT_COMMAND_ID (0x02) +#define ZCL_GET_SETUP_PIN_REQUEST_COMMAND_ID (0x00) +#define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x01) +#define ZCL_LOGIN_REQUEST_COMMAND_ID (0x02) +#define ZCL_LOGOUT_REQUEST_COMMAND_ID (0x03) // Commands for cluster: Test Cluster #define ZCL_TEST_COMMAND_ID (0x00) diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index 70ce299d265bf8..16a982466a2a46 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -24,14 +24,6 @@ // ZCL enums -// Enum for ApplicationLauncherStatus -enum EmberAfApplicationLauncherStatus : uint8_t -{ - EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SUCCESS = 0, - EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_APP_NOT_AVAILABLE = 1, - EMBER_ZCL_APPLICATION_LAUNCHER_STATUS_SYSTEM_BUSY = 2, -}; - // Enum for AttributeWritePermission enum EmberAfAttributeWritePermission : uint8_t { @@ -44,17 +36,6 @@ enum EmberAfAttributeWritePermission : uint8_t EMBER_ZCL_ATTRIBUTE_WRITE_PERMISSION_INVALID_DATA_TYPE = 141, }; -// Enum for AudioOutputType -enum EmberAfAudioOutputType : uint8_t -{ - EMBER_ZCL_AUDIO_OUTPUT_TYPE_HDMI = 0, - EMBER_ZCL_AUDIO_OUTPUT_TYPE_BT = 1, - EMBER_ZCL_AUDIO_OUTPUT_TYPE_OPTICAL = 2, - EMBER_ZCL_AUDIO_OUTPUT_TYPE_HEADPHONE = 3, - EMBER_ZCL_AUDIO_OUTPUT_TYPE_INTERNAL = 4, - EMBER_ZCL_AUDIO_OUTPUT_TYPE_OTHER = 5, -}; - // Enum for BarrierControlBarrierPosition enum EmberAfBarrierControlBarrierPosition : uint8_t { @@ -122,14 +103,6 @@ enum EmberAfColorMode : uint8_t EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE = 2, }; -// Enum for ContentLaunchStatus -enum EmberAfContentLaunchStatus : uint8_t -{ - EMBER_ZCL_CONTENT_LAUNCH_STATUS_SUCCESS = 0, - EMBER_ZCL_CONTENT_LAUNCH_STATUS_URL_NOT_AVAILABLE = 1, - EMBER_ZCL_CONTENT_LAUNCH_STATUS_AUTH_FAILED = 2, -}; - // Enum for DoorLockEventSource enum EmberAfDoorLockEventSource : uint8_t { @@ -353,105 +326,6 @@ enum EmberAfInterfaceType : uint8_t EMBER_ZCL_INTERFACE_TYPE_THREAD = 4, }; -// Enum for KeypadInputCecKeyCode -enum EmberAfKeypadInputCecKeyCode : uint8_t -{ - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_SELECT = 0, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_UP = 1, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_DOWN = 2, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_LEFT = 3, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_RIGHT = 4, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_RIGHT_UP = 5, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_RIGHT_DOWN = 6, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_LEFT_UP = 7, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_LEFT_DOWN = 8, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_ROOT_MENU = 9, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_SETUP_MENU = 10, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_CONTENTS_MENU = 11, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_FAVORITE_MENU = 12, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_EXIT = 13, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_MEDIA_TOP_MENU = 16, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_MEDIA_CONTEXT_SENSITIVE_MENU = 17, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBER_ENTRY_MODE = 29, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBER11 = 30, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBER12 = 31, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBER0_OR_NUMBER10 = 32, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBERS1 = 33, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBERS2 = 34, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBERS3 = 35, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBERS4 = 36, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBERS5 = 37, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBERS6 = 38, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBERS7 = 39, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBERS8 = 40, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NUMBERS9 = 41, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_DOT = 42, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_ENTER = 43, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_CLEAR = 44, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_NEXT_FAVORITE = 47, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_CHANNEL_UP = 48, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_CHANNEL_DOWN = 49, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_PREVIOUS_CHANNEL = 50, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_SOUND_SELECT = 51, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_INPUT_SELECT = 52, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_DISPLAY_INFORMATION = 53, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_HELP = 54, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_PAGE_UP = 55, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_PAGE_DOWN = 56, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_POWER = 64, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_VOLUME_UP = 65, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_VOLUME_DOWN = 66, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_MUTE = 67, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_PLAY = 68, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_STOP = 69, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_PAUSE = 70, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_RECORD = 71, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_REWIND = 72, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_FAST_FORWARD = 73, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_EJECT = 74, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_FORWARD = 75, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_BACKWARD = 76, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_STOP_RECORD = 77, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_PAUSE_RECORD = 78, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_RESERVED = 79, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_ANGLE = 80, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_SUB_PICTURE = 81, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_VIDEO_ON_DEMAND = 82, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_ELECTRONIC_PROGRAM_GUIDE = 83, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_TIMER_PROGRAMMING = 84, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_INITIAL_CONFIGURATION = 85, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_SELECT_BROADCAST_TYPE = 86, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_SELECT_SOUND_PRESENTATION = 87, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_PLAY_FUNCTION = 96, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_PAUSE_PLAY_FUNCTION = 97, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_RECORD_FUNCTION = 98, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_PAUSE_RECORD_FUNCTION = 99, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_STOP_FUNCTION = 100, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_MUTE_FUNCTION = 101, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_RESTORE_VOLUME_FUNCTION = 102, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_TUNE_FUNCTION = 103, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_SELECT_MEDIA_FUNCTION = 104, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_SELECT_AV_INPUT_FUNCTION = 105, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_SELECT_AUDIO_INPUT_FUNCTION = 106, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_POWER_TOGGLE_FUNCTION = 107, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_POWER_OFF_FUNCTION = 108, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_POWER_ON_FUNCTION = 109, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_F1_BLUE = 113, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_F2_RED = 114, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_F3_GREEN = 115, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_F4_YELLOW = 116, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_F5 = 117, - EMBER_ZCL_KEYPAD_INPUT_CEC_KEY_CODE_DATA = 118, -}; - -// Enum for KeypadInputStatus -enum EmberAfKeypadInputStatus : uint8_t -{ - EMBER_ZCL_KEYPAD_INPUT_STATUS_SUCCESS = 0, - EMBER_ZCL_KEYPAD_INPUT_STATUS_UNSUPPORTED_KEY = 1, - EMBER_ZCL_KEYPAD_INPUT_STATUS_INVALID_KEY_IN_CURRENT_STATE = 2, -}; - // Enum for KeypadLockout enum EmberAfKeypadLockout : uint8_t { @@ -470,43 +344,6 @@ enum EmberAfLevelControlOptions : uint8_t EMBER_ZCL_LEVEL_CONTROL_OPTIONS_COUPLE_COLOR_TEMP_TO_LEVEL = 2, }; -// Enum for MediaInputType -enum EmberAfMediaInputType : uint8_t -{ - EMBER_ZCL_MEDIA_INPUT_TYPE_INTERNAL = 0, - EMBER_ZCL_MEDIA_INPUT_TYPE_AUX = 1, - EMBER_ZCL_MEDIA_INPUT_TYPE_COAX = 2, - EMBER_ZCL_MEDIA_INPUT_TYPE_COMPOSITE = 3, - EMBER_ZCL_MEDIA_INPUT_TYPE_HDMI = 4, - EMBER_ZCL_MEDIA_INPUT_TYPE_INPUT = 5, - EMBER_ZCL_MEDIA_INPUT_TYPE_LINE = 6, - EMBER_ZCL_MEDIA_INPUT_TYPE_OPTICAL = 7, - EMBER_ZCL_MEDIA_INPUT_TYPE_VIDEO = 8, - EMBER_ZCL_MEDIA_INPUT_TYPE_SCART = 9, - EMBER_ZCL_MEDIA_INPUT_TYPE_USB = 10, - EMBER_ZCL_MEDIA_INPUT_TYPE_OTHER = 11, -}; - -// Enum for MediaPlaybackState -enum EmberAfMediaPlaybackState : uint8_t -{ - EMBER_ZCL_MEDIA_PLAYBACK_STATE_PLAYING = 0, - EMBER_ZCL_MEDIA_PLAYBACK_STATE_PAUSED = 1, - EMBER_ZCL_MEDIA_PLAYBACK_STATE_NOT_PLAYING = 2, - EMBER_ZCL_MEDIA_PLAYBACK_STATE_BUFFERING = 3, -}; - -// Enum for MediaPlaybackStatus -enum EmberAfMediaPlaybackStatus : uint8_t -{ - EMBER_ZCL_MEDIA_PLAYBACK_STATUS_SUCCESS = 0, - EMBER_ZCL_MEDIA_PLAYBACK_STATUS_INVALID_STATE_FOR_COMMAND = 1, - EMBER_ZCL_MEDIA_PLAYBACK_STATUS_NOT_ALLOWED = 2, - EMBER_ZCL_MEDIA_PLAYBACK_STATUS_NOT_ACTIVE = 3, - EMBER_ZCL_MEDIA_PLAYBACK_STATUS_SPEED_OUT_OF_RANGE = 4, - EMBER_ZCL_MEDIA_PLAYBACK_STATUS_SEEK_OUT_OF_RANGE = 5, -}; - // Enum for MoveMode enum EmberAfMoveMode : uint8_t { @@ -812,6 +649,10 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_ALERT_STRUCTURE_CATEGORY_OFFSET (8) #define EMBER_AF_ALERT_STRUCTURE_PRESENCE_RECOVERY (12288) #define EMBER_AF_ALERT_STRUCTURE_PRESENCE_RECOVERY_OFFSET (12) +#define EMBER_AF_APPLICATION_LAUNCHER_FEATURE_APPLICATION_PLATFORM (1) +#define EMBER_AF_APPLICATION_LAUNCHER_FEATURE_APPLICATION_PLATFORM_OFFSET (0) +#define EMBER_AF_AUDIOU_OUTPUT_FEATURE_NAME_UPDATES (1) +#define EMBER_AF_AUDIOU_OUTPUT_FEATURE_NAME_UPDATES_OFFSET (0) #define EMBER_AF_BALLAST_STATUS_NON_OPERATIONAL (1) #define EMBER_AF_BALLAST_STATUS_NON_OPERATIONAL_OFFSET (0) #define EMBER_AF_BALLAST_STATUS_LAMP_NOT_IN_SOCKET (2) @@ -828,6 +669,10 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_POSITION_FAILURE_OFFSET (3) #define EMBER_AF_BATTERY_ALARM_MASK_VOLTAGE_TOO_LOW (1) #define EMBER_AF_BATTERY_ALARM_MASK_VOLTAGE_TOO_LOW_OFFSET (0) +#define EMBER_AF_CHANNEL_FEATURE_CHANNEL_LIST (1) +#define EMBER_AF_CHANNEL_FEATURE_CHANNEL_LIST_OFFSET (0) +#define EMBER_AF_CHANNEL_FEATURE_LINEUP_INFO (2) +#define EMBER_AF_CHANNEL_FEATURE_LINEUP_INFO_OFFSET (1) #define EMBER_AF_COLOR_CAPABILITIES_HUE_SATURATION_SUPPORTED (1) #define EMBER_AF_COLOR_CAPABILITIES_HUE_SATURATION_SUPPORTED_OFFSET (0) #define EMBER_AF_COLOR_CAPABILITIES_ENHANCED_HUE_SUPPORTED (2) @@ -870,6 +715,10 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_COMMAND_BITS_DISABLE_ACTION_OFFSET (10) #define EMBER_AF_COMMAND_BITS_DISABLE_ACTION_WITH_DURATION (2048) #define EMBER_AF_COMMAND_BITS_DISABLE_ACTION_WITH_DURATION_OFFSET (11) +#define EMBER_AF_CONTENT_LAUNCHER_FEATURE_CONTENT_SEARCH (1) +#define EMBER_AF_CONTENT_LAUNCHER_FEATURE_CONTENT_SEARCH_OFFSET (0) +#define EMBER_AF_CONTENT_LAUNCHER_FEATURE_URL_PLAYBACK (2) +#define EMBER_AF_CONTENT_LAUNCHER_FEATURE_URL_PLAYBACK_OFFSET (1) #define EMBER_AF_DAY_OF_WEEK_SUNDAY (1) #define EMBER_AF_DAY_OF_WEEK_SUNDAY_OFFSET (0) #define EMBER_AF_DAY_OF_WEEK_MONDAY (2) @@ -1102,6 +951,12 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_IAS_ZONE_STATUS_TEST_OFFSET (8) #define EMBER_AF_IAS_ZONE_STATUS_BATTERY_DEFECT (512) #define EMBER_AF_IAS_ZONE_STATUS_BATTERY_DEFECT_OFFSET (9) +#define EMBER_AF_KEYPAD_INPUT_FEATURE_NAVIGATION_KEY_CODES (1) +#define EMBER_AF_KEYPAD_INPUT_FEATURE_NAVIGATION_KEY_CODES_OFFSET (0) +#define EMBER_AF_KEYPAD_INPUT_FEATURE_LOCATION_KEYS (2) +#define EMBER_AF_KEYPAD_INPUT_FEATURE_LOCATION_KEYS_OFFSET (1) +#define EMBER_AF_KEYPAD_INPUT_FEATURE_NUMBER_KEYS (4) +#define EMBER_AF_KEYPAD_INPUT_FEATURE_NUMBER_KEYS_OFFSET (2) #define EMBER_AF_LAMP_ALARM_MODE_LAMP_BURN_HOURS (1) #define EMBER_AF_LAMP_ALARM_MODE_LAMP_BURN_HOURS_OFFSET (0) #define EMBER_AF_MAINS_ALARM_MASK_VOLTAGE_TOO_LOW (1) @@ -1110,6 +965,8 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_MAINS_ALARM_MASK_VOLTAGE_TOO_HIGH_OFFSET (1) #define EMBER_AF_MAINS_ALARM_MASK_MAINS_POWER_SUPPLY_LOST (4) #define EMBER_AF_MAINS_ALARM_MASK_MAINS_POWER_SUPPLY_LOST_OFFSET (2) +#define EMBER_AF_MEDIA_INPUT_FEATURE_NAME_UPDATES (1) +#define EMBER_AF_MEDIA_INPUT_FEATURE_NAME_UPDATES_OFFSET (0) #define EMBER_AF_MESSAGING_CONFIRMATION_CONTROL_NO_RETURNED (1) #define EMBER_AF_MESSAGING_CONFIRMATION_CONTROL_NO_RETURNED_OFFSET (0) #define EMBER_AF_MESSAGING_CONFIRMATION_CONTROL_YES_RETURNED (2) @@ -1214,6 +1071,10 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_START_TIME_TIME_ENCODING_OFFSET (6) #define EMBER_AF_START_TIME_HOURS (65280) #define EMBER_AF_START_TIME_HOURS_OFFSET (8) +#define EMBER_AF_SUPPORTED_STREAMING_PROTOCOL_DASH (1) +#define EMBER_AF_SUPPORTED_STREAMING_PROTOCOL_DASH_OFFSET (0) +#define EMBER_AF_SUPPORTED_STREAMING_PROTOCOL_HLS (2) +#define EMBER_AF_SUPPORTED_STREAMING_PROTOCOL_HLS_OFFSET (1) #define EMBER_AF_SWITCH_FEATURE_LATCHING_SWITCH (1) #define EMBER_AF_SWITCH_FEATURE_LATCHING_SWITCH_OFFSET (0) #define EMBER_AF_SWITCH_FEATURE_MOMENTARY_SWITCH (2) @@ -1300,6 +1161,16 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_WC_CONFIG_STATUS_LIFT_ENCODER_CONTROLLED_OFFSET (5) #define EMBER_AF_WC_CONFIG_STATUS_TILT_ENCODER_CONTROLLED (64) #define EMBER_AF_WC_CONFIG_STATUS_TILT_ENCODER_CONTROLLED_OFFSET (6) +#define EMBER_AF_WC_FEATURE_LIFT (1) +#define EMBER_AF_WC_FEATURE_LIFT_OFFSET (0) +#define EMBER_AF_WC_FEATURE_TILT (2) +#define EMBER_AF_WC_FEATURE_TILT_OFFSET (1) +#define EMBER_AF_WC_FEATURE_POSITION_AWARE_LIFT (4) +#define EMBER_AF_WC_FEATURE_POSITION_AWARE_LIFT_OFFSET (2) +#define EMBER_AF_WC_FEATURE_ABSOLUTE_POSITION (8) +#define EMBER_AF_WC_FEATURE_ABSOLUTE_POSITION_OFFSET (3) +#define EMBER_AF_WC_FEATURE_POSITION_AWARE_TILT (16) +#define EMBER_AF_WC_FEATURE_POSITION_AWARE_TILT_OFFSET (4) #define EMBER_AF_WC_MODE_MOTOR_DIRECTION_REVERSED (1) #define EMBER_AF_WC_MODE_MOTOR_DIRECTION_REVERSED_OFFSET (0) #define EMBER_AF_WC_MODE_CALIBRATION_MODE (2) @@ -1342,13 +1213,3 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_WI_FI_NETWORK_DIAGNOSTICS_FEATURE_PACKET_COUNTS_OFFSET (0) #define EMBER_AF_WI_FI_NETWORK_DIAGNOSTICS_FEATURE_ERROR_COUNTS (2) #define EMBER_AF_WI_FI_NETWORK_DIAGNOSTICS_FEATURE_ERROR_COUNTS_OFFSET (1) -#define EMBER_AF_WINDOW_COVERING_FEATURE_LIFT (1) -#define EMBER_AF_WINDOW_COVERING_FEATURE_LIFT_OFFSET (0) -#define EMBER_AF_WINDOW_COVERING_FEATURE_TILT (2) -#define EMBER_AF_WINDOW_COVERING_FEATURE_TILT_OFFSET (1) -#define EMBER_AF_WINDOW_COVERING_FEATURE_POSITION_AWARE_LIFT (4) -#define EMBER_AF_WINDOW_COVERING_FEATURE_POSITION_AWARE_LIFT_OFFSET (2) -#define EMBER_AF_WINDOW_COVERING_FEATURE_ABSOLUTE_POSITION (8) -#define EMBER_AF_WINDOW_COVERING_FEATURE_ABSOLUTE_POSITION_OFFSET (3) -#define EMBER_AF_WINDOW_COVERING_FEATURE_POSITION_AWARE_TILT (16) -#define EMBER_AF_WINDOW_COVERING_FEATURE_POSITION_AWARE_TILT_OFFSET (4) 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 4794917210dd97..3bc731181f2d4d 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 @@ -1060,14 +1060,22 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; namespace OtaSoftwareUpdateRequestor { namespace Attributes { -namespace DefaultOtaProvider { -static constexpr AttributeId Id = 0x00000001; -} // namespace DefaultOtaProvider +namespace DefaultOtaProviders { +static constexpr AttributeId Id = 0x00000000; +} // namespace DefaultOtaProviders namespace UpdatePossible { -static constexpr AttributeId Id = 0x00000002; +static constexpr AttributeId Id = 0x00000001; } // namespace UpdatePossible +namespace UpdateState { +static constexpr AttributeId Id = 0x00000002; +} // namespace UpdateState + +namespace UpdateStateProgress { +static constexpr AttributeId Id = 0x00000003; +} // namespace UpdateStateProgress + namespace AttributeList { static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; } // namespace AttributeList @@ -2078,13 +2086,21 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; namespace GroupKeyManagement { namespace Attributes { -namespace Groups { +namespace GroupKeyMap { static constexpr AttributeId Id = 0x00000000; -} // namespace Groups +} // namespace GroupKeyMap -namespace GroupKeys { +namespace GroupTable { static constexpr AttributeId Id = 0x00000001; -} // namespace GroupKeys +} // namespace GroupTable + +namespace MaxGroupsPerFabric { +static constexpr AttributeId Id = 0x00000002; +} // namespace MaxGroupsPerFabric + +namespace MaxGroupKeysPerFabric { +static constexpr AttributeId Id = 0x00000003; +} // namespace MaxGroupKeysPerFabric namespace AttributeList { static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; @@ -2578,30 +2594,10 @@ namespace InstalledClosedLimitTilt { static constexpr AttributeId Id = 0x00000013; } // namespace InstalledClosedLimitTilt -namespace VelocityLift { -static constexpr AttributeId Id = 0x00000014; -} // namespace VelocityLift - -namespace AccelerationTimeLift { -static constexpr AttributeId Id = 0x00000015; -} // namespace AccelerationTimeLift - -namespace DecelerationTimeLift { -static constexpr AttributeId Id = 0x00000016; -} // namespace DecelerationTimeLift - namespace Mode { static constexpr AttributeId Id = 0x00000017; } // namespace Mode -namespace IntermediateSetpointsLift { -static constexpr AttributeId Id = 0x00000018; -} // namespace IntermediateSetpointsLift - -namespace IntermediateSetpointsTilt { -static constexpr AttributeId Id = 0x00000019; -} // namespace IntermediateSetpointsTilt - namespace SafetyStatus { static constexpr AttributeId Id = 0x0000001A; } // namespace SafetyStatus @@ -4785,7 +4781,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace WakeOnLan -namespace TvChannel { +namespace Channel { namespace Attributes { namespace ChannelList { @@ -4813,7 +4809,7 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision } // namespace Attributes -} // namespace TvChannel +} // namespace Channel namespace TargetNavigator { namespace Attributes { @@ -4952,9 +4948,9 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; namespace ContentLauncher { namespace Attributes { -namespace AcceptsHeaderList { +namespace AcceptHeaderList { static constexpr AttributeId Id = 0x00000000; -} // namespace AcceptsHeaderList +} // namespace AcceptHeaderList namespace SupportedStreamingProtocols { static constexpr AttributeId Id = 0x00000001; @@ -5058,6 +5054,10 @@ namespace ApplicationVersion { static constexpr AttributeId Id = 0x00000006; } // namespace ApplicationVersion +namespace AllowedVendorList { +static constexpr AttributeId Id = 0x00000007; +} // namespace AllowedVendorList + namespace AttributeList { static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; } // namespace AttributeList 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 311692b53d8be3..b7e174cbdb279f 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 @@ -322,9 +322,9 @@ static constexpr ClusterId Id = 0x00000502; namespace WakeOnLan { static constexpr ClusterId Id = 0x00000503; } // namespace WakeOnLan -namespace TvChannel { +namespace Channel { static constexpr ClusterId Id = 0x00000504; -} // namespace TvChannel +} // namespace Channel namespace TargetNavigator { static constexpr ClusterId Id = 0x00000505; } // namespace TargetNavigator 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 431fd1d5a31100..8d0ba7f394e092 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 @@ -514,21 +514,21 @@ namespace QueryImage { static constexpr CommandId Id = 0x00000000; } // namespace QueryImage -namespace ApplyUpdateRequest { +namespace QueryImageResponse { static constexpr CommandId Id = 0x00000001; -} // namespace ApplyUpdateRequest +} // namespace QueryImageResponse -namespace NotifyUpdateApplied { +namespace ApplyUpdateRequest { static constexpr CommandId Id = 0x00000002; -} // namespace NotifyUpdateApplied +} // namespace ApplyUpdateRequest -namespace QueryImageResponse { +namespace ApplyUpdateResponse { static constexpr CommandId Id = 0x00000003; -} // namespace QueryImageResponse +} // namespace ApplyUpdateResponse -namespace ApplyUpdateResponse { +namespace NotifyUpdateApplied { static constexpr CommandId Id = 0x00000004; -} // namespace ApplyUpdateResponse +} // namespace NotifyUpdateApplied } // namespace Commands } // namespace OtaSoftwareUpdateProvider @@ -767,6 +767,36 @@ static constexpr CommandId Id = 0x0000000C; } // namespace Commands } // namespace OperationalCredentials +namespace GroupKeyManagement { +namespace Commands { + +namespace KeySetWrite { +static constexpr CommandId Id = 0x00000000; +} // namespace KeySetWrite + +namespace KeySetRead { +static constexpr CommandId Id = 0x00000001; +} // namespace KeySetRead + +namespace KeySetReadResponse { +static constexpr CommandId Id = 0x00000002; +} // namespace KeySetReadResponse + +namespace KeySetRemove { +static constexpr CommandId Id = 0x00000003; +} // namespace KeySetRemove + +namespace KeySetReadAllIndices { +static constexpr CommandId Id = 0x00000004; +} // namespace KeySetReadAllIndices + +namespace KeySetReadAllIndicesResponse { +static constexpr CommandId Id = 0x00000005; +} // namespace KeySetReadAllIndicesResponse + +} // namespace Commands +} // namespace GroupKeyManagement + namespace ModeSelect { namespace Commands { @@ -1253,37 +1283,37 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace IasWd -namespace TvChannel { +namespace Channel { namespace Commands { -namespace ChangeChannel { +namespace ChangeChannelRequest { static constexpr CommandId Id = 0x00000000; -} // namespace ChangeChannel +} // namespace ChangeChannelRequest namespace ChangeChannelResponse { -static constexpr CommandId Id = 0x00000000; -} // namespace ChangeChannelResponse - -namespace ChangeChannelByNumber { static constexpr CommandId Id = 0x00000001; -} // namespace ChangeChannelByNumber +} // namespace ChangeChannelResponse -namespace SkipChannel { +namespace ChangeChannelByNumberRequest { static constexpr CommandId Id = 0x00000002; -} // namespace SkipChannel +} // namespace ChangeChannelByNumberRequest + +namespace SkipChannelRequest { +static constexpr CommandId Id = 0x00000003; +} // namespace SkipChannelRequest } // namespace Commands -} // namespace TvChannel +} // namespace Channel namespace TargetNavigator { namespace Commands { -namespace NavigateTarget { +namespace NavigateTargetRequest { static constexpr CommandId Id = 0x00000000; -} // namespace NavigateTarget +} // namespace NavigateTargetRequest namespace NavigateTargetResponse { -static constexpr CommandId Id = 0x00000000; +static constexpr CommandId Id = 0x00000001; } // namespace NavigateTargetResponse } // namespace Commands @@ -1292,93 +1322,53 @@ static constexpr CommandId Id = 0x00000000; namespace MediaPlayback { namespace Commands { -namespace MediaPlay { -static constexpr CommandId Id = 0x00000000; -} // namespace MediaPlay - -namespace MediaPlayResponse { +namespace PlayRequest { static constexpr CommandId Id = 0x00000000; -} // namespace MediaPlayResponse +} // namespace PlayRequest -namespace MediaPause { +namespace PauseRequest { static constexpr CommandId Id = 0x00000001; -} // namespace MediaPause +} // namespace PauseRequest -namespace MediaPauseResponse { -static constexpr CommandId Id = 0x00000001; -} // namespace MediaPauseResponse - -namespace MediaStop { -static constexpr CommandId Id = 0x00000002; -} // namespace MediaStop - -namespace MediaStopResponse { +namespace StopRequest { static constexpr CommandId Id = 0x00000002; -} // namespace MediaStopResponse - -namespace MediaStartOver { -static constexpr CommandId Id = 0x00000003; -} // namespace MediaStartOver +} // namespace StopRequest -namespace MediaStartOverResponse { +namespace StartOverRequest { static constexpr CommandId Id = 0x00000003; -} // namespace MediaStartOverResponse +} // namespace StartOverRequest -namespace MediaPrevious { +namespace PreviousRequest { static constexpr CommandId Id = 0x00000004; -} // namespace MediaPrevious +} // namespace PreviousRequest -namespace MediaPreviousResponse { -static constexpr CommandId Id = 0x00000004; -} // namespace MediaPreviousResponse - -namespace MediaNext { +namespace NextRequest { static constexpr CommandId Id = 0x00000005; -} // namespace MediaNext +} // namespace NextRequest -namespace MediaNextResponse { -static constexpr CommandId Id = 0x00000005; -} // namespace MediaNextResponse - -namespace MediaRewind { +namespace RewindRequest { static constexpr CommandId Id = 0x00000006; -} // namespace MediaRewind +} // namespace RewindRequest -namespace MediaRewindResponse { -static constexpr CommandId Id = 0x00000006; -} // namespace MediaRewindResponse - -namespace MediaFastForward { -static constexpr CommandId Id = 0x00000007; -} // namespace MediaFastForward - -namespace MediaFastForwardResponse { +namespace FastForwardRequest { static constexpr CommandId Id = 0x00000007; -} // namespace MediaFastForwardResponse - -namespace MediaSkipForward { -static constexpr CommandId Id = 0x00000008; -} // namespace MediaSkipForward +} // namespace FastForwardRequest -namespace MediaSkipForwardResponse { +namespace SkipForwardRequest { static constexpr CommandId Id = 0x00000008; -} // namespace MediaSkipForwardResponse +} // namespace SkipForwardRequest -namespace MediaSkipBackward { +namespace SkipBackwardRequest { static constexpr CommandId Id = 0x00000009; -} // namespace MediaSkipBackward +} // namespace SkipBackwardRequest -namespace MediaSkipBackwardResponse { -static constexpr CommandId Id = 0x00000009; -} // namespace MediaSkipBackwardResponse - -namespace MediaSeek { +namespace PlaybackResponse { static constexpr CommandId Id = 0x0000000A; -} // namespace MediaSeek +} // namespace PlaybackResponse -namespace MediaSeekResponse { +namespace SeekRequest { static constexpr CommandId Id = 0x0000000B; -} // namespace MediaSeekResponse +} // namespace SeekRequest } // namespace Commands } // namespace MediaPlayback @@ -1386,21 +1376,21 @@ static constexpr CommandId Id = 0x0000000B; namespace MediaInput { namespace Commands { -namespace SelectInput { +namespace SelectInputRequest { static constexpr CommandId Id = 0x00000000; -} // namespace SelectInput +} // namespace SelectInputRequest -namespace ShowInputStatus { +namespace ShowInputStatusRequest { static constexpr CommandId Id = 0x00000001; -} // namespace ShowInputStatus +} // namespace ShowInputStatusRequest -namespace HideInputStatus { +namespace HideInputStatusRequest { static constexpr CommandId Id = 0x00000002; -} // namespace HideInputStatus +} // namespace HideInputStatusRequest -namespace RenameInput { +namespace RenameInputRequest { static constexpr CommandId Id = 0x00000003; -} // namespace RenameInput +} // namespace RenameInputRequest } // namespace Commands } // namespace MediaInput @@ -1418,12 +1408,12 @@ static constexpr CommandId Id = 0x00000000; namespace KeypadInput { namespace Commands { -namespace SendKey { +namespace SendKeyRequest { static constexpr CommandId Id = 0x00000000; -} // namespace SendKey +} // namespace SendKeyRequest namespace SendKeyResponse { -static constexpr CommandId Id = 0x00000000; +static constexpr CommandId Id = 0x00000001; } // namespace SendKeyResponse } // namespace Commands @@ -1432,21 +1422,17 @@ static constexpr CommandId Id = 0x00000000; namespace ContentLauncher { namespace Commands { -namespace LaunchContent { -static constexpr CommandId Id = 0x00000000; -} // namespace LaunchContent - -namespace LaunchContentResponse { +namespace LaunchContentRequest { static constexpr CommandId Id = 0x00000000; -} // namespace LaunchContentResponse +} // namespace LaunchContentRequest -namespace LaunchURL { +namespace LaunchURLRequest { static constexpr CommandId Id = 0x00000001; -} // namespace LaunchURL +} // namespace LaunchURLRequest -namespace LaunchURLResponse { -static constexpr CommandId Id = 0x00000001; -} // namespace LaunchURLResponse +namespace LaunchResponse { +static constexpr CommandId Id = 0x00000002; +} // namespace LaunchResponse } // namespace Commands } // namespace ContentLauncher @@ -1454,13 +1440,13 @@ static constexpr CommandId Id = 0x00000001; namespace AudioOutput { namespace Commands { -namespace SelectOutput { +namespace SelectOutputRequest { static constexpr CommandId Id = 0x00000000; -} // namespace SelectOutput +} // namespace SelectOutputRequest -namespace RenameOutput { +namespace RenameOutputRequest { static constexpr CommandId Id = 0x00000001; -} // namespace RenameOutput +} // namespace RenameOutputRequest } // namespace Commands } // namespace AudioOutput @@ -1468,61 +1454,43 @@ static constexpr CommandId Id = 0x00000001; namespace ApplicationLauncher { namespace Commands { -namespace LaunchApp { +namespace LaunchAppRequest { static constexpr CommandId Id = 0x00000000; -} // namespace LaunchApp +} // namespace LaunchAppRequest -namespace LaunchAppResponse { -static constexpr CommandId Id = 0x00000000; -} // namespace LaunchAppResponse - -namespace StopApp { +namespace StopAppRequest { static constexpr CommandId Id = 0x00000001; -} // namespace StopApp +} // namespace StopAppRequest -namespace StopAppResponse { -static constexpr CommandId Id = 0x00000001; -} // namespace StopAppResponse - -namespace HideApp { +namespace HideAppRequest { static constexpr CommandId Id = 0x00000002; -} // namespace HideApp +} // namespace HideAppRequest -namespace HideAppResponse { -static constexpr CommandId Id = 0x00000002; -} // namespace HideAppResponse +namespace LauncherResponse { +static constexpr CommandId Id = 0x00000003; +} // namespace LauncherResponse } // namespace Commands } // namespace ApplicationLauncher -namespace ApplicationBasic { -namespace Commands { - -namespace ChangeStatus { -static constexpr CommandId Id = 0x00000000; -} // namespace ChangeStatus - -} // namespace Commands -} // namespace ApplicationBasic - namespace AccountLogin { namespace Commands { -namespace GetSetupPIN { +namespace GetSetupPINRequest { static constexpr CommandId Id = 0x00000000; -} // namespace GetSetupPIN +} // namespace GetSetupPINRequest namespace GetSetupPINResponse { -static constexpr CommandId Id = 0x00000000; -} // namespace GetSetupPINResponse - -namespace Login { static constexpr CommandId Id = 0x00000001; -} // namespace Login +} // namespace GetSetupPINResponse -namespace Logout { +namespace LoginRequest { static constexpr CommandId Id = 0x00000002; -} // namespace Logout +} // namespace LoginRequest + +namespace LogoutRequest { +static constexpr CommandId Id = 0x00000003; +} // namespace LogoutRequest } // namespace Commands } // namespace AccountLogin diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index 7f08003e103c0e..d50a0d00c69ac3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -690,10 +690,10 @@ #define CHIP_PRINTCLUSTER_WAKE_ON_LAN_CLUSTER #endif -#if defined(ZCL_USING_TV_CHANNEL_CLUSTER_SERVER) || defined(ZCL_USING_TV_CHANNEL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TV_CHANNEL_CLUSTER { ZCL_TV_CHANNEL_CLUSTER_ID, 1284, "TV Channel" }, +#if defined(ZCL_USING_CHANNEL_CLUSTER_SERVER) || defined(ZCL_USING_CHANNEL_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_CHANNEL_CLUSTER { ZCL_CHANNEL_CLUSTER_ID, 1284, "Channel" }, #else -#define CHIP_PRINTCLUSTER_TV_CHANNEL_CLUSTER +#define CHIP_PRINTCLUSTER_CHANNEL_CLUSTER #endif #if defined(ZCL_USING_TARGET_NAVIGATOR_CLUSTER_SERVER) || defined(ZCL_USING_TARGET_NAVIGATOR_CLUSTER_CLIENT) @@ -900,7 +900,7 @@ CHIP_PRINTCLUSTER_IAS_ACE_CLUSTER \ CHIP_PRINTCLUSTER_IAS_WD_CLUSTER \ CHIP_PRINTCLUSTER_WAKE_ON_LAN_CLUSTER \ - CHIP_PRINTCLUSTER_TV_CHANNEL_CLUSTER \ + CHIP_PRINTCLUSTER_CHANNEL_CLUSTER \ CHIP_PRINTCLUSTER_TARGET_NAVIGATOR_CLUSTER \ CHIP_PRINTCLUSTER_MEDIA_PLAYBACK_CLUSTER \ CHIP_PRINTCLUSTER_MEDIA_INPUT_CLUSTER \ diff --git a/zzz_generated/bridge-app/zap-generated/endpoint_config.h b/zzz_generated/bridge-app/zap-generated/endpoint_config.h index ace95aa8e33da6..651fa813f44f5f 100644 --- a/zzz_generated/bridge-app/zap-generated/endpoint_config.h +++ b/zzz_generated/bridge-app/zap-generated/endpoint_config.h @@ -792,8 +792,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index c6e534819cce58..b78a88b3a85fa3 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -59,6 +59,8 @@ CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::BridgedActions::Structs::ActionStruct::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::BridgedActions::Structs::EndpointListStruct::DecodableType & value); +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, @@ -86,10 +88,12 @@ CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalCredentials::Structs::NOCStruct::DecodableType & value); +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::GroupKeyManagement::Structs::GroupInfo::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupState::DecodableType & value); + const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::FixedLabel::Structs::LabelStruct::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, @@ -103,33 +107,35 @@ CHIP_ERROR LogValue(const char * label, size_t indent, CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::IasAce::Structs::IasAceZoneStatusResult::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TvChannel::Structs::TvChannelInfo::DecodableType & value); + const chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType & value); +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Channel::Structs::LineupInfo::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TvChannel::Structs::TvChannelLineupInfo::DecodableType & value); + const chip::app::Clusters::TargetNavigator::Structs::TargetInfo::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType & value); + const chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::MediaPlayback::Structs::MediaPlaybackPosition::DecodableType & value); + const chip::app::Clusters::MediaInput::Structs::InputInfo::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::MediaInput::Structs::MediaInputInfo::DecodableType & value); + const chip::app::Clusters::ContentLauncher::Structs::Dimension::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentLaunchDimension::DecodableType & value); + const chip::app::Clusters::ContentLauncher::Structs::AdditionalInfo::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentLaunchAdditionalInfo::DecodableType & value); + const chip::app::Clusters::ContentLauncher::Structs::Parameter::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentLaunchParamater::DecodableType & value); + const chip::app::Clusters::ContentLauncher::Structs::ContentSearch::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentLaunchStyleInformation::DecodableType & value); + const chip::app::Clusters::ContentLauncher::Structs::StyleInformation::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentLaunchBrandingInformation::DecodableType & value); + const chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::AudioOutput::Structs::AudioOutputInfo::DecodableType & value); + const chip::app::Clusters::AudioOutput::Structs::OutputInfo::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApp::DecodableType & value); + const chip::app::Clusters::ApplicationLauncher::Structs::Application::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherEndpoint::DecodableType & value); + const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApp::DecodableType & value); + const chip::app::Clusters::ApplicationBasic::Structs::Application::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, @@ -636,6 +642,38 @@ CHIP_ERROR LogValue(const char * label, size_t indent, ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); return CHIP_NO_ERROR; } +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType & value) +{ + ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); + { + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("ProviderNodeID", indent + 1, value.providerNodeID); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ProviderNodeID'", + IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("Endpoint", indent + 1, value.endpoint); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Endpoint'", IndentStr(indent + 1).c_str()); + return err; + } + } + ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); + return CHIP_NO_ERROR; +} CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfoType::DecodableType & value) { @@ -1370,48 +1408,69 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::DecodableType & value) + const chip::app::Clusters::GroupKeyManagement::Structs::GroupInfo::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { - CHIP_ERROR err = LogValue("VendorId", indent + 1, value.vendorId); + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'VendorId'", IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("GroupKeyIndex", indent + 1, value.groupKeyIndex); + CHIP_ERROR err = LogValue("GroupId", indent + 1, value.groupId); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeyIndex'", IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupId'", IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("GroupKeyRoot", indent + 1, value.groupKeyRoot); + CHIP_ERROR err = LogValue("Endpoints", indent + 1, value.endpoints); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeyRoot'", IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Endpoints'", IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("GroupKeyEpochStartTime", indent + 1, value.groupKeyEpochStartTime); + CHIP_ERROR err = LogValue("GroupName", indent + 1, value.groupName); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeyEpochStartTime'", - IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupName'", IndentStr(indent + 1).c_str()); return err; } } + ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); + return CHIP_NO_ERROR; +} +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::GroupKeyManagement::Structs::GroupKey::DecodableType & value) +{ + ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { - CHIP_ERROR err = LogValue("GroupKeySecurityPolicy", indent + 1, value.groupKeySecurityPolicy); + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySecurityPolicy'", - IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("GroupId", indent + 1, value.groupId); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupId'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("GroupKeySetID", indent + 1, value.groupKeySetID); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySetID'", IndentStr(indent + 1).c_str()); return err; } } @@ -1419,30 +1478,73 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::GroupKeyManagement::Structs::GroupState::DecodableType & value) + const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { - CHIP_ERROR err = LogValue("VendorId", indent + 1, value.vendorId); + CHIP_ERROR err = LogValue("GroupKeySetID", indent + 1, value.groupKeySetID); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'VendorId'", IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySetID'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("SecurityPolicy", indent + 1, value.securityPolicy); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'SecurityPolicy'", + IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("EpochKey0", indent + 1, value.epochKey0); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochKey0'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("EpochStartTime0", indent + 1, value.epochStartTime0); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochStartTime0'", + IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("VendorGroupId", indent + 1, value.vendorGroupId); + CHIP_ERROR err = LogValue("EpochKey1", indent + 1, value.epochKey1); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'VendorGroupId'", IndentStr(indent + 1).c_str()); + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochKey1'", IndentStr(indent + 1).c_str()); return err; } } { - CHIP_ERROR err = LogValue("GroupKeySetIndex", indent + 1, value.groupKeySetIndex); + CHIP_ERROR err = LogValue("EpochStartTime1", indent + 1, value.epochStartTime1); if (err != CHIP_NO_ERROR) { - ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'GroupKeySetIndex'", + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochStartTime1'", + IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("EpochKey2", indent + 1, value.epochKey2); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochKey2'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("EpochStartTime2", indent + 1, value.epochStartTime2); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'EpochStartTime2'", IndentStr(indent + 1).c_str()); return err; } @@ -1599,7 +1701,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TvChannel::Structs::TvChannelInfo::DecodableType & value) + const chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1647,7 +1749,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TvChannel::Structs::TvChannelLineupInfo::DecodableType & value) + const chip::app::Clusters::Channel::Structs::LineupInfo::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1687,7 +1789,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType & value) + const chip::app::Clusters::TargetNavigator::Structs::TargetInfo::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1710,7 +1812,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::MediaPlayback::Structs::MediaPlaybackPosition::DecodableType & value) + const chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1733,7 +1835,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::MediaInput::Structs::MediaInputInfo::DecodableType & value) + const chip::app::Clusters::MediaInput::Structs::InputInfo::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1772,7 +1874,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentLaunchDimension::DecodableType & value) + const chip::app::Clusters::ContentLauncher::Structs::Dimension::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1803,7 +1905,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentLaunchAdditionalInfo::DecodableType & value) + const chip::app::Clusters::ContentLauncher::Structs::AdditionalInfo::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1826,7 +1928,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentLaunchParamater::DecodableType & value) + const chip::app::Clusters::ContentLauncher::Structs::Parameter::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1858,7 +1960,22 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentLaunchStyleInformation::DecodableType & value) + const chip::app::Clusters::ContentLauncher::Structs::ContentSearch::DecodableType & value) +{ + ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); + { + CHIP_ERROR err = LogValue("ParameterList", indent + 1, value.parameterList); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'ParameterList'", IndentStr(indent + 1).c_str()); + return err; + } + } + ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); + return CHIP_NO_ERROR; +} +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ContentLauncher::Structs::StyleInformation::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1889,7 +2006,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ContentLauncher::Structs::ContentLaunchBrandingInformation::DecodableType & value) + const chip::app::Clusters::ContentLauncher::Structs::BrandingInformation::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1944,7 +2061,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::AudioOutput::Structs::AudioOutputInfo::DecodableType & value) + const chip::app::Clusters::AudioOutput::Structs::OutputInfo::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1975,7 +2092,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherApp::DecodableType & value) + const chip::app::Clusters::ApplicationLauncher::Structs::Application::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -1999,7 +2116,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationLauncherEndpoint::DecodableType & value) + const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEP::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -2022,7 +2139,7 @@ CHIP_ERROR LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApp::DecodableType & value) + const chip::app::Clusters::ApplicationBasic::Structs::Application::DecodableType & value) { ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); { @@ -2413,10 +2530,10 @@ static void OnAccountLoginGetSetupPINResponseSuccess( command->SetCommandExitStatus(err); }; -static void OnApplicationLauncherHideAppResponseSuccess( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::HideAppResponse::DecodableType & data) +static void OnApplicationLauncherLauncherResponseSuccess( + void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & data) { - ChipLogProgress(Zcl, "Received HideAppResponse:"); + ChipLogProgress(Zcl, "Received LauncherResponse:"); CHIP_ERROR err = CHIP_NO_ERROR; if (err == CHIP_NO_ERROR) { @@ -2431,28 +2548,30 @@ static void OnApplicationLauncherHideAppResponseSuccess( command->SetCommandExitStatus(err); }; -static void OnApplicationLauncherLaunchAppResponseSuccess( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType & data) +static void +OnChannelChangeChannelResponseSuccess(void * context, + const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & data) { - ChipLogProgress(Zcl, "Received LaunchAppResponse:"); + ChipLogProgress(Zcl, "Received ChangeChannelResponse:"); CHIP_ERROR err = CHIP_NO_ERROR; if (err == CHIP_NO_ERROR) { - err = LogValue("status", 1, data.status); + err = LogValue("channelMatch", 1, data.channelMatch); } if (err == CHIP_NO_ERROR) { - err = LogValue("data", 1, data.data); + err = LogValue("errorType", 1, data.errorType); } ModelCommand * command = static_cast(context); command->SetCommandExitStatus(err); }; -static void OnApplicationLauncherStopAppResponseSuccess( - void * context, const chip::app::Clusters::ApplicationLauncher::Commands::StopAppResponse::DecodableType & data) +static void +OnContentLauncherLaunchResponseSuccess(void * context, + const chip::app::Clusters::ContentLauncher::Commands::LaunchResponse::DecodableType & data) { - ChipLogProgress(Zcl, "Received StopAppResponse:"); + ChipLogProgress(Zcl, "Received LaunchResponse:"); CHIP_ERROR err = CHIP_NO_ERROR; if (err == CHIP_NO_ERROR) { @@ -2467,42 +2586,6 @@ static void OnApplicationLauncherStopAppResponseSuccess( command->SetCommandExitStatus(err); }; -static void OnContentLauncherLaunchContentResponseSuccess( - void * context, const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received LaunchContentResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("contentLaunchStatus", 1, data.contentLaunchStatus); - } - if (err == CHIP_NO_ERROR) - { - err = LogValue("data", 1, data.data); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnContentLauncherLaunchURLResponseSuccess( - void * context, const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received LaunchURLResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("contentLaunchStatus", 1, data.contentLaunchStatus); - } - if (err == CHIP_NO_ERROR) - { - err = LogValue("data", 1, data.data); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - static void OnDiagnosticLogsRetrieveLogsResponseSuccess( void * context, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data) { @@ -2678,6 +2761,34 @@ static void OnGeneralCommissioningSetRegulatoryConfigResponseSuccess( command->SetCommandExitStatus(err); }; +static void OnGroupKeyManagementKeySetReadAllIndicesResponseSuccess( + void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data) +{ + ChipLogProgress(Zcl, "Received KeySetReadAllIndicesResponse:"); + CHIP_ERROR err = CHIP_NO_ERROR; + if (err == CHIP_NO_ERROR) + { + err = LogValue("groupKeySetIDs", 1, data.groupKeySetIDs); + } + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(err); +}; + +static void OnGroupKeyManagementKeySetReadResponseSuccess( + void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data) +{ + ChipLogProgress(Zcl, "Received KeySetReadResponse:"); + CHIP_ERROR err = CHIP_NO_ERROR; + if (err == CHIP_NO_ERROR) + { + err = LogValue("groupKeySet", 1, data.groupKeySet); + } + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(err); +}; + static void OnGroupsAddGroupResponseSuccess(void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data) { @@ -2785,158 +2896,15 @@ OnKeypadInputSendKeyResponseSuccess(void * context, command->SetCommandExitStatus(err); }; -static void OnMediaPlaybackMediaFastForwardResponseSuccess( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received MediaFastForwardResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnMediaPlaybackMediaNextResponseSuccess(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaNextResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received MediaNextResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnMediaPlaybackMediaPauseResponseSuccess( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPauseResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received MediaPauseResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnMediaPlaybackMediaPlayResponseSuccess(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaPlayResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received MediaPlayResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnMediaPlaybackMediaPreviousResponseSuccess( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaPreviousResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received MediaPreviousResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnMediaPlaybackMediaRewindResponseSuccess( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaRewindResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received MediaRewindResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - static void -OnMediaPlaybackMediaSeekResponseSuccess(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaSeekResponse::DecodableType & data) +OnMediaPlaybackPlaybackResponseSuccess(void * context, + const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & data) { - ChipLogProgress(Zcl, "Received MediaSeekResponse:"); + ChipLogProgress(Zcl, "Received PlaybackResponse:"); CHIP_ERROR err = CHIP_NO_ERROR; if (err == CHIP_NO_ERROR) { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnMediaPlaybackMediaSkipBackwardResponseSuccess( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackwardResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received MediaSkipBackwardResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnMediaPlaybackMediaSkipForwardResponseSuccess( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaSkipForwardResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received MediaSkipForwardResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void OnMediaPlaybackMediaStartOverResponseSuccess( - void * context, const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received MediaStartOverResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - -static void -OnMediaPlaybackMediaStopResponseSuccess(void * context, - const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received MediaStopResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("mediaPlaybackStatus", 1, data.mediaPlaybackStatus); + err = LogValue("status", 1, data.status); } ModelCommand * command = static_cast(context); @@ -3291,25 +3259,6 @@ static void OnScenesViewSceneResponseSuccess(void * context, command->SetCommandExitStatus(err); }; -static void -OnTvChannelChangeChannelResponseSuccess(void * context, - const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType & data) -{ - ChipLogProgress(Zcl, "Received ChangeChannelResponse:"); - CHIP_ERROR err = CHIP_NO_ERROR; - if (err == CHIP_NO_ERROR) - { - err = LogValue("channelMatch", 1, data.channelMatch); - } - if (err == CHIP_NO_ERROR) - { - err = LogValue("errorType", 1, data.errorType); - } - - ModelCommand * command = static_cast(context); - command->SetCommandExitStatus(err); -}; - static void OnTargetNavigatorNavigateTargetResponseSuccess( void * context, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & data) { @@ -3520,6 +3469,7 @@ static void OnThermostatGetWeeklyScheduleResponseSuccess( | BooleanState | 0x0045 | | BridgedActions | 0x0025 | | BridgedDeviceBasic | 0x0039 | +| Channel | 0x0504 | | ColorControl | 0x0300 | | ContentLauncher | 0x050A | | Descriptor | 0x001D | @@ -3556,7 +3506,6 @@ static void OnThermostatGetWeeklyScheduleResponseSuccess( | Scenes | 0x0005 | | SoftwareDiagnostics | 0x0034 | | Switch | 0x003B | -| TvChannel | 0x0504 | | TargetNavigator | 0x0505 | | TemperatureMeasurement | 0x0402 | | TestCluster | 0x050F | @@ -3801,9 +3750,9 @@ class ReadAccessControlClusterRevision : public ModelCommand | Cluster AccountLogin | 0x050E | |------------------------------------------------------------------------------| | Commands: | | -| * GetSetupPIN | 0x00 | -| * Login | 0x01 | -| * Logout | 0x02 | +| * GetSetupPINRequest | 0x00 | +| * LoginRequest | 0x02 | +| * LogoutRequest | 0x03 | |------------------------------------------------------------------------------| | Attributes: | | | * AttributeList | 0xFFFB | @@ -3811,12 +3760,12 @@ class ReadAccessControlClusterRevision : public ModelCommand \*----------------------------------------------------------------------------*/ /* - * Command GetSetupPIN + * Command GetSetupPINRequest */ -class AccountLoginGetSetupPIN : public ModelCommand +class AccountLoginGetSetupPINRequest : public ModelCommand { public: - AccountLoginGetSetupPIN() : ModelCommand("get-setup-pin") + AccountLoginGetSetupPINRequest() : ModelCommand("get-setup-pinrequest") { AddArgument("TempAccountIdentifier", &mRequest.tempAccountIdentifier); ModelCommand::AddArguments(); @@ -3831,16 +3780,16 @@ class AccountLoginGetSetupPIN : public ModelCommand } private: - chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type mRequest; + chip::app::Clusters::AccountLogin::Commands::GetSetupPINRequest::Type mRequest; }; /* - * Command Login + * Command LoginRequest */ -class AccountLoginLogin : public ModelCommand +class AccountLoginLoginRequest : public ModelCommand { public: - AccountLoginLogin() : ModelCommand("login") + AccountLoginLoginRequest() : ModelCommand("login-request") { AddArgument("TempAccountIdentifier", &mRequest.tempAccountIdentifier); AddArgument("SetupPIN", &mRequest.setupPIN); @@ -3849,34 +3798,34 @@ class AccountLoginLogin : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050E) command (0x00000001) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050E) command (0x00000002) on endpoint %" PRIu8, endpointId); return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::AccountLogin::Commands::Login::Type mRequest; + chip::app::Clusters::AccountLogin::Commands::LoginRequest::Type mRequest; }; /* - * Command Logout + * Command LogoutRequest */ -class AccountLoginLogout : public ModelCommand +class AccountLoginLogoutRequest : public ModelCommand { public: - AccountLoginLogout() : ModelCommand("logout") { ModelCommand::AddArguments(); } + AccountLoginLogoutRequest() : ModelCommand("logout-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000050E) command (0x00000002) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000050E) command (0x00000003) on endpoint %" PRIu8, endpointId); return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::AccountLogin::Commands::Logout::Type mRequest; + chip::app::Clusters::AccountLogin::Commands::LogoutRequest::Type mRequest; }; /* @@ -4263,7 +4212,6 @@ class ReportAdministratorCommissioningClusterRevision : public ModelCommand | Cluster ApplicationBasic | 0x050D | |------------------------------------------------------------------------------| | Commands: | | -| * ChangeStatus | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | | * VendorName | 0x0000 | @@ -4273,35 +4221,11 @@ class ReportAdministratorCommissioningClusterRevision : public ModelCommand | * ApplicationApp | 0x0004 | | * ApplicationStatus | 0x0005 | | * ApplicationVersion | 0x0006 | +| * AllowedVendorList | 0x0007 | | * AttributeList | 0xFFFB | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ -/* - * Command ChangeStatus - */ -class ApplicationBasicChangeStatus : public ModelCommand -{ -public: - ApplicationBasicChangeStatus() : ModelCommand("change-status") - { - AddArgument("Status", 0, UINT8_MAX, - reinterpret_cast *>(&mRequest.status)); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000050D) command (0x00000000) on endpoint %" PRIu8, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::ApplicationBasic::Commands::ChangeStatus::Type mRequest; -}; - /* * Attribute VendorName */ @@ -4605,7 +4529,7 @@ class ReadApplicationBasicApplicationStatus : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, uint8_t value) + static void OnAttributeResponse(void * context, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value) { OnGeneralAttributeResponse(context, "ApplicationBasic.ApplicationStatus response", value); } @@ -4642,7 +4566,10 @@ class ReportApplicationBasicApplicationStatus : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, uint8_t value) { LogValue("ApplicationBasic.ApplicationStatus report", 0, value); } + static void OnValueReport(void * context, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value) + { + LogValue("ApplicationBasic.ApplicationStatus report", 0, value); + } private: uint16_t mMinInterval; @@ -4722,6 +4649,36 @@ class ReportApplicationBasicApplicationVersion : public ModelCommand bool mWait; }; +/* + * Attribute AllowedVendorList + */ +class ReadApplicationBasicAllowedVendorList : public ModelCommand +{ +public: + ReadApplicationBasicAllowedVendorList() : ModelCommand("read") + { + AddArgument("attr-name", "allowed-vendor-list"); + ModelCommand::AddArguments(); + } + + ~ReadApplicationBasicAllowedVendorList() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::ApplicationBasicCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute( + this, OnAttributeResponse, OnDefaultFailure); + } + + static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) + { + OnGeneralAttributeResponse(context, "ApplicationBasic.AllowedVendorList response", value); + } +}; + /* * Attribute AttributeList */ @@ -4825,9 +4782,9 @@ class ReportApplicationBasicClusterRevision : public ModelCommand | Cluster ApplicationLauncher | 0x050C | |------------------------------------------------------------------------------| | Commands: | | -| * HideApp | 0x02 | -| * LaunchApp | 0x00 | -| * StopApp | 0x01 | +| * HideAppRequest | 0x02 | +| * LaunchAppRequest | 0x00 | +| * StopAppRequest | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * ApplicationLauncherList | 0x0000 | @@ -4836,12 +4793,12 @@ class ReportApplicationBasicClusterRevision : public ModelCommand \*----------------------------------------------------------------------------*/ /* - * Command HideApp + * Command HideAppRequest */ -class ApplicationLauncherHideApp : public ModelCommand +class ApplicationLauncherHideAppRequest : public ModelCommand { public: - ApplicationLauncherHideApp() : ModelCommand("hide-app") + ApplicationLauncherHideAppRequest() : ModelCommand("hide-app-request") { // application Struct parsing is not supported yet ModelCommand::AddArguments(); @@ -4851,21 +4808,21 @@ class ApplicationLauncherHideApp : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000002) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnApplicationLauncherHideAppResponseSuccess, OnDefaultFailure, + return chip::Controller::InvokeCommand(device, this, OnApplicationLauncherLauncherResponseSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type mRequest; + chip::app::Clusters::ApplicationLauncher::Commands::HideAppRequest::Type mRequest; }; /* - * Command LaunchApp + * Command LaunchAppRequest */ -class ApplicationLauncherLaunchApp : public ModelCommand +class ApplicationLauncherLaunchAppRequest : public ModelCommand { public: - ApplicationLauncherLaunchApp() : ModelCommand("launch-app") + ApplicationLauncherLaunchAppRequest() : ModelCommand("launch-app-request") { AddArgument("Data", &mRequest.data); // application Struct parsing is not supported yet @@ -4876,21 +4833,21 @@ class ApplicationLauncherLaunchApp : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000000) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnApplicationLauncherLaunchAppResponseSuccess, OnDefaultFailure, + return chip::Controller::InvokeCommand(device, this, OnApplicationLauncherLauncherResponseSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type mRequest; + chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppRequest::Type mRequest; }; /* - * Command StopApp + * Command StopAppRequest */ -class ApplicationLauncherStopApp : public ModelCommand +class ApplicationLauncherStopAppRequest : public ModelCommand { public: - ApplicationLauncherStopApp() : ModelCommand("stop-app") + ApplicationLauncherStopAppRequest() : ModelCommand("stop-app-request") { // application Struct parsing is not supported yet ModelCommand::AddArguments(); @@ -4900,12 +4857,12 @@ class ApplicationLauncherStopApp : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050C) command (0x00000001) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnApplicationLauncherStopAppResponseSuccess, OnDefaultFailure, + return chip::Controller::InvokeCommand(device, this, OnApplicationLauncherLauncherResponseSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type mRequest; + chip::app::Clusters::ApplicationLauncher::Commands::StopAppRequest::Type mRequest; }; /* @@ -5083,8 +5040,8 @@ class ReportApplicationLauncherClusterRevision : public ModelCommand | Cluster AudioOutput | 0x050B | |------------------------------------------------------------------------------| | Commands: | | -| * RenameOutput | 0x01 | -| * SelectOutput | 0x00 | +| * RenameOutputRequest | 0x01 | +| * SelectOutputRequest | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | | * AudioOutputList | 0x0000 | @@ -5094,12 +5051,12 @@ class ReportApplicationLauncherClusterRevision : public ModelCommand \*----------------------------------------------------------------------------*/ /* - * Command RenameOutput + * Command RenameOutputRequest */ -class AudioOutputRenameOutput : public ModelCommand +class AudioOutputRenameOutputRequest : public ModelCommand { public: - AudioOutputRenameOutput() : ModelCommand("rename-output") + AudioOutputRenameOutputRequest() : ModelCommand("rename-output-request") { AddArgument("Index", 0, UINT8_MAX, &mRequest.index); AddArgument("Name", &mRequest.name); @@ -5115,16 +5072,16 @@ class AudioOutputRenameOutput : public ModelCommand } private: - chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type mRequest; + chip::app::Clusters::AudioOutput::Commands::RenameOutputRequest::Type mRequest; }; /* - * Command SelectOutput + * Command SelectOutputRequest */ -class AudioOutputSelectOutput : public ModelCommand +class AudioOutputSelectOutputRequest : public ModelCommand { public: - AudioOutputSelectOutput() : ModelCommand("select-output") + AudioOutputSelectOutputRequest() : ModelCommand("select-output-request") { AddArgument("Index", 0, UINT8_MAX, &mRequest.index); ModelCommand::AddArguments(); @@ -5139,7 +5096,7 @@ class AudioOutputSelectOutput : public ModelCommand } private: - chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type mRequest; + chip::app::Clusters::AudioOutput::Commands::SelectOutputRequest::Type mRequest; }; /* @@ -5168,8 +5125,7 @@ class ReadAudioOutputAudioOutputList : public ModelCommand static void OnAttributeResponse( void * context, - const chip::app::DataModel::DecodableList & - value) + const chip::app::DataModel::DecodableList & value) { OnGeneralAttributeResponse(context, "AudioOutput.AudioOutputList response", value); } @@ -5208,8 +5164,7 @@ class ReportAudioOutputAudioOutputList : public ModelCommand static void OnValueReport( void * context, - const chip::app::DataModel::DecodableList & - value) + const chip::app::DataModel::DecodableList & value) { LogValue("AudioOutput.AudioOutputList report", 0, value); } @@ -8800,6 +8755,268 @@ class ReportBridgedDeviceBasicClusterRevision : public ModelCommand bool mWait; }; +/*----------------------------------------------------------------------------*\ +| Cluster Channel | 0x0504 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ChangeChannelByNumberRequest | 0x02 | +| * ChangeChannelRequest | 0x00 | +| * SkipChannelRequest | 0x03 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * ChannelList | 0x0000 | +| * AttributeList | 0xFFFB | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/* + * Command ChangeChannelByNumberRequest + */ +class ChannelChangeChannelByNumberRequest : public ModelCommand +{ +public: + ChannelChangeChannelByNumberRequest() : ModelCommand("change-channel-by-number-request") + { + AddArgument("MajorNumber", 0, UINT16_MAX, &mRequest.majorNumber); + AddArgument("MinorNumber", 0, UINT16_MAX, &mRequest.minorNumber); + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000504) command (0x00000002) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, + mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::Channel::Commands::ChangeChannelByNumberRequest::Type mRequest; +}; + +/* + * Command ChangeChannelRequest + */ +class ChannelChangeChannelRequest : public ModelCommand +{ +public: + ChannelChangeChannelRequest() : ModelCommand("change-channel-request") + { + AddArgument("Match", &mRequest.match); + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000504) command (0x00000000) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnChannelChangeChannelResponseSuccess, OnDefaultFailure, endpointId, + mRequest, mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::Channel::Commands::ChangeChannelRequest::Type mRequest; +}; + +/* + * Command SkipChannelRequest + */ +class ChannelSkipChannelRequest : public ModelCommand +{ +public: + ChannelSkipChannelRequest() : ModelCommand("skip-channel-request") + { + AddArgument("Count", 0, UINT16_MAX, &mRequest.count); + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000504) command (0x00000003) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, + mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::Channel::Commands::SkipChannelRequest::Type mRequest; +}; + +/* + * Attribute ChannelList + */ +class ReadChannelChannelList : public ModelCommand +{ +public: + ReadChannelChannelList() : ModelCommand("read") + { + AddArgument("attr-name", "channel-list"); + ModelCommand::AddArguments(); + } + + ~ReadChannelChannelList() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::ChannelCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute(this, OnAttributeResponse, + OnDefaultFailure); + } + + static void OnAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & value) + { + OnGeneralAttributeResponse(context, "Channel.ChannelList response", value); + } +}; + +class ReportChannelChannelList : public ModelCommand +{ +public: + ReportChannelChannelList() : ModelCommand("report") + { + AddArgument("attr-name", "channel-list"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportChannelChannelList() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::ChannelCluster cluster; + cluster.Associate(device, endpointId); + + auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; + return cluster.SubscribeAttribute( + this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + + static void OnValueReport( + void * context, + const chip::app::DataModel::DecodableList & value) + { + LogValue("Channel.ChannelList report", 0, value); + } + +private: + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + +/* + * Attribute AttributeList + */ +class ReadChannelAttributeList : public ModelCommand +{ +public: + ReadChannelAttributeList() : ModelCommand("read") + { + AddArgument("attr-name", "attribute-list"); + ModelCommand::AddArguments(); + } + + ~ReadChannelAttributeList() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::ChannelCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute(this, OnAttributeResponse, + OnDefaultFailure); + } + + static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) + { + OnGeneralAttributeResponse(context, "Channel.AttributeList response", value); + } +}; + +/* + * Attribute ClusterRevision + */ +class ReadChannelClusterRevision : public ModelCommand +{ +public: + ReadChannelClusterRevision() : ModelCommand("read") + { + AddArgument("attr-name", "cluster-revision"); + ModelCommand::AddArguments(); + } + + ~ReadChannelClusterRevision() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::ChannelCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute(this, OnAttributeResponse, + OnDefaultFailure); + } + + static void OnAttributeResponse(void * context, uint16_t value) + { + OnGeneralAttributeResponse(context, "Channel.ClusterRevision response", value); + } +}; + +class ReportChannelClusterRevision : public ModelCommand +{ +public: + ReportChannelClusterRevision() : ModelCommand("report") + { + AddArgument("attr-name", "cluster-revision"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportChannelClusterRevision() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::ChannelCluster cluster; + cluster.Associate(device, endpointId); + + auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; + return cluster.SubscribeAttribute( + this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + + static void OnValueReport(void * context, uint16_t value) { LogValue("Channel.ClusterRevision report", 0, value); } + +private: + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + /*----------------------------------------------------------------------------*\ | Cluster ColorControl | 0x0300 | |------------------------------------------------------------------------------| @@ -13464,23 +13681,23 @@ class ReportColorControlClusterRevision : public ModelCommand | Cluster ContentLauncher | 0x050A | |------------------------------------------------------------------------------| | Commands: | | -| * LaunchContent | 0x00 | -| * LaunchURL | 0x01 | +| * LaunchContentRequest | 0x00 | +| * LaunchURLRequest | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | -| * AcceptsHeaderList | 0x0000 | +| * AcceptHeaderList | 0x0000 | | * SupportedStreamingProtocols | 0x0001 | | * AttributeList | 0xFFFB | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ /* - * Command LaunchContent + * Command LaunchContentRequest */ -class ContentLauncherLaunchContent : public ModelCommand +class ContentLauncherLaunchContentRequest : public ModelCommand { public: - ContentLauncherLaunchContent() : ModelCommand("launch-content") + ContentLauncherLaunchContentRequest() : ModelCommand("launch-content-request") { AddArgument("AutoPlay", 0, 1, &mRequest.autoPlay); AddArgument("Data", &mRequest.data); @@ -13492,25 +13709,25 @@ class ContentLauncherLaunchContent : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050A) command (0x00000000) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnContentLauncherLaunchContentResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); + return chip::Controller::InvokeCommand(device, this, OnContentLauncherLaunchResponseSuccess, OnDefaultFailure, endpointId, + mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type mRequest; + chip::app::Clusters::ContentLauncher::Commands::LaunchContentRequest::Type mRequest; }; /* - * Command LaunchURL + * Command LaunchURLRequest */ -class ContentLauncherLaunchURL : public ModelCommand +class ContentLauncherLaunchURLRequest : public ModelCommand { public: - ContentLauncherLaunchURL() : ModelCommand("launch-url") + ContentLauncherLaunchURLRequest() : ModelCommand("launch-urlrequest") { AddArgument("ContentURL", &mRequest.contentURL); AddArgument("DisplayString", &mRequest.displayString); - // brandingInformation Array parsing is not supported yet + // brandingInformation Struct parsing is not supported yet ModelCommand::AddArguments(); } @@ -13518,27 +13735,27 @@ class ContentLauncherLaunchURL : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x0000050A) command (0x00000001) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnContentLauncherLaunchURLResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); + return chip::Controller::InvokeCommand(device, this, OnContentLauncherLaunchResponseSuccess, OnDefaultFailure, endpointId, + mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type mRequest; + chip::app::Clusters::ContentLauncher::Commands::LaunchURLRequest::Type mRequest; }; /* - * Attribute AcceptsHeaderList + * Attribute AcceptHeaderList */ -class ReadContentLauncherAcceptsHeaderList : public ModelCommand +class ReadContentLauncherAcceptHeaderList : public ModelCommand { public: - ReadContentLauncherAcceptsHeaderList() : ModelCommand("read") + ReadContentLauncherAcceptHeaderList() : ModelCommand("read") { - AddArgument("attr-name", "accepts-header-list"); + AddArgument("attr-name", "accept-header-list"); ModelCommand::AddArguments(); } - ~ReadContentLauncherAcceptsHeaderList() {} + ~ReadContentLauncherAcceptHeaderList() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -13546,29 +13763,29 @@ class ReadContentLauncherAcceptsHeaderList : public ModelCommand chip::Controller::ContentLauncherCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttribute( + return cluster.ReadAttribute( this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) + static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) { - OnGeneralAttributeResponse(context, "ContentLauncher.AcceptsHeaderList response", value); + OnGeneralAttributeResponse(context, "ContentLauncher.AcceptHeaderList response", value); } }; -class ReportContentLauncherAcceptsHeaderList : public ModelCommand +class ReportContentLauncherAcceptHeaderList : public ModelCommand { public: - ReportContentLauncherAcceptsHeaderList() : ModelCommand("report") + ReportContentLauncherAcceptHeaderList() : ModelCommand("report") { - AddArgument("attr-name", "accepts-header-list"); + AddArgument("attr-name", "accept-header-list"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportContentLauncherAcceptsHeaderList() {} + ~ReportContentLauncherAcceptHeaderList() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -13578,7 +13795,7 @@ class ReportContentLauncherAcceptsHeaderList : public ModelCommand cluster.Associate(device, endpointId); auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( + return cluster.SubscribeAttribute( this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); } @@ -13587,9 +13804,9 @@ class ReportContentLauncherAcceptsHeaderList : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) + static void OnValueReport(void * context, const chip::app::DataModel::DecodableList & value) { - LogValue("ContentLauncher.AcceptsHeaderList report", 0, value); + LogValue("ContentLauncher.AcceptHeaderList report", 0, value); } private: @@ -19108,27 +19325,129 @@ class ReportGeneralDiagnosticsClusterRevision : public ModelCommand | Cluster GroupKeyManagement | 0x003F | |------------------------------------------------------------------------------| | Commands: | | +| * KeySetRead | 0x01 | +| * KeySetReadAllIndices | 0x04 | +| * KeySetRemove | 0x03 | +| * KeySetWrite | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | -| * Groups | 0x0000 | -| * GroupKeys | 0x0001 | +| * GroupKeyMap | 0x0000 | +| * GroupTable | 0x0001 | +| * MaxGroupsPerFabric | 0x0002 | +| * MaxGroupKeysPerFabric | 0x0003 | | * AttributeList | 0xFFFB | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ /* - * Attribute Groups + * Command KeySetRead + */ +class GroupKeyManagementKeySetRead : public ModelCommand +{ +public: + GroupKeyManagementKeySetRead() : ModelCommand("key-set-read") + { + AddArgument("GroupKeySetID", 0, UINT16_MAX, &mRequest.groupKeySetID); + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000001) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnGroupKeyManagementKeySetReadResponseSuccess, OnDefaultFailure, + endpointId, mRequest, mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRead::Type mRequest; +}; + +/* + * Command KeySetReadAllIndices + */ +class GroupKeyManagementKeySetReadAllIndices : public ModelCommand +{ +public: + GroupKeyManagementKeySetReadAllIndices() : ModelCommand("key-set-read-all-indices") + { + // groupKeySetIDs Array parsing is not supported yet + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000004) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnGroupKeyManagementKeySetReadAllIndicesResponseSuccess, + OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndices::Type mRequest; +}; + +/* + * Command KeySetRemove + */ +class GroupKeyManagementKeySetRemove : public ModelCommand +{ +public: + GroupKeyManagementKeySetRemove() : ModelCommand("key-set-remove") + { + AddArgument("GroupKeySetID", 0, UINT16_MAX, &mRequest.groupKeySetID); + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000003) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, + mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetRemove::Type mRequest; +}; + +/* + * Command KeySetWrite + */ +class GroupKeyManagementKeySetWrite : public ModelCommand +{ +public: + GroupKeyManagementKeySetWrite() : ModelCommand("key-set-write") + { + // groupKeySet Struct parsing is not supported yet + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000003F) command (0x00000000) on endpoint %" PRIu8, endpointId); + + return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, + mTimedInteractionTimeoutMs); + } + +private: + chip::app::Clusters::GroupKeyManagement::Commands::KeySetWrite::Type mRequest; +}; + +/* + * Attribute GroupKeyMap */ -class ReadGroupKeyManagementGroups : public ModelCommand +class ReadGroupKeyManagementGroupKeyMap : public ModelCommand { public: - ReadGroupKeyManagementGroups() : ModelCommand("read") + ReadGroupKeyManagementGroupKeyMap() : ModelCommand("read") { - AddArgument("attr-name", "groups"); + AddArgument("attr-name", "group-key-map"); ModelCommand::AddArguments(); } - ~ReadGroupKeyManagementGroups() {} + ~ReadGroupKeyManagementGroupKeyMap() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -19136,32 +19455,32 @@ class ReadGroupKeyManagementGroups : public ModelCommand chip::Controller::GroupKeyManagementCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttribute( + return cluster.ReadAttribute( this, OnAttributeResponse, OnDefaultFailure); } static void OnAttributeResponse( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value) { - OnGeneralAttributeResponse(context, "GroupKeyManagement.Groups response", value); + OnGeneralAttributeResponse(context, "GroupKeyManagement.GroupKeyMap response", value); } }; -class ReportGroupKeyManagementGroups : public ModelCommand +class ReportGroupKeyManagementGroupKeyMap : public ModelCommand { public: - ReportGroupKeyManagementGroups() : ModelCommand("report") + ReportGroupKeyManagementGroupKeyMap() : ModelCommand("report") { - AddArgument("attr-name", "groups"); + AddArgument("attr-name", "group-key-map"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportGroupKeyManagementGroups() {} + ~ReportGroupKeyManagementGroupKeyMap() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -19171,7 +19490,7 @@ class ReportGroupKeyManagementGroups : public ModelCommand cluster.Associate(device, endpointId); auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( + return cluster.SubscribeAttribute( this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); } @@ -19182,10 +19501,10 @@ class ReportGroupKeyManagementGroups : public ModelCommand static void OnValueReport( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value) { - LogValue("GroupKeyManagement.Groups report", 0, value); + LogValue("GroupKeyManagement.GroupKeyMap report", 0, value); } private: @@ -19195,18 +19514,18 @@ class ReportGroupKeyManagementGroups : public ModelCommand }; /* - * Attribute GroupKeys + * Attribute GroupTable */ -class ReadGroupKeyManagementGroupKeys : public ModelCommand +class ReadGroupKeyManagementGroupTable : public ModelCommand { public: - ReadGroupKeyManagementGroupKeys() : ModelCommand("read") + ReadGroupKeyManagementGroupTable() : ModelCommand("read") { - AddArgument("attr-name", "group-keys"); + AddArgument("attr-name", "group-table"); ModelCommand::AddArguments(); } - ~ReadGroupKeyManagementGroupKeys() {} + ~ReadGroupKeyManagementGroupTable() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -19214,32 +19533,32 @@ class ReadGroupKeyManagementGroupKeys : public ModelCommand chip::Controller::GroupKeyManagementCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttribute( + return cluster.ReadAttribute( this, OnAttributeResponse, OnDefaultFailure); } static void OnAttributeResponse( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value) { - OnGeneralAttributeResponse(context, "GroupKeyManagement.GroupKeys response", value); + OnGeneralAttributeResponse(context, "GroupKeyManagement.GroupTable response", value); } }; -class ReportGroupKeyManagementGroupKeys : public ModelCommand +class ReportGroupKeyManagementGroupTable : public ModelCommand { public: - ReportGroupKeyManagementGroupKeys() : ModelCommand("report") + ReportGroupKeyManagementGroupTable() : ModelCommand("report") { - AddArgument("attr-name", "group-keys"); + AddArgument("attr-name", "group-table"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportGroupKeyManagementGroupKeys() {} + ~ReportGroupKeyManagementGroupTable() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -19249,7 +19568,7 @@ class ReportGroupKeyManagementGroupKeys : public ModelCommand cluster.Associate(device, endpointId); auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( + return cluster.SubscribeAttribute( this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); } @@ -19260,10 +19579,10 @@ class ReportGroupKeyManagementGroupKeys : public ModelCommand static void OnValueReport( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & value) { - LogValue("GroupKeyManagement.GroupKeys report", 0, value); + LogValue("GroupKeyManagement.GroupTable report", 0, value); } private: @@ -19272,6 +19591,66 @@ class ReportGroupKeyManagementGroupKeys : public ModelCommand bool mWait; }; +/* + * Attribute MaxGroupsPerFabric + */ +class ReadGroupKeyManagementMaxGroupsPerFabric : public ModelCommand +{ +public: + ReadGroupKeyManagementMaxGroupsPerFabric() : ModelCommand("read") + { + AddArgument("attr-name", "max-groups-per-fabric"); + ModelCommand::AddArguments(); + } + + ~ReadGroupKeyManagementMaxGroupsPerFabric() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x003F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::GroupKeyManagementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute( + this, OnAttributeResponse, OnDefaultFailure); + } + + static void OnAttributeResponse(void * context, uint16_t value) + { + OnGeneralAttributeResponse(context, "GroupKeyManagement.MaxGroupsPerFabric response", value); + } +}; + +/* + * Attribute MaxGroupKeysPerFabric + */ +class ReadGroupKeyManagementMaxGroupKeysPerFabric : public ModelCommand +{ +public: + ReadGroupKeyManagementMaxGroupKeysPerFabric() : ModelCommand("read") + { + AddArgument("attr-name", "max-group-keys-per-fabric"); + ModelCommand::AddArguments(); + } + + ~ReadGroupKeyManagementMaxGroupKeysPerFabric() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x003F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::GroupKeyManagementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute( + this, OnAttributeResponse, OnDefaultFailure); + } + + static void OnAttributeResponse(void * context, uint16_t value) + { + OnGeneralAttributeResponse(context, "GroupKeyManagement.MaxGroupKeysPerFabric response", value); + } +}; + /* * Attribute AttributeList */ @@ -20525,7 +20904,7 @@ class ReportIlluminanceMeasurementClusterRevision : public ModelCommand | Cluster KeypadInput | 0x0509 | |------------------------------------------------------------------------------| | Commands: | | -| * SendKey | 0x00 | +| * SendKeyRequest | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | | * AttributeList | 0xFFFB | @@ -20533,12 +20912,12 @@ class ReportIlluminanceMeasurementClusterRevision : public ModelCommand \*----------------------------------------------------------------------------*/ /* - * Command SendKey + * Command SendKeyRequest */ -class KeypadInputSendKey : public ModelCommand +class KeypadInputSendKeyRequest : public ModelCommand { public: - KeypadInputSendKey() : ModelCommand("send-key") + KeypadInputSendKeyRequest() : ModelCommand("send-key-request") { AddArgument("KeyCode", 0, UINT8_MAX, reinterpret_cast *>(&mRequest.keyCode)); @@ -20554,7 +20933,7 @@ class KeypadInputSendKey : public ModelCommand } private: - chip::app::Clusters::KeypadInput::Commands::SendKey::Type mRequest; + chip::app::Clusters::KeypadInput::Commands::SendKeyRequest::Type mRequest; }; /* @@ -22288,10 +22667,10 @@ class ReportLowPowerClusterRevision : public ModelCommand | Cluster MediaInput | 0x0507 | |------------------------------------------------------------------------------| | Commands: | | -| * HideInputStatus | 0x02 | -| * RenameInput | 0x03 | -| * SelectInput | 0x00 | -| * ShowInputStatus | 0x01 | +| * HideInputStatusRequest | 0x02 | +| * RenameInputRequest | 0x03 | +| * SelectInputRequest | 0x00 | +| * ShowInputStatusRequest | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * MediaInputList | 0x0000 | @@ -22301,12 +22680,12 @@ class ReportLowPowerClusterRevision : public ModelCommand \*----------------------------------------------------------------------------*/ /* - * Command HideInputStatus + * Command HideInputStatusRequest */ -class MediaInputHideInputStatus : public ModelCommand +class MediaInputHideInputStatusRequest : public ModelCommand { public: - MediaInputHideInputStatus() : ModelCommand("hide-input-status") { ModelCommand::AddArguments(); } + MediaInputHideInputStatusRequest() : ModelCommand("hide-input-status-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -22317,16 +22696,16 @@ class MediaInputHideInputStatus : public ModelCommand } private: - chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type mRequest; + chip::app::Clusters::MediaInput::Commands::HideInputStatusRequest::Type mRequest; }; /* - * Command RenameInput + * Command RenameInputRequest */ -class MediaInputRenameInput : public ModelCommand +class MediaInputRenameInputRequest : public ModelCommand { public: - MediaInputRenameInput() : ModelCommand("rename-input") + MediaInputRenameInputRequest() : ModelCommand("rename-input-request") { AddArgument("Index", 0, UINT8_MAX, &mRequest.index); AddArgument("Name", &mRequest.name); @@ -22342,16 +22721,16 @@ class MediaInputRenameInput : public ModelCommand } private: - chip::app::Clusters::MediaInput::Commands::RenameInput::Type mRequest; + chip::app::Clusters::MediaInput::Commands::RenameInputRequest::Type mRequest; }; /* - * Command SelectInput + * Command SelectInputRequest */ -class MediaInputSelectInput : public ModelCommand +class MediaInputSelectInputRequest : public ModelCommand { public: - MediaInputSelectInput() : ModelCommand("select-input") + MediaInputSelectInputRequest() : ModelCommand("select-input-request") { AddArgument("Index", 0, UINT8_MAX, &mRequest.index); ModelCommand::AddArguments(); @@ -22366,16 +22745,16 @@ class MediaInputSelectInput : public ModelCommand } private: - chip::app::Clusters::MediaInput::Commands::SelectInput::Type mRequest; + chip::app::Clusters::MediaInput::Commands::SelectInputRequest::Type mRequest; }; /* - * Command ShowInputStatus + * Command ShowInputStatusRequest */ -class MediaInputShowInputStatus : public ModelCommand +class MediaInputShowInputStatusRequest : public ModelCommand { public: - MediaInputShowInputStatus() : ModelCommand("show-input-status") { ModelCommand::AddArguments(); } + MediaInputShowInputStatusRequest() : ModelCommand("show-input-status-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -22386,7 +22765,7 @@ class MediaInputShowInputStatus : public ModelCommand } private: - chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type mRequest; + chip::app::Clusters::MediaInput::Commands::ShowInputStatusRequest::Type mRequest; }; /* @@ -22415,7 +22794,7 @@ class ReadMediaInputMediaInputList : public ModelCommand static void OnAttributeResponse( void * context, - const chip::app::DataModel::DecodableList & value) + const chip::app::DataModel::DecodableList & value) { OnGeneralAttributeResponse(context, "MediaInput.MediaInputList response", value); } @@ -22454,7 +22833,7 @@ class ReportMediaInputMediaInputList : public ModelCommand static void OnValueReport( void * context, - const chip::app::DataModel::DecodableList & value) + const chip::app::DataModel::DecodableList & value) { LogValue("MediaInput.MediaInputList report", 0, value); } @@ -22637,17 +23016,17 @@ class ReportMediaInputClusterRevision : public ModelCommand | Cluster MediaPlayback | 0x0506 | |------------------------------------------------------------------------------| | Commands: | | -| * MediaFastForward | 0x07 | -| * MediaNext | 0x05 | -| * MediaPause | 0x01 | -| * MediaPlay | 0x00 | -| * MediaPrevious | 0x04 | -| * MediaRewind | 0x06 | -| * MediaSeek | 0x0A | -| * MediaSkipBackward | 0x09 | -| * MediaSkipForward | 0x08 | -| * MediaStartOver | 0x03 | -| * MediaStop | 0x02 | +| * FastForwardRequest | 0x07 | +| * NextRequest | 0x05 | +| * PauseRequest | 0x01 | +| * PlayRequest | 0x00 | +| * PreviousRequest | 0x04 | +| * RewindRequest | 0x06 | +| * SeekRequest | 0x0B | +| * SkipBackwardRequest | 0x09 | +| * SkipForwardRequest | 0x08 | +| * StartOverRequest | 0x03 | +| * StopRequest | 0x02 | |------------------------------------------------------------------------------| | Attributes: | | | * PlaybackState | 0x0000 | @@ -22661,132 +23040,132 @@ class ReportMediaInputClusterRevision : public ModelCommand \*----------------------------------------------------------------------------*/ /* - * Command MediaFastForward + * Command FastForwardRequest */ -class MediaPlaybackMediaFastForward : public ModelCommand +class MediaPlaybackFastForwardRequest : public ModelCommand { public: - MediaPlaybackMediaFastForward() : ModelCommand("media-fast-forward") { ModelCommand::AddArguments(); } + MediaPlaybackFastForwardRequest() : ModelCommand("fast-forward-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000007) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaFastForwardResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, + mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaFastForward::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::FastForwardRequest::Type mRequest; }; /* - * Command MediaNext + * Command NextRequest */ -class MediaPlaybackMediaNext : public ModelCommand +class MediaPlaybackNextRequest : public ModelCommand { public: - MediaPlaybackMediaNext() : ModelCommand("media-next") { ModelCommand::AddArguments(); } + MediaPlaybackNextRequest() : ModelCommand("next-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000005) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaNextResponseSuccess, OnDefaultFailure, endpointId, + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaNext::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::NextRequest::Type mRequest; }; /* - * Command MediaPause + * Command PauseRequest */ -class MediaPlaybackMediaPause : public ModelCommand +class MediaPlaybackPauseRequest : public ModelCommand { public: - MediaPlaybackMediaPause() : ModelCommand("media-pause") { ModelCommand::AddArguments(); } + MediaPlaybackPauseRequest() : ModelCommand("pause-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000001) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaPauseResponseSuccess, OnDefaultFailure, endpointId, + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaPause::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::PauseRequest::Type mRequest; }; /* - * Command MediaPlay + * Command PlayRequest */ -class MediaPlaybackMediaPlay : public ModelCommand +class MediaPlaybackPlayRequest : public ModelCommand { public: - MediaPlaybackMediaPlay() : ModelCommand("media-play") { ModelCommand::AddArguments(); } + MediaPlaybackPlayRequest() : ModelCommand("play-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000000) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaPlayResponseSuccess, OnDefaultFailure, endpointId, + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaPlay::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::PlayRequest::Type mRequest; }; /* - * Command MediaPrevious + * Command PreviousRequest */ -class MediaPlaybackMediaPrevious : public ModelCommand +class MediaPlaybackPreviousRequest : public ModelCommand { public: - MediaPlaybackMediaPrevious() : ModelCommand("media-previous") { ModelCommand::AddArguments(); } + MediaPlaybackPreviousRequest() : ModelCommand("previous-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000004) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaPreviousResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, + mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaPrevious::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::PreviousRequest::Type mRequest; }; /* - * Command MediaRewind + * Command RewindRequest */ -class MediaPlaybackMediaRewind : public ModelCommand +class MediaPlaybackRewindRequest : public ModelCommand { public: - MediaPlaybackMediaRewind() : ModelCommand("media-rewind") { ModelCommand::AddArguments(); } + MediaPlaybackRewindRequest() : ModelCommand("rewind-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000006) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaRewindResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, + mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaRewind::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::RewindRequest::Type mRequest; }; /* - * Command MediaSeek + * Command SeekRequest */ -class MediaPlaybackMediaSeek : public ModelCommand +class MediaPlaybackSeekRequest : public ModelCommand { public: - MediaPlaybackMediaSeek() : ModelCommand("media-seek") + MediaPlaybackSeekRequest() : ModelCommand("seek-request") { AddArgument("Position", 0, UINT64_MAX, &mRequest.position); ModelCommand::AddArguments(); @@ -22794,23 +23173,23 @@ class MediaPlaybackMediaSeek : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x0000000A) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x0000000B) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaSeekResponseSuccess, OnDefaultFailure, endpointId, + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaSeek::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::SeekRequest::Type mRequest; }; /* - * Command MediaSkipBackward + * Command SkipBackwardRequest */ -class MediaPlaybackMediaSkipBackward : public ModelCommand +class MediaPlaybackSkipBackwardRequest : public ModelCommand { public: - MediaPlaybackMediaSkipBackward() : ModelCommand("media-skip-backward") + MediaPlaybackSkipBackwardRequest() : ModelCommand("skip-backward-request") { AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mRequest.deltaPositionMilliseconds); ModelCommand::AddArguments(); @@ -22820,21 +23199,21 @@ class MediaPlaybackMediaSkipBackward : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000009) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaSkipBackwardResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, + mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackward::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::SkipBackwardRequest::Type mRequest; }; /* - * Command MediaSkipForward + * Command SkipForwardRequest */ -class MediaPlaybackMediaSkipForward : public ModelCommand +class MediaPlaybackSkipForwardRequest : public ModelCommand { public: - MediaPlaybackMediaSkipForward() : ModelCommand("media-skip-forward") + MediaPlaybackSkipForwardRequest() : ModelCommand("skip-forward-request") { AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mRequest.deltaPositionMilliseconds); ModelCommand::AddArguments(); @@ -22844,52 +23223,52 @@ class MediaPlaybackMediaSkipForward : public ModelCommand { ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000008) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaSkipForwardResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, + mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaSkipForward::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::SkipForwardRequest::Type mRequest; }; /* - * Command MediaStartOver + * Command StartOverRequest */ -class MediaPlaybackMediaStartOver : public ModelCommand +class MediaPlaybackStartOverRequest : public ModelCommand { public: - MediaPlaybackMediaStartOver() : ModelCommand("media-start-over") { ModelCommand::AddArguments(); } + MediaPlaybackStartOverRequest() : ModelCommand("start-over-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000003) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaStartOverResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, + mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaStartOver::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::StartOverRequest::Type mRequest; }; /* - * Command MediaStop + * Command StopRequest */ -class MediaPlaybackMediaStop : public ModelCommand +class MediaPlaybackStopRequest : public ModelCommand { public: - MediaPlaybackMediaStop() : ModelCommand("media-stop") { ModelCommand::AddArguments(); } + MediaPlaybackStopRequest() : ModelCommand("stop-request") { ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { ChipLogProgress(chipTool, "Sending cluster (0x00000506) command (0x00000002) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackMediaStopResponseSuccess, OnDefaultFailure, endpointId, + return chip::Controller::InvokeCommand(device, this, OnMediaPlaybackPlaybackResponseSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::MediaPlayback::Commands::MediaStop::Type mRequest; + chip::app::Clusters::MediaPlayback::Commands::StopRequest::Type mRequest; }; /* @@ -22916,7 +23295,7 @@ class ReadMediaPlaybackPlaybackState : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, uint8_t value) + static void OnAttributeResponse(void * context, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value) { OnGeneralAttributeResponse(context, "MediaPlayback.PlaybackState response", value); } @@ -22953,7 +23332,10 @@ class ReportMediaPlaybackPlaybackState : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, uint8_t value) { LogValue("MediaPlayback.PlaybackState report", 0, value); } + static void OnValueReport(void * context, chip::app::Clusters::MediaPlayback::PlaybackStateEnum value) + { + LogValue("MediaPlayback.PlaybackState report", 0, value); + } private: uint16_t mMinInterval; @@ -24472,8 +24854,8 @@ class ReportNetworkCommissioningClusterRevision : public ModelCommand | Cluster OtaSoftwareUpdateProvider | 0x0029 | |------------------------------------------------------------------------------| | Commands: | | -| * ApplyUpdateRequest | 0x01 | -| * NotifyUpdateApplied | 0x02 | +| * ApplyUpdateRequest | 0x02 | +| * NotifyUpdateApplied | 0x04 | | * QueryImage | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | @@ -24496,7 +24878,7 @@ class OtaSoftwareUpdateProviderApplyUpdateRequest : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000001) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000002) on endpoint %" PRIu8, endpointId); return chip::Controller::InvokeCommand(device, this, OnOtaSoftwareUpdateProviderApplyUpdateResponseSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); @@ -24521,7 +24903,7 @@ class OtaSoftwareUpdateProviderNotifyUpdateApplied : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000002) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000029) command (0x00000004) on endpoint %" PRIu8, endpointId); return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, mTimedInteractionTimeoutMs); @@ -24671,8 +25053,10 @@ class ReportOtaSoftwareUpdateProviderClusterRevision : public ModelCommand | * AnnounceOtaProvider | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | -| * DefaultOtaProvider | 0x0001 | -| * UpdatePossible | 0x0002 | +| * DefaultOtaProviders | 0x0000 | +| * UpdatePossible | 0x0001 | +| * UpdateState | 0x0002 | +| * UpdateStateProgress | 0x0003 | | * AttributeList | 0xFFFB | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -24685,12 +25069,13 @@ class OtaSoftwareUpdateRequestorAnnounceOtaProvider : public ModelCommand public: OtaSoftwareUpdateRequestorAnnounceOtaProvider() : ModelCommand("announce-ota-provider") { - AddArgument("ProviderLocation", 0, UINT64_MAX, &mRequest.providerLocation); + AddArgument("ProviderNodeId", 0, UINT64_MAX, &mRequest.providerNodeId); AddArgument("VendorId", 0, UINT16_MAX, &mRequest.vendorId); AddArgument( "AnnouncementReason", 0, UINT8_MAX, reinterpret_cast *>(&mRequest.announcementReason)); AddArgument("MetadataForNode", &mRequest.metadataForNode); + AddArgument("Endpoint", 0, UINT16_MAX, &mRequest.endpoint); ModelCommand::AddArguments(); } @@ -24707,18 +25092,18 @@ class OtaSoftwareUpdateRequestorAnnounceOtaProvider : public ModelCommand }; /* - * Attribute DefaultOtaProvider + * Attribute DefaultOtaProviders */ -class ReadOtaSoftwareUpdateRequestorDefaultOtaProvider : public ModelCommand +class ReadOtaSoftwareUpdateRequestorDefaultOtaProviders : public ModelCommand { public: - ReadOtaSoftwareUpdateRequestorDefaultOtaProvider() : ModelCommand("read") + ReadOtaSoftwareUpdateRequestorDefaultOtaProviders() : ModelCommand("read") { - AddArgument("attr-name", "default-ota-provider"); + AddArgument("attr-name", "default-ota-providers"); ModelCommand::AddArguments(); } - ~ReadOtaSoftwareUpdateRequestorDefaultOtaProvider() {} + ~ReadOtaSoftwareUpdateRequestorDefaultOtaProviders() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -24726,55 +25111,32 @@ class ReadOtaSoftwareUpdateRequestorDefaultOtaProvider : public ModelCommand chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttribute( + return cluster.ReadAttribute( this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, chip::ByteSpan value) - { - OnGeneralAttributeResponse(context, "OtaSoftwareUpdateRequestor.DefaultOtaProvider response", value); - } -}; - -class WriteOtaSoftwareUpdateRequestorDefaultOtaProvider : public ModelCommand -{ -public: - WriteOtaSoftwareUpdateRequestorDefaultOtaProvider() : ModelCommand("write") - { - AddArgument("attr-name", "default-ota-provider"); - AddArgument("attr-value", &mValue); - ModelCommand::AddArguments(); - } - - ~WriteOtaSoftwareUpdateRequestorDefaultOtaProvider() {} - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + static void + OnAttributeResponse(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> & value) { - ChipLogProgress(chipTool, "Sending cluster (0x002A) command (0x01) on endpoint %" PRIu8, endpointId); - - chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.WriteAttribute( - mValue, this, OnDefaultSuccessResponse, OnDefaultFailure, mTimedInteractionTimeoutMs); + OnGeneralAttributeResponse(context, "OtaSoftwareUpdateRequestor.DefaultOtaProviders response", value); } - -private: - chip::ByteSpan mValue; }; -class ReportOtaSoftwareUpdateRequestorDefaultOtaProvider : public ModelCommand +class ReportOtaSoftwareUpdateRequestorDefaultOtaProviders : public ModelCommand { public: - ReportOtaSoftwareUpdateRequestorDefaultOtaProvider() : ModelCommand("report") + ReportOtaSoftwareUpdateRequestorDefaultOtaProviders() : ModelCommand("report") { - AddArgument("attr-name", "default-ota-provider"); + AddArgument("attr-name", "default-ota-providers"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportOtaSoftwareUpdateRequestorDefaultOtaProvider() {} + ~ReportOtaSoftwareUpdateRequestorDefaultOtaProviders() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -24785,7 +25147,7 @@ class ReportOtaSoftwareUpdateRequestorDefaultOtaProvider : public ModelCommand auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; return cluster - .SubscribeAttribute( + .SubscribeAttribute( this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); } @@ -24794,9 +25156,12 @@ class ReportOtaSoftwareUpdateRequestorDefaultOtaProvider : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, chip::ByteSpan value) + static void + OnValueReport(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> & value) { - LogValue("OtaSoftwareUpdateRequestor.DefaultOtaProvider report", 0, value); + LogValue("OtaSoftwareUpdateRequestor.DefaultOtaProviders report", 0, value); } private: @@ -24877,6 +25242,151 @@ class ReportOtaSoftwareUpdateRequestorUpdatePossible : public ModelCommand bool mWait; }; +/* + * Attribute UpdateState + */ +class ReadOtaSoftwareUpdateRequestorUpdateState : public ModelCommand +{ +public: + ReadOtaSoftwareUpdateRequestorUpdateState() : ModelCommand("read") + { + AddArgument("attr-name", "update-state"); + ModelCommand::AddArguments(); + } + + ~ReadOtaSoftwareUpdateRequestorUpdateState() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x002A) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute( + this, OnAttributeResponse, OnDefaultFailure); + } + + static void OnAttributeResponse(void * context, chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum value) + { + OnGeneralAttributeResponse(context, "OtaSoftwareUpdateRequestor.UpdateState response", value); + } +}; + +class ReportOtaSoftwareUpdateRequestorUpdateState : public ModelCommand +{ +public: + ReportOtaSoftwareUpdateRequestorUpdateState() : ModelCommand("report") + { + AddArgument("attr-name", "update-state"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportOtaSoftwareUpdateRequestorUpdateState() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x002A) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; + cluster.Associate(device, endpointId); + + auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; + return cluster.SubscribeAttribute( + this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + + static void OnValueReport(void * context, chip::app::Clusters::OtaSoftwareUpdateRequestor::UpdateStateEnum value) + { + LogValue("OtaSoftwareUpdateRequestor.UpdateState report", 0, value); + } + +private: + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + +/* + * Attribute UpdateStateProgress + */ +class ReadOtaSoftwareUpdateRequestorUpdateStateProgress : public ModelCommand +{ +public: + ReadOtaSoftwareUpdateRequestorUpdateStateProgress() : ModelCommand("read") + { + AddArgument("attr-name", "update-state-progress"); + ModelCommand::AddArguments(); + } + + ~ReadOtaSoftwareUpdateRequestorUpdateStateProgress() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x002A) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttribute( + this, OnAttributeResponse, OnDefaultFailure); + } + + static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) + { + OnGeneralAttributeResponse(context, "OtaSoftwareUpdateRequestor.UpdateStateProgress response", value); + } +}; + +class ReportOtaSoftwareUpdateRequestorUpdateStateProgress : public ModelCommand +{ +public: + ReportOtaSoftwareUpdateRequestorUpdateStateProgress() : ModelCommand("report") + { + AddArgument("attr-name", "update-state-progress"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("wait", 0, 1, &mWait); + ModelCommand::AddArguments(); + } + + ~ReportOtaSoftwareUpdateRequestorUpdateStateProgress() {} + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x002A) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::OtaSoftwareUpdateRequestorCluster cluster; + cluster.Associate(device, endpointId); + + auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; + return cluster + .SubscribeAttribute( + this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } + + static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) + { + LogValue("OtaSoftwareUpdateRequestor.UpdateStateProgress report", 0, value); + } + +private: + uint16_t mMinInterval; + uint16_t mMaxInterval; + bool mWait; +}; + /* * Attribute AttributeList */ @@ -32197,147 +32707,98 @@ class ReportSwitchClusterRevision : public ModelCommand }; /*----------------------------------------------------------------------------*\ -| Cluster TvChannel | 0x0504 | +| Cluster TargetNavigator | 0x0505 | |------------------------------------------------------------------------------| | Commands: | | -| * ChangeChannel | 0x00 | -| * ChangeChannelByNumber | 0x01 | -| * SkipChannel | 0x02 | +| * NavigateTargetRequest | 0x00 | |------------------------------------------------------------------------------| | Attributes: | | -| * ChannelList | 0x0000 | +| * TargetNavigatorList | 0x0000 | +| * CurrentNavigatorTarget | 0x0001 | | * AttributeList | 0xFFFB | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ /* - * Command ChangeChannel - */ -class TvChannelChangeChannel : public ModelCommand -{ -public: - TvChannelChangeChannel() : ModelCommand("change-channel") - { - AddArgument("Match", &mRequest.match); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) command (0x00000000) on endpoint %" PRIu8, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTvChannelChangeChannelResponseSuccess, OnDefaultFailure, endpointId, - mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TvChannel::Commands::ChangeChannel::Type mRequest; -}; - -/* - * Command ChangeChannelByNumber + * Command NavigateTargetRequest */ -class TvChannelChangeChannelByNumber : public ModelCommand +class TargetNavigatorNavigateTargetRequest : public ModelCommand { public: - TvChannelChangeChannelByNumber() : ModelCommand("change-channel-by-number") - { - AddArgument("MajorNumber", 0, UINT16_MAX, &mRequest.majorNumber); - AddArgument("MinorNumber", 0, UINT16_MAX, &mRequest.minorNumber); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + TargetNavigatorNavigateTargetRequest() : ModelCommand("navigate-target-request") { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) command (0x00000001) on endpoint %" PRIu8, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TvChannel::Commands::ChangeChannelByNumber::Type mRequest; -}; - -/* - * Command SkipChannel - */ -class TvChannelSkipChannel : public ModelCommand -{ -public: - TvChannelSkipChannel() : ModelCommand("skip-channel") - { - AddArgument("Count", 0, UINT16_MAX, &mRequest.count); + AddArgument("Target", 0, UINT8_MAX, &mRequest.target); + AddArgument("Data", &mRequest.data); ModelCommand::AddArguments(); } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x00000504) command (0x00000002) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x00000505) command (0x00000000) on endpoint %" PRIu8, endpointId); - return chip::Controller::InvokeCommand(device, this, OnDefaultSuccess, OnDefaultFailure, endpointId, mRequest, - mTimedInteractionTimeoutMs); + return chip::Controller::InvokeCommand(device, this, OnTargetNavigatorNavigateTargetResponseSuccess, OnDefaultFailure, + endpointId, mRequest, mTimedInteractionTimeoutMs); } private: - chip::app::Clusters::TvChannel::Commands::SkipChannel::Type mRequest; + chip::app::Clusters::TargetNavigator::Commands::NavigateTargetRequest::Type mRequest; }; /* - * Attribute ChannelList + * Attribute TargetNavigatorList */ -class ReadTvChannelChannelList : public ModelCommand +class ReadTargetNavigatorTargetNavigatorList : public ModelCommand { public: - ReadTvChannelChannelList() : ModelCommand("read") + ReadTargetNavigatorTargetNavigatorList() : ModelCommand("read") { - AddArgument("attr-name", "channel-list"); + AddArgument("attr-name", "target-navigator-list"); ModelCommand::AddArguments(); } - ~ReadTvChannelChannelList() {} + ~ReadTargetNavigatorTargetNavigatorList() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0505) command (0x00) on endpoint %" PRIu8, endpointId); - chip::Controller::TvChannelCluster cluster; + chip::Controller::TargetNavigatorCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); + return cluster.ReadAttribute( + this, OnAttributeResponse, OnDefaultFailure); } static void OnAttributeResponse( void * context, - const chip::app::DataModel::DecodableList & value) + const chip::app::DataModel::DecodableList & value) { - OnGeneralAttributeResponse(context, "TvChannel.ChannelList response", value); + OnGeneralAttributeResponse(context, "TargetNavigator.TargetNavigatorList response", value); } }; -class ReportTvChannelChannelList : public ModelCommand +class ReportTargetNavigatorTargetNavigatorList : public ModelCommand { public: - ReportTvChannelChannelList() : ModelCommand("report") + ReportTargetNavigatorTargetNavigatorList() : ModelCommand("report") { - AddArgument("attr-name", "channel-list"); + AddArgument("attr-name", "target-navigator-list"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportTvChannelChannelList() {} + ~ReportTargetNavigatorTargetNavigatorList() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x06) on endpoint %" PRIu8, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0505) command (0x06) on endpoint %" PRIu8, endpointId); - chip::Controller::TvChannelCluster cluster; + chip::Controller::TargetNavigatorCluster cluster; cluster.Associate(device, endpointId); auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( + return cluster.SubscribeAttribute( this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); } @@ -32348,167 +32809,30 @@ class ReportTvChannelChannelList : public ModelCommand static void OnValueReport( void * context, - const chip::app::DataModel::DecodableList & value) - { - LogValue("TvChannel.ChannelList report", 0, value); - } - -private: - uint16_t mMinInterval; - uint16_t mMaxInterval; - bool mWait; -}; - -/* - * Attribute AttributeList - */ -class ReadTvChannelAttributeList : public ModelCommand -{ -public: - ReadTvChannelAttributeList() : ModelCommand("read") - { - AddArgument("attr-name", "attribute-list"); - ModelCommand::AddArguments(); - } - - ~ReadTvChannelAttributeList() {} - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::TvChannelCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute(this, OnAttributeResponse, - OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, const chip::app::DataModel::DecodableList & value) - { - OnGeneralAttributeResponse(context, "TvChannel.AttributeList response", value); - } -}; - -/* - * Attribute ClusterRevision - */ -class ReadTvChannelClusterRevision : public ModelCommand -{ -public: - ReadTvChannelClusterRevision() : ModelCommand("read") - { - AddArgument("attr-name", "cluster-revision"); - ModelCommand::AddArguments(); - } - - ~ReadTvChannelClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::TvChannelCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint16_t value) - { - OnGeneralAttributeResponse(context, "TvChannel.ClusterRevision response", value); - } -}; - -class ReportTvChannelClusterRevision : public ModelCommand -{ -public: - ReportTvChannelClusterRevision() : ModelCommand("report") - { - AddArgument("attr-name", "cluster-revision"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("wait", 0, 1, &mWait); - ModelCommand::AddArguments(); - } - - ~ReportTvChannelClusterRevision() {} - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x06) on endpoint %" PRIu8, endpointId); - - chip::Controller::TvChannelCluster cluster; - cluster.Associate(device, endpointId); - - auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( - this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); - } - - chip::System::Clock::Timeout GetWaitDuration() const override + const chip::app::DataModel::DecodableList & value) { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + LogValue("TargetNavigator.TargetNavigatorList report", 0, value); } - static void OnValueReport(void * context, uint16_t value) { LogValue("TvChannel.ClusterRevision report", 0, value); } - private: uint16_t mMinInterval; uint16_t mMaxInterval; bool mWait; }; -/*----------------------------------------------------------------------------*\ -| Cluster TargetNavigator | 0x0505 | -|------------------------------------------------------------------------------| -| Commands: | | -| * NavigateTarget | 0x00 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * TargetNavigatorList | 0x0000 | -| * CurrentNavigatorTarget | 0x0001 | -| * AttributeList | 0xFFFB | -| * ClusterRevision | 0xFFFD | -\*----------------------------------------------------------------------------*/ - /* - * Command NavigateTarget - */ -class TargetNavigatorNavigateTarget : public ModelCommand -{ -public: - TargetNavigatorNavigateTarget() : ModelCommand("navigate-target") - { - AddArgument("Target", 0, UINT8_MAX, &mRequest.target); - AddArgument("Data", &mRequest.data); - ModelCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000505) command (0x00000000) on endpoint %" PRIu8, endpointId); - - return chip::Controller::InvokeCommand(device, this, OnTargetNavigatorNavigateTargetResponseSuccess, OnDefaultFailure, - endpointId, mRequest, mTimedInteractionTimeoutMs); - } - -private: - chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type mRequest; -}; - -/* - * Attribute TargetNavigatorList + * Attribute CurrentNavigatorTarget */ -class ReadTargetNavigatorTargetNavigatorList : public ModelCommand +class ReadTargetNavigatorCurrentNavigatorTarget : public ModelCommand { public: - ReadTargetNavigatorTargetNavigatorList() : ModelCommand("read") + ReadTargetNavigatorCurrentNavigatorTarget() : ModelCommand("read") { - AddArgument("attr-name", "target-navigator-list"); + AddArgument("attr-name", "current-navigator-target"); ModelCommand::AddArguments(); } - ~ReadTargetNavigatorTargetNavigatorList() {} + ~ReadTargetNavigatorCurrentNavigatorTarget() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -32516,32 +32840,29 @@ class ReadTargetNavigatorTargetNavigatorList : public ModelCommand chip::Controller::TargetNavigatorCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttribute( + return cluster.ReadAttribute( this, OnAttributeResponse, OnDefaultFailure); } - static void - OnAttributeResponse(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & value) + static void OnAttributeResponse(void * context, uint8_t value) { - OnGeneralAttributeResponse(context, "TargetNavigator.TargetNavigatorList response", value); + OnGeneralAttributeResponse(context, "TargetNavigator.CurrentNavigatorTarget response", value); } }; -class ReportTargetNavigatorTargetNavigatorList : public ModelCommand +class ReportTargetNavigatorCurrentNavigatorTarget : public ModelCommand { public: - ReportTargetNavigatorTargetNavigatorList() : ModelCommand("report") + ReportTargetNavigatorCurrentNavigatorTarget() : ModelCommand("report") { - AddArgument("attr-name", "target-navigator-list"); + AddArgument("attr-name", "current-navigator-target"); AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); AddArgument("wait", 0, 1, &mWait); ModelCommand::AddArguments(); } - ~ReportTargetNavigatorTargetNavigatorList() {} + ~ReportTargetNavigatorCurrentNavigatorTarget() {} CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { @@ -32551,7 +32872,7 @@ class ReportTargetNavigatorTargetNavigatorList : public ModelCommand cluster.Associate(device, endpointId); auto subscriptionEstablishedCallback = mWait ? OnDefaultSuccessResponseWithoutExit : OnDefaultSuccessResponse; - return cluster.SubscribeAttribute( + return cluster.SubscribeAttribute( this, OnValueReport, OnDefaultFailure, mMinInterval, mMaxInterval, subscriptionEstablishedCallback); } @@ -32560,11 +32881,9 @@ class ReportTargetNavigatorTargetNavigatorList : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & value) + static void OnValueReport(void * context, uint8_t value) { - LogValue("TargetNavigator.TargetNavigatorList report", 0, value); + LogValue("TargetNavigator.CurrentNavigatorTarget report", 0, value); } private: @@ -32573,36 +32892,6 @@ class ReportTargetNavigatorTargetNavigatorList : public ModelCommand bool mWait; }; -/* - * Attribute CurrentNavigatorTarget - */ -class ReadTargetNavigatorCurrentNavigatorTarget : public ModelCommand -{ -public: - ReadTargetNavigatorCurrentNavigatorTarget() : ModelCommand("read") - { - AddArgument("attr-name", "current-navigator-target"); - ModelCommand::AddArguments(); - } - - ~ReadTargetNavigatorCurrentNavigatorTarget() {} - - CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0505) command (0x00) on endpoint %" PRIu8, endpointId); - - chip::Controller::TargetNavigatorCluster cluster; - cluster.Associate(device, endpointId); - return cluster.ReadAttribute( - this, OnAttributeResponse, OnDefaultFailure); - } - - static void OnAttributeResponse(void * context, uint8_t value) - { - OnGeneralAttributeResponse(context, "TargetNavigator.CurrentNavigatorTarget response", value); - } -}; - /* * Attribute AttributeList */ @@ -49394,7 +49683,7 @@ class ReadWindowCoveringCurrentPositionLift : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, uint16_t value) + static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) { OnGeneralAttributeResponse(context, "WindowCovering.CurrentPositionLift response", value); } @@ -49431,7 +49720,10 @@ class ReportWindowCoveringCurrentPositionLift : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, uint16_t value) { LogValue("WindowCovering.CurrentPositionLift report", 0, value); } + static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) + { + LogValue("WindowCovering.CurrentPositionLift report", 0, value); + } private: uint16_t mMinInterval; @@ -49463,7 +49755,7 @@ class ReadWindowCoveringCurrentPositionTilt : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, uint16_t value) + static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) { OnGeneralAttributeResponse(context, "WindowCovering.CurrentPositionTilt response", value); } @@ -49500,7 +49792,10 @@ class ReportWindowCoveringCurrentPositionTilt : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, uint16_t value) { LogValue("WindowCovering.CurrentPositionTilt report", 0, value); } + static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) + { + LogValue("WindowCovering.CurrentPositionTilt report", 0, value); + } private: uint16_t mMinInterval; @@ -49601,7 +49896,7 @@ class ReadWindowCoveringCurrentPositionLiftPercentage : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, uint8_t value) + static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) { OnGeneralAttributeResponse(context, "WindowCovering.CurrentPositionLiftPercentage response", value); } @@ -49638,7 +49933,7 @@ class ReportWindowCoveringCurrentPositionLiftPercentage : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, uint8_t value) + static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) { LogValue("WindowCovering.CurrentPositionLiftPercentage report", 0, value); } @@ -49673,7 +49968,7 @@ class ReadWindowCoveringCurrentPositionTiltPercentage : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, uint8_t value) + static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) { OnGeneralAttributeResponse(context, "WindowCovering.CurrentPositionTiltPercentage response", value); } @@ -49710,7 +50005,7 @@ class ReportWindowCoveringCurrentPositionTiltPercentage : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, uint8_t value) + static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) { LogValue("WindowCovering.CurrentPositionTiltPercentage report", 0, value); } @@ -49814,7 +50109,7 @@ class ReadWindowCoveringTargetPositionLiftPercent100ths : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, uint16_t value) + static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) { OnGeneralAttributeResponse(context, "WindowCovering.TargetPositionLiftPercent100ths response", value); } @@ -49852,7 +50147,7 @@ class ReportWindowCoveringTargetPositionLiftPercent100ths : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, uint16_t value) + static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) { LogValue("WindowCovering.TargetPositionLiftPercent100ths report", 0, value); } @@ -49887,7 +50182,7 @@ class ReadWindowCoveringTargetPositionTiltPercent100ths : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, uint16_t value) + static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) { OnGeneralAttributeResponse(context, "WindowCovering.TargetPositionTiltPercent100ths response", value); } @@ -49925,7 +50220,7 @@ class ReportWindowCoveringTargetPositionTiltPercent100ths : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, uint16_t value) + static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) { LogValue("WindowCovering.TargetPositionTiltPercent100ths report", 0, value); } @@ -50029,7 +50324,7 @@ class ReadWindowCoveringCurrentPositionLiftPercent100ths : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, uint16_t value) + static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) { OnGeneralAttributeResponse(context, "WindowCovering.CurrentPositionLiftPercent100ths response", value); } @@ -50067,7 +50362,7 @@ class ReportWindowCoveringCurrentPositionLiftPercent100ths : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, uint16_t value) + static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) { LogValue("WindowCovering.CurrentPositionLiftPercent100ths report", 0, value); } @@ -50102,7 +50397,7 @@ class ReadWindowCoveringCurrentPositionTiltPercent100ths : public ModelCommand this, OnAttributeResponse, OnDefaultFailure); } - static void OnAttributeResponse(void * context, uint16_t value) + static void OnAttributeResponse(void * context, const chip::app::DataModel::Nullable & value) { OnGeneralAttributeResponse(context, "WindowCovering.CurrentPositionTiltPercent100ths response", value); } @@ -50140,7 +50435,7 @@ class ReportWindowCoveringCurrentPositionTiltPercent100ths : public ModelCommand return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); } - static void OnValueReport(void * context, uint16_t value) + static void OnValueReport(void * context, const chip::app::DataModel::Nullable & value) { LogValue("WindowCovering.CurrentPositionTiltPercent100ths report", 0, value); } @@ -50792,9 +51087,9 @@ void registerClusterAccountLogin(Commands & commands) const char * clusterName = "AccountLogin"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -50825,7 +51120,6 @@ void registerClusterApplicationBasic(Commands & commands) const char * clusterName = "ApplicationBasic"; commands_list clusterCommands = { - make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -50838,6 +51132,7 @@ void registerClusterApplicationBasic(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -50850,9 +51145,9 @@ void registerClusterApplicationLauncher(Commands & commands) const char * clusterName = "ApplicationLauncher"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -50866,8 +51161,8 @@ void registerClusterAudioOutput(Commands & commands) const char * clusterName = "AudioOutput"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -51041,6 +51336,22 @@ void registerClusterBridgedDeviceBasic(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterChannel(Commands & commands) +{ + const char * clusterName = "Channel"; + + commands_list clusterCommands = { + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterColorControl(Commands & commands) { const char * clusterName = "ColorControl"; @@ -51194,9 +51505,9 @@ void registerClusterContentLauncher(Commands & commands) const char * clusterName = "ContentLauncher"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -51437,11 +51748,17 @@ void registerClusterGroupKeyManagement(Commands & commands) const char * clusterName = "GroupKeyManagement"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); @@ -51513,7 +51830,7 @@ void registerClusterKeypadInput(Commands & commands) const char * clusterName = "KeypadInput"; commands_list clusterCommands = { - make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -51594,10 +51911,10 @@ void registerClusterMediaInput(Commands & commands) const char * clusterName = "MediaInput"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -51613,17 +51930,17 @@ void registerClusterMediaPlayback(Commands & commands) const char * clusterName = "MediaPlayback"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -51713,15 +52030,17 @@ void registerClusterOtaSoftwareUpdateRequestor(Commands & commands) const char * clusterName = "OtaSoftwareUpdateRequestor"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); @@ -52040,33 +52359,18 @@ void registerClusterSwitch(Commands & commands) commands.Register(clusterName, clusterCommands); } -void registerClusterTvChannel(Commands & commands) -{ - const char * clusterName = "TvChannel"; - - commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - }; - - commands.Register(clusterName, clusterCommands); -} void registerClusterTargetNavigator(Commands & commands) { const char * clusterName = "TargetNavigator"; commands_list clusterCommands = { - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); @@ -52694,6 +52998,7 @@ void registerClusters(Commands & commands) registerClusterBooleanState(commands); registerClusterBridgedActions(commands); registerClusterBridgedDeviceBasic(commands); + registerClusterChannel(commands); registerClusterColorControl(commands); registerClusterContentLauncher(commands); registerClusterDescriptor(commands); @@ -52730,7 +53035,6 @@ void registerClusters(Commands & commands) registerClusterScenes(commands); registerClusterSoftwareDiagnostics(commands); registerClusterSwitch(commands); - registerClusterTvChannel(commands); registerClusterTargetNavigator(commands); registerClusterTemperatureMeasurement(commands); registerClusterTestCluster(commands); diff --git a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h deleted file mode 100644 index 5077ca0a7c98e5..00000000000000 --- a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h +++ /dev/null @@ -1,3500 +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. - */ - -// THIS FILE IS GENERATED BY ZAP - -#pragma once - -#include "../cluster/Commands.h" // For the LogValue bits and read callbacks -#include - -typedef void (*UnsupportedAttributeCallback)(void * context); - -class Listen : public ReportingCommand -{ -public: - Listen() : ReportingCommand("listen") {} - - ~Listen() - { - delete onReportAccountLoginClusterRevisionCallback; - delete onReportAdministratorCommissioningClusterRevisionCallback; - delete onReportApplicationBasicVendorNameCallback; - delete onReportApplicationBasicVendorIdCallback; - delete onReportApplicationBasicApplicationNameCallback; - delete onReportApplicationBasicProductIdCallback; - delete onReportApplicationBasicApplicationStatusCallback; - delete onReportApplicationBasicApplicationVersionCallback; - delete onReportApplicationBasicClusterRevisionCallback; - delete onReportApplicationLauncherClusterRevisionCallback; - delete onReportAudioOutputCurrentAudioOutputCallback; - delete onReportAudioOutputClusterRevisionCallback; - delete onReportBarrierControlBarrierMovingStateCallback; - delete onReportBarrierControlBarrierSafetyStatusCallback; - delete onReportBarrierControlBarrierCapabilitiesCallback; - delete onReportBarrierControlBarrierPositionCallback; - delete onReportBarrierControlClusterRevisionCallback; - delete onReportBasicInteractionModelVersionCallback; - delete onReportBasicVendorNameCallback; - delete onReportBasicVendorIDCallback; - delete onReportBasicProductNameCallback; - delete onReportBasicProductIDCallback; - delete onReportBasicNodeLabelCallback; - delete onReportBasicLocationCallback; - delete onReportBasicHardwareVersionCallback; - delete onReportBasicHardwareVersionStringCallback; - delete onReportBasicSoftwareVersionCallback; - delete onReportBasicSoftwareVersionStringCallback; - delete onReportBasicManufacturingDateCallback; - delete onReportBasicPartNumberCallback; - delete onReportBasicProductURLCallback; - delete onReportBasicProductLabelCallback; - delete onReportBasicSerialNumberCallback; - delete onReportBasicLocalConfigDisabledCallback; - delete onReportBasicReachableCallback; - delete onReportBasicClusterRevisionCallback; - delete onReportBinaryInputBasicOutOfServiceCallback; - delete onReportBinaryInputBasicPresentValueCallback; - delete onReportBinaryInputBasicStatusFlagsCallback; - delete onReportBinaryInputBasicClusterRevisionCallback; - delete onReportBindingClusterRevisionCallback; - delete onReportBooleanStateStateValueCallback; - delete onReportBooleanStateClusterRevisionCallback; - delete onReportBridgedActionsSetupUrlCallback; - delete onReportBridgedActionsClusterRevisionCallback; - delete onReportBridgedDeviceBasicClusterRevisionCallback; - delete onReportColorControlCurrentHueCallback; - delete onReportColorControlCurrentSaturationCallback; - delete onReportColorControlRemainingTimeCallback; - delete onReportColorControlCurrentXCallback; - delete onReportColorControlCurrentYCallback; - delete onReportColorControlDriftCompensationCallback; - delete onReportColorControlCompensationTextCallback; - delete onReportColorControlColorTemperatureCallback; - delete onReportColorControlColorModeCallback; - delete onReportColorControlColorControlOptionsCallback; - delete onReportColorControlNumberOfPrimariesCallback; - delete onReportColorControlPrimary1XCallback; - delete onReportColorControlPrimary1YCallback; - delete onReportColorControlPrimary1IntensityCallback; - delete onReportColorControlPrimary2XCallback; - delete onReportColorControlPrimary2YCallback; - delete onReportColorControlPrimary2IntensityCallback; - delete onReportColorControlPrimary3XCallback; - delete onReportColorControlPrimary3YCallback; - delete onReportColorControlPrimary3IntensityCallback; - delete onReportColorControlPrimary4XCallback; - delete onReportColorControlPrimary4YCallback; - delete onReportColorControlPrimary4IntensityCallback; - delete onReportColorControlPrimary5XCallback; - delete onReportColorControlPrimary5YCallback; - delete onReportColorControlPrimary5IntensityCallback; - delete onReportColorControlPrimary6XCallback; - delete onReportColorControlPrimary6YCallback; - delete onReportColorControlPrimary6IntensityCallback; - delete onReportColorControlWhitePointXCallback; - delete onReportColorControlWhitePointYCallback; - delete onReportColorControlColorPointRXCallback; - delete onReportColorControlColorPointRYCallback; - delete onReportColorControlColorPointRIntensityCallback; - delete onReportColorControlColorPointGXCallback; - delete onReportColorControlColorPointGYCallback; - delete onReportColorControlColorPointGIntensityCallback; - delete onReportColorControlColorPointBXCallback; - delete onReportColorControlColorPointBYCallback; - delete onReportColorControlColorPointBIntensityCallback; - delete onReportColorControlEnhancedCurrentHueCallback; - delete onReportColorControlEnhancedColorModeCallback; - delete onReportColorControlColorLoopActiveCallback; - delete onReportColorControlColorLoopDirectionCallback; - delete onReportColorControlColorLoopTimeCallback; - delete onReportColorControlColorLoopStartEnhancedHueCallback; - delete onReportColorControlColorLoopStoredEnhancedHueCallback; - delete onReportColorControlColorCapabilitiesCallback; - delete onReportColorControlColorTempPhysicalMinCallback; - delete onReportColorControlColorTempPhysicalMaxCallback; - delete onReportColorControlCoupleColorTempToLevelMinMiredsCallback; - delete onReportColorControlStartUpColorTemperatureMiredsCallback; - delete onReportColorControlClusterRevisionCallback; - delete onReportContentLauncherSupportedStreamingProtocolsCallback; - delete onReportContentLauncherClusterRevisionCallback; - delete onReportDescriptorClusterRevisionCallback; - delete onReportDoorLockLockStateCallback; - delete onReportDoorLockLockTypeCallback; - delete onReportDoorLockActuatorEnabledCallback; - delete onReportDoorLockDoorStateCallback; - delete onReportDoorLockLanguageCallback; - delete onReportDoorLockAutoRelockTimeCallback; - delete onReportDoorLockSoundVolumeCallback; - delete onReportDoorLockOperatingModeCallback; - delete onReportDoorLockEnableOneTouchLockingCallback; - delete onReportDoorLockEnablePrivacyModeButtonCallback; - delete onReportDoorLockWrongCodeEntryLimitCallback; - delete onReportDoorLockClusterRevisionCallback; - delete onReportElectricalMeasurementMeasurementTypeCallback; - delete onReportElectricalMeasurementTotalActivePowerCallback; - delete onReportElectricalMeasurementRmsVoltageCallback; - delete onReportElectricalMeasurementRmsVoltageMinCallback; - delete onReportElectricalMeasurementRmsVoltageMaxCallback; - delete onReportElectricalMeasurementRmsCurrentCallback; - delete onReportElectricalMeasurementRmsCurrentMinCallback; - delete onReportElectricalMeasurementRmsCurrentMaxCallback; - delete onReportElectricalMeasurementActivePowerCallback; - delete onReportElectricalMeasurementActivePowerMinCallback; - delete onReportElectricalMeasurementActivePowerMaxCallback; - delete onReportElectricalMeasurementClusterRevisionCallback; - delete onReportEthernetNetworkDiagnosticsPHYRateCallback; - delete onReportEthernetNetworkDiagnosticsFullDuplexCallback; - delete onReportEthernetNetworkDiagnosticsPacketRxCountCallback; - delete onReportEthernetNetworkDiagnosticsPacketTxCountCallback; - delete onReportEthernetNetworkDiagnosticsTxErrCountCallback; - delete onReportEthernetNetworkDiagnosticsCollisionCountCallback; - delete onReportEthernetNetworkDiagnosticsOverrunCountCallback; - delete onReportEthernetNetworkDiagnosticsCarrierDetectCallback; - delete onReportEthernetNetworkDiagnosticsTimeSinceResetCallback; - delete onReportEthernetNetworkDiagnosticsClusterRevisionCallback; - delete onReportFixedLabelClusterRevisionCallback; - delete onReportFlowMeasurementMeasuredValueCallback; - delete onReportFlowMeasurementMinMeasuredValueCallback; - delete onReportFlowMeasurementMaxMeasuredValueCallback; - delete onReportFlowMeasurementToleranceCallback; - delete onReportFlowMeasurementClusterRevisionCallback; - delete onReportGeneralCommissioningBreadcrumbCallback; - delete onReportGeneralCommissioningClusterRevisionCallback; - delete onReportGeneralDiagnosticsRebootCountCallback; - delete onReportGeneralDiagnosticsUpTimeCallback; - delete onReportGeneralDiagnosticsTotalOperationalHoursCallback; - delete onReportGeneralDiagnosticsBootReasonsCallback; - delete onReportGeneralDiagnosticsClusterRevisionCallback; - delete onReportGroupKeyManagementClusterRevisionCallback; - delete onReportGroupsNameSupportCallback; - delete onReportGroupsClusterRevisionCallback; - delete onReportIdentifyIdentifyTimeCallback; - delete onReportIdentifyIdentifyTypeCallback; - delete onReportIdentifyClusterRevisionCallback; - delete onReportIlluminanceMeasurementMeasuredValueCallback; - delete onReportIlluminanceMeasurementMinMeasuredValueCallback; - delete onReportIlluminanceMeasurementMaxMeasuredValueCallback; - delete onReportIlluminanceMeasurementToleranceCallback; - delete onReportIlluminanceMeasurementLightSensorTypeCallback; - delete onReportIlluminanceMeasurementClusterRevisionCallback; - delete onReportKeypadInputClusterRevisionCallback; - delete onReportLevelControlCurrentLevelCallback; - delete onReportLevelControlRemainingTimeCallback; - delete onReportLevelControlMinLevelCallback; - delete onReportLevelControlMaxLevelCallback; - delete onReportLevelControlCurrentFrequencyCallback; - delete onReportLevelControlMinFrequencyCallback; - delete onReportLevelControlMaxFrequencyCallback; - delete onReportLevelControlOptionsCallback; - delete onReportLevelControlOnOffTransitionTimeCallback; - delete onReportLevelControlOnLevelCallback; - delete onReportLevelControlOnTransitionTimeCallback; - delete onReportLevelControlOffTransitionTimeCallback; - delete onReportLevelControlDefaultMoveRateCallback; - delete onReportLevelControlStartUpCurrentLevelCallback; - delete onReportLevelControlClusterRevisionCallback; - delete onReportLowPowerClusterRevisionCallback; - delete onReportMediaInputCurrentMediaInputCallback; - delete onReportMediaInputClusterRevisionCallback; - delete onReportMediaPlaybackPlaybackStateCallback; - delete onReportMediaPlaybackStartTimeCallback; - delete onReportMediaPlaybackDurationCallback; - delete onReportMediaPlaybackSeekRangeEndCallback; - delete onReportMediaPlaybackSeekRangeStartCallback; - delete onReportMediaPlaybackClusterRevisionCallback; - delete onReportModeSelectCurrentModeCallback; - delete onReportModeSelectOnModeCallback; - delete onReportModeSelectStartUpModeCallback; - delete onReportModeSelectDescriptionCallback; - delete onReportModeSelectClusterRevisionCallback; - delete onReportNetworkCommissioningFeatureMapCallback; - delete onReportNetworkCommissioningClusterRevisionCallback; - delete onReportOtaSoftwareUpdateProviderClusterRevisionCallback; - delete onReportOtaSoftwareUpdateRequestorDefaultOtaProviderCallback; - delete onReportOtaSoftwareUpdateRequestorUpdatePossibleCallback; - delete onReportOtaSoftwareUpdateRequestorClusterRevisionCallback; - delete onReportOccupancySensingOccupancyCallback; - delete onReportOccupancySensingOccupancySensorTypeCallback; - delete onReportOccupancySensingOccupancySensorTypeBitmapCallback; - delete onReportOccupancySensingClusterRevisionCallback; - delete onReportOnOffOnOffCallback; - delete onReportOnOffGlobalSceneControlCallback; - delete onReportOnOffOnTimeCallback; - delete onReportOnOffOffWaitTimeCallback; - delete onReportOnOffStartUpOnOffCallback; - delete onReportOnOffFeatureMapCallback; - delete onReportOnOffClusterRevisionCallback; - delete onReportOnOffSwitchConfigurationSwitchTypeCallback; - delete onReportOnOffSwitchConfigurationSwitchActionsCallback; - delete onReportOnOffSwitchConfigurationClusterRevisionCallback; - delete onReportOperationalCredentialsSupportedFabricsCallback; - delete onReportOperationalCredentialsCommissionedFabricsCallback; - delete onReportOperationalCredentialsCurrentFabricIndexCallback; - delete onReportOperationalCredentialsClusterRevisionCallback; - delete onReportPowerSourceStatusCallback; - delete onReportPowerSourceOrderCallback; - delete onReportPowerSourceDescriptionCallback; - delete onReportPowerSourceBatteryVoltageCallback; - delete onReportPowerSourceBatteryPercentRemainingCallback; - delete onReportPowerSourceBatteryTimeRemainingCallback; - delete onReportPowerSourceBatteryChargeLevelCallback; - delete onReportPowerSourceBatteryChargeStateCallback; - delete onReportPowerSourceFeatureMapCallback; - delete onReportPowerSourceClusterRevisionCallback; - delete onReportPressureMeasurementMeasuredValueCallback; - delete onReportPressureMeasurementMinMeasuredValueCallback; - delete onReportPressureMeasurementMaxMeasuredValueCallback; - delete onReportPressureMeasurementClusterRevisionCallback; - delete onReportPumpConfigurationAndControlMaxPressureCallback; - delete onReportPumpConfigurationAndControlMaxSpeedCallback; - delete onReportPumpConfigurationAndControlMaxFlowCallback; - delete onReportPumpConfigurationAndControlMinConstPressureCallback; - delete onReportPumpConfigurationAndControlMaxConstPressureCallback; - delete onReportPumpConfigurationAndControlMinCompPressureCallback; - delete onReportPumpConfigurationAndControlMaxCompPressureCallback; - delete onReportPumpConfigurationAndControlMinConstSpeedCallback; - delete onReportPumpConfigurationAndControlMaxConstSpeedCallback; - delete onReportPumpConfigurationAndControlMinConstFlowCallback; - delete onReportPumpConfigurationAndControlMaxConstFlowCallback; - delete onReportPumpConfigurationAndControlMinConstTempCallback; - delete onReportPumpConfigurationAndControlMaxConstTempCallback; - delete onReportPumpConfigurationAndControlPumpStatusCallback; - delete onReportPumpConfigurationAndControlEffectiveOperationModeCallback; - delete onReportPumpConfigurationAndControlEffectiveControlModeCallback; - delete onReportPumpConfigurationAndControlCapacityCallback; - delete onReportPumpConfigurationAndControlSpeedCallback; - delete onReportPumpConfigurationAndControlLifetimeRunningHoursCallback; - delete onReportPumpConfigurationAndControlPowerCallback; - delete onReportPumpConfigurationAndControlLifetimeEnergyConsumedCallback; - delete onReportPumpConfigurationAndControlOperationModeCallback; - delete onReportPumpConfigurationAndControlControlModeCallback; - delete onReportPumpConfigurationAndControlAlarmMaskCallback; - delete onReportPumpConfigurationAndControlFeatureMapCallback; - delete onReportPumpConfigurationAndControlClusterRevisionCallback; - delete onReportRelativeHumidityMeasurementMeasuredValueCallback; - delete onReportRelativeHumidityMeasurementMinMeasuredValueCallback; - delete onReportRelativeHumidityMeasurementMaxMeasuredValueCallback; - delete onReportRelativeHumidityMeasurementToleranceCallback; - delete onReportRelativeHumidityMeasurementClusterRevisionCallback; - delete onReportScenesSceneCountCallback; - delete onReportScenesCurrentSceneCallback; - delete onReportScenesCurrentGroupCallback; - delete onReportScenesSceneValidCallback; - delete onReportScenesNameSupportCallback; - delete onReportScenesClusterRevisionCallback; - delete onReportSoftwareDiagnosticsCurrentHeapFreeCallback; - delete onReportSoftwareDiagnosticsCurrentHeapUsedCallback; - delete onReportSoftwareDiagnosticsCurrentHeapHighWatermarkCallback; - delete onReportSoftwareDiagnosticsClusterRevisionCallback; - delete onReportSwitchNumberOfPositionsCallback; - delete onReportSwitchCurrentPositionCallback; - delete onReportSwitchMultiPressMaxCallback; - delete onReportSwitchFeatureMapCallback; - delete onReportSwitchClusterRevisionCallback; - delete onReportTvChannelClusterRevisionCallback; - delete onReportTargetNavigatorClusterRevisionCallback; - delete onReportTemperatureMeasurementMeasuredValueCallback; - delete onReportTemperatureMeasurementMinMeasuredValueCallback; - delete onReportTemperatureMeasurementMaxMeasuredValueCallback; - delete onReportTemperatureMeasurementToleranceCallback; - delete onReportTemperatureMeasurementClusterRevisionCallback; - delete onReportTestClusterBooleanCallback; - delete onReportTestClusterBitmap8Callback; - delete onReportTestClusterBitmap16Callback; - delete onReportTestClusterBitmap32Callback; - delete onReportTestClusterBitmap64Callback; - delete onReportTestClusterInt8uCallback; - delete onReportTestClusterInt16uCallback; - delete onReportTestClusterInt24uCallback; - delete onReportTestClusterInt32uCallback; - delete onReportTestClusterInt40uCallback; - delete onReportTestClusterInt48uCallback; - delete onReportTestClusterInt56uCallback; - delete onReportTestClusterInt64uCallback; - delete onReportTestClusterInt8sCallback; - delete onReportTestClusterInt16sCallback; - delete onReportTestClusterInt24sCallback; - delete onReportTestClusterInt32sCallback; - delete onReportTestClusterInt40sCallback; - delete onReportTestClusterInt48sCallback; - delete onReportTestClusterInt56sCallback; - delete onReportTestClusterInt64sCallback; - delete onReportTestClusterEnum8Callback; - delete onReportTestClusterEnum16Callback; - delete onReportTestClusterFloatSingleCallback; - delete onReportTestClusterFloatDoubleCallback; - delete onReportTestClusterOctetStringCallback; - delete onReportTestClusterLongOctetStringCallback; - delete onReportTestClusterCharStringCallback; - delete onReportTestClusterLongCharStringCallback; - delete onReportTestClusterEpochUsCallback; - delete onReportTestClusterEpochSCallback; - delete onReportTestClusterVendorIdCallback; - delete onReportTestClusterEnumAttrCallback; - delete onReportTestClusterRangeRestrictedInt8uCallback; - delete onReportTestClusterRangeRestrictedInt8sCallback; - delete onReportTestClusterRangeRestrictedInt16uCallback; - delete onReportTestClusterRangeRestrictedInt16sCallback; - delete onReportTestClusterUnsupportedCallback; - delete onReportTestClusterNullableBooleanCallback; - delete onReportTestClusterNullableBitmap8Callback; - delete onReportTestClusterNullableBitmap16Callback; - delete onReportTestClusterNullableBitmap32Callback; - delete onReportTestClusterNullableBitmap64Callback; - delete onReportTestClusterNullableInt8uCallback; - delete onReportTestClusterNullableInt16uCallback; - delete onReportTestClusterNullableInt24uCallback; - delete onReportTestClusterNullableInt32uCallback; - delete onReportTestClusterNullableInt40uCallback; - delete onReportTestClusterNullableInt48uCallback; - delete onReportTestClusterNullableInt56uCallback; - delete onReportTestClusterNullableInt64uCallback; - delete onReportTestClusterNullableInt8sCallback; - delete onReportTestClusterNullableInt16sCallback; - delete onReportTestClusterNullableInt24sCallback; - delete onReportTestClusterNullableInt32sCallback; - delete onReportTestClusterNullableInt40sCallback; - delete onReportTestClusterNullableInt48sCallback; - delete onReportTestClusterNullableInt56sCallback; - delete onReportTestClusterNullableInt64sCallback; - delete onReportTestClusterNullableEnum8Callback; - delete onReportTestClusterNullableEnum16Callback; - delete onReportTestClusterNullableFloatSingleCallback; - delete onReportTestClusterNullableFloatDoubleCallback; - delete onReportTestClusterNullableOctetStringCallback; - delete onReportTestClusterNullableCharStringCallback; - delete onReportTestClusterNullableEnumAttrCallback; - delete onReportTestClusterNullableRangeRestrictedInt8uCallback; - delete onReportTestClusterNullableRangeRestrictedInt8sCallback; - delete onReportTestClusterNullableRangeRestrictedInt16uCallback; - delete onReportTestClusterNullableRangeRestrictedInt16sCallback; - delete onReportTestClusterClusterRevisionCallback; - delete onReportThermostatLocalTemperatureCallback; - delete onReportThermostatAbsMinHeatSetpointLimitCallback; - delete onReportThermostatAbsMaxHeatSetpointLimitCallback; - delete onReportThermostatAbsMinCoolSetpointLimitCallback; - delete onReportThermostatAbsMaxCoolSetpointLimitCallback; - delete onReportThermostatOccupiedCoolingSetpointCallback; - delete onReportThermostatOccupiedHeatingSetpointCallback; - delete onReportThermostatMinHeatSetpointLimitCallback; - delete onReportThermostatMaxHeatSetpointLimitCallback; - delete onReportThermostatMinCoolSetpointLimitCallback; - delete onReportThermostatMaxCoolSetpointLimitCallback; - delete onReportThermostatMinSetpointDeadBandCallback; - delete onReportThermostatControlSequenceOfOperationCallback; - delete onReportThermostatSystemModeCallback; - delete onReportThermostatStartOfWeekCallback; - delete onReportThermostatNumberOfWeeklyTransitionsCallback; - delete onReportThermostatNumberOfDailyTransitionsCallback; - delete onReportThermostatFeatureMapCallback; - delete onReportThermostatClusterRevisionCallback; - delete onReportThermostatUserInterfaceConfigurationTemperatureDisplayModeCallback; - delete onReportThermostatUserInterfaceConfigurationKeypadLockoutCallback; - delete onReportThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCallback; - delete onReportThermostatUserInterfaceConfigurationClusterRevisionCallback; - delete onReportThreadNetworkDiagnosticsChannelCallback; - delete onReportThreadNetworkDiagnosticsRoutingRoleCallback; - delete onReportThreadNetworkDiagnosticsNetworkNameCallback; - delete onReportThreadNetworkDiagnosticsPanIdCallback; - delete onReportThreadNetworkDiagnosticsExtendedPanIdCallback; - delete onReportThreadNetworkDiagnosticsMeshLocalPrefixCallback; - delete onReportThreadNetworkDiagnosticsOverrunCountCallback; - delete onReportThreadNetworkDiagnosticsPartitionIdCallback; - delete onReportThreadNetworkDiagnosticsWeightingCallback; - delete onReportThreadNetworkDiagnosticsDataVersionCallback; - delete onReportThreadNetworkDiagnosticsStableDataVersionCallback; - delete onReportThreadNetworkDiagnosticsLeaderRouterIdCallback; - delete onReportThreadNetworkDiagnosticsDetachedRoleCountCallback; - delete onReportThreadNetworkDiagnosticsChildRoleCountCallback; - delete onReportThreadNetworkDiagnosticsRouterRoleCountCallback; - delete onReportThreadNetworkDiagnosticsLeaderRoleCountCallback; - delete onReportThreadNetworkDiagnosticsAttachAttemptCountCallback; - delete onReportThreadNetworkDiagnosticsPartitionIdChangeCountCallback; - delete onReportThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCallback; - delete onReportThreadNetworkDiagnosticsParentChangeCountCallback; - delete onReportThreadNetworkDiagnosticsTxTotalCountCallback; - delete onReportThreadNetworkDiagnosticsTxUnicastCountCallback; - delete onReportThreadNetworkDiagnosticsTxBroadcastCountCallback; - delete onReportThreadNetworkDiagnosticsTxAckRequestedCountCallback; - delete onReportThreadNetworkDiagnosticsTxAckedCountCallback; - delete onReportThreadNetworkDiagnosticsTxNoAckRequestedCountCallback; - delete onReportThreadNetworkDiagnosticsTxDataCountCallback; - delete onReportThreadNetworkDiagnosticsTxDataPollCountCallback; - delete onReportThreadNetworkDiagnosticsTxBeaconCountCallback; - delete onReportThreadNetworkDiagnosticsTxBeaconRequestCountCallback; - delete onReportThreadNetworkDiagnosticsTxOtherCountCallback; - delete onReportThreadNetworkDiagnosticsTxRetryCountCallback; - delete onReportThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountCallback; - delete onReportThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountCallback; - delete onReportThreadNetworkDiagnosticsTxErrCcaCountCallback; - delete onReportThreadNetworkDiagnosticsTxErrAbortCountCallback; - delete onReportThreadNetworkDiagnosticsTxErrBusyChannelCountCallback; - delete onReportThreadNetworkDiagnosticsRxTotalCountCallback; - delete onReportThreadNetworkDiagnosticsRxUnicastCountCallback; - delete onReportThreadNetworkDiagnosticsRxBroadcastCountCallback; - delete onReportThreadNetworkDiagnosticsRxDataCountCallback; - delete onReportThreadNetworkDiagnosticsRxDataPollCountCallback; - delete onReportThreadNetworkDiagnosticsRxBeaconCountCallback; - delete onReportThreadNetworkDiagnosticsRxBeaconRequestCountCallback; - delete onReportThreadNetworkDiagnosticsRxOtherCountCallback; - delete onReportThreadNetworkDiagnosticsRxAddressFilteredCountCallback; - delete onReportThreadNetworkDiagnosticsRxDestAddrFilteredCountCallback; - delete onReportThreadNetworkDiagnosticsRxDuplicatedCountCallback; - delete onReportThreadNetworkDiagnosticsRxErrNoFrameCountCallback; - delete onReportThreadNetworkDiagnosticsRxErrUnknownNeighborCountCallback; - delete onReportThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountCallback; - delete onReportThreadNetworkDiagnosticsRxErrSecCountCallback; - delete onReportThreadNetworkDiagnosticsRxErrFcsCountCallback; - delete onReportThreadNetworkDiagnosticsRxErrOtherCountCallback; - delete onReportThreadNetworkDiagnosticsActiveTimestampCallback; - delete onReportThreadNetworkDiagnosticsPendingTimestampCallback; - delete onReportThreadNetworkDiagnosticsDelayCallback; - delete onReportThreadNetworkDiagnosticsChannelMaskCallback; - delete onReportThreadNetworkDiagnosticsClusterRevisionCallback; - delete onReportWakeOnLanWakeOnLanMacAddressCallback; - delete onReportWakeOnLanClusterRevisionCallback; - delete onReportWiFiNetworkDiagnosticsBssidCallback; - delete onReportWiFiNetworkDiagnosticsSecurityTypeCallback; - delete onReportWiFiNetworkDiagnosticsWiFiVersionCallback; - delete onReportWiFiNetworkDiagnosticsChannelNumberCallback; - delete onReportWiFiNetworkDiagnosticsRssiCallback; - delete onReportWiFiNetworkDiagnosticsBeaconLostCountCallback; - delete onReportWiFiNetworkDiagnosticsBeaconRxCountCallback; - delete onReportWiFiNetworkDiagnosticsPacketMulticastRxCountCallback; - delete onReportWiFiNetworkDiagnosticsPacketMulticastTxCountCallback; - delete onReportWiFiNetworkDiagnosticsPacketUnicastRxCountCallback; - delete onReportWiFiNetworkDiagnosticsPacketUnicastTxCountCallback; - delete onReportWiFiNetworkDiagnosticsCurrentMaxRateCallback; - delete onReportWiFiNetworkDiagnosticsOverrunCountCallback; - delete onReportWiFiNetworkDiagnosticsClusterRevisionCallback; - delete onReportWindowCoveringTypeCallback; - delete onReportWindowCoveringCurrentPositionLiftCallback; - delete onReportWindowCoveringCurrentPositionTiltCallback; - delete onReportWindowCoveringConfigStatusCallback; - delete onReportWindowCoveringCurrentPositionLiftPercentageCallback; - delete onReportWindowCoveringCurrentPositionTiltPercentageCallback; - delete onReportWindowCoveringOperationalStatusCallback; - delete onReportWindowCoveringTargetPositionLiftPercent100thsCallback; - delete onReportWindowCoveringTargetPositionTiltPercent100thsCallback; - delete onReportWindowCoveringEndProductTypeCallback; - delete onReportWindowCoveringCurrentPositionLiftPercent100thsCallback; - delete onReportWindowCoveringCurrentPositionTiltPercent100thsCallback; - delete onReportWindowCoveringInstalledOpenLimitLiftCallback; - delete onReportWindowCoveringInstalledClosedLimitLiftCallback; - delete onReportWindowCoveringInstalledOpenLimitTiltCallback; - delete onReportWindowCoveringInstalledClosedLimitTiltCallback; - delete onReportWindowCoveringModeCallback; - delete onReportWindowCoveringSafetyStatusCallback; - delete onReportWindowCoveringFeatureMapCallback; - delete onReportWindowCoveringClusterRevisionCallback; - } - - void AddReportCallbacks(NodeId remoteId, uint8_t endpointId) override - { - chip::app::CHIPDeviceCallbacksMgr & callbacksMgr = chip::app::CHIPDeviceCallbacksMgr::GetInstance(); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050E, 0xFFFD, onReportAccountLoginClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003C, 0xFFFD, - onReportAdministratorCommissioningClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050D, 0x0000, onReportApplicationBasicVendorNameCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050D, 0x0001, onReportApplicationBasicVendorIdCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050D, 0x0002, - onReportApplicationBasicApplicationNameCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050D, 0x0003, onReportApplicationBasicProductIdCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050D, 0x0005, - onReportApplicationBasicApplicationStatusCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050D, 0x0006, - onReportApplicationBasicApplicationVersionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050D, 0xFFFD, - onReportApplicationBasicClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050C, 0xFFFD, - onReportApplicationLauncherClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050B, 0x0001, - onReportAudioOutputCurrentAudioOutputCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050B, 0xFFFD, onReportAudioOutputClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0103, 0x0001, - onReportBarrierControlBarrierMovingStateCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0103, 0x0002, - onReportBarrierControlBarrierSafetyStatusCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0103, 0x0003, - onReportBarrierControlBarrierCapabilitiesCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0103, 0x000A, - onReportBarrierControlBarrierPositionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0103, 0xFFFD, - onReportBarrierControlClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0000, onReportBasicInteractionModelVersionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0001, onReportBasicVendorNameCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0002, onReportBasicVendorIDCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0003, onReportBasicProductNameCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0004, onReportBasicProductIDCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0005, onReportBasicNodeLabelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0006, onReportBasicLocationCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0007, onReportBasicHardwareVersionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0008, onReportBasicHardwareVersionStringCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0009, onReportBasicSoftwareVersionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x000A, onReportBasicSoftwareVersionStringCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x000B, onReportBasicManufacturingDateCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x000C, onReportBasicPartNumberCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x000D, onReportBasicProductURLCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x000E, onReportBasicProductLabelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x000F, onReportBasicSerialNumberCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0010, onReportBasicLocalConfigDisabledCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0x0011, onReportBasicReachableCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0028, 0xFFFD, onReportBasicClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x000F, 0x0051, onReportBinaryInputBasicOutOfServiceCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x000F, 0x0055, onReportBinaryInputBasicPresentValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x000F, 0x006F, onReportBinaryInputBasicStatusFlagsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x000F, 0xFFFD, - onReportBinaryInputBasicClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x001E, 0xFFFD, onReportBindingClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0045, 0x0000, onReportBooleanStateStateValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0045, 0xFFFD, onReportBooleanStateClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0025, 0x0002, onReportBridgedActionsSetupUrlCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0025, 0xFFFD, - onReportBridgedActionsClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0039, 0xFFFD, - onReportBridgedDeviceBasicClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0000, onReportColorControlCurrentHueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0001, - onReportColorControlCurrentSaturationCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0002, onReportColorControlRemainingTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0003, onReportColorControlCurrentXCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0004, onReportColorControlCurrentYCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0005, - onReportColorControlDriftCompensationCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0006, onReportColorControlCompensationTextCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0007, onReportColorControlColorTemperatureCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0008, onReportColorControlColorModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x000F, - onReportColorControlColorControlOptionsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0010, - onReportColorControlNumberOfPrimariesCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0011, onReportColorControlPrimary1XCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0012, onReportColorControlPrimary1YCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0013, - onReportColorControlPrimary1IntensityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0015, onReportColorControlPrimary2XCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0016, onReportColorControlPrimary2YCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0017, - onReportColorControlPrimary2IntensityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0019, onReportColorControlPrimary3XCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x001A, onReportColorControlPrimary3YCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x001B, - onReportColorControlPrimary3IntensityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0020, onReportColorControlPrimary4XCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0021, onReportColorControlPrimary4YCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0022, - onReportColorControlPrimary4IntensityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0024, onReportColorControlPrimary5XCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0025, onReportColorControlPrimary5YCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0026, - onReportColorControlPrimary5IntensityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0028, onReportColorControlPrimary6XCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0029, onReportColorControlPrimary6YCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x002A, - onReportColorControlPrimary6IntensityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0030, onReportColorControlWhitePointXCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0031, onReportColorControlWhitePointYCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0032, onReportColorControlColorPointRXCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0033, onReportColorControlColorPointRYCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0034, - onReportColorControlColorPointRIntensityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0036, onReportColorControlColorPointGXCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0037, onReportColorControlColorPointGYCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x0038, - onReportColorControlColorPointGIntensityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x003A, onReportColorControlColorPointBXCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x003B, onReportColorControlColorPointBYCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x003C, - onReportColorControlColorPointBIntensityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x4000, - onReportColorControlEnhancedCurrentHueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x4001, - onReportColorControlEnhancedColorModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x4002, onReportColorControlColorLoopActiveCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x4003, - onReportColorControlColorLoopDirectionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x4004, onReportColorControlColorLoopTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x4005, - onReportColorControlColorLoopStartEnhancedHueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x4006, - onReportColorControlColorLoopStoredEnhancedHueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x400A, - onReportColorControlColorCapabilitiesCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x400B, - onReportColorControlColorTempPhysicalMinCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x400C, - onReportColorControlColorTempPhysicalMaxCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x400D, - onReportColorControlCoupleColorTempToLevelMinMiredsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0x4010, - onReportColorControlStartUpColorTemperatureMiredsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0300, 0xFFFD, onReportColorControlClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050A, 0x0001, - onReportContentLauncherSupportedStreamingProtocolsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050A, 0xFFFD, - onReportContentLauncherClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x001D, 0xFFFD, onReportDescriptorClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0000, onReportDoorLockLockStateCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0001, onReportDoorLockLockTypeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0002, onReportDoorLockActuatorEnabledCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0003, onReportDoorLockDoorStateCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0021, onReportDoorLockLanguageCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0023, onReportDoorLockAutoRelockTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0024, onReportDoorLockSoundVolumeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0025, onReportDoorLockOperatingModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0029, - onReportDoorLockEnableOneTouchLockingCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x002B, - onReportDoorLockEnablePrivacyModeButtonCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0x0030, onReportDoorLockWrongCodeEntryLimitCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0101, 0xFFFD, onReportDoorLockClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x0000, - onReportElectricalMeasurementMeasurementTypeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x0304, - onReportElectricalMeasurementTotalActivePowerCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x0505, - onReportElectricalMeasurementRmsVoltageCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x0506, - onReportElectricalMeasurementRmsVoltageMinCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x0507, - onReportElectricalMeasurementRmsVoltageMaxCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x0508, - onReportElectricalMeasurementRmsCurrentCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x0509, - onReportElectricalMeasurementRmsCurrentMinCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x050A, - onReportElectricalMeasurementRmsCurrentMaxCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x050B, - onReportElectricalMeasurementActivePowerCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x050C, - onReportElectricalMeasurementActivePowerMinCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0x050D, - onReportElectricalMeasurementActivePowerMaxCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0B04, 0xFFFD, - onReportElectricalMeasurementClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0037, 0x0000, - onReportEthernetNetworkDiagnosticsPHYRateCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0037, 0x0001, - onReportEthernetNetworkDiagnosticsFullDuplexCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0037, 0x0002, - onReportEthernetNetworkDiagnosticsPacketRxCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0037, 0x0003, - onReportEthernetNetworkDiagnosticsPacketTxCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0037, 0x0004, - onReportEthernetNetworkDiagnosticsTxErrCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0037, 0x0005, - onReportEthernetNetworkDiagnosticsCollisionCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0037, 0x0006, - onReportEthernetNetworkDiagnosticsOverrunCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0037, 0x0007, - onReportEthernetNetworkDiagnosticsCarrierDetectCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0037, 0x0008, - onReportEthernetNetworkDiagnosticsTimeSinceResetCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0037, 0xFFFD, - onReportEthernetNetworkDiagnosticsClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0040, 0xFFFD, onReportFixedLabelClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0404, 0x0000, onReportFlowMeasurementMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0404, 0x0001, - onReportFlowMeasurementMinMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0404, 0x0002, - onReportFlowMeasurementMaxMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0404, 0x0003, onReportFlowMeasurementToleranceCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0404, 0xFFFD, - onReportFlowMeasurementClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0030, 0x0000, - onReportGeneralCommissioningBreadcrumbCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0030, 0xFFFD, - onReportGeneralCommissioningClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0033, 0x0001, - onReportGeneralDiagnosticsRebootCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0033, 0x0002, onReportGeneralDiagnosticsUpTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0033, 0x0003, - onReportGeneralDiagnosticsTotalOperationalHoursCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0033, 0x0004, - onReportGeneralDiagnosticsBootReasonsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0033, 0xFFFD, - onReportGeneralDiagnosticsClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003F, 0xFFFD, - onReportGroupKeyManagementClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0004, 0x0000, onReportGroupsNameSupportCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0004, 0xFFFD, onReportGroupsClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0003, 0x0000, onReportIdentifyIdentifyTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0003, 0x0001, onReportIdentifyIdentifyTypeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0003, 0xFFFD, onReportIdentifyClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0400, 0x0000, - onReportIlluminanceMeasurementMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0400, 0x0001, - onReportIlluminanceMeasurementMinMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0400, 0x0002, - onReportIlluminanceMeasurementMaxMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0400, 0x0003, - onReportIlluminanceMeasurementToleranceCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0400, 0x0004, - onReportIlluminanceMeasurementLightSensorTypeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0400, 0xFFFD, - onReportIlluminanceMeasurementClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0509, 0xFFFD, onReportKeypadInputClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0000, onReportLevelControlCurrentLevelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0001, onReportLevelControlRemainingTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0002, onReportLevelControlMinLevelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0003, onReportLevelControlMaxLevelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0004, onReportLevelControlCurrentFrequencyCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0005, onReportLevelControlMinFrequencyCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0006, onReportLevelControlMaxFrequencyCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x000F, onReportLevelControlOptionsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0010, - onReportLevelControlOnOffTransitionTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0011, onReportLevelControlOnLevelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0012, onReportLevelControlOnTransitionTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0013, - onReportLevelControlOffTransitionTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x0014, onReportLevelControlDefaultMoveRateCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0x4000, - onReportLevelControlStartUpCurrentLevelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0008, 0xFFFD, onReportLevelControlClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0508, 0xFFFD, onReportLowPowerClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0507, 0x0001, onReportMediaInputCurrentMediaInputCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0507, 0xFFFD, onReportMediaInputClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0506, 0x0000, onReportMediaPlaybackPlaybackStateCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0506, 0x0001, onReportMediaPlaybackStartTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0506, 0x0002, onReportMediaPlaybackDurationCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0506, 0x0005, onReportMediaPlaybackSeekRangeEndCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0506, 0x0006, onReportMediaPlaybackSeekRangeStartCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0506, 0xFFFD, onReportMediaPlaybackClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0050, 0x0000, onReportModeSelectCurrentModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0050, 0x0002, onReportModeSelectOnModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0050, 0x0003, onReportModeSelectStartUpModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0050, 0x0004, onReportModeSelectDescriptionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0050, 0xFFFD, onReportModeSelectClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0031, 0xFFFC, - onReportNetworkCommissioningFeatureMapCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0031, 0xFFFD, - onReportNetworkCommissioningClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0029, 0xFFFD, - onReportOtaSoftwareUpdateProviderClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002A, 0x0001, - onReportOtaSoftwareUpdateRequestorDefaultOtaProviderCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002A, 0x0002, - onReportOtaSoftwareUpdateRequestorUpdatePossibleCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002A, 0xFFFD, - onReportOtaSoftwareUpdateRequestorClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0406, 0x0000, onReportOccupancySensingOccupancyCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0406, 0x0001, - onReportOccupancySensingOccupancySensorTypeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0406, 0x0002, - onReportOccupancySensingOccupancySensorTypeBitmapCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0406, 0xFFFD, - onReportOccupancySensingClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0006, 0x0000, onReportOnOffOnOffCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0006, 0x4000, onReportOnOffGlobalSceneControlCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0006, 0x4001, onReportOnOffOnTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0006, 0x4002, onReportOnOffOffWaitTimeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0006, 0x4003, onReportOnOffStartUpOnOffCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0006, 0xFFFC, onReportOnOffFeatureMapCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0006, 0xFFFD, onReportOnOffClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0007, 0x0000, - onReportOnOffSwitchConfigurationSwitchTypeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0007, 0x0010, - onReportOnOffSwitchConfigurationSwitchActionsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0007, 0xFFFD, - onReportOnOffSwitchConfigurationClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003E, 0x0002, - onReportOperationalCredentialsSupportedFabricsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003E, 0x0003, - onReportOperationalCredentialsCommissionedFabricsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003E, 0x0005, - onReportOperationalCredentialsCurrentFabricIndexCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003E, 0xFFFD, - onReportOperationalCredentialsClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002F, 0x0000, onReportPowerSourceStatusCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002F, 0x0001, onReportPowerSourceOrderCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002F, 0x0002, onReportPowerSourceDescriptionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002F, 0x000B, onReportPowerSourceBatteryVoltageCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002F, 0x000C, - onReportPowerSourceBatteryPercentRemainingCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002F, 0x000D, - onReportPowerSourceBatteryTimeRemainingCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002F, 0x000E, - onReportPowerSourceBatteryChargeLevelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002F, 0x001A, - onReportPowerSourceBatteryChargeStateCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002F, 0xFFFC, onReportPowerSourceFeatureMapCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x002F, 0xFFFD, onReportPowerSourceClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0403, 0x0000, - onReportPressureMeasurementMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0403, 0x0001, - onReportPressureMeasurementMinMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0403, 0x0002, - onReportPressureMeasurementMaxMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0403, 0xFFFD, - onReportPressureMeasurementClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0000, - onReportPumpConfigurationAndControlMaxPressureCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0001, - onReportPumpConfigurationAndControlMaxSpeedCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0002, - onReportPumpConfigurationAndControlMaxFlowCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0003, - onReportPumpConfigurationAndControlMinConstPressureCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0004, - onReportPumpConfigurationAndControlMaxConstPressureCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0005, - onReportPumpConfigurationAndControlMinCompPressureCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0006, - onReportPumpConfigurationAndControlMaxCompPressureCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0007, - onReportPumpConfigurationAndControlMinConstSpeedCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0008, - onReportPumpConfigurationAndControlMaxConstSpeedCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0009, - onReportPumpConfigurationAndControlMinConstFlowCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x000A, - onReportPumpConfigurationAndControlMaxConstFlowCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x000B, - onReportPumpConfigurationAndControlMinConstTempCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x000C, - onReportPumpConfigurationAndControlMaxConstTempCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0010, - onReportPumpConfigurationAndControlPumpStatusCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0011, - onReportPumpConfigurationAndControlEffectiveOperationModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0012, - onReportPumpConfigurationAndControlEffectiveControlModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0013, - onReportPumpConfigurationAndControlCapacityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0014, - onReportPumpConfigurationAndControlSpeedCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0015, - onReportPumpConfigurationAndControlLifetimeRunningHoursCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0016, - onReportPumpConfigurationAndControlPowerCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0017, - onReportPumpConfigurationAndControlLifetimeEnergyConsumedCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0020, - onReportPumpConfigurationAndControlOperationModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0021, - onReportPumpConfigurationAndControlControlModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0x0022, - onReportPumpConfigurationAndControlAlarmMaskCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0xFFFC, - onReportPumpConfigurationAndControlFeatureMapCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0200, 0xFFFD, - onReportPumpConfigurationAndControlClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0405, 0x0000, - onReportRelativeHumidityMeasurementMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0405, 0x0001, - onReportRelativeHumidityMeasurementMinMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0405, 0x0002, - onReportRelativeHumidityMeasurementMaxMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0405, 0x0003, - onReportRelativeHumidityMeasurementToleranceCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0405, 0xFFFD, - onReportRelativeHumidityMeasurementClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0005, 0x0000, onReportScenesSceneCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0005, 0x0001, onReportScenesCurrentSceneCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0005, 0x0002, onReportScenesCurrentGroupCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0005, 0x0003, onReportScenesSceneValidCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0005, 0x0004, onReportScenesNameSupportCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0005, 0xFFFD, onReportScenesClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0034, 0x0001, - onReportSoftwareDiagnosticsCurrentHeapFreeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0034, 0x0002, - onReportSoftwareDiagnosticsCurrentHeapUsedCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0034, 0x0003, - onReportSoftwareDiagnosticsCurrentHeapHighWatermarkCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0034, 0xFFFD, - onReportSoftwareDiagnosticsClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003B, 0x0000, onReportSwitchNumberOfPositionsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003B, 0x0001, onReportSwitchCurrentPositionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003B, 0x0002, onReportSwitchMultiPressMaxCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003B, 0xFFFC, onReportSwitchFeatureMapCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003B, 0xFFFD, onReportSwitchClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0504, 0xFFFD, onReportTvChannelClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0505, 0xFFFD, - onReportTargetNavigatorClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0402, 0x0000, - onReportTemperatureMeasurementMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0402, 0x0001, - onReportTemperatureMeasurementMinMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0402, 0x0002, - onReportTemperatureMeasurementMaxMeasuredValueCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0402, 0x0003, - onReportTemperatureMeasurementToleranceCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0402, 0xFFFD, - onReportTemperatureMeasurementClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0000, onReportTestClusterBooleanCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0001, onReportTestClusterBitmap8Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0002, onReportTestClusterBitmap16Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0003, onReportTestClusterBitmap32Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0004, onReportTestClusterBitmap64Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0005, onReportTestClusterInt8uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0006, onReportTestClusterInt16uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0007, onReportTestClusterInt24uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0008, onReportTestClusterInt32uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0009, onReportTestClusterInt40uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x000A, onReportTestClusterInt48uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x000B, onReportTestClusterInt56uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x000C, onReportTestClusterInt64uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x000D, onReportTestClusterInt8sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x000E, onReportTestClusterInt16sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x000F, onReportTestClusterInt24sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0010, onReportTestClusterInt32sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0011, onReportTestClusterInt40sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0012, onReportTestClusterInt48sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0013, onReportTestClusterInt56sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0014, onReportTestClusterInt64sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0015, onReportTestClusterEnum8Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0016, onReportTestClusterEnum16Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0017, onReportTestClusterFloatSingleCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0018, onReportTestClusterFloatDoubleCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0019, onReportTestClusterOctetStringCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x001D, onReportTestClusterLongOctetStringCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x001E, onReportTestClusterCharStringCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x001F, onReportTestClusterLongCharStringCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0020, onReportTestClusterEpochUsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0021, onReportTestClusterEpochSCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0022, onReportTestClusterVendorIdCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0024, onReportTestClusterEnumAttrCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0026, - onReportTestClusterRangeRestrictedInt8uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0027, - onReportTestClusterRangeRestrictedInt8sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0028, - onReportTestClusterRangeRestrictedInt16uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x0029, - onReportTestClusterRangeRestrictedInt16sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x00FF, onReportTestClusterUnsupportedCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8000, onReportTestClusterNullableBooleanCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8001, onReportTestClusterNullableBitmap8Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8002, onReportTestClusterNullableBitmap16Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8003, onReportTestClusterNullableBitmap32Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8004, onReportTestClusterNullableBitmap64Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8005, onReportTestClusterNullableInt8uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8006, onReportTestClusterNullableInt16uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8007, onReportTestClusterNullableInt24uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8008, onReportTestClusterNullableInt32uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8009, onReportTestClusterNullableInt40uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x800A, onReportTestClusterNullableInt48uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x800B, onReportTestClusterNullableInt56uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x800C, onReportTestClusterNullableInt64uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x800D, onReportTestClusterNullableInt8sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x800E, onReportTestClusterNullableInt16sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x800F, onReportTestClusterNullableInt24sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8010, onReportTestClusterNullableInt32sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8011, onReportTestClusterNullableInt40sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8012, onReportTestClusterNullableInt48sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8013, onReportTestClusterNullableInt56sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8014, onReportTestClusterNullableInt64sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8015, onReportTestClusterNullableEnum8Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8016, onReportTestClusterNullableEnum16Callback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8017, - onReportTestClusterNullableFloatSingleCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8018, - onReportTestClusterNullableFloatDoubleCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8019, - onReportTestClusterNullableOctetStringCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x801E, - onReportTestClusterNullableCharStringCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8024, onReportTestClusterNullableEnumAttrCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8026, - onReportTestClusterNullableRangeRestrictedInt8uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8027, - onReportTestClusterNullableRangeRestrictedInt8sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8028, - onReportTestClusterNullableRangeRestrictedInt16uCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0x8029, - onReportTestClusterNullableRangeRestrictedInt16sCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x050F, 0xFFFD, onReportTestClusterClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0000, onReportThermostatLocalTemperatureCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0003, - onReportThermostatAbsMinHeatSetpointLimitCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0004, - onReportThermostatAbsMaxHeatSetpointLimitCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0005, - onReportThermostatAbsMinCoolSetpointLimitCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0006, - onReportThermostatAbsMaxCoolSetpointLimitCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0011, - onReportThermostatOccupiedCoolingSetpointCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0012, - onReportThermostatOccupiedHeatingSetpointCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0015, - onReportThermostatMinHeatSetpointLimitCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0016, - onReportThermostatMaxHeatSetpointLimitCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0017, - onReportThermostatMinCoolSetpointLimitCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0018, - onReportThermostatMaxCoolSetpointLimitCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0019, - onReportThermostatMinSetpointDeadBandCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x001B, - onReportThermostatControlSequenceOfOperationCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x001C, onReportThermostatSystemModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0020, onReportThermostatStartOfWeekCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0021, - onReportThermostatNumberOfWeeklyTransitionsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0022, - onReportThermostatNumberOfDailyTransitionsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0xFFFC, onReportThermostatFeatureMapCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0xFFFD, onReportThermostatClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0204, 0x0000, - onReportThermostatUserInterfaceConfigurationTemperatureDisplayModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0204, 0x0001, - onReportThermostatUserInterfaceConfigurationKeypadLockoutCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0204, 0x0002, - onReportThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0204, 0xFFFD, - onReportThermostatUserInterfaceConfigurationClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0000, - onReportThreadNetworkDiagnosticsChannelCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0001, - onReportThreadNetworkDiagnosticsRoutingRoleCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0002, - onReportThreadNetworkDiagnosticsNetworkNameCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0003, - onReportThreadNetworkDiagnosticsPanIdCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0004, - onReportThreadNetworkDiagnosticsExtendedPanIdCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0005, - onReportThreadNetworkDiagnosticsMeshLocalPrefixCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0006, - onReportThreadNetworkDiagnosticsOverrunCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0009, - onReportThreadNetworkDiagnosticsPartitionIdCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x000A, - onReportThreadNetworkDiagnosticsWeightingCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x000B, - onReportThreadNetworkDiagnosticsDataVersionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x000C, - onReportThreadNetworkDiagnosticsStableDataVersionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x000D, - onReportThreadNetworkDiagnosticsLeaderRouterIdCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x000E, - onReportThreadNetworkDiagnosticsDetachedRoleCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x000F, - onReportThreadNetworkDiagnosticsChildRoleCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0010, - onReportThreadNetworkDiagnosticsRouterRoleCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0011, - onReportThreadNetworkDiagnosticsLeaderRoleCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0012, - onReportThreadNetworkDiagnosticsAttachAttemptCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0013, - onReportThreadNetworkDiagnosticsPartitionIdChangeCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0014, - onReportThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0015, - onReportThreadNetworkDiagnosticsParentChangeCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0016, - onReportThreadNetworkDiagnosticsTxTotalCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0017, - onReportThreadNetworkDiagnosticsTxUnicastCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0018, - onReportThreadNetworkDiagnosticsTxBroadcastCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0019, - onReportThreadNetworkDiagnosticsTxAckRequestedCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x001A, - onReportThreadNetworkDiagnosticsTxAckedCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x001B, - onReportThreadNetworkDiagnosticsTxNoAckRequestedCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x001C, - onReportThreadNetworkDiagnosticsTxDataCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x001D, - onReportThreadNetworkDiagnosticsTxDataPollCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x001E, - onReportThreadNetworkDiagnosticsTxBeaconCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x001F, - onReportThreadNetworkDiagnosticsTxBeaconRequestCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0020, - onReportThreadNetworkDiagnosticsTxOtherCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0021, - onReportThreadNetworkDiagnosticsTxRetryCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0022, - onReportThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0023, - onReportThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0024, - onReportThreadNetworkDiagnosticsTxErrCcaCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0025, - onReportThreadNetworkDiagnosticsTxErrAbortCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0026, - onReportThreadNetworkDiagnosticsTxErrBusyChannelCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0027, - onReportThreadNetworkDiagnosticsRxTotalCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0028, - onReportThreadNetworkDiagnosticsRxUnicastCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0029, - onReportThreadNetworkDiagnosticsRxBroadcastCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x002A, - onReportThreadNetworkDiagnosticsRxDataCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x002B, - onReportThreadNetworkDiagnosticsRxDataPollCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x002C, - onReportThreadNetworkDiagnosticsRxBeaconCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x002D, - onReportThreadNetworkDiagnosticsRxBeaconRequestCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x002E, - onReportThreadNetworkDiagnosticsRxOtherCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x002F, - onReportThreadNetworkDiagnosticsRxAddressFilteredCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0030, - onReportThreadNetworkDiagnosticsRxDestAddrFilteredCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0031, - onReportThreadNetworkDiagnosticsRxDuplicatedCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0032, - onReportThreadNetworkDiagnosticsRxErrNoFrameCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0033, - onReportThreadNetworkDiagnosticsRxErrUnknownNeighborCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0034, - onReportThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0035, - onReportThreadNetworkDiagnosticsRxErrSecCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0036, - onReportThreadNetworkDiagnosticsRxErrFcsCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0037, - onReportThreadNetworkDiagnosticsRxErrOtherCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0038, - onReportThreadNetworkDiagnosticsActiveTimestampCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x0039, - onReportThreadNetworkDiagnosticsPendingTimestampCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x003A, - onReportThreadNetworkDiagnosticsDelayCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0x003C, - onReportThreadNetworkDiagnosticsChannelMaskCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0035, 0xFFFD, - onReportThreadNetworkDiagnosticsClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0503, 0x0000, onReportWakeOnLanWakeOnLanMacAddressCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0503, 0xFFFD, onReportWakeOnLanClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x0000, onReportWiFiNetworkDiagnosticsBssidCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x0001, - onReportWiFiNetworkDiagnosticsSecurityTypeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x0002, - onReportWiFiNetworkDiagnosticsWiFiVersionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x0003, - onReportWiFiNetworkDiagnosticsChannelNumberCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x0004, onReportWiFiNetworkDiagnosticsRssiCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x0005, - onReportWiFiNetworkDiagnosticsBeaconLostCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x0006, - onReportWiFiNetworkDiagnosticsBeaconRxCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x0007, - onReportWiFiNetworkDiagnosticsPacketMulticastRxCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x0008, - onReportWiFiNetworkDiagnosticsPacketMulticastTxCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x0009, - onReportWiFiNetworkDiagnosticsPacketUnicastRxCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x000A, - onReportWiFiNetworkDiagnosticsPacketUnicastTxCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x000B, - onReportWiFiNetworkDiagnosticsCurrentMaxRateCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0x000C, - onReportWiFiNetworkDiagnosticsOverrunCountCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0036, 0xFFFD, - onReportWiFiNetworkDiagnosticsClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0000, onReportWindowCoveringTypeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0003, - onReportWindowCoveringCurrentPositionLiftCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0004, - onReportWindowCoveringCurrentPositionTiltCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0007, onReportWindowCoveringConfigStatusCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0008, - onReportWindowCoveringCurrentPositionLiftPercentageCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0009, - onReportWindowCoveringCurrentPositionTiltPercentageCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x000A, - onReportWindowCoveringOperationalStatusCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x000B, - onReportWindowCoveringTargetPositionLiftPercent100thsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x000C, - onReportWindowCoveringTargetPositionTiltPercent100thsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x000D, onReportWindowCoveringEndProductTypeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x000E, - onReportWindowCoveringCurrentPositionLiftPercent100thsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x000F, - onReportWindowCoveringCurrentPositionTiltPercent100thsCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0010, - onReportWindowCoveringInstalledOpenLimitLiftCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0011, - onReportWindowCoveringInstalledClosedLimitLiftCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0012, - onReportWindowCoveringInstalledOpenLimitTiltCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0013, - onReportWindowCoveringInstalledClosedLimitTiltCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0017, onReportWindowCoveringModeCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x001A, onReportWindowCoveringSafetyStatusCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0xFFFC, onReportWindowCoveringFeatureMapCallback->Cancel(), - BasicAttributeFilter); - callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0xFFFD, - onReportWindowCoveringClusterRevisionCallback->Cancel(), - BasicAttributeFilter); - } - -private: - chip::Callback::Callback * - onReportAccountLoginClusterRevisionCallback = - new chip::Callback::Callback( - ReadAccountLoginClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportAdministratorCommissioningClusterRevisionCallback = - new chip::Callback::Callback( - ReadAdministratorCommissioningClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportApplicationBasicVendorNameCallback = - new chip::Callback::Callback( - ReadApplicationBasicVendorName::OnAttributeResponse, this); - chip::Callback::Callback * - onReportApplicationBasicVendorIdCallback = - new chip::Callback::Callback( - ReadApplicationBasicVendorId::OnAttributeResponse, this); - chip::Callback::Callback * - onReportApplicationBasicApplicationNameCallback = - new chip::Callback::Callback( - ReadApplicationBasicApplicationName::OnAttributeResponse, this); - chip::Callback::Callback * - onReportApplicationBasicProductIdCallback = - new chip::Callback::Callback( - ReadApplicationBasicProductId::OnAttributeResponse, this); - chip::Callback::Callback * - onReportApplicationBasicApplicationStatusCallback = - new chip::Callback::Callback( - ReadApplicationBasicApplicationStatus::OnAttributeResponse, this); - chip::Callback::Callback * - onReportApplicationBasicApplicationVersionCallback = - new chip::Callback::Callback( - ReadApplicationBasicApplicationVersion::OnAttributeResponse, this); - chip::Callback::Callback * - onReportApplicationBasicClusterRevisionCallback = - new chip::Callback::Callback( - ReadApplicationBasicClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportApplicationLauncherClusterRevisionCallback = - new chip::Callback::Callback( - ReadApplicationLauncherClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportAudioOutputCurrentAudioOutputCallback = - new chip::Callback::Callback( - ReadAudioOutputCurrentAudioOutput::OnAttributeResponse, this); - chip::Callback::Callback * - onReportAudioOutputClusterRevisionCallback = - new chip::Callback::Callback( - ReadAudioOutputClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBarrierControlBarrierMovingStateCallback = - new chip::Callback::Callback( - ReadBarrierControlBarrierMovingState::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBarrierControlBarrierSafetyStatusCallback = - new chip::Callback::Callback( - ReadBarrierControlBarrierSafetyStatus::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBarrierControlBarrierCapabilitiesCallback = - new chip::Callback::Callback( - ReadBarrierControlBarrierCapabilities::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBarrierControlBarrierPositionCallback = - new chip::Callback::Callback( - ReadBarrierControlBarrierPosition::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBarrierControlClusterRevisionCallback = - new chip::Callback::Callback( - ReadBarrierControlClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBasicInteractionModelVersionCallback = - new chip::Callback::Callback( - ReadBasicInteractionModelVersion::OnAttributeResponse, this); - chip::Callback::Callback * onReportBasicVendorNameCallback = - new chip::Callback::Callback(ReadBasicVendorName::OnAttributeResponse, - this); - chip::Callback::Callback * onReportBasicVendorIDCallback = - new chip::Callback::Callback(ReadBasicVendorID::OnAttributeResponse, - this); - chip::Callback::Callback * onReportBasicProductNameCallback = - new chip::Callback::Callback( - ReadBasicProductName::OnAttributeResponse, this); - chip::Callback::Callback * onReportBasicProductIDCallback = - new chip::Callback::Callback(ReadBasicProductID::OnAttributeResponse, - this); - chip::Callback::Callback * onReportBasicNodeLabelCallback = - new chip::Callback::Callback(ReadBasicNodeLabel::OnAttributeResponse, - this); - chip::Callback::Callback * onReportBasicLocationCallback = - new chip::Callback::Callback(ReadBasicLocation::OnAttributeResponse, - this); - chip::Callback::Callback * onReportBasicHardwareVersionCallback = - new chip::Callback::Callback( - ReadBasicHardwareVersion::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBasicHardwareVersionStringCallback = - new chip::Callback::Callback( - ReadBasicHardwareVersionString::OnAttributeResponse, this); - chip::Callback::Callback * onReportBasicSoftwareVersionCallback = - new chip::Callback::Callback( - ReadBasicSoftwareVersion::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBasicSoftwareVersionStringCallback = - new chip::Callback::Callback( - ReadBasicSoftwareVersionString::OnAttributeResponse, this); - chip::Callback::Callback * onReportBasicManufacturingDateCallback = - new chip::Callback::Callback( - ReadBasicManufacturingDate::OnAttributeResponse, this); - chip::Callback::Callback * onReportBasicPartNumberCallback = - new chip::Callback::Callback(ReadBasicPartNumber::OnAttributeResponse, - this); - chip::Callback::Callback * onReportBasicProductURLCallback = - new chip::Callback::Callback(ReadBasicProductURL::OnAttributeResponse, - this); - chip::Callback::Callback * onReportBasicProductLabelCallback = - new chip::Callback::Callback( - ReadBasicProductLabel::OnAttributeResponse, this); - chip::Callback::Callback * onReportBasicSerialNumberCallback = - new chip::Callback::Callback( - ReadBasicSerialNumber::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBasicLocalConfigDisabledCallback = - new chip::Callback::Callback( - ReadBasicLocalConfigDisabled::OnAttributeResponse, this); - chip::Callback::Callback * onReportBasicReachableCallback = - new chip::Callback::Callback(ReadBasicReachable::OnAttributeResponse, - this); - chip::Callback::Callback * onReportBasicClusterRevisionCallback = - new chip::Callback::Callback( - ReadBasicClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBinaryInputBasicOutOfServiceCallback = - new chip::Callback::Callback( - ReadBinaryInputBasicOutOfService::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBinaryInputBasicPresentValueCallback = - new chip::Callback::Callback( - ReadBinaryInputBasicPresentValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBinaryInputBasicStatusFlagsCallback = - new chip::Callback::Callback( - ReadBinaryInputBasicStatusFlags::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBinaryInputBasicClusterRevisionCallback = - new chip::Callback::Callback( - ReadBinaryInputBasicClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportBindingClusterRevisionCallback = - new chip::Callback::Callback( - ReadBindingClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportBooleanStateStateValueCallback = - new chip::Callback::Callback( - ReadBooleanStateStateValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBooleanStateClusterRevisionCallback = - new chip::Callback::Callback( - ReadBooleanStateClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportBridgedActionsSetupUrlCallback = - new chip::Callback::Callback( - ReadBridgedActionsSetupUrl::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBridgedActionsClusterRevisionCallback = - new chip::Callback::Callback( - ReadBridgedActionsClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportBridgedDeviceBasicClusterRevisionCallback = - new chip::Callback::Callback( - ReadBridgedDeviceBasicClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlCurrentHueCallback = - new chip::Callback::Callback( - ReadColorControlCurrentHue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlCurrentSaturationCallback = - new chip::Callback::Callback( - ReadColorControlCurrentSaturation::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlRemainingTimeCallback = - new chip::Callback::Callback( - ReadColorControlRemainingTime::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlCurrentXCallback = - new chip::Callback::Callback( - ReadColorControlCurrentX::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlCurrentYCallback = - new chip::Callback::Callback( - ReadColorControlCurrentY::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlDriftCompensationCallback = - new chip::Callback::Callback( - ReadColorControlDriftCompensation::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlCompensationTextCallback = - new chip::Callback::Callback( - ReadColorControlCompensationText::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorTemperatureCallback = - new chip::Callback::Callback( - ReadColorControlColorTemperature::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlColorModeCallback = - new chip::Callback::Callback( - ReadColorControlColorMode::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorControlOptionsCallback = - new chip::Callback::Callback( - ReadColorControlColorControlOptions::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlNumberOfPrimariesCallback = - new chip::Callback::Callback( - ReadColorControlNumberOfPrimaries::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary1XCallback = - new chip::Callback::Callback( - ReadColorControlPrimary1X::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary1YCallback = - new chip::Callback::Callback( - ReadColorControlPrimary1Y::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlPrimary1IntensityCallback = - new chip::Callback::Callback( - ReadColorControlPrimary1Intensity::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary2XCallback = - new chip::Callback::Callback( - ReadColorControlPrimary2X::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary2YCallback = - new chip::Callback::Callback( - ReadColorControlPrimary2Y::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlPrimary2IntensityCallback = - new chip::Callback::Callback( - ReadColorControlPrimary2Intensity::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary3XCallback = - new chip::Callback::Callback( - ReadColorControlPrimary3X::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary3YCallback = - new chip::Callback::Callback( - ReadColorControlPrimary3Y::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlPrimary3IntensityCallback = - new chip::Callback::Callback( - ReadColorControlPrimary3Intensity::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary4XCallback = - new chip::Callback::Callback( - ReadColorControlPrimary4X::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary4YCallback = - new chip::Callback::Callback( - ReadColorControlPrimary4Y::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlPrimary4IntensityCallback = - new chip::Callback::Callback( - ReadColorControlPrimary4Intensity::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary5XCallback = - new chip::Callback::Callback( - ReadColorControlPrimary5X::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary5YCallback = - new chip::Callback::Callback( - ReadColorControlPrimary5Y::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlPrimary5IntensityCallback = - new chip::Callback::Callback( - ReadColorControlPrimary5Intensity::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary6XCallback = - new chip::Callback::Callback( - ReadColorControlPrimary6X::OnAttributeResponse, this); - chip::Callback::Callback * onReportColorControlPrimary6YCallback = - new chip::Callback::Callback( - ReadColorControlPrimary6Y::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlPrimary6IntensityCallback = - new chip::Callback::Callback( - ReadColorControlPrimary6Intensity::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlWhitePointXCallback = - new chip::Callback::Callback( - ReadColorControlWhitePointX::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlWhitePointYCallback = - new chip::Callback::Callback( - ReadColorControlWhitePointY::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorPointRXCallback = - new chip::Callback::Callback( - ReadColorControlColorPointRX::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorPointRYCallback = - new chip::Callback::Callback( - ReadColorControlColorPointRY::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorPointRIntensityCallback = - new chip::Callback::Callback( - ReadColorControlColorPointRIntensity::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorPointGXCallback = - new chip::Callback::Callback( - ReadColorControlColorPointGX::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorPointGYCallback = - new chip::Callback::Callback( - ReadColorControlColorPointGY::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorPointGIntensityCallback = - new chip::Callback::Callback( - ReadColorControlColorPointGIntensity::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorPointBXCallback = - new chip::Callback::Callback( - ReadColorControlColorPointBX::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorPointBYCallback = - new chip::Callback::Callback( - ReadColorControlColorPointBY::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorPointBIntensityCallback = - new chip::Callback::Callback( - ReadColorControlColorPointBIntensity::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlEnhancedCurrentHueCallback = - new chip::Callback::Callback( - ReadColorControlEnhancedCurrentHue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlEnhancedColorModeCallback = - new chip::Callback::Callback( - ReadColorControlEnhancedColorMode::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorLoopActiveCallback = - new chip::Callback::Callback( - ReadColorControlColorLoopActive::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorLoopDirectionCallback = - new chip::Callback::Callback( - ReadColorControlColorLoopDirection::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorLoopTimeCallback = - new chip::Callback::Callback( - ReadColorControlColorLoopTime::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorLoopStartEnhancedHueCallback = - new chip::Callback::Callback( - ReadColorControlColorLoopStartEnhancedHue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorLoopStoredEnhancedHueCallback = - new chip::Callback::Callback( - ReadColorControlColorLoopStoredEnhancedHue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorCapabilitiesCallback = - new chip::Callback::Callback( - ReadColorControlColorCapabilities::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorTempPhysicalMinCallback = - new chip::Callback::Callback( - ReadColorControlColorTempPhysicalMin::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlColorTempPhysicalMaxCallback = - new chip::Callback::Callback( - ReadColorControlColorTempPhysicalMax::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlCoupleColorTempToLevelMinMiredsCallback = - new chip::Callback::Callback( - ReadColorControlCoupleColorTempToLevelMinMireds::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlStartUpColorTemperatureMiredsCallback = - new chip::Callback::Callback( - ReadColorControlStartUpColorTemperatureMireds::OnAttributeResponse, this); - chip::Callback::Callback * - onReportColorControlClusterRevisionCallback = - new chip::Callback::Callback( - ReadColorControlClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportContentLauncherSupportedStreamingProtocolsCallback = - new chip::Callback::Callback( - ReadContentLauncherSupportedStreamingProtocols::OnAttributeResponse, this); - chip::Callback::Callback * - onReportContentLauncherClusterRevisionCallback = - new chip::Callback::Callback( - ReadContentLauncherClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportDescriptorClusterRevisionCallback = - new chip::Callback::Callback( - ReadDescriptorClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportDoorLockLockStateCallback = - new chip::Callback::Callback( - ReadDoorLockLockState::OnAttributeResponse, this); - chip::Callback::Callback * onReportDoorLockLockTypeCallback = - new chip::Callback::Callback( - ReadDoorLockLockType::OnAttributeResponse, this); - chip::Callback::Callback * - onReportDoorLockActuatorEnabledCallback = - new chip::Callback::Callback( - ReadDoorLockActuatorEnabled::OnAttributeResponse, this); - chip::Callback::Callback * onReportDoorLockDoorStateCallback = - new chip::Callback::Callback( - ReadDoorLockDoorState::OnAttributeResponse, this); - chip::Callback::Callback * onReportDoorLockLanguageCallback = - new chip::Callback::Callback( - ReadDoorLockLanguage::OnAttributeResponse, this); - chip::Callback::Callback * onReportDoorLockAutoRelockTimeCallback = - new chip::Callback::Callback( - ReadDoorLockAutoRelockTime::OnAttributeResponse, this); - chip::Callback::Callback * onReportDoorLockSoundVolumeCallback = - new chip::Callback::Callback( - ReadDoorLockSoundVolume::OnAttributeResponse, this); - chip::Callback::Callback * onReportDoorLockOperatingModeCallback = - new chip::Callback::Callback( - ReadDoorLockOperatingMode::OnAttributeResponse, this); - chip::Callback::Callback * - onReportDoorLockEnableOneTouchLockingCallback = - new chip::Callback::Callback( - ReadDoorLockEnableOneTouchLocking::OnAttributeResponse, this); - chip::Callback::Callback * - onReportDoorLockEnablePrivacyModeButtonCallback = - new chip::Callback::Callback( - ReadDoorLockEnablePrivacyModeButton::OnAttributeResponse, this); - chip::Callback::Callback * - onReportDoorLockWrongCodeEntryLimitCallback = - new chip::Callback::Callback( - ReadDoorLockWrongCodeEntryLimit::OnAttributeResponse, this); - chip::Callback::Callback * - onReportDoorLockClusterRevisionCallback = - new chip::Callback::Callback( - ReadDoorLockClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementMeasurementTypeCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementMeasurementType::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementTotalActivePowerCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementTotalActivePower::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementRmsVoltageCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementRmsVoltage::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementRmsVoltageMinCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementRmsVoltageMin::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementRmsVoltageMaxCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementRmsVoltageMax::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementRmsCurrentCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementRmsCurrent::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementRmsCurrentMinCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementRmsCurrentMin::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementRmsCurrentMaxCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementRmsCurrentMax::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementActivePowerCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementActivePower::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementActivePowerMinCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementActivePowerMin::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementActivePowerMaxCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementActivePowerMax::OnAttributeResponse, this); - chip::Callback::Callback * - onReportElectricalMeasurementClusterRevisionCallback = - new chip::Callback::Callback( - ReadElectricalMeasurementClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportEthernetNetworkDiagnosticsPHYRateCallback = - new chip::Callback::Callback( - ReadEthernetNetworkDiagnosticsPHYRate::OnAttributeResponse, this); - chip::Callback::Callback * - onReportEthernetNetworkDiagnosticsFullDuplexCallback = - new chip::Callback::Callback( - ReadEthernetNetworkDiagnosticsFullDuplex::OnAttributeResponse, this); - chip::Callback::Callback * - onReportEthernetNetworkDiagnosticsPacketRxCountCallback = - new chip::Callback::Callback( - ReadEthernetNetworkDiagnosticsPacketRxCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportEthernetNetworkDiagnosticsPacketTxCountCallback = - new chip::Callback::Callback( - ReadEthernetNetworkDiagnosticsPacketTxCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportEthernetNetworkDiagnosticsTxErrCountCallback = - new chip::Callback::Callback( - ReadEthernetNetworkDiagnosticsTxErrCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportEthernetNetworkDiagnosticsCollisionCountCallback = - new chip::Callback::Callback( - ReadEthernetNetworkDiagnosticsCollisionCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportEthernetNetworkDiagnosticsOverrunCountCallback = - new chip::Callback::Callback( - ReadEthernetNetworkDiagnosticsOverrunCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportEthernetNetworkDiagnosticsCarrierDetectCallback = - new chip::Callback::Callback( - ReadEthernetNetworkDiagnosticsCarrierDetect::OnAttributeResponse, this); - chip::Callback::Callback * - onReportEthernetNetworkDiagnosticsTimeSinceResetCallback = - new chip::Callback::Callback( - ReadEthernetNetworkDiagnosticsTimeSinceReset::OnAttributeResponse, this); - chip::Callback::Callback * - onReportEthernetNetworkDiagnosticsClusterRevisionCallback = - new chip::Callback::Callback( - ReadEthernetNetworkDiagnosticsClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportFixedLabelClusterRevisionCallback = - new chip::Callback::Callback( - ReadFixedLabelClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportFlowMeasurementMeasuredValueCallback = - new chip::Callback::Callback( - ReadFlowMeasurementMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportFlowMeasurementMinMeasuredValueCallback = - new chip::Callback::Callback( - ReadFlowMeasurementMinMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportFlowMeasurementMaxMeasuredValueCallback = - new chip::Callback::Callback( - ReadFlowMeasurementMaxMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportFlowMeasurementToleranceCallback = - new chip::Callback::Callback( - ReadFlowMeasurementTolerance::OnAttributeResponse, this); - chip::Callback::Callback * - onReportFlowMeasurementClusterRevisionCallback = - new chip::Callback::Callback( - ReadFlowMeasurementClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportGeneralCommissioningBreadcrumbCallback = - new chip::Callback::Callback( - ReadGeneralCommissioningBreadcrumb::OnAttributeResponse, this); - chip::Callback::Callback * - onReportGeneralCommissioningClusterRevisionCallback = - new chip::Callback::Callback( - ReadGeneralCommissioningClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportGeneralDiagnosticsRebootCountCallback = - new chip::Callback::Callback( - ReadGeneralDiagnosticsRebootCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportGeneralDiagnosticsUpTimeCallback = - new chip::Callback::Callback( - ReadGeneralDiagnosticsUpTime::OnAttributeResponse, this); - chip::Callback::Callback * - onReportGeneralDiagnosticsTotalOperationalHoursCallback = - new chip::Callback::Callback( - ReadGeneralDiagnosticsTotalOperationalHours::OnAttributeResponse, this); - chip::Callback::Callback * - onReportGeneralDiagnosticsBootReasonsCallback = - new chip::Callback::Callback( - ReadGeneralDiagnosticsBootReasons::OnAttributeResponse, this); - chip::Callback::Callback * - onReportGeneralDiagnosticsClusterRevisionCallback = - new chip::Callback::Callback( - ReadGeneralDiagnosticsClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportGroupKeyManagementClusterRevisionCallback = - new chip::Callback::Callback( - ReadGroupKeyManagementClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportGroupsNameSupportCallback = - new chip::Callback::Callback( - ReadGroupsNameSupport::OnAttributeResponse, this); - chip::Callback::Callback * onReportGroupsClusterRevisionCallback = - new chip::Callback::Callback( - ReadGroupsClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportIdentifyIdentifyTimeCallback = - new chip::Callback::Callback( - ReadIdentifyIdentifyTime::OnAttributeResponse, this); - chip::Callback::Callback * onReportIdentifyIdentifyTypeCallback = - new chip::Callback::Callback( - ReadIdentifyIdentifyType::OnAttributeResponse, this); - chip::Callback::Callback * - onReportIdentifyClusterRevisionCallback = - new chip::Callback::Callback( - ReadIdentifyClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportIlluminanceMeasurementMeasuredValueCallback = - new chip::Callback::Callback( - ReadIlluminanceMeasurementMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportIlluminanceMeasurementMinMeasuredValueCallback = - new chip::Callback::Callback( - ReadIlluminanceMeasurementMinMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportIlluminanceMeasurementMaxMeasuredValueCallback = - new chip::Callback::Callback( - ReadIlluminanceMeasurementMaxMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportIlluminanceMeasurementToleranceCallback = - new chip::Callback::Callback( - ReadIlluminanceMeasurementTolerance::OnAttributeResponse, this); - chip::Callback::Callback * - onReportIlluminanceMeasurementLightSensorTypeCallback = - new chip::Callback::Callback( - ReadIlluminanceMeasurementLightSensorType::OnAttributeResponse, this); - chip::Callback::Callback * - onReportIlluminanceMeasurementClusterRevisionCallback = - new chip::Callback::Callback( - ReadIlluminanceMeasurementClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportKeypadInputClusterRevisionCallback = - new chip::Callback::Callback( - ReadKeypadInputClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlCurrentLevelCallback = - new chip::Callback::Callback( - ReadLevelControlCurrentLevel::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlRemainingTimeCallback = - new chip::Callback::Callback( - ReadLevelControlRemainingTime::OnAttributeResponse, this); - chip::Callback::Callback * onReportLevelControlMinLevelCallback = - new chip::Callback::Callback( - ReadLevelControlMinLevel::OnAttributeResponse, this); - chip::Callback::Callback * onReportLevelControlMaxLevelCallback = - new chip::Callback::Callback( - ReadLevelControlMaxLevel::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlCurrentFrequencyCallback = - new chip::Callback::Callback( - ReadLevelControlCurrentFrequency::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlMinFrequencyCallback = - new chip::Callback::Callback( - ReadLevelControlMinFrequency::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlMaxFrequencyCallback = - new chip::Callback::Callback( - ReadLevelControlMaxFrequency::OnAttributeResponse, this); - chip::Callback::Callback * onReportLevelControlOptionsCallback = - new chip::Callback::Callback( - ReadLevelControlOptions::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlOnOffTransitionTimeCallback = - new chip::Callback::Callback( - ReadLevelControlOnOffTransitionTime::OnAttributeResponse, this); - chip::Callback::Callback * onReportLevelControlOnLevelCallback = - new chip::Callback::Callback( - ReadLevelControlOnLevel::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlOnTransitionTimeCallback = - new chip::Callback::Callback( - ReadLevelControlOnTransitionTime::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlOffTransitionTimeCallback = - new chip::Callback::Callback( - ReadLevelControlOffTransitionTime::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlDefaultMoveRateCallback = - new chip::Callback::Callback( - ReadLevelControlDefaultMoveRate::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlStartUpCurrentLevelCallback = - new chip::Callback::Callback( - ReadLevelControlStartUpCurrentLevel::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLevelControlClusterRevisionCallback = - new chip::Callback::Callback( - ReadLevelControlClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportLowPowerClusterRevisionCallback = - new chip::Callback::Callback( - ReadLowPowerClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportMediaInputCurrentMediaInputCallback = - new chip::Callback::Callback( - ReadMediaInputCurrentMediaInput::OnAttributeResponse, this); - chip::Callback::Callback * - onReportMediaInputClusterRevisionCallback = - new chip::Callback::Callback( - ReadMediaInputClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportMediaPlaybackPlaybackStateCallback = - new chip::Callback::Callback( - ReadMediaPlaybackPlaybackState::OnAttributeResponse, this); - chip::Callback::Callback * onReportMediaPlaybackStartTimeCallback = - new chip::Callback::Callback( - ReadMediaPlaybackStartTime::OnAttributeResponse, this); - chip::Callback::Callback * onReportMediaPlaybackDurationCallback = - new chip::Callback::Callback( - ReadMediaPlaybackDuration::OnAttributeResponse, this); - chip::Callback::Callback * - onReportMediaPlaybackSeekRangeEndCallback = - new chip::Callback::Callback( - ReadMediaPlaybackSeekRangeEnd::OnAttributeResponse, this); - chip::Callback::Callback * - onReportMediaPlaybackSeekRangeStartCallback = - new chip::Callback::Callback( - ReadMediaPlaybackSeekRangeStart::OnAttributeResponse, this); - chip::Callback::Callback * - onReportMediaPlaybackClusterRevisionCallback = - new chip::Callback::Callback( - ReadMediaPlaybackClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportModeSelectCurrentModeCallback = - new chip::Callback::Callback( - ReadModeSelectCurrentMode::OnAttributeResponse, this); - chip::Callback::Callback * onReportModeSelectOnModeCallback = - new chip::Callback::Callback( - ReadModeSelectOnMode::OnAttributeResponse, this); - chip::Callback::Callback * onReportModeSelectStartUpModeCallback = - new chip::Callback::Callback( - ReadModeSelectStartUpMode::OnAttributeResponse, this); - chip::Callback::Callback * onReportModeSelectDescriptionCallback = - new chip::Callback::Callback( - ReadModeSelectDescription::OnAttributeResponse, this); - chip::Callback::Callback * - onReportModeSelectClusterRevisionCallback = - new chip::Callback::Callback( - ReadModeSelectClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportNetworkCommissioningFeatureMapCallback = - new chip::Callback::Callback( - ReadNetworkCommissioningFeatureMap::OnAttributeResponse, this); - chip::Callback::Callback * - onReportNetworkCommissioningClusterRevisionCallback = - new chip::Callback::Callback( - ReadNetworkCommissioningClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOtaSoftwareUpdateProviderClusterRevisionCallback = - new chip::Callback::Callback( - ReadOtaSoftwareUpdateProviderClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOtaSoftwareUpdateRequestorDefaultOtaProviderCallback = - new chip::Callback::Callback( - ReadOtaSoftwareUpdateRequestorDefaultOtaProvider::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOtaSoftwareUpdateRequestorUpdatePossibleCallback = - new chip::Callback::Callback( - ReadOtaSoftwareUpdateRequestorUpdatePossible::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOtaSoftwareUpdateRequestorClusterRevisionCallback = - new chip::Callback::Callback( - ReadOtaSoftwareUpdateRequestorClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOccupancySensingOccupancyCallback = - new chip::Callback::Callback( - ReadOccupancySensingOccupancy::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOccupancySensingOccupancySensorTypeCallback = - new chip::Callback::Callback( - ReadOccupancySensingOccupancySensorType::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOccupancySensingOccupancySensorTypeBitmapCallback = - new chip::Callback::Callback( - ReadOccupancySensingOccupancySensorTypeBitmap::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOccupancySensingClusterRevisionCallback = - new chip::Callback::Callback( - ReadOccupancySensingClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportOnOffOnOffCallback = - new chip::Callback::Callback(ReadOnOffOnOff::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOnOffGlobalSceneControlCallback = - new chip::Callback::Callback( - ReadOnOffGlobalSceneControl::OnAttributeResponse, this); - chip::Callback::Callback * onReportOnOffOnTimeCallback = - new chip::Callback::Callback(ReadOnOffOnTime::OnAttributeResponse, this); - chip::Callback::Callback * onReportOnOffOffWaitTimeCallback = - new chip::Callback::Callback( - ReadOnOffOffWaitTime::OnAttributeResponse, this); - chip::Callback::Callback * onReportOnOffStartUpOnOffCallback = - new chip::Callback::Callback( - ReadOnOffStartUpOnOff::OnAttributeResponse, this); - chip::Callback::Callback * onReportOnOffFeatureMapCallback = - new chip::Callback::Callback(ReadOnOffFeatureMap::OnAttributeResponse, - this); - chip::Callback::Callback * onReportOnOffClusterRevisionCallback = - new chip::Callback::Callback( - ReadOnOffClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOnOffSwitchConfigurationSwitchTypeCallback = - new chip::Callback::Callback( - ReadOnOffSwitchConfigurationSwitchType::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOnOffSwitchConfigurationSwitchActionsCallback = - new chip::Callback::Callback( - ReadOnOffSwitchConfigurationSwitchActions::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOnOffSwitchConfigurationClusterRevisionCallback = - new chip::Callback::Callback( - ReadOnOffSwitchConfigurationClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOperationalCredentialsSupportedFabricsCallback = - new chip::Callback::Callback( - ReadOperationalCredentialsSupportedFabrics::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOperationalCredentialsCommissionedFabricsCallback = - new chip::Callback::Callback( - ReadOperationalCredentialsCommissionedFabrics::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOperationalCredentialsCurrentFabricIndexCallback = - new chip::Callback::Callback( - ReadOperationalCredentialsCurrentFabricIndex::OnAttributeResponse, this); - chip::Callback::Callback * - onReportOperationalCredentialsClusterRevisionCallback = - new chip::Callback::Callback( - ReadOperationalCredentialsClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportPowerSourceStatusCallback = - new chip::Callback::Callback( - ReadPowerSourceStatus::OnAttributeResponse, this); - chip::Callback::Callback * onReportPowerSourceOrderCallback = - new chip::Callback::Callback( - ReadPowerSourceOrder::OnAttributeResponse, this); - chip::Callback::Callback * onReportPowerSourceDescriptionCallback = - new chip::Callback::Callback( - ReadPowerSourceDescription::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPowerSourceBatteryVoltageCallback = - new chip::Callback::Callback( - ReadPowerSourceBatteryVoltage::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPowerSourceBatteryPercentRemainingCallback = - new chip::Callback::Callback( - ReadPowerSourceBatteryPercentRemaining::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPowerSourceBatteryTimeRemainingCallback = - new chip::Callback::Callback( - ReadPowerSourceBatteryTimeRemaining::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPowerSourceBatteryChargeLevelCallback = - new chip::Callback::Callback( - ReadPowerSourceBatteryChargeLevel::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPowerSourceBatteryChargeStateCallback = - new chip::Callback::Callback( - ReadPowerSourceBatteryChargeState::OnAttributeResponse, this); - chip::Callback::Callback * onReportPowerSourceFeatureMapCallback = - new chip::Callback::Callback( - ReadPowerSourceFeatureMap::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPowerSourceClusterRevisionCallback = - new chip::Callback::Callback( - ReadPowerSourceClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPressureMeasurementMeasuredValueCallback = - new chip::Callback::Callback( - ReadPressureMeasurementMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPressureMeasurementMinMeasuredValueCallback = - new chip::Callback::Callback( - ReadPressureMeasurementMinMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPressureMeasurementMaxMeasuredValueCallback = - new chip::Callback::Callback( - ReadPressureMeasurementMaxMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPressureMeasurementClusterRevisionCallback = - new chip::Callback::Callback( - ReadPressureMeasurementClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMaxPressureCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMaxPressure::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMaxSpeedCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMaxSpeed::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMaxFlowCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMaxFlow::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMinConstPressureCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMinConstPressure::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMaxConstPressureCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMaxConstPressure::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMinCompPressureCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMinCompPressure::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMaxCompPressureCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMaxCompPressure::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMinConstSpeedCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMinConstSpeed::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMaxConstSpeedCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMaxConstSpeed::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMinConstFlowCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMinConstFlow::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMaxConstFlowCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMaxConstFlow::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMinConstTempCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMinConstTemp::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlMaxConstTempCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlMaxConstTemp::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlPumpStatusCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlPumpStatus::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlEffectiveOperationModeCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlEffectiveOperationMode::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlEffectiveControlModeCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlEffectiveControlMode::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlCapacityCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlCapacity::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlSpeedCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlSpeed::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlLifetimeRunningHoursCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlLifetimeRunningHours::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlPowerCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlPower::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlLifetimeEnergyConsumedCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlLifetimeEnergyConsumed::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlOperationModeCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlOperationMode::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlControlModeCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlControlMode::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlAlarmMaskCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlAlarmMask::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlFeatureMapCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlFeatureMap::OnAttributeResponse, this); - chip::Callback::Callback * - onReportPumpConfigurationAndControlClusterRevisionCallback = - new chip::Callback::Callback( - ReadPumpConfigurationAndControlClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportRelativeHumidityMeasurementMeasuredValueCallback = - new chip::Callback::Callback( - ReadRelativeHumidityMeasurementMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportRelativeHumidityMeasurementMinMeasuredValueCallback = - new chip::Callback::Callback( - ReadRelativeHumidityMeasurementMinMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportRelativeHumidityMeasurementMaxMeasuredValueCallback = - new chip::Callback::Callback( - ReadRelativeHumidityMeasurementMaxMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportRelativeHumidityMeasurementToleranceCallback = - new chip::Callback::Callback( - ReadRelativeHumidityMeasurementTolerance::OnAttributeResponse, this); - chip::Callback::Callback * - onReportRelativeHumidityMeasurementClusterRevisionCallback = - new chip::Callback::Callback( - ReadRelativeHumidityMeasurementClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportScenesSceneCountCallback = - new chip::Callback::Callback( - ReadScenesSceneCount::OnAttributeResponse, this); - chip::Callback::Callback * onReportScenesCurrentSceneCallback = - new chip::Callback::Callback( - ReadScenesCurrentScene::OnAttributeResponse, this); - chip::Callback::Callback * onReportScenesCurrentGroupCallback = - new chip::Callback::Callback( - ReadScenesCurrentGroup::OnAttributeResponse, this); - chip::Callback::Callback * onReportScenesSceneValidCallback = - new chip::Callback::Callback( - ReadScenesSceneValid::OnAttributeResponse, this); - chip::Callback::Callback * onReportScenesNameSupportCallback = - new chip::Callback::Callback( - ReadScenesNameSupport::OnAttributeResponse, this); - chip::Callback::Callback * onReportScenesClusterRevisionCallback = - new chip::Callback::Callback( - ReadScenesClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportSoftwareDiagnosticsCurrentHeapFreeCallback = - new chip::Callback::Callback( - ReadSoftwareDiagnosticsCurrentHeapFree::OnAttributeResponse, this); - chip::Callback::Callback * - onReportSoftwareDiagnosticsCurrentHeapUsedCallback = - new chip::Callback::Callback( - ReadSoftwareDiagnosticsCurrentHeapUsed::OnAttributeResponse, this); - chip::Callback::Callback * - onReportSoftwareDiagnosticsCurrentHeapHighWatermarkCallback = - new chip::Callback::Callback( - ReadSoftwareDiagnosticsCurrentHeapHighWatermark::OnAttributeResponse, this); - chip::Callback::Callback * - onReportSoftwareDiagnosticsClusterRevisionCallback = - new chip::Callback::Callback( - ReadSoftwareDiagnosticsClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportSwitchNumberOfPositionsCallback = - new chip::Callback::Callback( - ReadSwitchNumberOfPositions::OnAttributeResponse, this); - chip::Callback::Callback * onReportSwitchCurrentPositionCallback = - new chip::Callback::Callback( - ReadSwitchCurrentPosition::OnAttributeResponse, this); - chip::Callback::Callback * onReportSwitchMultiPressMaxCallback = - new chip::Callback::Callback( - ReadSwitchMultiPressMax::OnAttributeResponse, this); - chip::Callback::Callback * onReportSwitchFeatureMapCallback = - new chip::Callback::Callback( - ReadSwitchFeatureMap::OnAttributeResponse, this); - chip::Callback::Callback * onReportSwitchClusterRevisionCallback = - new chip::Callback::Callback( - ReadSwitchClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTvChannelClusterRevisionCallback = - new chip::Callback::Callback( - ReadTvChannelClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTargetNavigatorClusterRevisionCallback = - new chip::Callback::Callback( - ReadTargetNavigatorClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTemperatureMeasurementMeasuredValueCallback = - new chip::Callback::Callback( - ReadTemperatureMeasurementMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTemperatureMeasurementMinMeasuredValueCallback = - new chip::Callback::Callback( - ReadTemperatureMeasurementMinMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTemperatureMeasurementMaxMeasuredValueCallback = - new chip::Callback::Callback( - ReadTemperatureMeasurementMaxMeasuredValue::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTemperatureMeasurementToleranceCallback = - new chip::Callback::Callback( - ReadTemperatureMeasurementTolerance::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTemperatureMeasurementClusterRevisionCallback = - new chip::Callback::Callback( - ReadTemperatureMeasurementClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterBooleanCallback = - new chip::Callback::Callback( - ReadTestClusterBoolean::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterBitmap8Callback = - new chip::Callback::Callback( - ReadTestClusterBitmap8::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterBitmap16Callback = - new chip::Callback::Callback( - ReadTestClusterBitmap16::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterBitmap32Callback = - new chip::Callback::Callback( - ReadTestClusterBitmap32::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterBitmap64Callback = - new chip::Callback::Callback( - ReadTestClusterBitmap64::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt8uCallback = - new chip::Callback::Callback( - ReadTestClusterInt8u::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt16uCallback = - new chip::Callback::Callback( - ReadTestClusterInt16u::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt24uCallback = - new chip::Callback::Callback( - ReadTestClusterInt24u::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt32uCallback = - new chip::Callback::Callback( - ReadTestClusterInt32u::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt40uCallback = - new chip::Callback::Callback( - ReadTestClusterInt40u::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt48uCallback = - new chip::Callback::Callback( - ReadTestClusterInt48u::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt56uCallback = - new chip::Callback::Callback( - ReadTestClusterInt56u::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt64uCallback = - new chip::Callback::Callback( - ReadTestClusterInt64u::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt8sCallback = - new chip::Callback::Callback( - ReadTestClusterInt8s::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt16sCallback = - new chip::Callback::Callback( - ReadTestClusterInt16s::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt24sCallback = - new chip::Callback::Callback( - ReadTestClusterInt24s::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt32sCallback = - new chip::Callback::Callback( - ReadTestClusterInt32s::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt40sCallback = - new chip::Callback::Callback( - ReadTestClusterInt40s::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt48sCallback = - new chip::Callback::Callback( - ReadTestClusterInt48s::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt56sCallback = - new chip::Callback::Callback( - ReadTestClusterInt56s::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterInt64sCallback = - new chip::Callback::Callback( - ReadTestClusterInt64s::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterEnum8Callback = - new chip::Callback::Callback( - ReadTestClusterEnum8::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterEnum16Callback = - new chip::Callback::Callback( - ReadTestClusterEnum16::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterFloatSingleCallback = - new chip::Callback::Callback( - ReadTestClusterFloatSingle::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterFloatDoubleCallback = - new chip::Callback::Callback( - ReadTestClusterFloatDouble::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterOctetStringCallback = - new chip::Callback::Callback( - ReadTestClusterOctetString::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterLongOctetStringCallback = - new chip::Callback::Callback( - ReadTestClusterLongOctetString::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterCharStringCallback = - new chip::Callback::Callback( - ReadTestClusterCharString::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterLongCharStringCallback = - new chip::Callback::Callback( - ReadTestClusterLongCharString::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterEpochUsCallback = - new chip::Callback::Callback( - ReadTestClusterEpochUs::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterEpochSCallback = - new chip::Callback::Callback( - ReadTestClusterEpochS::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterVendorIdCallback = - new chip::Callback::Callback( - ReadTestClusterVendorId::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterEnumAttrCallback = - new chip::Callback::Callback( - ReadTestClusterEnumAttr::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterRangeRestrictedInt8uCallback = - new chip::Callback::Callback( - ReadTestClusterRangeRestrictedInt8u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterRangeRestrictedInt8sCallback = - new chip::Callback::Callback( - ReadTestClusterRangeRestrictedInt8s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterRangeRestrictedInt16uCallback = - new chip::Callback::Callback( - ReadTestClusterRangeRestrictedInt16u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterRangeRestrictedInt16sCallback = - new chip::Callback::Callback( - ReadTestClusterRangeRestrictedInt16s::OnAttributeResponse, this); - chip::Callback::Callback * onReportTestClusterUnsupportedCallback = - new chip::Callback::Callback( - ReadTestClusterUnsupported::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableBooleanCallback = - new chip::Callback::Callback( - ReadTestClusterNullableBoolean::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableBitmap8Callback = - new chip::Callback::Callback( - ReadTestClusterNullableBitmap8::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableBitmap16Callback = - new chip::Callback::Callback( - ReadTestClusterNullableBitmap16::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableBitmap32Callback = - new chip::Callback::Callback( - ReadTestClusterNullableBitmap32::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableBitmap64Callback = - new chip::Callback::Callback( - ReadTestClusterNullableBitmap64::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt8uCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt8u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt16uCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt16u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt24uCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt24u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt32uCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt32u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt40uCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt40u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt48uCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt48u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt56uCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt56u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt64uCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt64u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt8sCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt8s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt16sCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt16s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt24sCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt24s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt32sCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt32s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt40sCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt40s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt48sCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt48s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt56sCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt56s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableInt64sCallback = - new chip::Callback::Callback( - ReadTestClusterNullableInt64s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableEnum8Callback = - new chip::Callback::Callback( - ReadTestClusterNullableEnum8::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableEnum16Callback = - new chip::Callback::Callback( - ReadTestClusterNullableEnum16::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableFloatSingleCallback = - new chip::Callback::Callback( - ReadTestClusterNullableFloatSingle::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableFloatDoubleCallback = - new chip::Callback::Callback( - ReadTestClusterNullableFloatDouble::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableOctetStringCallback = - new chip::Callback::Callback( - ReadTestClusterNullableOctetString::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableCharStringCallback = - new chip::Callback::Callback( - ReadTestClusterNullableCharString::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableEnumAttrCallback = - new chip::Callback::Callback( - ReadTestClusterNullableEnumAttr::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableRangeRestrictedInt8uCallback = - new chip::Callback::Callback( - ReadTestClusterNullableRangeRestrictedInt8u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableRangeRestrictedInt8sCallback = - new chip::Callback::Callback( - ReadTestClusterNullableRangeRestrictedInt8s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableRangeRestrictedInt16uCallback = - new chip::Callback::Callback( - ReadTestClusterNullableRangeRestrictedInt16u::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterNullableRangeRestrictedInt16sCallback = - new chip::Callback::Callback( - ReadTestClusterNullableRangeRestrictedInt16s::OnAttributeResponse, this); - chip::Callback::Callback * - onReportTestClusterClusterRevisionCallback = - new chip::Callback::Callback( - ReadTestClusterClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatLocalTemperatureCallback = - new chip::Callback::Callback( - ReadThermostatLocalTemperature::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatAbsMinHeatSetpointLimitCallback = - new chip::Callback::Callback( - ReadThermostatAbsMinHeatSetpointLimit::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatAbsMaxHeatSetpointLimitCallback = - new chip::Callback::Callback( - ReadThermostatAbsMaxHeatSetpointLimit::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatAbsMinCoolSetpointLimitCallback = - new chip::Callback::Callback( - ReadThermostatAbsMinCoolSetpointLimit::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatAbsMaxCoolSetpointLimitCallback = - new chip::Callback::Callback( - ReadThermostatAbsMaxCoolSetpointLimit::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatOccupiedCoolingSetpointCallback = - new chip::Callback::Callback( - ReadThermostatOccupiedCoolingSetpoint::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatOccupiedHeatingSetpointCallback = - new chip::Callback::Callback( - ReadThermostatOccupiedHeatingSetpoint::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatMinHeatSetpointLimitCallback = - new chip::Callback::Callback( - ReadThermostatMinHeatSetpointLimit::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatMaxHeatSetpointLimitCallback = - new chip::Callback::Callback( - ReadThermostatMaxHeatSetpointLimit::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatMinCoolSetpointLimitCallback = - new chip::Callback::Callback( - ReadThermostatMinCoolSetpointLimit::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatMaxCoolSetpointLimitCallback = - new chip::Callback::Callback( - ReadThermostatMaxCoolSetpointLimit::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatMinSetpointDeadBandCallback = - new chip::Callback::Callback( - ReadThermostatMinSetpointDeadBand::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatControlSequenceOfOperationCallback = - new chip::Callback::Callback( - ReadThermostatControlSequenceOfOperation::OnAttributeResponse, this); - chip::Callback::Callback * onReportThermostatSystemModeCallback = - new chip::Callback::Callback( - ReadThermostatSystemMode::OnAttributeResponse, this); - chip::Callback::Callback * onReportThermostatStartOfWeekCallback = - new chip::Callback::Callback( - ReadThermostatStartOfWeek::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatNumberOfWeeklyTransitionsCallback = - new chip::Callback::Callback( - ReadThermostatNumberOfWeeklyTransitions::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatNumberOfDailyTransitionsCallback = - new chip::Callback::Callback( - ReadThermostatNumberOfDailyTransitions::OnAttributeResponse, this); - chip::Callback::Callback * onReportThermostatFeatureMapCallback = - new chip::Callback::Callback( - ReadThermostatFeatureMap::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatClusterRevisionCallback = - new chip::Callback::Callback( - ReadThermostatClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatUserInterfaceConfigurationTemperatureDisplayModeCallback = new chip::Callback::Callback( - ReadThermostatUserInterfaceConfigurationTemperatureDisplayMode::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatUserInterfaceConfigurationKeypadLockoutCallback = - new chip::Callback::Callback( - ReadThermostatUserInterfaceConfigurationKeypadLockout::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatUserInterfaceConfigurationScheduleProgrammingVisibilityCallback = new chip::Callback::Callback( - ReadThermostatUserInterfaceConfigurationScheduleProgrammingVisibility::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThermostatUserInterfaceConfigurationClusterRevisionCallback = - new chip::Callback::Callback( - ReadThermostatUserInterfaceConfigurationClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsChannelCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsChannel::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRoutingRoleCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRoutingRole::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsNetworkNameCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsNetworkName::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsPanIdCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsPanId::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsExtendedPanIdCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsExtendedPanId::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsMeshLocalPrefixCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsMeshLocalPrefix::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsOverrunCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsOverrunCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsPartitionIdCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsPartitionId::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsWeightingCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsWeighting::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsDataVersionCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsDataVersion::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsStableDataVersionCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsStableDataVersion::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsLeaderRouterIdCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsLeaderRouterId::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsDetachedRoleCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsDetachedRoleCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsChildRoleCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsChildRoleCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRouterRoleCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRouterRoleCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsLeaderRoleCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsLeaderRoleCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsAttachAttemptCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsAttachAttemptCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsPartitionIdChangeCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsPartitionIdChangeCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsBetterPartitionAttachAttemptCountCallback = new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsBetterPartitionAttachAttemptCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsParentChangeCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsParentChangeCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxTotalCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxTotalCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxUnicastCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxUnicastCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxBroadcastCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxBroadcastCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxAckRequestedCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxAckRequestedCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxAckedCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxAckedCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxNoAckRequestedCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxNoAckRequestedCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxDataCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxDataCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxDataPollCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxDataPollCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxBeaconCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxBeaconCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxBeaconRequestCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxBeaconRequestCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxOtherCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxOtherCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxRetryCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxRetryCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxErrCcaCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxErrCcaCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxErrAbortCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxErrAbortCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsTxErrBusyChannelCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsTxErrBusyChannelCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxTotalCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxTotalCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxUnicastCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxUnicastCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxBroadcastCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxBroadcastCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxDataCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxDataCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxDataPollCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxDataPollCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxBeaconCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxBeaconCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxBeaconRequestCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxBeaconRequestCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxOtherCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxOtherCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxAddressFilteredCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxAddressFilteredCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxDestAddrFilteredCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxDestAddrFilteredCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxDuplicatedCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxDuplicatedCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxErrNoFrameCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxErrNoFrameCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxErrUnknownNeighborCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxErrUnknownNeighborCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxErrInvalidSrcAddrCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxErrInvalidSrcAddrCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxErrSecCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxErrSecCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxErrFcsCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxErrFcsCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsRxErrOtherCountCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsRxErrOtherCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsActiveTimestampCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsActiveTimestamp::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsPendingTimestampCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsPendingTimestamp::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsDelayCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsDelay::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsChannelMaskCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsChannelMask::OnAttributeResponse, this); - chip::Callback::Callback * - onReportThreadNetworkDiagnosticsClusterRevisionCallback = - new chip::Callback::Callback( - ReadThreadNetworkDiagnosticsClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWakeOnLanWakeOnLanMacAddressCallback = - new chip::Callback::Callback( - ReadWakeOnLanWakeOnLanMacAddress::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWakeOnLanClusterRevisionCallback = - new chip::Callback::Callback( - ReadWakeOnLanClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsBssidCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsBssid::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsSecurityTypeCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsSecurityType::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsWiFiVersionCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsWiFiVersion::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsChannelNumberCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsChannelNumber::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsRssiCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsRssi::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsBeaconLostCountCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsBeaconLostCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsBeaconRxCountCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsBeaconRxCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsPacketMulticastRxCountCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsPacketMulticastRxCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsPacketMulticastTxCountCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsPacketMulticastTxCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsPacketUnicastRxCountCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsPacketUnicastRxCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsPacketUnicastTxCountCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsPacketUnicastTxCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsCurrentMaxRateCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsCurrentMaxRate::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsOverrunCountCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsOverrunCount::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWiFiNetworkDiagnosticsClusterRevisionCallback = - new chip::Callback::Callback( - ReadWiFiNetworkDiagnosticsClusterRevision::OnAttributeResponse, this); - chip::Callback::Callback * onReportWindowCoveringTypeCallback = - new chip::Callback::Callback( - ReadWindowCoveringType::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringCurrentPositionLiftCallback = - new chip::Callback::Callback( - ReadWindowCoveringCurrentPositionLift::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringCurrentPositionTiltCallback = - new chip::Callback::Callback( - ReadWindowCoveringCurrentPositionTilt::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringConfigStatusCallback = - new chip::Callback::Callback( - ReadWindowCoveringConfigStatus::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringCurrentPositionLiftPercentageCallback = - new chip::Callback::Callback( - ReadWindowCoveringCurrentPositionLiftPercentage::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringCurrentPositionTiltPercentageCallback = - new chip::Callback::Callback( - ReadWindowCoveringCurrentPositionTiltPercentage::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringOperationalStatusCallback = - new chip::Callback::Callback( - ReadWindowCoveringOperationalStatus::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringTargetPositionLiftPercent100thsCallback = - new chip::Callback::Callback( - ReadWindowCoveringTargetPositionLiftPercent100ths::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringTargetPositionTiltPercent100thsCallback = - new chip::Callback::Callback( - ReadWindowCoveringTargetPositionTiltPercent100ths::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringEndProductTypeCallback = - new chip::Callback::Callback( - ReadWindowCoveringEndProductType::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringCurrentPositionLiftPercent100thsCallback = - new chip::Callback::Callback( - ReadWindowCoveringCurrentPositionLiftPercent100ths::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringCurrentPositionTiltPercent100thsCallback = - new chip::Callback::Callback( - ReadWindowCoveringCurrentPositionTiltPercent100ths::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringInstalledOpenLimitLiftCallback = - new chip::Callback::Callback( - ReadWindowCoveringInstalledOpenLimitLift::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringInstalledClosedLimitLiftCallback = - new chip::Callback::Callback( - ReadWindowCoveringInstalledClosedLimitLift::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringInstalledOpenLimitTiltCallback = - new chip::Callback::Callback( - ReadWindowCoveringInstalledOpenLimitTilt::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringInstalledClosedLimitTiltCallback = - new chip::Callback::Callback( - ReadWindowCoveringInstalledClosedLimitTilt::OnAttributeResponse, this); - chip::Callback::Callback * onReportWindowCoveringModeCallback = - new chip::Callback::Callback( - ReadWindowCoveringMode::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringSafetyStatusCallback = - new chip::Callback::Callback( - ReadWindowCoveringSafetyStatus::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringFeatureMapCallback = - new chip::Callback::Callback( - ReadWindowCoveringFeatureMap::OnAttributeResponse, this); - chip::Callback::Callback * - onReportWindowCoveringClusterRevisionCallback = - new chip::Callback::Callback( - ReadWindowCoveringClusterRevision::OnAttributeResponse, this); -}; - -void registerCommandsReporting(Commands & commands) -{ - const char * clusterName = "Reporting"; - - commands_list clusterCommands = { - make_unique(), - }; - - commands.Register(clusterName, clusterCommands); -} diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 163a654439e57d..34d7ab9a0bf208 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -60,6 +60,11 @@ class TestList : public Command printf("Test_TC_CC_9_1\n"); printf("Test_TC_CC_9_2\n"); printf("Test_TC_CC_9_3\n"); + printf("Test_TC_DD_1_5\n"); + printf("Test_TC_DD_1_6\n"); + printf("Test_TC_DD_1_7\n"); + printf("Test_TC_DD_1_8\n"); + printf("Test_TC_DD_1_9\n"); printf("Test_TC_DM_1_1\n"); printf("Test_TC_DM_3_1\n"); printf("Test_TC_DM_2_2\n"); @@ -128,8 +133,9 @@ class TestList : public Command printf("TV_WakeOnLanCluster\n"); printf("TV_ApplicationBasicCluster\n"); printf("TV_MediaPlaybackCluster\n"); - printf("TV_TvChannelCluster\n"); + printf("TV_ChannelCluster\n"); printf("TV_LowPowerCluster\n"); + printf("TV_ContentLauncherCluster\n"); printf("TV_MediaInputCluster\n"); printf("TestCluster\n"); printf("TestClusterComplexTypes\n"); @@ -141,6 +147,7 @@ class TestList : public Command printf("TestBasicInformation\n"); printf("TestIdentifyCluster\n"); printf("TestGroupsCluster\n"); + printf("TestGroupKeyManagementCluster\n"); printf("TestOperationalCredentialsCluster\n"); printf("TestModeSelectCluster\n"); printf("TestGroupMessaging\n"); @@ -300,7 +307,6 @@ class Test_TC_BI_1_1 : public TestCommand void OnSuccessResponse_2(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -588,7 +594,6 @@ class Test_TC_BI_2_1 : public TestCommand void OnSuccessResponse_2(bool outOfService) { VerifyOrReturn(CheckConstraintType("outOfService", "", "bool")); - NextTest(); } @@ -646,7 +651,6 @@ class Test_TC_BI_2_1 : public TestCommand void OnSuccessResponse_5(bool presentValue) { VerifyOrReturn(CheckConstraintType("presentValue", "", "bool")); - NextTest(); } @@ -725,7 +729,6 @@ class Test_TC_BI_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("statusFlags", "", "map8")); VerifyOrReturn(CheckConstraintMaxValue("statusFlags", statusFlags, 15)); - NextTest(); } @@ -1249,7 +1252,6 @@ class Test_TC_BOOL_1_1 : public TestCommand void OnSuccessResponse_2(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -1443,7 +1445,6 @@ class Test_TC_BOOL_2_1 : public TestCommand void OnSuccessResponse_2(bool stateValue) { VerifyOrReturn(CheckConstraintType("stateValue", "", "bool")); - NextTest(); } @@ -1589,7 +1590,6 @@ class Test_TC_CC_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -3632,7 +3632,6 @@ class Test_TC_CC_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("currentHue", "", "uint8")); VerifyOrReturn(CheckConstraintMaxValue("currentHue", currentHue, 254)); - NextTest(); } @@ -3715,7 +3714,6 @@ class Test_TC_CC_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("currentSaturation", "", "uint8")); VerifyOrReturn(CheckConstraintMaxValue("currentSaturation", currentSaturation, 254)); - NextTest(); } @@ -3797,8 +3795,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_10(uint16_t currentX) { VerifyOrReturn(CheckConstraintType("currentX", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentX", currentX, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("currentX", currentX, 65279U)); NextTest(); } @@ -3880,8 +3877,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_14(uint16_t currentY) { VerifyOrReturn(CheckConstraintType("currentY", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentY", currentY, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("currentY", currentY, 65279U)); NextTest(); } @@ -3943,8 +3939,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_17(uint16_t colorTemperature) { VerifyOrReturn(CheckConstraintType("colorTemperature", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", colorTemperature, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("colorTemperature", colorTemperature, 65279U)); NextTest(); } @@ -3965,7 +3960,6 @@ class Test_TC_CC_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("colorMode", "", "enum8")); VerifyOrReturn(CheckConstraintMaxValue("colorMode", colorMode, 2)); - NextTest(); } @@ -4005,7 +3999,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_20(uint8_t colorControlOptions) { VerifyOrReturn(CheckConstraintType("colorControlOptions", "", "map8")); - NextTest(); } @@ -4083,7 +4076,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_24(uint16_t enhancedCurrentHue) { VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "", "uint16")); - NextTest(); } @@ -4145,7 +4137,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_27(uint8_t enhancedColorMode) { VerifyOrReturn(CheckConstraintType("enhancedColorMode", "", "enum8")); - NextTest(); } @@ -4185,7 +4176,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_29(uint8_t colorLoopActive) { VerifyOrReturn(CheckConstraintType("colorLoopActive", "", "uint8")); - NextTest(); } @@ -4267,7 +4257,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_33(uint8_t colorLoopDirection) { VerifyOrReturn(CheckConstraintType("colorLoopDirection", "", "uint8")); - NextTest(); } @@ -4349,7 +4338,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_37(uint16_t colorLoopTime) { VerifyOrReturn(CheckConstraintType("colorLoopTime", "", "uint16")); - NextTest(); } @@ -4433,7 +4421,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_41(uint16_t colorLoopStartEnhancedHue) { VerifyOrReturn(CheckConstraintType("colorLoopStartEnhancedHue", "", "uint16")); - NextTest(); } @@ -4519,7 +4506,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_45(uint16_t colorLoopStoredEnhancedHue) { VerifyOrReturn(CheckConstraintType("colorLoopStoredEnhancedHue", "", "uint16")); - NextTest(); } @@ -4603,8 +4589,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_49(uint16_t colorCapabilities) { VerifyOrReturn(CheckConstraintType("colorCapabilities", "", "map16")); - VerifyOrReturn(CheckConstraintMaxValue("colorCapabilities", colorCapabilities, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("colorCapabilities", colorCapabilities, 65279U)); NextTest(); } @@ -4686,8 +4671,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_53(uint16_t colorTempPhysicalMin) { VerifyOrReturn(CheckConstraintType("colorTempPhysicalMin", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMin", colorTempPhysicalMin, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMin", colorTempPhysicalMin, 65279U)); NextTest(); } @@ -4769,8 +4753,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_57(uint16_t colorTempPhysicalMax) { VerifyOrReturn(CheckConstraintType("colorTempPhysicalMax", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMax", colorTempPhysicalMax, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("colorTempPhysicalMax", colorTempPhysicalMax, 65279U)); NextTest(); } @@ -4833,7 +4816,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_60(uint16_t coupleColorTempToLevelMinMireds) { VerifyOrReturn(CheckConstraintType("coupleColorTempToLevelMinMireds", "", "uint16")); - NextTest(); } @@ -4898,8 +4880,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_63(uint16_t startUpColorTemperatureMireds) { VerifyOrReturn(CheckConstraintType("startUpColorTemperatureMireds", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("startUpColorTemperatureMireds", startUpColorTemperatureMireds, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("startUpColorTemperatureMireds", startUpColorTemperatureMireds, 65279U)); NextTest(); } @@ -4979,8 +4960,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_67(uint16_t remainingTime) { VerifyOrReturn(CheckConstraintType("remainingTime", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("remainingTime", remainingTime, 254)); - + VerifyOrReturn(CheckConstraintMaxValue("remainingTime", remainingTime, 254U)); NextTest(); } @@ -5043,7 +5023,6 @@ class Test_TC_CC_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("driftCompensation", "", "enum8")); VerifyOrReturn(CheckConstraintMaxValue("driftCompensation", driftCompensation, 4)); - NextTest(); } @@ -5106,7 +5085,6 @@ class Test_TC_CC_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("compensationText", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("compensationText", compensationText.size(), 254)); - NextTest(); } @@ -5127,7 +5105,6 @@ class Test_TC_CC_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("numberOfPrimaries", "", "uint8")); VerifyOrReturn(CheckConstraintMaxValue("numberOfPrimaries", numberOfPrimaries, 6)); - NextTest(); } @@ -5189,8 +5166,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_77(uint16_t primary1X) { VerifyOrReturn(CheckConstraintType("primary1X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary1X", primary1X, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary1X", primary1X, 65279U)); NextTest(); } @@ -5252,8 +5228,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_80(uint16_t primary1Y) { VerifyOrReturn(CheckConstraintType("primary1Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary1Y", primary1Y, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary1Y", primary1Y, 65279U)); NextTest(); } @@ -5315,7 +5290,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_83(uint8_t primary1Intensity) { VerifyOrReturn(CheckConstraintType("primary1Intensity", "", "uint8")); - NextTest(); } @@ -5335,8 +5309,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_84(uint16_t primary2X) { VerifyOrReturn(CheckConstraintType("primary2X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary2X", primary2X, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary2X", primary2X, 65279U)); NextTest(); } @@ -5398,8 +5371,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_87(uint16_t primary2Y) { VerifyOrReturn(CheckConstraintType("primary2Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary2Y", primary2Y, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary2Y", primary2Y, 65279U)); NextTest(); } @@ -5461,7 +5433,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_90(uint8_t primary2Intensity) { VerifyOrReturn(CheckConstraintType("primary2Intensity", "", "uint8")); - NextTest(); } @@ -5481,8 +5452,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_91(uint16_t primary3X) { VerifyOrReturn(CheckConstraintType("primary3X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary3X", primary3X, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary3X", primary3X, 65279U)); NextTest(); } @@ -5544,8 +5514,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_94(uint16_t primary3Y) { VerifyOrReturn(CheckConstraintType("primary3Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary3Y", primary3Y, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary3Y", primary3Y, 65279U)); NextTest(); } @@ -5607,7 +5576,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_97(uint8_t primary3Intensity) { VerifyOrReturn(CheckConstraintType("primary3Intensity", "", "uint8")); - NextTest(); } @@ -5627,8 +5595,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_98(uint16_t primary4X) { VerifyOrReturn(CheckConstraintType("primary4X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary4X", primary4X, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary4X", primary4X, 65279U)); NextTest(); } @@ -5690,8 +5657,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_101(uint16_t primary4Y) { VerifyOrReturn(CheckConstraintType("primary4Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary4Y", primary4Y, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary4Y", primary4Y, 65279U)); NextTest(); } @@ -5753,7 +5719,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_104(uint8_t primary4Intensity) { VerifyOrReturn(CheckConstraintType("primary4Intensity", "", "uint8")); - NextTest(); } @@ -5773,8 +5738,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_105(uint16_t primary5X) { VerifyOrReturn(CheckConstraintType("primary5X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary5X", primary5X, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary5X", primary5X, 65279U)); NextTest(); } @@ -5836,8 +5800,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_108(uint16_t primary5Y) { VerifyOrReturn(CheckConstraintType("primary5Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary5Y", primary5Y, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary5Y", primary5Y, 65279U)); NextTest(); } @@ -5899,7 +5862,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_111(uint8_t primary5Intensity) { VerifyOrReturn(CheckConstraintType("primary5Intensity", "", "uint8")); - NextTest(); } @@ -5919,8 +5881,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_112(uint16_t primary6X) { VerifyOrReturn(CheckConstraintType("primary6X", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary6X", primary6X, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary6X", primary6X, 65279U)); NextTest(); } @@ -5982,8 +5943,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_115(uint16_t primary6Y) { VerifyOrReturn(CheckConstraintType("primary6Y", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("primary6Y", primary6Y, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("primary6Y", primary6Y, 65279U)); NextTest(); } @@ -6045,7 +6005,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_118(uint8_t primary6Intensity) { VerifyOrReturn(CheckConstraintType("primary6Intensity", "", "uint8")); - NextTest(); } @@ -6065,8 +6024,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_119(uint16_t whitePointX) { VerifyOrReturn(CheckConstraintType("whitePointX", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("whitePointX", whitePointX, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("whitePointX", whitePointX, 65279U)); NextTest(); } @@ -6124,8 +6082,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_122(uint16_t whitePointY) { VerifyOrReturn(CheckConstraintType("whitePointY", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("whitePointY", whitePointY, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("whitePointY", whitePointY, 65279U)); NextTest(); } @@ -6183,8 +6140,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_125(uint16_t colorPointRX) { VerifyOrReturn(CheckConstraintType("colorPointRX", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointRX", colorPointRX, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("colorPointRX", colorPointRX, 65279U)); NextTest(); } @@ -6242,8 +6198,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_128(uint16_t colorPointRY) { VerifyOrReturn(CheckConstraintType("colorPointRY", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointRY", colorPointRY, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("colorPointRY", colorPointRY, 65279U)); NextTest(); } @@ -6301,7 +6256,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_131(uint8_t colorPointRIntensity) { VerifyOrReturn(CheckConstraintType("colorPointRIntensity", "", "uint8")); - NextTest(); } @@ -6321,8 +6275,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_132(uint16_t colorPointGX) { VerifyOrReturn(CheckConstraintType("colorPointGX", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointGX", colorPointGX, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("colorPointGX", colorPointGX, 65279U)); NextTest(); } @@ -6380,8 +6333,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_135(uint16_t colorPointGY) { VerifyOrReturn(CheckConstraintType("colorPointGY", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointGY", colorPointGY, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("colorPointGY", colorPointGY, 65279U)); NextTest(); } @@ -6439,7 +6391,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_138(uint8_t colorPointGIntensity) { VerifyOrReturn(CheckConstraintType("colorPointGIntensity", "", "uint8")); - NextTest(); } @@ -6459,8 +6410,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_139(uint16_t colorPointBX) { VerifyOrReturn(CheckConstraintType("colorPointBX", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointBX", colorPointBX, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("colorPointBX", colorPointBX, 65279U)); NextTest(); } @@ -6518,8 +6468,7 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_142(uint16_t colorPointBY) { VerifyOrReturn(CheckConstraintType("colorPointBY", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("colorPointBY", colorPointBY, 65279)); - + VerifyOrReturn(CheckConstraintMaxValue("colorPointBY", colorPointBY, 65279U)); NextTest(); } @@ -6577,7 +6526,6 @@ class Test_TC_CC_2_1 : public TestCommand void OnSuccessResponse_145(uint8_t colorPointBIntensity) { VerifyOrReturn(CheckConstraintType("colorPointBIntensity", "", "uint8")); - NextTest(); } }; @@ -10923,8 +10871,8 @@ class Test_TC_CC_8_1 : public TestCommand err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Color Loop Set Command - Set all Attributs\n"); - err = TestColorLoopSetCommandSetAllAttributs_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Color Loop Set Command - Set all Attributes\n"); + err = TestColorLoopSetCommandSetAllAttributes_3(); break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Check ColorLoopDirection Value\n"); @@ -11144,7 +11092,7 @@ class Test_TC_CC_8_1 : public TestCommand NextTest(); } - CHIP_ERROR TestColorLoopSetCommandSetAllAttributs_3() + CHIP_ERROR TestColorLoopSetCommandSetAllAttributes_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type; @@ -13755,6 +13703,361 @@ class Test_TC_CC_9_3 : public TestCommand void OnSuccessResponse_14() { NextTest(); } }; +class Test_TC_DD_1_5 : public TestCommand +{ +public: + Test_TC_DD_1_5() : TestCommand("Test_TC_DD_1_5"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_1_5\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_1_5\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1\n"); + err = TestStep1_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + // + // Tests methods + // + + CHIP_ERROR TestStep1_0() + { + SetIdentity(kIdentityAlpha); + return Log("Verify that the onboarding payload for NFC tags SHALL use NDEF URI Record Type Definition as defined by NFC " + "Forum in URI Record Type Definition RTD URI"); + } +}; + +class Test_TC_DD_1_6 : public TestCommand +{ +public: + Test_TC_DD_1_6() : TestCommand("Test_TC_DD_1_6"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_1_6\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_1_6\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1\n"); + err = TestStep1_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1 verification\n"); + err = TestStep1Verification_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2 verificaiton\n"); + err = TestStep2Verificaiton_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + // + // Tests methods + // + + CHIP_ERROR TestStep1_0() + { + SetIdentity(kIdentityAlpha); + return Log("Scan the DUTs QR code using a QR code reader"); + } + + CHIP_ERROR TestStep1Verification_1() + { + SetIdentity(kIdentityAlpha); + return Log( + "Verify the QR code gets scanned successfully and the QR code must be of sufficient size and contrast respective to " + "surface material as to be readable with standard readers such as smartphones in normal lighting conditions"); + } + + CHIP_ERROR TestStep2Verificaiton_2() + { + SetIdentity(kIdentityAlpha); + return Log("Verify QR code version is 1 or higher"); + } +}; + +class Test_TC_DD_1_7 : public TestCommand +{ +public: + Test_TC_DD_1_7() : TestCommand("Test_TC_DD_1_7"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_1_7\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_1_7\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Precondition\n"); + err = TestPrecondition_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1\n"); + err = TestStep1_1(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + // + // Tests methods + // + + CHIP_ERROR TestPrecondition_0() + { + SetIdentity(kIdentityAlpha); + return Log("Verify manual pairing code is printed on the device or in additional provided materials"); + } + + CHIP_ERROR TestStep1_1() + { + SetIdentity(kIdentityAlpha); + return Log("Verify that the Manual Pairing Code should be printed using a minimum font size of 6 points typically " + "producing a typeface height of 2.1 mm"); + } +}; + +class Test_TC_DD_1_8 : public TestCommand +{ +public: + Test_TC_DD_1_8() : TestCommand("Test_TC_DD_1_8"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_1_8\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_1_8\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1\n"); + err = TestStep1_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1 verification\n"); + err = TestStep1Verification_1(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + // + // Tests methods + // + + CHIP_ERROR TestStep1_0() + { + SetIdentity(kIdentityAlpha); + return Log("Scan the device QR code using DUT"); + } + + CHIP_ERROR TestStep1Verification_1() + { + SetIdentity(kIdentityAlpha); + return Log("Verify the DUT is able to scan and parse the QR code successfully to onboard the device onto the CHIP network"); + } +}; + +class Test_TC_DD_1_9 : public TestCommand +{ +public: + Test_TC_DD_1_9() : TestCommand("Test_TC_DD_1_9"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DD_1_9\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DD_1_9\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Precondition\n"); + err = TestPrecondition_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1\n"); + err = TestStep1_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 1 verification\n"); + err = TestStep1Verification_2(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; + + // + // Tests methods + // + + CHIP_ERROR TestPrecondition_0() + { + SetIdentity(kIdentityAlpha); + return Log("Verify that the manual pairing code is printed on the device or in additional provided materials"); + } + + CHIP_ERROR TestStep1_1() + { + SetIdentity(kIdentityAlpha); + return Log("Provide the 11 digit or 21 digit pairing code from the Device in text speech or any format supported by DUT"); + } + + CHIP_ERROR TestStep1Verification_2() + { + SetIdentity(kIdentityAlpha); + return Log( + "Verify that the manual pairing code can be provided to DUT and parsed to onboard the device onto the CHIP network"); + } +}; + class Test_TC_DM_1_1 : public TestCommand { public: @@ -14094,7 +14397,6 @@ class Test_TC_DM_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t interactionModelVersion) { VerifyOrReturn(CheckConstraintType("interactionModelVersion", "", "uint16")); - NextTest(); } @@ -14115,7 +14417,6 @@ class Test_TC_DM_1_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("vendorName", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("vendorName", vendorName.size(), 32)); - NextTest(); } @@ -14135,7 +14436,6 @@ class Test_TC_DM_1_1 : public TestCommand void OnSuccessResponse_3(uint16_t vendorID) { VerifyOrReturn(CheckConstraintType("vendorID", "", "uint16")); - NextTest(); } @@ -14156,7 +14456,6 @@ class Test_TC_DM_1_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("productName", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("productName", productName.size(), 32)); - NextTest(); } @@ -14176,7 +14475,6 @@ class Test_TC_DM_1_1 : public TestCommand void OnSuccessResponse_5(uint16_t productID) { VerifyOrReturn(CheckConstraintType("productID", "", "uint16")); - NextTest(); } @@ -14197,7 +14495,6 @@ class Test_TC_DM_1_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("nodeLabel", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("nodeLabel", nodeLabel.size(), 32)); - NextTest(); } @@ -14219,7 +14516,6 @@ class Test_TC_DM_1_1 : public TestCommand VerifyOrReturn(CheckConstraintType("location", "", "string")); VerifyOrReturn(CheckConstraintFormat("location", "", "ISO 3166-1 alpha-2")); VerifyOrReturn(CheckConstraintMaxLength("location", location.size(), 2)); - NextTest(); } @@ -14239,7 +14535,6 @@ class Test_TC_DM_1_1 : public TestCommand void OnSuccessResponse_8(uint16_t hardwareVersion) { VerifyOrReturn(CheckConstraintType("hardwareVersion", "", "uint16")); - NextTest(); } @@ -14261,7 +14556,6 @@ class Test_TC_DM_1_1 : public TestCommand VerifyOrReturn(CheckConstraintType("hardwareVersionString", "", "string")); VerifyOrReturn(CheckConstraintMinLength("hardwareVersionString", hardwareVersionString.size(), 1)); VerifyOrReturn(CheckConstraintMaxLength("hardwareVersionString", hardwareVersionString.size(), 64)); - NextTest(); } @@ -14281,7 +14575,6 @@ class Test_TC_DM_1_1 : public TestCommand void OnSuccessResponse_10(uint32_t softwareVersion) { VerifyOrReturn(CheckConstraintType("softwareVersion", "", "uint32")); - NextTest(); } @@ -14304,7 +14597,6 @@ class Test_TC_DM_1_1 : public TestCommand VerifyOrReturn(CheckConstraintFormat("softwareVersionString", "", "ASCII")); VerifyOrReturn(CheckConstraintMinLength("softwareVersionString", softwareVersionString.size(), 1)); VerifyOrReturn(CheckConstraintMaxLength("softwareVersionString", softwareVersionString.size(), 64)); - NextTest(); } @@ -14330,7 +14622,6 @@ class Test_TC_DM_1_1 : public TestCommand VerifyOrReturn(CheckConstraintFormat("manufacturingDate", "", "ISO 8601")); VerifyOrReturn(CheckConstraintMinLength("manufacturingDate", manufacturingDate.size(), 8)); VerifyOrReturn(CheckConstraintMaxLength("manufacturingDate", manufacturingDate.size(), 16)); - NextTest(); } @@ -14354,7 +14645,6 @@ class Test_TC_DM_1_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("partNumber", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("partNumber", partNumber.size(), 32)); - NextTest(); } @@ -14379,7 +14669,6 @@ class Test_TC_DM_1_1 : public TestCommand VerifyOrReturn(CheckConstraintType("productURL", "", "string")); VerifyOrReturn(CheckConstraintFormat("productURL", "", "RFC3986")); VerifyOrReturn(CheckConstraintMaxLength("productURL", productURL.size(), 256)); - NextTest(); } @@ -14403,7 +14692,6 @@ class Test_TC_DM_1_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("productLabel", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("productLabel", productLabel.size(), 64)); - NextTest(); } @@ -14427,7 +14715,6 @@ class Test_TC_DM_1_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("serialNumber", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("serialNumber", serialNumber.size(), 32)); - NextTest(); } @@ -14450,7 +14737,6 @@ class Test_TC_DM_1_1 : public TestCommand void OnSuccessResponse_17(bool localConfigDisabled) { VerifyOrReturn(CheckConstraintType("localConfigDisabled", "", "boolean")); - NextTest(); } @@ -14473,7 +14759,6 @@ class Test_TC_DM_1_1 : public TestCommand void OnSuccessResponse_18(bool reachable) { VerifyOrReturn(CheckConstraintType("reachable", "", "boolean")); - NextTest(); } @@ -14497,7 +14782,6 @@ class Test_TC_DM_1_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("uniqueID", "", "string")); VerifyOrReturn(CheckConstraintMaxLength("uniqueID", uniqueID.size(), 32)); - NextTest(); } }; @@ -14759,7 +15043,6 @@ class Test_TC_DM_2_2 : public TestCommand void OnSuccessResponse_4(const chip::app::DataModel::DecodableList & trustedRootCertificates) { VerifyOrReturn(CheckConstraintType("trustedRootCertificates", "", "list")); - NextTest(); } }; @@ -14913,7 +15196,6 @@ class Test_TC_EMR_1_1 : public TestCommand void OnSuccessResponse_2(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -15061,7 +15343,6 @@ class Test_TC_FLW_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -15267,7 +15548,6 @@ class Test_TC_FLW_2_1 : public TestCommand void OnSuccessResponse_1(int16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); } @@ -15287,7 +15567,6 @@ class Test_TC_FLW_2_1 : public TestCommand void OnSuccessResponse_2(int16_t minMeasuredValue) { VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); - NextTest(); } @@ -15307,7 +15586,6 @@ class Test_TC_FLW_2_1 : public TestCommand void OnSuccessResponse_3(int16_t maxMeasuredValue) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "uint16")); - NextTest(); } @@ -15371,7 +15649,6 @@ class Test_TC_FLW_2_1 : public TestCommand void OnSuccessResponse_6(int16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); } @@ -15391,7 +15668,6 @@ class Test_TC_FLW_2_1 : public TestCommand void OnSuccessResponse_7(int16_t minMeasuredValue) { VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); - NextTest(); } @@ -15411,7 +15687,6 @@ class Test_TC_FLW_2_1 : public TestCommand void OnSuccessResponse_8(int16_t maxMeasuredValue) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "uint16")); - NextTest(); } }; @@ -15517,7 +15792,6 @@ class Test_TC_FLW_2_2 : public TestCommand void OnSuccessResponse_1(int16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); } @@ -15537,7 +15811,6 @@ class Test_TC_FLW_2_2 : public TestCommand void OnSuccessResponse_2(int16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); } }; @@ -15691,7 +15964,6 @@ class Test_TC_ILL_1_1 : public TestCommand void OnSuccessResponse_2(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -15839,7 +16111,6 @@ class Test_TC_LVL_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -17370,7 +17641,6 @@ class Test_TC_MC_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -18253,7 +18523,6 @@ class Test_TC_OCC_1_1 : public TestCommand void OnSuccessResponse_2(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -18475,7 +18744,6 @@ class Test_TC_OCC_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("occupancy", "", "map8")); VerifyOrReturn(CheckConstraintMaxValue("occupancy", occupancy, 1)); - NextTest(); } @@ -18539,7 +18807,6 @@ class Test_TC_OCC_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("occupancySensorType", "", "enum8")); VerifyOrReturn(CheckConstraintMaxValue("occupancySensorType", occupancySensorType, 3)); - NextTest(); } @@ -18606,7 +18873,6 @@ class Test_TC_OCC_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("occupancySensorTypeBitmap", "", "map8")); VerifyOrReturn(CheckConstraintMinValue("occupancySensorTypeBitmap", occupancySensorTypeBitmap, 1)); VerifyOrReturn(CheckConstraintMaxValue("occupancySensorTypeBitmap", occupancySensorTypeBitmap, 7)); - NextTest(); } @@ -18756,7 +19022,6 @@ class Test_TC_OCC_2_2 : public TestCommand void OnSuccessResponse_1(uint8_t occupancy) { VerifyOrReturn(CheckConstraintType("occupancy", "", "map8")); - NextTest(); } @@ -18776,7 +19041,6 @@ class Test_TC_OCC_2_2 : public TestCommand void OnSuccessResponse_2(uint8_t occupancy) { VerifyOrReturn(CheckConstraintType("occupancy", "", "map8")); - NextTest(); } }; @@ -18991,7 +19255,6 @@ class Test_TC_OO_1_1 : public TestCommand void OnSuccessResponse_3(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -19073,7 +19336,6 @@ class Test_TC_OO_1_1 : public TestCommand void OnSuccessResponse_7(uint32_t featureMap) { VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - NextTest(); } @@ -21635,7 +21897,6 @@ class Test_TC_PRS_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -21853,7 +22114,6 @@ class Test_TC_PRS_2_1 : public TestCommand void OnSuccessResponse_1(int16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); - NextTest(); } @@ -21916,7 +22176,6 @@ class Test_TC_PRS_2_1 : public TestCommand void OnSuccessResponse_4(int16_t minMeasuredValue) { VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); - NextTest(); } @@ -21981,7 +22240,6 @@ class Test_TC_PRS_2_1 : public TestCommand void OnSuccessResponse_7(int16_t maxMeasuredValue) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); - NextTest(); } @@ -22144,7 +22402,6 @@ class Test_TC_PCC_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -22188,7 +22445,6 @@ class Test_TC_PCC_1_1 : public TestCommand void OnSuccessResponse_3(uint32_t featureMap) { VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - NextTest(); } }; @@ -22379,7 +22635,6 @@ class Test_TC_PCC_2_1 : public TestCommand void OnSuccessResponse_1(int16_t maxPressure) { VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); - NextTest(); } @@ -22400,7 +22655,6 @@ class Test_TC_PCC_2_1 : public TestCommand void OnSuccessResponse_2(uint8_t effectiveOperationMode) { VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); - NextTest(); } @@ -22421,7 +22675,6 @@ class Test_TC_PCC_2_1 : public TestCommand void OnSuccessResponse_3(uint8_t effectiveControlMode) { VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - NextTest(); } @@ -22442,7 +22695,6 @@ class Test_TC_PCC_2_1 : public TestCommand void OnSuccessResponse_4(int16_t capacity) { VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - NextTest(); } @@ -22463,7 +22715,6 @@ class Test_TC_PCC_2_1 : public TestCommand void OnSuccessResponse_5(int16_t maxPressure) { VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); - NextTest(); } @@ -22484,7 +22735,6 @@ class Test_TC_PCC_2_1 : public TestCommand void OnSuccessResponse_6(uint8_t effectiveOperationMode) { VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); - NextTest(); } @@ -22505,7 +22755,6 @@ class Test_TC_PCC_2_1 : public TestCommand void OnSuccessResponse_7(uint8_t effectiveControlMode) { VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - NextTest(); } @@ -22526,7 +22775,6 @@ class Test_TC_PCC_2_1 : public TestCommand void OnSuccessResponse_8(int16_t capacity) { VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - NextTest(); } }; @@ -22902,7 +23150,6 @@ class Test_TC_RH_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -23032,7 +23279,6 @@ class Test_TC_RH_2_1 : public TestCommand void OnSuccessResponse_1(uint16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); } @@ -23053,8 +23299,7 @@ class Test_TC_RH_2_1 : public TestCommand void OnSuccessResponse_2(uint16_t minMeasuredValue) { VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", minMeasuredValue, 9999)); - + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", minMeasuredValue, 9999U)); NextTest(); } }; @@ -23161,7 +23406,6 @@ class Test_TC_RH_2_2 : public TestCommand void OnSuccessResponse_1(uint16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); } @@ -23182,7 +23426,6 @@ class Test_TC_RH_2_2 : public TestCommand void OnSuccessResponse_2(uint16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); } }; @@ -23336,7 +23579,6 @@ class Test_TC_TM_1_1 : public TestCommand void OnSuccessResponse_2(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -23473,7 +23715,6 @@ class Test_TC_TM_2_1 : public TestCommand void OnSuccessResponse_1(int16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); - NextTest(); } }; @@ -23580,7 +23821,6 @@ class Test_TC_TM_2_2 : public TestCommand void OnSuccessResponse_1(int16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); } @@ -23601,7 +23841,6 @@ class Test_TC_TM_2_2 : public TestCommand void OnSuccessResponse_2(int16_t measuredValue) { VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); - NextTest(); } }; @@ -23719,7 +23958,6 @@ class Test_TC_TSTAT_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -23761,7 +23999,6 @@ class Test_TC_TSTAT_1_1 : public TestCommand void OnSuccessResponse_3(uint32_t featureMap) { VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); - NextTest(); } }; @@ -24677,7 +24914,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand void OnSuccessResponse_1(int16_t localTemperature) { VerifyOrReturn(CheckConstraintType("localTemperature", "", "int16")); - NextTest(); } @@ -24719,7 +24955,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("absMinHeatSetpointLimit", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 700)); VerifyOrReturn(CheckConstraintMaxValue("absMinHeatSetpointLimit", absMinHeatSetpointLimit, 3000)); - NextTest(); } @@ -24803,7 +25038,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("absMaxHeatSetpointLimit", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 700)); VerifyOrReturn(CheckConstraintMaxValue("absMaxHeatSetpointLimit", absMaxHeatSetpointLimit, 3000)); - NextTest(); } @@ -24887,7 +25121,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("absMinCoolSetpointLimit", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 1600)); VerifyOrReturn(CheckConstraintMaxValue("absMinCoolSetpointLimit", absMinCoolSetpointLimit, 3200)); - NextTest(); } @@ -24971,7 +25204,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("absMaxCoolSetpointLimit", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 1600)); VerifyOrReturn(CheckConstraintMaxValue("absMaxCoolSetpointLimit", absMaxCoolSetpointLimit, 3200)); - NextTest(); } @@ -25055,7 +25287,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("occupiedCoolingSetpoint", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 1600)); VerifyOrReturn(CheckConstraintMaxValue("occupiedCoolingSetpoint", occupiedCoolingSetpoint, 2600)); - NextTest(); } @@ -25135,7 +25366,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("occupiedHeatingSetpoint", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 700)); VerifyOrReturn(CheckConstraintMaxValue("occupiedHeatingSetpoint", occupiedHeatingSetpoint, 2600)); - NextTest(); } @@ -25215,7 +25445,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("minHeatSetpointLimit", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("minHeatSetpointLimit", minHeatSetpointLimit, 700)); VerifyOrReturn(CheckConstraintMaxValue("minHeatSetpointLimit", minHeatSetpointLimit, 3000)); - NextTest(); } @@ -25295,7 +25524,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("maxHeatSetpointLimit", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 700)); VerifyOrReturn(CheckConstraintMaxValue("maxHeatSetpointLimit", maxHeatSetpointLimit, 3000)); - NextTest(); } @@ -25375,7 +25603,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("minCoolSetpointLimit", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("minCoolSetpointLimit", minCoolSetpointLimit, 1600)); VerifyOrReturn(CheckConstraintMaxValue("minCoolSetpointLimit", minCoolSetpointLimit, 3200)); - NextTest(); } @@ -25455,7 +25682,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand VerifyOrReturn(CheckConstraintType("maxCoolSetpointLimit", "", "int16")); VerifyOrReturn(CheckConstraintMinValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 1600)); VerifyOrReturn(CheckConstraintMaxValue("maxCoolSetpointLimit", maxCoolSetpointLimit, 3200)); - NextTest(); } @@ -25536,7 +25762,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("controlSequenceOfOperation", "", "enum8")); VerifyOrReturn(CheckConstraintMaxValue("controlSequenceOfOperation", controlSequenceOfOperation, 5)); - NextTest(); } @@ -25617,7 +25842,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("systemMode", "", "enum8")); VerifyOrReturn(CheckConstraintMaxValue("systemMode", systemMode, 9)); - NextTest(); } @@ -25696,7 +25920,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("minSetpointDeadBand", "", "int8")); VerifyOrReturn(CheckConstraintMaxValue("minSetpointDeadBand", minSetpointDeadBand, 25)); - NextTest(); } @@ -25755,7 +25978,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("startOfWeek", "", "enum8")); VerifyOrReturn(CheckConstraintMaxValue("startOfWeek", startOfWeek, 6)); - NextTest(); } @@ -25818,7 +26040,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand void OnSuccessResponse_57(uint8_t numberOfWeeklyTransitions) { VerifyOrReturn(CheckConstraintType("numberOfWeeklyTransitions", "", "uint8")); - NextTest(); } @@ -25861,7 +26082,6 @@ class Test_TC_TSTAT_2_1 : public TestCommand void OnSuccessResponse_59(uint8_t numberOfDailyTransitions) { VerifyOrReturn(CheckConstraintType("numberOfDailyTransitions", "", "uint8")); - NextTest(); } @@ -27688,7 +27908,6 @@ class Test_TC_TSUIC_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -28015,7 +28234,6 @@ class Test_TC_TSUIC_2_1 : public TestCommand void OnSuccessResponse_2(uint8_t temperatureDisplayMode) { VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); - NextTest(); } @@ -28079,7 +28297,6 @@ class Test_TC_TSUIC_2_1 : public TestCommand void OnSuccessResponse_5(uint8_t temperatureDisplayMode) { VerifyOrReturn(CheckConstraintType("temperatureDisplayMode", "", "enum8")); - NextTest(); } @@ -28121,7 +28338,6 @@ class Test_TC_TSUIC_2_1 : public TestCommand void OnSuccessResponse_7(uint8_t keypadLockout) { VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); - NextTest(); } @@ -28182,7 +28398,6 @@ class Test_TC_TSUIC_2_1 : public TestCommand void OnSuccessResponse_10(uint8_t keypadLockout) { VerifyOrReturn(CheckConstraintType("keypadLockout", "", "enum8")); - NextTest(); } @@ -28226,7 +28441,6 @@ class Test_TC_TSUIC_2_1 : public TestCommand void OnSuccessResponse_12(uint8_t scheduleProgrammingVisibility) { VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); - NextTest(); } @@ -28290,7 +28504,6 @@ class Test_TC_TSUIC_2_1 : public TestCommand void OnSuccessResponse_15(uint8_t scheduleProgrammingVisibility) { VerifyOrReturn(CheckConstraintType("scheduleProgrammingVisibility", "", "enum8")); - NextTest(); } }; @@ -28814,7 +29027,6 @@ class Test_TC_DIAGTH_1_1 : public TestCommand void OnSuccessResponse_2(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - NextTest(); } @@ -29016,9 +29228,8 @@ class Test_TC_WNCV_1_1 : public TestCommand void OnSuccessResponse_1(uint16_t clusterRevision) { VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); - VerifyOrReturn(CheckConstraintMinValue("clusterRevision", clusterRevision, 5)); - VerifyOrReturn(CheckConstraintMaxValue("clusterRevision", clusterRevision, 200)); - + VerifyOrReturn(CheckConstraintMinValue("clusterRevision", clusterRevision, 5U)); + VerifyOrReturn(CheckConstraintMaxValue("clusterRevision", clusterRevision, 200U)); NextTest(); } @@ -29081,8 +29292,7 @@ class Test_TC_WNCV_1_1 : public TestCommand void OnSuccessResponse_4(uint32_t featureMap) { VerifyOrReturn(CheckConstraintType("featureMap", "", "uint32")); - VerifyOrReturn(CheckConstraintMaxValue("featureMap", featureMap, 32768)); - + VerifyOrReturn(CheckConstraintMaxValue("featureMap", featureMap, 32768UL)); NextTest(); } @@ -29566,7 +29776,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_16(status); } - static void OnSuccessCallback_16(void * context, uint16_t targetPositionLiftPercent100ths) + static void OnSuccessCallback_16(void * context, + const chip::app::DataModel::Nullable & targetPositionLiftPercent100ths) { (static_cast(context))->OnSuccessResponse_16(targetPositionLiftPercent100ths); } @@ -29583,7 +29794,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_18(status); } - static void OnSuccessCallback_18(void * context, uint16_t targetPositionLiftPercent100ths) + static void OnSuccessCallback_18(void * context, + const chip::app::DataModel::Nullable & targetPositionLiftPercent100ths) { (static_cast(context))->OnSuccessResponse_18(targetPositionLiftPercent100ths); } @@ -29593,7 +29805,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_19(status); } - static void OnSuccessCallback_19(void * context, uint16_t targetPositionTiltPercent100ths) + static void OnSuccessCallback_19(void * context, + const chip::app::DataModel::Nullable & targetPositionTiltPercent100ths) { (static_cast(context))->OnSuccessResponse_19(targetPositionTiltPercent100ths); } @@ -29610,7 +29823,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_21(status); } - static void OnSuccessCallback_21(void * context, uint16_t targetPositionTiltPercent100ths) + static void OnSuccessCallback_21(void * context, + const chip::app::DataModel::Nullable & targetPositionTiltPercent100ths) { (static_cast(context))->OnSuccessResponse_21(targetPositionTiltPercent100ths); } @@ -29620,7 +29834,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_22(status); } - static void OnSuccessCallback_22(void * context, uint16_t currentPositionLiftPercent100ths) + static void OnSuccessCallback_22(void * context, + const chip::app::DataModel::Nullable & currentPositionLiftPercent100ths) { (static_cast(context))->OnSuccessResponse_22(currentPositionLiftPercent100ths); } @@ -29637,7 +29852,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_24(status); } - static void OnSuccessCallback_24(void * context, uint16_t currentPositionLiftPercent100ths) + static void OnSuccessCallback_24(void * context, + const chip::app::DataModel::Nullable & currentPositionLiftPercent100ths) { (static_cast(context))->OnSuccessResponse_24(currentPositionLiftPercent100ths); } @@ -29647,7 +29863,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_25(status); } - static void OnSuccessCallback_25(void * context, uint16_t currentPositionTiltPercent100ths) + static void OnSuccessCallback_25(void * context, + const chip::app::DataModel::Nullable & currentPositionTiltPercent100ths) { (static_cast(context))->OnSuccessResponse_25(currentPositionTiltPercent100ths); } @@ -29664,7 +29881,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_27(status); } - static void OnSuccessCallback_27(void * context, uint16_t currentPositionTiltPercent100ths) + static void OnSuccessCallback_27(void * context, + const chip::app::DataModel::Nullable & currentPositionTiltPercent100ths) { (static_cast(context))->OnSuccessResponse_27(currentPositionTiltPercent100ths); } @@ -29809,7 +30027,7 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_43(status); } - static void OnSuccessCallback_43(void * context, uint16_t currentPositionLift) + static void OnSuccessCallback_43(void * context, const chip::app::DataModel::Nullable & currentPositionLift) { (static_cast(context))->OnSuccessResponse_43(currentPositionLift); } @@ -29826,7 +30044,7 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_45(status); } - static void OnSuccessCallback_45(void * context, uint16_t currentPositionLift) + static void OnSuccessCallback_45(void * context, const chip::app::DataModel::Nullable & currentPositionLift) { (static_cast(context))->OnSuccessResponse_45(currentPositionLift); } @@ -29836,7 +30054,7 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_46(status); } - static void OnSuccessCallback_46(void * context, uint16_t currentPositionTilt) + static void OnSuccessCallback_46(void * context, const chip::app::DataModel::Nullable & currentPositionTilt) { (static_cast(context))->OnSuccessResponse_46(currentPositionTilt); } @@ -29853,7 +30071,7 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_48(status); } - static void OnSuccessCallback_48(void * context, uint16_t currentPositionTilt) + static void OnSuccessCallback_48(void * context, const chip::app::DataModel::Nullable & currentPositionTilt) { (static_cast(context))->OnSuccessResponse_48(currentPositionTilt); } @@ -29863,7 +30081,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_49(status); } - static void OnSuccessCallback_49(void * context, uint8_t currentPositionLiftPercentage) + static void OnSuccessCallback_49(void * context, + const chip::app::DataModel::Nullable & currentPositionLiftPercentage) { (static_cast(context))->OnSuccessResponse_49(currentPositionLiftPercentage); } @@ -29880,7 +30099,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_51(status); } - static void OnSuccessCallback_51(void * context, uint8_t currentPositionLiftPercentage) + static void OnSuccessCallback_51(void * context, + const chip::app::DataModel::Nullable & currentPositionLiftPercentage) { (static_cast(context))->OnSuccessResponse_51(currentPositionLiftPercentage); } @@ -29890,7 +30110,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_52(status); } - static void OnSuccessCallback_52(void * context, uint8_t currentPositionTiltPercentage) + static void OnSuccessCallback_52(void * context, + const chip::app::DataModel::Nullable & currentPositionTiltPercentage) { (static_cast(context))->OnSuccessResponse_52(currentPositionTiltPercentage); } @@ -29907,7 +30128,8 @@ class Test_TC_WNCV_2_1 : public TestCommand (static_cast(context))->OnFailureResponse_54(status); } - static void OnSuccessCallback_54(void * context, uint8_t currentPositionTiltPercentage) + static void OnSuccessCallback_54(void * context, + const chip::app::DataModel::Nullable & currentPositionTiltPercentage) { (static_cast(context))->OnSuccessResponse_54(currentPositionTiltPercentage); } @@ -29939,7 +30161,6 @@ class Test_TC_WNCV_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("type", "", "enum8")); VerifyOrReturn(CheckConstraintMaxValue("type", type, 9)); - NextTest(); } @@ -30003,7 +30224,6 @@ class Test_TC_WNCV_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("configStatus", "", "map8")); VerifyOrReturn(CheckConstraintMaxValue("configStatus", configStatus, 63)); - NextTest(); } @@ -30067,7 +30287,6 @@ class Test_TC_WNCV_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("operationalStatus", "", "map8")); VerifyOrReturn(CheckConstraintMaxValue("operationalStatus", operationalStatus, 63)); - NextTest(); } @@ -30131,7 +30350,6 @@ class Test_TC_WNCV_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); VerifyOrReturn(CheckConstraintMaxValue("endProductType", endProductType, 23)); - NextTest(); } @@ -30195,7 +30413,6 @@ class Test_TC_WNCV_2_1 : public TestCommand { VerifyOrReturn(CheckConstraintType("mode", "", "map8")); VerifyOrReturn(CheckConstraintMaxValue("mode", mode, 15)); - NextTest(); } @@ -30251,12 +30468,11 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_16(uint16_t targetPositionLiftPercent100ths) + void OnSuccessResponse_16(const chip::app::DataModel::Nullable & targetPositionLiftPercent100ths) { - VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("targetPositionLiftPercent100ths", targetPositionLiftPercent100ths, 10000)); - + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "Percent100ths")); + VerifyOrReturn(CheckConstraintMaxValue("targetPositionLiftPercent100ths", + targetPositionLiftPercent100ths, 10000U)); NextTest(); } @@ -30266,8 +30482,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t targetPositionLiftPercent100thsArgument; - targetPositionLiftPercent100thsArgument = 20000U; + chip::app::DataModel::Nullable targetPositionLiftPercent100thsArgument; + targetPositionLiftPercent100thsArgument.SetNonNull() = 20000U; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -30297,9 +30513,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_18(uint16_t targetPositionLiftPercent100ths) + void OnSuccessResponse_18(const chip::app::DataModel::Nullable & targetPositionLiftPercent100ths) { - VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("targetPositionLiftPercent100ths", "", "Percent100ths")); VerifyOrReturn(CheckConstraintNotValue("targetPositionLiftPercent100ths", targetPositionLiftPercent100ths, 20000U)); NextTest(); @@ -30319,12 +30535,11 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_19(uint16_t targetPositionTiltPercent100ths) + void OnSuccessResponse_19(const chip::app::DataModel::Nullable & targetPositionTiltPercent100ths) { - VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("targetPositionTiltPercent100ths", targetPositionTiltPercent100ths, 10000)); - + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "Percent100ths")); + VerifyOrReturn(CheckConstraintMaxValue("targetPositionTiltPercent100ths", + targetPositionTiltPercent100ths, 10000U)); NextTest(); } @@ -30334,8 +30549,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t targetPositionTiltPercent100thsArgument; - targetPositionTiltPercent100thsArgument = 20000U; + chip::app::DataModel::Nullable targetPositionTiltPercent100thsArgument; + targetPositionTiltPercent100thsArgument.SetNonNull() = 20000U; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -30365,9 +30580,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_21(uint16_t targetPositionTiltPercent100ths) + void OnSuccessResponse_21(const chip::app::DataModel::Nullable & targetPositionTiltPercent100ths) { - VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("targetPositionTiltPercent100ths", "", "Percent100ths")); VerifyOrReturn(CheckConstraintNotValue("targetPositionTiltPercent100ths", targetPositionTiltPercent100ths, 20000U)); NextTest(); @@ -30387,12 +30602,11 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_22(uint16_t currentPositionLiftPercent100ths) + void OnSuccessResponse_22(const chip::app::DataModel::Nullable & currentPositionLiftPercent100ths) { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionLiftPercent100ths", currentPositionLiftPercent100ths, 10000)); - + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "Percent100ths")); + VerifyOrReturn(CheckConstraintMaxValue("currentPositionLiftPercent100ths", + currentPositionLiftPercent100ths, 10000U)); NextTest(); } @@ -30402,8 +30616,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t currentPositionLiftPercent100thsArgument; - currentPositionLiftPercent100thsArgument = 20000U; + chip::app::DataModel::Nullable currentPositionLiftPercent100thsArgument; + currentPositionLiftPercent100thsArgument.SetNonNull() = 20000U; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -30433,9 +30647,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_24(uint16_t currentPositionLiftPercent100ths) + void OnSuccessResponse_24(const chip::app::DataModel::Nullable & currentPositionLiftPercent100ths) { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercent100ths", "", "Percent100ths")); VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercent100ths", currentPositionLiftPercent100ths, 20000U)); NextTest(); @@ -30455,12 +30669,11 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_25(uint16_t currentPositionTiltPercent100ths) + void OnSuccessResponse_25(const chip::app::DataModel::Nullable & currentPositionTiltPercent100ths) { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionTiltPercent100ths", currentPositionTiltPercent100ths, 10000)); - + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "Percent100ths")); + VerifyOrReturn(CheckConstraintMaxValue("currentPositionTiltPercent100ths", + currentPositionTiltPercent100ths, 10000U)); NextTest(); } @@ -30470,8 +30683,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t currentPositionTiltPercent100thsArgument; - currentPositionTiltPercent100thsArgument = 20000U; + chip::app::DataModel::Nullable currentPositionTiltPercent100thsArgument; + currentPositionTiltPercent100thsArgument.SetNonNull() = 20000U; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -30501,9 +30714,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_27(uint16_t currentPositionTiltPercent100ths) + void OnSuccessResponse_27(const chip::app::DataModel::Nullable & currentPositionTiltPercent100ths) { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "uint16")); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercent100ths", "", "Percent100ths")); VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercent100ths", currentPositionTiltPercent100ths, 20000U)); NextTest(); @@ -30526,8 +30739,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_28(uint16_t installedOpenLimitLift) { VerifyOrReturn(CheckConstraintType("installedOpenLimitLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", installedOpenLimitLift, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", installedOpenLimitLift, 65535U)); NextTest(); } @@ -30571,8 +30783,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_30(uint16_t installedOpenLimitLift) { VerifyOrReturn(CheckConstraintType("installedOpenLimitLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", installedOpenLimitLift, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", installedOpenLimitLift, 65535U)); NextTest(); } @@ -30593,8 +30804,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_31(uint16_t installedClosedLimitLift) { VerifyOrReturn(CheckConstraintType("installedClosedLimitLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", installedClosedLimitLift, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", installedClosedLimitLift, 65535U)); NextTest(); } @@ -30638,8 +30848,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_33(uint16_t installedClosedLimitLift) { VerifyOrReturn(CheckConstraintType("installedClosedLimitLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", installedClosedLimitLift, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", installedClosedLimitLift, 65535U)); NextTest(); } @@ -30660,8 +30869,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_34(uint16_t installedOpenLimitTilt) { VerifyOrReturn(CheckConstraintType("installedOpenLimitTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", installedOpenLimitTilt, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", installedOpenLimitTilt, 65535U)); NextTest(); } @@ -30705,8 +30913,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_36(uint16_t installedOpenLimitTilt) { VerifyOrReturn(CheckConstraintType("installedOpenLimitTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", installedOpenLimitTilt, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", installedOpenLimitTilt, 65535U)); NextTest(); } @@ -30727,8 +30934,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_37(uint16_t installedClosedLimitTilt) { VerifyOrReturn(CheckConstraintType("installedClosedLimitTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", installedClosedLimitTilt, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", installedClosedLimitTilt, 65535U)); NextTest(); } @@ -30772,8 +30978,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_39(uint16_t installedClosedLimitTilt) { VerifyOrReturn(CheckConstraintType("installedClosedLimitTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", installedClosedLimitTilt, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", installedClosedLimitTilt, 65535U)); NextTest(); } @@ -30793,8 +30998,7 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnSuccessResponse_40(uint16_t safetyStatus) { VerifyOrReturn(CheckConstraintType("safetyStatus", "", "map16")); - VerifyOrReturn(CheckConstraintMaxValue("safetyStatus", safetyStatus, 2047)); - + VerifyOrReturn(CheckConstraintMaxValue("safetyStatus", safetyStatus, 2047U)); NextTest(); } @@ -30854,11 +31058,10 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_43(uint16_t currentPositionLift) + void OnSuccessResponse_43(const chip::app::DataModel::Nullable & currentPositionLift) { VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", currentPositionLift, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", currentPositionLift, 65535U)); NextTest(); } @@ -30868,8 +31071,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t currentPositionLiftArgument; - currentPositionLiftArgument = 255U; + chip::app::DataModel::Nullable currentPositionLiftArgument; + currentPositionLiftArgument.SetNonNull() = 255U; ReturnErrorOnFailure(cluster.WriteAttribute( currentPositionLiftArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); @@ -30897,11 +31100,10 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_45(uint16_t currentPositionLift) + void OnSuccessResponse_45(const chip::app::DataModel::Nullable & currentPositionLift) { VerifyOrReturn(CheckConstraintType("currentPositionLift", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", currentPositionLift, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("currentPositionLift", currentPositionLift, 65535U)); NextTest(); } @@ -30918,11 +31120,10 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_46(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_46(uint16_t currentPositionTilt) + void OnSuccessResponse_46(const chip::app::DataModel::Nullable & currentPositionTilt) { VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", currentPositionTilt, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", currentPositionTilt, 65535U)); NextTest(); } @@ -30932,8 +31133,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t currentPositionTiltArgument; - currentPositionTiltArgument = 255U; + chip::app::DataModel::Nullable currentPositionTiltArgument; + currentPositionTiltArgument.SetNonNull() = 255U; ReturnErrorOnFailure(cluster.WriteAttribute( currentPositionTiltArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); @@ -30961,11 +31162,10 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_48(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_48(uint16_t currentPositionTilt) + void OnSuccessResponse_48(const chip::app::DataModel::Nullable & currentPositionTilt) { VerifyOrReturn(CheckConstraintType("currentPositionTilt", "", "uint16")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", currentPositionTilt, 65535)); - + VerifyOrReturn(CheckConstraintMaxValue("currentPositionTilt", currentPositionTilt, 65535U)); NextTest(); } @@ -30983,11 +31183,10 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_49(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_49(uint8_t currentPositionLiftPercentage) + void OnSuccessResponse_49(const chip::app::DataModel::Nullable & currentPositionLiftPercentage) { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionLiftPercentage", currentPositionLiftPercentage, 100)); - + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "Percent")); + VerifyOrReturn(CheckConstraintMaxValue("currentPositionLiftPercentage", currentPositionLiftPercentage, 100)); NextTest(); } @@ -30997,8 +31196,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t currentPositionLiftPercentageArgument; - currentPositionLiftPercentageArgument = 200; + chip::app::DataModel::Nullable currentPositionLiftPercentageArgument; + currentPositionLiftPercentageArgument.SetNonNull() = 200; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -31028,9 +31227,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_51(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_51(uint8_t currentPositionLiftPercentage) + void OnSuccessResponse_51(const chip::app::DataModel::Nullable & currentPositionLiftPercentage) { - VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "uint8")); + VerifyOrReturn(CheckConstraintType("currentPositionLiftPercentage", "", "Percent")); VerifyOrReturn(CheckConstraintNotValue("currentPositionLiftPercentage", currentPositionLiftPercentage, 200)); NextTest(); @@ -31050,11 +31249,10 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_52(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_52(uint8_t currentPositionTiltPercentage) + void OnSuccessResponse_52(const chip::app::DataModel::Nullable & currentPositionTiltPercentage) { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); - VerifyOrReturn(CheckConstraintMaxValue("currentPositionTiltPercentage", currentPositionTiltPercentage, 100)); - + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "Percent")); + VerifyOrReturn(CheckConstraintMaxValue("currentPositionTiltPercentage", currentPositionTiltPercentage, 100)); NextTest(); } @@ -31064,8 +31262,8 @@ class Test_TC_WNCV_2_1 : public TestCommand chip::Controller::WindowCoveringClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t currentPositionTiltPercentageArgument; - currentPositionTiltPercentageArgument = 200; + chip::app::DataModel::Nullable currentPositionTiltPercentageArgument; + currentPositionTiltPercentageArgument.SetNonNull() = 200; ReturnErrorOnFailure( cluster.WriteAttribute( @@ -31095,9 +31293,9 @@ class Test_TC_WNCV_2_1 : public TestCommand void OnFailureResponse_54(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_54(uint8_t currentPositionTiltPercentage) + void OnSuccessResponse_54(const chip::app::DataModel::Nullable & currentPositionTiltPercentage) { - VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "uint8")); + VerifyOrReturn(CheckConstraintType("currentPositionTiltPercentage", "", "Percent")); VerifyOrReturn(CheckConstraintNotValue("currentPositionTiltPercentage", currentPositionTiltPercentage, 200)); NextTest(); @@ -31284,7 +31482,6 @@ class Test_TC_WNCV_2_4 : public TestCommand { VerifyOrReturn(CheckConstraintType("type", "", "enum8")); VerifyOrReturn(CheckConstraintMaxValue("type", type, 9)); - NextTest(); } }; @@ -31411,7 +31608,6 @@ class Test_TC_WNCV_2_5 : public TestCommand { VerifyOrReturn(CheckConstraintType("endProductType", "", "enum8")); VerifyOrReturn(CheckConstraintMaxValue("endProductType", endProductType, 23)); - NextTest(); } }; @@ -31897,8 +32093,8 @@ class TV_TargetNavigatorCluster : public TestCommand err = TestReadAttributeCurrentNavigatorTarget_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Navigate Target Command\n"); - err = TestNavigateTargetCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Navigate Target Request Command\n"); + err = TestNavigateTargetRequestCommand_3(); break; } @@ -31920,8 +32116,8 @@ class TV_TargetNavigatorCluster : public TestCommand static void OnSuccessCallback_1( void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & targetNavigatorList) + const chip::app::DataModel::DecodableList & + targetNavigatorList) { (static_cast(context))->OnSuccessResponse_1(targetNavigatorList); } @@ -31960,8 +32156,8 @@ class TV_TargetNavigatorCluster : public TestCommand void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } void OnSuccessResponse_1( - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & targetNavigatorList) + const chip::app::DataModel::DecodableList & + targetNavigatorList) { auto iter = targetNavigatorList.begin(); VerifyOrReturn(CheckNextListItemDecodes("targetNavigatorList", iter, 0)); @@ -31996,10 +32192,10 @@ class TV_TargetNavigatorCluster : public TestCommand NextTest(); } - CHIP_ERROR TestNavigateTargetCommand_3() + CHIP_ERROR TestNavigateTargetRequestCommand_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TargetNavigator::Commands::NavigateTarget::Type; + using RequestType = chip::app::Clusters::TargetNavigator::Commands::NavigateTargetRequest::Type; RequestType request; request.target = 1; @@ -32019,7 +32215,7 @@ class TV_TargetNavigatorCluster : public TestCommand void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(chip::app::Clusters::TargetNavigator::NavigateTargetStatus status, chip::CharSpan data) + void OnSuccessResponse_3(chip::app::Clusters::TargetNavigator::StatusEnum status, chip::CharSpan data) { VerifyOrReturn(CheckValue("status", status, 0)); @@ -32099,7 +32295,7 @@ class TV_AudioOutputCluster : public TestCommand static void OnSuccessCallback_1( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & audioOutputList) { (static_cast(context))->OnSuccessResponse_1(audioOutputList); @@ -32139,7 +32335,7 @@ class TV_AudioOutputCluster : public TestCommand void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } void OnSuccessResponse_1( - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & audioOutputList) { auto iter = audioOutputList.begin(); @@ -32183,7 +32379,7 @@ class TV_AudioOutputCluster : public TestCommand CHIP_ERROR TestSelectOutputCommand_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 2; - using RequestType = chip::app::Clusters::AudioOutput::Commands::SelectOutput::Type; + using RequestType = chip::app::Clusters::AudioOutput::Commands::SelectOutputRequest::Type; RequestType request; request.index = 1; @@ -32207,7 +32403,7 @@ class TV_AudioOutputCluster : public TestCommand CHIP_ERROR TestRenameOutputCommand_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 2; - using RequestType = chip::app::Clusters::AudioOutput::Commands::RenameOutput::Type; + using RequestType = chip::app::Clusters::AudioOutput::Commands::RenameOutputRequest::Type; RequestType request; request.index = 1; @@ -32342,12 +32538,14 @@ class TV_ApplicationLauncherCluster : public TestCommand CHIP_ERROR TestLaunchAppCommand_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type; + using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppRequest::Type; RequestType request; request.data = chip::Span("datagarbage: not in length on purpose", 4); request.application.catalogVendorId = 123U; + request.application.catalogVendorId = 123U; + request.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); request.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); auto success = [](void * context, const typename RequestType::ResponseType & data) { @@ -32364,7 +32562,7 @@ class TV_ApplicationLauncherCluster : public TestCommand void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatus status, chip::CharSpan data) + void OnSuccessResponse_2(chip::app::Clusters::ApplicationLauncher::StatusEnum status, chip::CharSpan data) { VerifyOrReturn(CheckValue("status", status, 0)); @@ -32376,12 +32574,14 @@ class TV_ApplicationLauncherCluster : public TestCommand CHIP_ERROR TestStopAppCommand_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type; + using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::StopAppRequest::Type; RequestType request; + request.application.catalogVendorId = 123U; request.application.catalogVendorId = 123U; request.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); + request.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); auto success = [](void * context, const typename RequestType::ResponseType & data) { (static_cast(context))->OnSuccessResponse_3(data.status, data.data); @@ -32397,7 +32597,7 @@ class TV_ApplicationLauncherCluster : public TestCommand void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatus status, chip::CharSpan data) + void OnSuccessResponse_3(chip::app::Clusters::ApplicationLauncher::StatusEnum status, chip::CharSpan data) { VerifyOrReturn(CheckValue("status", status, 0)); @@ -32409,11 +32609,13 @@ class TV_ApplicationLauncherCluster : public TestCommand CHIP_ERROR TestHideAppCommand_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type; + using RequestType = chip::app::Clusters::ApplicationLauncher::Commands::HideAppRequest::Type; RequestType request; request.application.catalogVendorId = 123U; + request.application.catalogVendorId = 123U; + request.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); request.application.applicationId = chip::Span("applicationIdgarbage: not in length on purpose", 13); auto success = [](void * context, const typename RequestType::ResponseType & data) { @@ -32430,7 +32632,7 @@ class TV_ApplicationLauncherCluster : public TestCommand void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(chip::app::Clusters::ApplicationLauncher::ApplicationLauncherStatus status, chip::CharSpan data) + void OnSuccessResponse_4(chip::app::Clusters::ApplicationLauncher::StatusEnum status, chip::CharSpan data) { VerifyOrReturn(CheckValue("status", status, 0)); @@ -32504,10 +32706,10 @@ class TV_KeypadInputCluster : public TestCommand CHIP_ERROR TestSendKeyCommand_1() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::KeypadInput::Commands::SendKey::Type; + using RequestType = chip::app::Clusters::KeypadInput::Commands::SendKeyRequest::Type; RequestType request; - request.keyCode = static_cast(3); + request.keyCode = static_cast(3); auto success = [](void * context, const typename RequestType::ResponseType & data) { (static_cast(context))->OnSuccessResponse_1(data.status); @@ -32523,7 +32725,7 @@ class TV_KeypadInputCluster : public TestCommand void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(chip::app::Clusters::KeypadInput::KeypadInputStatus status) + void OnSuccessResponse_1(chip::app::Clusters::KeypadInput::StatusEnum status) { VerifyOrReturn(CheckValue("status", status, 0)); @@ -32603,7 +32805,7 @@ class TV_AccountLoginCluster : public TestCommand CHIP_ERROR TestGetSetupPinCommand_1() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type; + using RequestType = chip::app::Clusters::AccountLogin::Commands::GetSetupPINRequest::Type; RequestType request; request.tempAccountIdentifier = chip::Span("asdfgarbage: not in length on purpose", 4); @@ -32616,18 +32818,24 @@ class TV_AccountLoginCluster : public TestCommand (static_cast(context))->OnFailureResponse_1(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure( + chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); return CHIP_NO_ERROR; } void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(chip::CharSpan setupPIN) { NextTest(); } + void OnSuccessResponse_1(chip::CharSpan setupPIN) + { + VerifyOrReturn(CheckValueAsString("setupPIN", setupPIN, chip::CharSpan("tempPin123", 10))); + + NextTest(); + } CHIP_ERROR TestLoginCommand_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::AccountLogin::Commands::Login::Type; + using RequestType = chip::app::Clusters::AccountLogin::Commands::LoginRequest::Type; RequestType request; request.tempAccountIdentifier = chip::Span("asdfgarbage: not in length on purpose", 4); @@ -32641,7 +32849,8 @@ class TV_AccountLoginCluster : public TestCommand (static_cast(context))->OnFailureResponse_2(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure( + chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); return CHIP_NO_ERROR; } @@ -32652,7 +32861,7 @@ class TV_AccountLoginCluster : public TestCommand CHIP_ERROR TestLogoutCommand_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::AccountLogin::Commands::Logout::Type; + using RequestType = chip::app::Clusters::AccountLogin::Commands::LogoutRequest::Type; RequestType request; @@ -32664,7 +32873,8 @@ class TV_AccountLoginCluster : public TestCommand (static_cast(context))->OnFailureResponse_3(status); }; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure( + chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request, 10000)); return CHIP_NO_ERROR; } @@ -32800,32 +33010,28 @@ class TV_ApplicationBasicCluster : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Change Status Command\n"); - err = TestChangeStatusCommand_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute vendor name\n"); + err = TestReadAttributeVendorName_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute vendor name\n"); - err = TestReadAttributeVendorName_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute vendor id\n"); + err = TestReadAttributeVendorId_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute vendor id\n"); - err = TestReadAttributeVendorId_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read attribute application name\n"); + err = TestReadAttributeApplicationName_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute application name\n"); - err = TestReadAttributeApplicationName_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read attribute product id\n"); + err = TestReadAttributeProductId_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute product id\n"); - err = TestReadAttributeProductId_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read attribute application status\n"); + err = TestReadAttributeApplicationStatus_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute application status\n"); - err = TestReadAttributeApplicationStatus_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read attribute application version\n"); - err = TestReadAttributeApplicationVersion_7(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read attribute application version\n"); + err = TestReadAttributeApplicationVersion_6(); break; } @@ -32838,16 +33044,26 @@ class TV_ApplicationBasicCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 7; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, chip::CharSpan vendorName) + { + (static_cast(context))->OnSuccessResponse_1(vendorName); + } static void OnFailureCallback_2(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, chip::CharSpan vendorName) + static void OnSuccessCallback_2(void * context, uint16_t vendorId) { - (static_cast(context))->OnSuccessResponse_2(vendorName); + (static_cast(context))->OnSuccessResponse_2(vendorId); } static void OnFailureCallback_3(void * context, EmberAfStatus status) @@ -32855,9 +33071,9 @@ class TV_ApplicationBasicCluster : public TestCommand (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_3(void * context, uint16_t vendorId) + static void OnSuccessCallback_3(void * context, chip::CharSpan applicationName) { - (static_cast(context))->OnSuccessResponse_3(vendorId); + (static_cast(context))->OnSuccessResponse_3(applicationName); } static void OnFailureCallback_4(void * context, EmberAfStatus status) @@ -32865,9 +33081,9 @@ class TV_ApplicationBasicCluster : public TestCommand (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_4(void * context, chip::CharSpan applicationName) + static void OnSuccessCallback_4(void * context, uint16_t productId) { - (static_cast(context))->OnSuccessResponse_4(applicationName); + (static_cast(context))->OnSuccessResponse_4(productId); } static void OnFailureCallback_5(void * context, EmberAfStatus status) @@ -32875,9 +33091,9 @@ class TV_ApplicationBasicCluster : public TestCommand (static_cast(context))->OnFailureResponse_5(status); } - static void OnSuccessCallback_5(void * context, uint16_t productId) + static void OnSuccessCallback_5(void * context, chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum applicationStatus) { - (static_cast(context))->OnSuccessResponse_5(productId); + (static_cast(context))->OnSuccessResponse_5(applicationStatus); } static void OnFailureCallback_6(void * context, EmberAfStatus status) @@ -32885,19 +33101,9 @@ class TV_ApplicationBasicCluster : public TestCommand (static_cast(context))->OnFailureResponse_6(status); } - static void OnSuccessCallback_6(void * context, uint8_t applicationStatus) - { - (static_cast(context))->OnSuccessResponse_6(applicationStatus); - } - - static void OnFailureCallback_7(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, chip::CharSpan applicationVersion) + static void OnSuccessCallback_6(void * context, chip::CharSpan applicationVersion) { - (static_cast(context))->OnSuccessResponse_7(applicationVersion); + (static_cast(context))->OnSuccessResponse_6(applicationVersion); } // @@ -32910,144 +33116,120 @@ class TV_ApplicationBasicCluster : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestChangeStatusCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::ApplicationBasic::Commands::ChangeStatus::Type; - - RequestType request; - request.status = static_cast(1); - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1() { NextTest(); } - - CHIP_ERROR TestReadAttributeVendorName_2() + CHIP_ERROR TestReadAttributeVendorName_1() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; chip::Controller::ApplicationBasicClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); + this, OnSuccessCallback_1, OnFailureCallback_1)); return CHIP_NO_ERROR; } - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(chip::CharSpan vendorName) + void OnSuccessResponse_1(chip::CharSpan vendorName) { VerifyOrReturn(CheckValueAsString("vendorName", vendorName, chip::CharSpan("exampleVendorName1", 18))); NextTest(); } - CHIP_ERROR TestReadAttributeVendorId_3() + CHIP_ERROR TestReadAttributeVendorId_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; chip::Controller::ApplicationBasicClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); + this, OnSuccessCallback_2, OnFailureCallback_2)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t vendorId) + void OnSuccessResponse_2(uint16_t vendorId) { VerifyOrReturn(CheckValue("vendorId", vendorId, 1U)); NextTest(); } - CHIP_ERROR TestReadAttributeApplicationName_4() + CHIP_ERROR TestReadAttributeApplicationName_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; chip::Controller::ApplicationBasicClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); + this, OnSuccessCallback_3, OnFailureCallback_3)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(chip::CharSpan applicationName) + void OnSuccessResponse_3(chip::CharSpan applicationName) { VerifyOrReturn(CheckValueAsString("applicationName", applicationName, chip::CharSpan("exampleName1", 12))); NextTest(); } - CHIP_ERROR TestReadAttributeProductId_5() + CHIP_ERROR TestReadAttributeProductId_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; chip::Controller::ApplicationBasicClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); + this, OnSuccessCallback_4, OnFailureCallback_4)); return CHIP_NO_ERROR; } - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(uint16_t productId) + void OnSuccessResponse_4(uint16_t productId) { VerifyOrReturn(CheckValue("productId", productId, 1U)); NextTest(); } - CHIP_ERROR TestReadAttributeApplicationStatus_6() + CHIP_ERROR TestReadAttributeApplicationStatus_5() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; chip::Controller::ApplicationBasicClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); + this, OnSuccessCallback_5, OnFailureCallback_5)); return CHIP_NO_ERROR; } - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_6(uint8_t applicationStatus) + void OnSuccessResponse_5(chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum applicationStatus) { VerifyOrReturn(CheckValue("applicationStatus", applicationStatus, 0)); NextTest(); } - CHIP_ERROR TestReadAttributeApplicationVersion_7() + CHIP_ERROR TestReadAttributeApplicationVersion_6() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; chip::Controller::ApplicationBasicClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_7, OnFailureCallback_7)); + this, OnSuccessCallback_6, OnFailureCallback_6)); return CHIP_NO_ERROR; } - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(chip::CharSpan applicationVersion) + void OnSuccessResponse_6(chip::CharSpan applicationVersion) { VerifyOrReturn(CheckValueAsString("applicationVersion", applicationVersion, chip::CharSpan("exampleVersion", 14))); @@ -33175,7 +33357,7 @@ class TV_MediaPlaybackCluster : public TestCommand (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint8_t playbackState) + static void OnSuccessCallback_1(void * context, chip::app::Clusters::MediaPlayback::PlaybackStateEnum playbackState) { (static_cast(context))->OnSuccessResponse_1(playbackState); } @@ -33253,7 +33435,7 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_1(uint8_t playbackState) + void OnSuccessResponse_1(chip::app::Clusters::MediaPlayback::PlaybackStateEnum playbackState) { VerifyOrReturn(CheckValue("playbackState", playbackState, 0)); @@ -33275,7 +33457,7 @@ class TV_MediaPlaybackCluster : public TestCommand void OnSuccessResponse_2(uint64_t startTime) { - VerifyOrReturn(CheckValue("startTime", startTime, 255ULL)); + VerifyOrReturn(CheckValue("startTime", startTime, 0ULL)); NextTest(); } @@ -33363,12 +33545,12 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackPlayCommand_7() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPlay::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::PlayRequest::Type; RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_7(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33381,9 +33563,9 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_7(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } @@ -33391,12 +33573,12 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackPauseCommand_8() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPause::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::PauseRequest::Type; RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_8(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_8(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33409,9 +33591,9 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_8(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_8(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } @@ -33419,12 +33601,12 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackStopCommand_9() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaStop::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::StopRequest::Type; RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_9(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33437,9 +33619,9 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_9(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_9(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } @@ -33447,12 +33629,12 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackStartOverCommand_10() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaStartOver::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::StartOverRequest::Type; RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_10(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_10(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33465,9 +33647,9 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_10(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_10(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } @@ -33475,12 +33657,12 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackPreviousCommand_11() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaPrevious::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::PreviousRequest::Type; RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_11(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_11(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33493,9 +33675,9 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_11(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_11(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } @@ -33503,12 +33685,12 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackNextCommand_12() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaNext::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::NextRequest::Type; RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_12(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_12(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33521,9 +33703,9 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_12(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_12(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } @@ -33531,12 +33713,12 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackRewindCommand_13() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaRewind::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::RewindRequest::Type; RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_13(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_13(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33549,9 +33731,9 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_13(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_13(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } @@ -33559,12 +33741,12 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackFastForwardCommand_14() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaFastForward::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::FastForwardRequest::Type; RequestType request; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_14(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_14(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33577,9 +33759,9 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_14(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_14(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } @@ -33587,13 +33769,13 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackSkipForwardCommand_15() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSkipForward::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::SkipForwardRequest::Type; RequestType request; request.deltaPositionMilliseconds = 100ULL; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_15(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33606,9 +33788,9 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_15(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_15(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } @@ -33616,13 +33798,13 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackSkipBackwardCommand_16() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSkipBackward::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::SkipBackwardRequest::Type; RequestType request; request.deltaPositionMilliseconds = 100ULL; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_16(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_16(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33635,9 +33817,9 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_16(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_16(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } @@ -33645,13 +33827,13 @@ class TV_MediaPlaybackCluster : public TestCommand CHIP_ERROR TestMediaPlaybackSeekCommand_17() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 3; - using RequestType = chip::app::Clusters::MediaPlayback::Commands::MediaSeek::Type; + using RequestType = chip::app::Clusters::MediaPlayback::Commands::SeekRequest::Type; RequestType request; request.position = 100ULL; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_17(data.mediaPlaybackStatus); + (static_cast(context))->OnSuccessResponse_17(data.status); }; auto failure = [](void * context, EmberAfStatus status) { @@ -33664,18 +33846,18 @@ class TV_MediaPlaybackCluster : public TestCommand void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_17(chip::app::Clusters::MediaPlayback::MediaPlaybackStatus mediaPlaybackStatus) + void OnSuccessResponse_17(chip::app::Clusters::MediaPlayback::StatusEnum status) { - VerifyOrReturn(CheckValue("mediaPlaybackStatus", mediaPlaybackStatus, 0)); + VerifyOrReturn(CheckValue("status", status, 0)); NextTest(); } }; -class TV_TvChannelCluster : public TestCommand +class TV_ChannelCluster : public TestCommand { public: - TV_TvChannelCluster() : TestCommand("TV_TvChannelCluster"), mTestIndex(0) {} + TV_ChannelCluster() : TestCommand("TV_ChannelCluster"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -33684,12 +33866,12 @@ class TV_TvChannelCluster : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: TV_TvChannelCluster\n"); + ChipLogProgress(chipTool, " **** Test Start: TV_ChannelCluster\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: TV_TvChannelCluster\n"); + ChipLogProgress(chipTool, " **** Test Complete: TV_ChannelCluster\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -33707,8 +33889,8 @@ class TV_TvChannelCluster : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute TV Channel list\n"); - err = TestReadAttributeTvChannelList_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute Channel list\n"); + err = TestReadAttributeChannelList_1(); break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Change Channel Command\n"); @@ -33737,15 +33919,14 @@ class TV_TvChannelCluster : public TestCommand static void OnFailureCallback_1(void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } static void OnSuccessCallback_1( void * context, - const chip::app::DataModel::DecodableList & - channelList) + const chip::app::DataModel::DecodableList & channelList) { - (static_cast(context))->OnSuccessResponse_1(channelList); + (static_cast(context))->OnSuccessResponse_1(channelList); } // @@ -33758,13 +33939,13 @@ class TV_TvChannelCluster : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestReadAttributeTvChannelList_1() + CHIP_ERROR TestReadAttributeChannelList_1() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TvChannelClusterTest cluster; + chip::Controller::ChannelClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( + ReturnErrorOnFailure(cluster.ReadAttribute( this, OnSuccessCallback_1, OnFailureCallback_1)); return CHIP_NO_ERROR; } @@ -33772,8 +33953,7 @@ class TV_TvChannelCluster : public TestCommand void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } void OnSuccessResponse_1( - const chip::app::DataModel::DecodableList & - channelList) + const chip::app::DataModel::DecodableList & channelList) { auto iter = channelList.begin(); VerifyOrReturn(CheckNextListItemDecodes("channelList", iter, 0)); @@ -33798,17 +33978,17 @@ class TV_TvChannelCluster : public TestCommand CHIP_ERROR TestChangeChannelCommand_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TvChannel::Commands::ChangeChannel::Type; + using RequestType = chip::app::Clusters::Channel::Commands::ChangeChannelRequest::Type; RequestType request; request.match = chip::Span("CNNgarbage: not in length on purpose", 3); auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(data.channelMatch, data.errorType); + (static_cast(context))->OnSuccessResponse_2(data.channelMatch, data.errorType); }; auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); @@ -33817,8 +33997,8 @@ class TV_TvChannelCluster : public TestCommand void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(const chip::app::Clusters::TvChannel::Structs::TvChannelInfo::DecodableType & channelMatch, - chip::app::Clusters::TvChannel::TvChannelErrorType errorType) + void OnSuccessResponse_2(const chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType & channelMatch, + chip::app::Clusters::Channel::ErrorTypeEnum errorType) { VerifyOrReturn(CheckValue("channelMatch.majorNumber", channelMatch.majorNumber, 1U)); VerifyOrReturn(CheckValue("channelMatch.minorNumber", channelMatch.minorNumber, 0U)); @@ -33835,18 +34015,18 @@ class TV_TvChannelCluster : public TestCommand CHIP_ERROR TestChangeChannelByNumberCommand_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TvChannel::Commands::ChangeChannelByNumber::Type; + using RequestType = chip::app::Clusters::Channel::Commands::ChangeChannelByNumberRequest::Type; RequestType request; request.majorNumber = 1U; request.minorNumber = 2U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(); + (static_cast(context))->OnSuccessResponse_3(); }; auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_3(status); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); @@ -33860,17 +34040,17 @@ class TV_TvChannelCluster : public TestCommand CHIP_ERROR TestSkipChannelCommand_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TvChannel::Commands::SkipChannel::Type; + using RequestType = chip::app::Clusters::Channel::Commands::SkipChannelRequest::Type; RequestType request; request.count = 1U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(); + (static_cast(context))->OnSuccessResponse_4(); }; auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_4(status); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); @@ -33967,6 +34147,250 @@ class TV_LowPowerCluster : public TestCommand void OnSuccessResponse_1() { NextTest(); } }; +class TV_ContentLauncherCluster : public TestCommand +{ +public: + TV_ContentLauncherCluster() : TestCommand("TV_ContentLauncherCluster"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TV_ContentLauncherCluster\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TV_ContentLauncherCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read attribute accept header list\n"); + err = TestReadAttributeAcceptHeaderList_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read attribute supported streaming protocols\n"); + err = TestReadAttributeSupportedStreamingProtocols_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Launch Content Command\n"); + err = TestLaunchContentCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Launch URL Command\n"); + err = TestLaunchUrlCommand_4(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + static void OnFailureCallback_1(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, const chip::app::DataModel::DecodableList & acceptHeaderList) + { + (static_cast(context))->OnSuccessResponse_1(acceptHeaderList); + } + + static void OnFailureCallback_2(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint32_t supportedStreamingProtocols) + { + (static_cast(context))->OnSuccessResponse_2(supportedStreamingProtocols); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestReadAttributeAcceptHeaderList_1() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::ContentLauncherClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(const chip::app::DataModel::DecodableList & acceptHeaderList) + { + auto iter = acceptHeaderList.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acceptHeaderList", iter, 0)); + VerifyOrReturn(CheckValueAsString("acceptHeaderList[0]", iter.GetValue(), chip::CharSpan("example", 7))); + VerifyOrReturn(CheckNextListItemDecodes("acceptHeaderList", iter, 1)); + VerifyOrReturn(CheckValueAsString("acceptHeaderList[1]", iter.GetValue(), chip::CharSpan("example", 7))); + VerifyOrReturn(CheckNoMoreListItems("acceptHeaderList", iter, 2)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeSupportedStreamingProtocols_2() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::ContentLauncherClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint32_t supportedStreamingProtocols) + { + VerifyOrReturn(CheckValue("supportedStreamingProtocols", supportedStreamingProtocols, 0UL)); + + NextTest(); + } + + CHIP_ERROR TestLaunchContentCommand_3() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ContentLauncher::Commands::LaunchContentRequest::Type; + + RequestType request; + request.autoPlay = true; + request.data = chip::Span("exampleDatagarbage: not in length on purpose", 11); + + request.search = chip::app::DataModel::List(); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_3(data.status, data.data); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_3(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(chip::app::Clusters::ContentLauncher::StatusEnum status, chip::CharSpan data) + { + VerifyOrReturn(CheckValue("status", status, 0)); + + VerifyOrReturn(CheckValueAsString("data", data, chip::CharSpan("exampleData", 11))); + + NextTest(); + } + + CHIP_ERROR TestLaunchUrlCommand_4() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::ContentLauncher::Commands::LaunchURLRequest::Type; + + RequestType request; + request.contentURL = chip::Span("exampleUrlgarbage: not in length on purpose", 10); + request.displayString = chip::Span("exampleDisplayStringgarbage: not in length on purpose", 20); + + request.brandingInformation.providerName = chip::Span("exampleNamegarbage: not in length on purpose", 11); + + request.brandingInformation.background.imageUrl = chip::Span("exampleUrlgarbage: not in length on purpose", 10); + request.brandingInformation.background.color = chip::Span("exampleColorgarbage: not in length on purpose", 12); + + request.brandingInformation.background.size.width = 0; + request.brandingInformation.background.size.height = 0; + request.brandingInformation.background.size.metric = static_cast(0); + + request.brandingInformation.logo.imageUrl = chip::Span("exampleUrlgarbage: not in length on purpose", 10); + request.brandingInformation.logo.color = chip::Span("exampleColorgarbage: not in length on purpose", 12); + + request.brandingInformation.logo.size.width = 0; + request.brandingInformation.logo.size.height = 0; + request.brandingInformation.logo.size.metric = static_cast(0); + + request.brandingInformation.progressBar.imageUrl = + chip::Span("exampleUrlgarbage: not in length on purpose", 10); + request.brandingInformation.progressBar.color = chip::Span("exampleColorgarbage: not in length on purpose", 12); + + request.brandingInformation.progressBar.size.width = 0; + request.brandingInformation.progressBar.size.height = 0; + request.brandingInformation.progressBar.size.metric = static_cast(0); + + request.brandingInformation.splash.imageUrl = chip::Span("exampleUrlgarbage: not in length on purpose", 10); + request.brandingInformation.splash.color = chip::Span("exampleColorgarbage: not in length on purpose", 12); + + request.brandingInformation.splash.size.width = 0; + request.brandingInformation.splash.size.height = 0; + request.brandingInformation.splash.size.metric = static_cast(0); + + request.brandingInformation.waterMark.imageUrl = chip::Span("exampleUrlgarbage: not in length on purpose", 10); + request.brandingInformation.waterMark.color = chip::Span("exampleColorgarbage: not in length on purpose", 12); + + request.brandingInformation.waterMark.size.width = 0; + request.brandingInformation.waterMark.size.height = 0; + request.brandingInformation.waterMark.size.metric = static_cast(0); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_4(data.status, data.data); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_4(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(chip::app::Clusters::ContentLauncher::StatusEnum status, chip::CharSpan data) + { + VerifyOrReturn(CheckValue("status", status, 0)); + + VerifyOrReturn(CheckValueAsString("data", data, chip::CharSpan("exampleData", 11))); + + NextTest(); + } +}; + class TV_MediaInputCluster : public TestCommand { public: @@ -34045,7 +34469,7 @@ class TV_MediaInputCluster : public TestCommand static void OnSuccessCallback_1( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & mediaInputList) { (static_cast(context))->OnSuccessResponse_1(mediaInputList); @@ -34085,7 +34509,7 @@ class TV_MediaInputCluster : public TestCommand void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } void OnSuccessResponse_1( - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & mediaInputList) { auto iter = mediaInputList.begin(); @@ -34129,7 +34553,7 @@ class TV_MediaInputCluster : public TestCommand CHIP_ERROR TestSelectInputCommand_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::MediaInput::Commands::SelectInput::Type; + using RequestType = chip::app::Clusters::MediaInput::Commands::SelectInputRequest::Type; RequestType request; request.index = 1; @@ -34153,7 +34577,7 @@ class TV_MediaInputCluster : public TestCommand CHIP_ERROR TestHideInputStatusCommand_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type; + using RequestType = chip::app::Clusters::MediaInput::Commands::HideInputStatusRequest::Type; RequestType request; @@ -34176,7 +34600,7 @@ class TV_MediaInputCluster : public TestCommand CHIP_ERROR TestShowInputStatusCommand_5() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type; + using RequestType = chip::app::Clusters::MediaInput::Commands::ShowInputStatusRequest::Type; RequestType request; @@ -34199,7 +34623,7 @@ class TV_MediaInputCluster : public TestCommand CHIP_ERROR TestRenameInputCommand_6() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::MediaInput::Commands::RenameInput::Type; + using RequestType = chip::app::Clusters::MediaInput::Commands::RenameInputRequest::Type; RequestType request; request.index = 1; @@ -34693,12 +35117,12 @@ class TestCluster : public TestCommand err = TestReadAttributeOctetStringWithEmbeddedNull_109(); break; case 110: - ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute OCTET_STRING\n"); - err = TestWriteAttributeOctetString_110(); + ChipLogProgress(chipTool, " ***** Test Step 110 : Write attribute OCTET_STRING with weird chars\n"); + err = TestWriteAttributeOctetStringWithWeirdChars_110(); break; case 111: - ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute OCTET_STRING\n"); - err = TestReadAttributeOctetString_111(); + ChipLogProgress(chipTool, " ***** Test Step 111 : Read attribute OCTET_STRING with weird chars\n"); + err = TestReadAttributeOctetStringWithWeirdChars_111(); break; case 112: ChipLogProgress(chipTool, " ***** Test Step 112 : Write attribute OCTET_STRING\n"); @@ -34713,753 +35137,1535 @@ class TestCluster : public TestCommand err = TestWriteAttributeOctetString_114(); break; case 115: - ChipLogProgress(chipTool, " ***** Test Step 115 : Read attribute LONG_OCTET_STRING Default Value\n"); - err = TestReadAttributeLongOctetStringDefaultValue_115(); + ChipLogProgress(chipTool, " ***** Test Step 115 : Read attribute OCTET_STRING\n"); + err = TestReadAttributeOctetString_115(); break; case 116: - ChipLogProgress(chipTool, " ***** Test Step 116 : Write attribute LONG_OCTET_STRING\n"); - err = TestWriteAttributeLongOctetString_116(); + ChipLogProgress(chipTool, " ***** Test Step 116 : Write attribute OCTET_STRING\n"); + err = TestWriteAttributeOctetString_116(); break; case 117: - ChipLogProgress(chipTool, " ***** Test Step 117 : Read attribute LONG_OCTET_STRING\n"); - err = TestReadAttributeLongOctetString_117(); + ChipLogProgress(chipTool, " ***** Test Step 117 : Read attribute LONG_OCTET_STRING Default Value\n"); + err = TestReadAttributeLongOctetStringDefaultValue_117(); break; case 118: ChipLogProgress(chipTool, " ***** Test Step 118 : Write attribute LONG_OCTET_STRING\n"); err = TestWriteAttributeLongOctetString_118(); break; case 119: - ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute CHAR_STRING Default Value\n"); - err = TestReadAttributeCharStringDefaultValue_119(); + ChipLogProgress(chipTool, " ***** Test Step 119 : Read attribute LONG_OCTET_STRING\n"); + err = TestReadAttributeLongOctetString_119(); break; case 120: - ChipLogProgress(chipTool, " ***** Test Step 120 : Write attribute CHAR_STRING\n"); - err = TestWriteAttributeCharString_120(); + ChipLogProgress(chipTool, " ***** Test Step 120 : Write attribute LONG_OCTET_STRING\n"); + err = TestWriteAttributeLongOctetString_120(); break; case 121: - ChipLogProgress(chipTool, " ***** Test Step 121 : Read attribute CHAR_STRING\n"); - err = TestReadAttributeCharString_121(); + ChipLogProgress(chipTool, " ***** Test Step 121 : Read attribute CHAR_STRING Default Value\n"); + err = TestReadAttributeCharStringDefaultValue_121(); break; case 122: - ChipLogProgress(chipTool, " ***** Test Step 122 : Write attribute CHAR_STRING - Value too long\n"); - err = TestWriteAttributeCharStringValueTooLong_122(); + ChipLogProgress(chipTool, " ***** Test Step 122 : Write attribute CHAR_STRING\n"); + err = TestWriteAttributeCharString_122(); break; case 123: ChipLogProgress(chipTool, " ***** Test Step 123 : Read attribute CHAR_STRING\n"); err = TestReadAttributeCharString_123(); break; case 124: - ChipLogProgress(chipTool, " ***** Test Step 124 : Write attribute CHAR_STRING - Empty\n"); - err = TestWriteAttributeCharStringEmpty_124(); + ChipLogProgress(chipTool, " ***** Test Step 124 : Write attribute CHAR_STRING - Value too long\n"); + err = TestWriteAttributeCharStringValueTooLong_124(); break; case 125: - ChipLogProgress(chipTool, " ***** Test Step 125 : Read attribute LONG_CHAR_STRING Default Value\n"); - err = TestReadAttributeLongCharStringDefaultValue_125(); + ChipLogProgress(chipTool, " ***** Test Step 125 : Read attribute CHAR_STRING\n"); + err = TestReadAttributeCharString_125(); break; case 126: - ChipLogProgress(chipTool, " ***** Test Step 126 : Write attribute LONG_CHAR_STRING\n"); - err = TestWriteAttributeLongCharString_126(); + ChipLogProgress(chipTool, " ***** Test Step 126 : Write attribute CHAR_STRING - Empty\n"); + err = TestWriteAttributeCharStringEmpty_126(); break; case 127: - ChipLogProgress(chipTool, " ***** Test Step 127 : Read attribute LONG_CHAR_STRING\n"); - err = TestReadAttributeLongCharString_127(); + ChipLogProgress(chipTool, " ***** Test Step 127 : Read attribute LONG_CHAR_STRING Default Value\n"); + err = TestReadAttributeLongCharStringDefaultValue_127(); break; case 128: ChipLogProgress(chipTool, " ***** Test Step 128 : Write attribute LONG_CHAR_STRING\n"); err = TestWriteAttributeLongCharString_128(); break; case 129: - ChipLogProgress(chipTool, " ***** Test Step 129 : Read attribute LIST_LONG_OCTET_STRING\n"); - err = TestReadAttributeListLongOctetString_129(); + ChipLogProgress(chipTool, " ***** Test Step 129 : Read attribute LONG_CHAR_STRING\n"); + err = TestReadAttributeLongCharString_129(); break; case 130: - ChipLogProgress(chipTool, " ***** Test Step 130 : Read attribute EPOCH_US Default Value\n"); - err = TestReadAttributeEpochUsDefaultValue_130(); + ChipLogProgress(chipTool, " ***** Test Step 130 : Write attribute LONG_CHAR_STRING\n"); + err = TestWriteAttributeLongCharString_130(); break; case 131: - ChipLogProgress(chipTool, " ***** Test Step 131 : Write attribute EPOCH_US Max Value\n"); - err = TestWriteAttributeEpochUsMaxValue_131(); + ChipLogProgress(chipTool, " ***** Test Step 131 : Read attribute LIST_LONG_OCTET_STRING\n"); + err = TestReadAttributeListLongOctetString_131(); break; case 132: - ChipLogProgress(chipTool, " ***** Test Step 132 : Read attribute EPOCH_US Max Value\n"); - err = TestReadAttributeEpochUsMaxValue_132(); + ChipLogProgress(chipTool, " ***** Test Step 132 : Read attribute EPOCH_US Default Value\n"); + err = TestReadAttributeEpochUsDefaultValue_132(); break; case 133: - ChipLogProgress(chipTool, " ***** Test Step 133 : Write attribute EPOCH_US Min Value\n"); - err = TestWriteAttributeEpochUsMinValue_133(); + ChipLogProgress(chipTool, " ***** Test Step 133 : Write attribute EPOCH_US Max Value\n"); + err = TestWriteAttributeEpochUsMaxValue_133(); break; case 134: - ChipLogProgress(chipTool, " ***** Test Step 134 : Read attribute EPOCH_US Min Value\n"); - err = TestReadAttributeEpochUsMinValue_134(); + ChipLogProgress(chipTool, " ***** Test Step 134 : Read attribute EPOCH_US Max Value\n"); + err = TestReadAttributeEpochUsMaxValue_134(); break; case 135: - ChipLogProgress(chipTool, " ***** Test Step 135 : Read attribute EPOCH_S Default Value\n"); - err = TestReadAttributeEpochSDefaultValue_135(); + ChipLogProgress(chipTool, " ***** Test Step 135 : Write attribute EPOCH_US Min Value\n"); + err = TestWriteAttributeEpochUsMinValue_135(); break; case 136: - ChipLogProgress(chipTool, " ***** Test Step 136 : Write attribute EPOCH_S Max Value\n"); - err = TestWriteAttributeEpochSMaxValue_136(); + ChipLogProgress(chipTool, " ***** Test Step 136 : Read attribute EPOCH_US Min Value\n"); + err = TestReadAttributeEpochUsMinValue_136(); break; case 137: - ChipLogProgress(chipTool, " ***** Test Step 137 : Read attribute EPOCH_S Max Value\n"); - err = TestReadAttributeEpochSMaxValue_137(); + ChipLogProgress(chipTool, " ***** Test Step 137 : Read attribute EPOCH_S Default Value\n"); + err = TestReadAttributeEpochSDefaultValue_137(); break; case 138: - ChipLogProgress(chipTool, " ***** Test Step 138 : Write attribute EPOCH_S Min Value\n"); - err = TestWriteAttributeEpochSMinValue_138(); + ChipLogProgress(chipTool, " ***** Test Step 138 : Write attribute EPOCH_S Max Value\n"); + err = TestWriteAttributeEpochSMaxValue_138(); break; case 139: - ChipLogProgress(chipTool, " ***** Test Step 139 : Read attribute EPOCH_S Min Value\n"); - err = TestReadAttributeEpochSMinValue_139(); + ChipLogProgress(chipTool, " ***** Test Step 139 : Read attribute EPOCH_S Max Value\n"); + err = TestReadAttributeEpochSMaxValue_139(); break; case 140: - ChipLogProgress(chipTool, " ***** Test Step 140 : Read attribute UNSUPPORTED\n"); - err = TestReadAttributeUnsupported_140(); + ChipLogProgress(chipTool, " ***** Test Step 140 : Write attribute EPOCH_S Min Value\n"); + err = TestWriteAttributeEpochSMinValue_140(); break; case 141: - ChipLogProgress(chipTool, " ***** Test Step 141 : Writeattribute UNSUPPORTED\n"); - err = TestWriteattributeUnsupported_141(); + ChipLogProgress(chipTool, " ***** Test Step 141 : Read attribute EPOCH_S Min Value\n"); + err = TestReadAttributeEpochSMinValue_141(); break; case 142: - ChipLogProgress(chipTool, " ***** Test Step 142 : Send Test Command to unsupported endpoint\n"); - err = TestSendTestCommandToUnsupportedEndpoint_142(); + ChipLogProgress(chipTool, " ***** Test Step 142 : Read attribute UNSUPPORTED\n"); + err = TestReadAttributeUnsupported_142(); break; case 143: - ChipLogProgress(chipTool, " ***** Test Step 143 : Send Test Command to unsupported cluster\n"); - err = TestSendTestCommandToUnsupportedCluster_143(); + ChipLogProgress(chipTool, " ***** Test Step 143 : Writeattribute UNSUPPORTED\n"); + err = TestWriteattributeUnsupported_143(); break; case 144: - ChipLogProgress(chipTool, " ***** Test Step 144 : Read attribute vendor_id Default Value\n"); - err = TestReadAttributeVendorIdDefaultValue_144(); + ChipLogProgress(chipTool, " ***** Test Step 144 : Send Test Command to unsupported endpoint\n"); + err = TestSendTestCommandToUnsupportedEndpoint_144(); break; case 145: - ChipLogProgress(chipTool, " ***** Test Step 145 : Write attribute vendor_id\n"); - err = TestWriteAttributeVendorId_145(); + ChipLogProgress(chipTool, " ***** Test Step 145 : Send Test Command to unsupported cluster\n"); + err = TestSendTestCommandToUnsupportedCluster_145(); break; case 146: - ChipLogProgress(chipTool, " ***** Test Step 146 : Read attribute vendor_id\n"); - err = TestReadAttributeVendorId_146(); + ChipLogProgress(chipTool, " ***** Test Step 146 : Read attribute vendor_id Default Value\n"); + err = TestReadAttributeVendorIdDefaultValue_146(); break; case 147: - ChipLogProgress(chipTool, " ***** Test Step 147 : Restore attribute vendor_id\n"); - err = TestRestoreAttributeVendorId_147(); + ChipLogProgress(chipTool, " ***** Test Step 147 : Write attribute vendor_id\n"); + err = TestWriteAttributeVendorId_147(); break; case 148: - ChipLogProgress(chipTool, " ***** Test Step 148 : Send a command with a vendor_id and enum\n"); - err = TestSendACommandWithAVendorIdAndEnum_148(); + ChipLogProgress(chipTool, " ***** Test Step 148 : Read attribute vendor_id\n"); + err = TestReadAttributeVendorId_148(); break; case 149: - ChipLogProgress(chipTool, " ***** Test Step 149 : Send Test Command With Struct Argument and arg1.b is true\n"); - err = TestSendTestCommandWithStructArgumentAndArg1bIsTrue_149(); + ChipLogProgress(chipTool, " ***** Test Step 149 : Restore attribute vendor_id\n"); + err = TestRestoreAttributeVendorId_149(); break; case 150: - ChipLogProgress(chipTool, " ***** Test Step 150 : Send Test Command With Struct Argument and arg1.b is false\n"); - err = TestSendTestCommandWithStructArgumentAndArg1bIsFalse_150(); + ChipLogProgress(chipTool, " ***** Test Step 150 : Send a command with a vendor_id and enum\n"); + err = TestSendACommandWithAVendorIdAndEnum_150(); break; case 151: - ChipLogProgress(chipTool, - " ***** Test Step 151 : Send Test Command With Nested Struct Argument and arg1.c.b is true\n"); - err = TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_151(); + ChipLogProgress(chipTool, " ***** Test Step 151 : Send Test Command With Struct Argument and arg1.b is true\n"); + err = TestSendTestCommandWithStructArgumentAndArg1bIsTrue_151(); break; case 152: - ChipLogProgress(chipTool, " ***** Test Step 152 : Send Test Command With Nested Struct Argument arg1.c.b is false\n"); - err = TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_152(); + ChipLogProgress(chipTool, " ***** Test Step 152 : Send Test Command With Struct Argument and arg1.b is false\n"); + err = TestSendTestCommandWithStructArgumentAndArg1bIsFalse_152(); break; case 153: - ChipLogProgress( - chipTool, - " ***** Test Step 153 : Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_153(); + ChipLogProgress(chipTool, + " ***** Test Step 153 : Send Test Command With Nested Struct Argument and arg1.c.b is true\n"); + err = TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_153(); break; case 154: - ChipLogProgress(chipTool, - " ***** Test Step 154 : Send Test Command With Nested Struct List Argument and some fields b of arg1.d " - "are false\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_154(); + ChipLogProgress(chipTool, " ***** Test Step 154 : Send Test Command With Nested Struct Argument arg1.c.b is false\n"); + err = TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_154(); break; case 155: - ChipLogProgress(chipTool, " ***** Test Step 155 : Send Test Command With Struct Argument and see what we get back\n"); - err = TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_155(); + ChipLogProgress( + chipTool, + " ***** Test Step 155 : Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true\n"); + err = TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_155(); break; case 156: - ChipLogProgress(chipTool, " ***** Test Step 156 : Send Test Command With List of INT8U and none of them is set to 0\n"); - err = TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_156(); + ChipLogProgress(chipTool, + " ***** Test Step 156 : Send Test Command With Nested Struct List Argument and some fields b of arg1.d " + "are false\n"); + err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_156(); break; case 157: - ChipLogProgress(chipTool, " ***** Test Step 157 : Send Test Command With List of INT8U and one of them is set to 0\n"); - err = TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_157(); + ChipLogProgress(chipTool, " ***** Test Step 157 : Send Test Command With Struct Argument and see what we get back\n"); + err = TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_157(); break; case 158: - ChipLogProgress(chipTool, " ***** Test Step 158 : Send Test Command With List of INT8U and get it reversed\n"); - err = TestSendTestCommandWithListOfInt8uAndGetItReversed_158(); + ChipLogProgress(chipTool, " ***** Test Step 158 : Send Test Command With List of INT8U and none of them is set to 0\n"); + err = TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_158(); break; case 159: - ChipLogProgress(chipTool, - " ***** Test Step 159 : Send Test Command With empty List of INT8U and get an empty list back\n"); - err = TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_159(); + ChipLogProgress(chipTool, " ***** Test Step 159 : Send Test Command With List of INT8U and one of them is set to 0\n"); + err = TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_159(); break; case 160: - ChipLogProgress( - chipTool, - " ***** Test Step 160 : Send Test Command With List of Struct Argument and arg1.b of first item is true\n"); - err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_160(); + ChipLogProgress(chipTool, " ***** Test Step 160 : Send Test Command With List of INT8U and get it reversed\n"); + err = TestSendTestCommandWithListOfInt8uAndGetItReversed_160(); break; case 161: - ChipLogProgress( - chipTool, - " ***** Test Step 161 : Send Test Command With List of Struct Argument and arg1.b of first item is false\n"); - err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_161(); + ChipLogProgress(chipTool, + " ***** Test Step 161 : Send Test Command With empty List of INT8U and get an empty list back\n"); + err = TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_161(); break; case 162: - ChipLogProgress(chipTool, - " ***** Test Step 162 : Send Test Command With List of Nested Struct List Argument and all fields b of " - "elements of arg1.d are true\n"); - err = TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_162(); + ChipLogProgress( + chipTool, + " ***** Test Step 162 : Send Test Command With List of Struct Argument and arg1.b of first item is true\n"); + err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_162(); break; case 163: - ChipLogProgress(chipTool, - " ***** Test Step 163 : Send Test Command With Nested Struct List Argument and some fields b of " - "elements of arg1.d are false\n"); - err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_163(); + ChipLogProgress( + chipTool, + " ***** Test Step 163 : Send Test Command With List of Struct Argument and arg1.b of first item is false\n"); + err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_163(); break; case 164: ChipLogProgress(chipTool, - " ***** Test Step 164 : Write attribute LIST With List of INT8U and none of them is set to 0\n"); - err = TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_164(); + " ***** Test Step 164 : Send Test Command With List of Nested Struct List Argument and all fields b of " + "elements of arg1.d are true\n"); + err = TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_164(); break; case 165: - ChipLogProgress(chipTool, " ***** Test Step 165 : Read attribute LIST With List of INT8U\n"); - err = TestReadAttributeListWithListOfInt8u_165(); + ChipLogProgress(chipTool, + " ***** Test Step 165 : Send Test Command With Nested Struct List Argument and some fields b of " + "elements of arg1.d are false\n"); + err = TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_165(); break; case 166: - ChipLogProgress(chipTool, " ***** Test Step 166 : Write attribute LIST With List of OCTET_STRING\n"); - err = TestWriteAttributeListWithListOfOctetString_166(); + ChipLogProgress(chipTool, + " ***** Test Step 166 : Write attribute LIST With List of INT8U and none of them is set to 0\n"); + err = TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_166(); break; case 167: - ChipLogProgress(chipTool, " ***** Test Step 167 : Read attribute LIST With List of OCTET_STRING\n"); - err = TestReadAttributeListWithListOfOctetString_167(); + ChipLogProgress(chipTool, " ***** Test Step 167 : Read attribute LIST With List of INT8U\n"); + err = TestReadAttributeListWithListOfInt8u_167(); break; case 168: - ChipLogProgress(chipTool, " ***** Test Step 168 : Write attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); - err = TestWriteAttributeListWithListOfListStructOctetString_168(); + ChipLogProgress(chipTool, " ***** Test Step 168 : Write attribute LIST With List of OCTET_STRING\n"); + err = TestWriteAttributeListWithListOfOctetString_168(); break; case 169: - ChipLogProgress(chipTool, " ***** Test Step 169 : Read attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); - err = TestReadAttributeListWithListOfListStructOctetString_169(); + ChipLogProgress(chipTool, " ***** Test Step 169 : Read attribute LIST With List of OCTET_STRING\n"); + err = TestReadAttributeListWithListOfOctetString_169(); break; case 170: - ChipLogProgress(chipTool, " ***** Test Step 170 : Send Test Command with optional arg set.\n"); - err = TestSendTestCommandWithOptionalArgSet_170(); + ChipLogProgress(chipTool, " ***** Test Step 170 : Write attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); + err = TestWriteAttributeListWithListOfListStructOctetString_170(); break; case 171: - ChipLogProgress(chipTool, " ***** Test Step 171 : Send Test Command without its optional arg.\n"); - err = TestSendTestCommandWithoutItsOptionalArg_171(); + ChipLogProgress(chipTool, " ***** Test Step 171 : Read attribute LIST With List of LIST_STRUCT_OCTET_STRING\n"); + err = TestReadAttributeListWithListOfListStructOctetString_171(); break; case 172: - ChipLogProgress(chipTool, " ***** Test Step 172 : Write attribute NULLABLE_BOOLEAN null\n"); - err = TestWriteAttributeNullableBooleanNull_172(); + ChipLogProgress(chipTool, " ***** Test Step 172 : Send Test Command with optional arg set.\n"); + err = TestSendTestCommandWithOptionalArgSet_172(); break; case 173: - ChipLogProgress(chipTool, " ***** Test Step 173 : Read attribute NULLABLE_BOOLEAN null\n"); - err = TestReadAttributeNullableBooleanNull_173(); + ChipLogProgress(chipTool, " ***** Test Step 173 : Send Test Command without its optional arg.\n"); + err = TestSendTestCommandWithoutItsOptionalArg_173(); break; case 174: - ChipLogProgress(chipTool, " ***** Test Step 174 : Write attribute NULLABLE_BOOLEAN True\n"); - err = TestWriteAttributeNullableBooleanTrue_174(); + ChipLogProgress(chipTool, " ***** Test Step 174 : Write attribute NULLABLE_BOOLEAN null\n"); + err = TestWriteAttributeNullableBooleanNull_174(); break; case 175: - ChipLogProgress(chipTool, " ***** Test Step 175 : Read attribute NULLABLE_BOOLEAN True\n"); - err = TestReadAttributeNullableBooleanTrue_175(); + ChipLogProgress(chipTool, " ***** Test Step 175 : Read attribute NULLABLE_BOOLEAN null\n"); + err = TestReadAttributeNullableBooleanNull_175(); break; case 176: - ChipLogProgress(chipTool, " ***** Test Step 176 : Write attribute NULLABLE_BITMAP8 Max Value\n"); - err = TestWriteAttributeNullableBitmap8MaxValue_176(); + ChipLogProgress(chipTool, " ***** Test Step 176 : Write attribute NULLABLE_BOOLEAN True\n"); + err = TestWriteAttributeNullableBooleanTrue_176(); break; case 177: - ChipLogProgress(chipTool, " ***** Test Step 177 : Read attribute NULLABLE_BITMAP8 Max Value\n"); - err = TestReadAttributeNullableBitmap8MaxValue_177(); + ChipLogProgress(chipTool, " ***** Test Step 177 : Read attribute NULLABLE_BOOLEAN True\n"); + err = TestReadAttributeNullableBooleanTrue_177(); break; case 178: - ChipLogProgress(chipTool, " ***** Test Step 178 : Write attribute NULLABLE_BITMAP8 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap8InvalidValue_178(); + ChipLogProgress(chipTool, " ***** Test Step 178 : Write attribute NULLABLE_BITMAP8 Max Value\n"); + err = TestWriteAttributeNullableBitmap8MaxValue_178(); break; case 179: - ChipLogProgress(chipTool, " ***** Test Step 179 : Read attribute NULLABLE_BITMAP8 unchanged Value\n"); - err = TestReadAttributeNullableBitmap8UnchangedValue_179(); + ChipLogProgress(chipTool, " ***** Test Step 179 : Read attribute NULLABLE_BITMAP8 Max Value\n"); + err = TestReadAttributeNullableBitmap8MaxValue_179(); break; case 180: - ChipLogProgress(chipTool, " ***** Test Step 180 : Write attribute NULLABLE_BITMAP8 null Value\n"); - err = TestWriteAttributeNullableBitmap8NullValue_180(); + ChipLogProgress(chipTool, " ***** Test Step 180 : Write attribute NULLABLE_BITMAP8 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap8InvalidValue_180(); break; case 181: - ChipLogProgress(chipTool, " ***** Test Step 181 : Read attribute NULLABLE_BITMAP8 null Value\n"); - err = TestReadAttributeNullableBitmap8NullValue_181(); + ChipLogProgress(chipTool, " ***** Test Step 181 : Read attribute NULLABLE_BITMAP8 unchanged Value\n"); + err = TestReadAttributeNullableBitmap8UnchangedValue_181(); break; case 182: - ChipLogProgress(chipTool, " ***** Test Step 182 : Write attribute NULLABLE_BITMAP16 Max Value\n"); - err = TestWriteAttributeNullableBitmap16MaxValue_182(); + ChipLogProgress(chipTool, " ***** Test Step 182 : Write attribute NULLABLE_BITMAP8 null Value\n"); + err = TestWriteAttributeNullableBitmap8NullValue_182(); break; case 183: - ChipLogProgress(chipTool, " ***** Test Step 183 : Read attribute NULLABLE_BITMAP16 Max Value\n"); - err = TestReadAttributeNullableBitmap16MaxValue_183(); + ChipLogProgress(chipTool, " ***** Test Step 183 : Read attribute NULLABLE_BITMAP8 null Value\n"); + err = TestReadAttributeNullableBitmap8NullValue_183(); break; case 184: - ChipLogProgress(chipTool, " ***** Test Step 184 : Write attribute NULLABLE_BITMAP16 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap16InvalidValue_184(); + ChipLogProgress(chipTool, " ***** Test Step 184 : Write attribute NULLABLE_BITMAP16 Max Value\n"); + err = TestWriteAttributeNullableBitmap16MaxValue_184(); break; case 185: - ChipLogProgress(chipTool, " ***** Test Step 185 : Read attribute NULLABLE_BITMAP16 unchanged Value\n"); - err = TestReadAttributeNullableBitmap16UnchangedValue_185(); + ChipLogProgress(chipTool, " ***** Test Step 185 : Read attribute NULLABLE_BITMAP16 Max Value\n"); + err = TestReadAttributeNullableBitmap16MaxValue_185(); break; case 186: - ChipLogProgress(chipTool, " ***** Test Step 186 : Write attribute NULLABLE_BITMAP16 null Value\n"); - err = TestWriteAttributeNullableBitmap16NullValue_186(); + ChipLogProgress(chipTool, " ***** Test Step 186 : Write attribute NULLABLE_BITMAP16 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap16InvalidValue_186(); break; case 187: - ChipLogProgress(chipTool, " ***** Test Step 187 : Read attribute NULLABLE_BITMAP16 null Value\n"); - err = TestReadAttributeNullableBitmap16NullValue_187(); + ChipLogProgress(chipTool, " ***** Test Step 187 : Read attribute NULLABLE_BITMAP16 unchanged Value\n"); + err = TestReadAttributeNullableBitmap16UnchangedValue_187(); break; case 188: - ChipLogProgress(chipTool, " ***** Test Step 188 : Write attribute NULLABLE_BITMAP32 Max Value\n"); - err = TestWriteAttributeNullableBitmap32MaxValue_188(); + ChipLogProgress(chipTool, " ***** Test Step 188 : Write attribute NULLABLE_BITMAP16 null Value\n"); + err = TestWriteAttributeNullableBitmap16NullValue_188(); break; case 189: - ChipLogProgress(chipTool, " ***** Test Step 189 : Read attribute NULLABLE_BITMAP32 Max Value\n"); - err = TestReadAttributeNullableBitmap32MaxValue_189(); + ChipLogProgress(chipTool, " ***** Test Step 189 : Read attribute NULLABLE_BITMAP16 null Value\n"); + err = TestReadAttributeNullableBitmap16NullValue_189(); break; case 190: - ChipLogProgress(chipTool, " ***** Test Step 190 : Write attribute NULLABLE_BITMAP32 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap32InvalidValue_190(); + ChipLogProgress(chipTool, " ***** Test Step 190 : Write attribute NULLABLE_BITMAP32 Max Value\n"); + err = TestWriteAttributeNullableBitmap32MaxValue_190(); break; case 191: - ChipLogProgress(chipTool, " ***** Test Step 191 : Read attribute NULLABLE_BITMAP32 unchanged Value\n"); - err = TestReadAttributeNullableBitmap32UnchangedValue_191(); + ChipLogProgress(chipTool, " ***** Test Step 191 : Read attribute NULLABLE_BITMAP32 Max Value\n"); + err = TestReadAttributeNullableBitmap32MaxValue_191(); break; case 192: - ChipLogProgress(chipTool, " ***** Test Step 192 : Write attribute NULLABLE_BITMAP32 null Value\n"); - err = TestWriteAttributeNullableBitmap32NullValue_192(); + ChipLogProgress(chipTool, " ***** Test Step 192 : Write attribute NULLABLE_BITMAP32 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap32InvalidValue_192(); break; case 193: - ChipLogProgress(chipTool, " ***** Test Step 193 : Read attribute NULLABLE_BITMAP32 null Value\n"); - err = TestReadAttributeNullableBitmap32NullValue_193(); + ChipLogProgress(chipTool, " ***** Test Step 193 : Read attribute NULLABLE_BITMAP32 unchanged Value\n"); + err = TestReadAttributeNullableBitmap32UnchangedValue_193(); break; case 194: - ChipLogProgress(chipTool, " ***** Test Step 194 : Write attribute NULLABLE_BITMAP64 Max Value\n"); - err = TestWriteAttributeNullableBitmap64MaxValue_194(); + ChipLogProgress(chipTool, " ***** Test Step 194 : Write attribute NULLABLE_BITMAP32 null Value\n"); + err = TestWriteAttributeNullableBitmap32NullValue_194(); break; case 195: - ChipLogProgress(chipTool, " ***** Test Step 195 : Read attribute NULLABLE_BITMAP64 Max Value\n"); - err = TestReadAttributeNullableBitmap64MaxValue_195(); + ChipLogProgress(chipTool, " ***** Test Step 195 : Read attribute NULLABLE_BITMAP32 null Value\n"); + err = TestReadAttributeNullableBitmap32NullValue_195(); break; case 196: - ChipLogProgress(chipTool, " ***** Test Step 196 : Write attribute NULLABLE_BITMAP64 Invalid Value\n"); - err = TestWriteAttributeNullableBitmap64InvalidValue_196(); + ChipLogProgress(chipTool, " ***** Test Step 196 : Write attribute NULLABLE_BITMAP64 Max Value\n"); + err = TestWriteAttributeNullableBitmap64MaxValue_196(); break; case 197: - ChipLogProgress(chipTool, " ***** Test Step 197 : Read attribute NULLABLE_BITMAP64 unchanged Value\n"); - err = TestReadAttributeNullableBitmap64UnchangedValue_197(); + ChipLogProgress(chipTool, " ***** Test Step 197 : Read attribute NULLABLE_BITMAP64 Max Value\n"); + err = TestReadAttributeNullableBitmap64MaxValue_197(); break; case 198: - ChipLogProgress(chipTool, " ***** Test Step 198 : Write attribute NULLABLE_BITMAP64 null Value\n"); - err = TestWriteAttributeNullableBitmap64NullValue_198(); + ChipLogProgress(chipTool, " ***** Test Step 198 : Write attribute NULLABLE_BITMAP64 Invalid Value\n"); + err = TestWriteAttributeNullableBitmap64InvalidValue_198(); break; case 199: - ChipLogProgress(chipTool, " ***** Test Step 199 : Read attribute NULLABLE_BITMAP64 null Value\n"); - err = TestReadAttributeNullableBitmap64NullValue_199(); + ChipLogProgress(chipTool, " ***** Test Step 199 : Read attribute NULLABLE_BITMAP64 unchanged Value\n"); + err = TestReadAttributeNullableBitmap64UnchangedValue_199(); break; case 200: - ChipLogProgress(chipTool, " ***** Test Step 200 : Write attribute NULLABLE_INT8U Max Value\n"); - err = TestWriteAttributeNullableInt8uMaxValue_200(); + ChipLogProgress(chipTool, " ***** Test Step 200 : Write attribute NULLABLE_BITMAP64 null Value\n"); + err = TestWriteAttributeNullableBitmap64NullValue_200(); break; case 201: - ChipLogProgress(chipTool, " ***** Test Step 201 : Read attribute NULLABLE_INT8U Max Value\n"); - err = TestReadAttributeNullableInt8uMaxValue_201(); + ChipLogProgress(chipTool, " ***** Test Step 201 : Read attribute NULLABLE_BITMAP64 null Value\n"); + err = TestReadAttributeNullableBitmap64NullValue_201(); break; case 202: - ChipLogProgress(chipTool, " ***** Test Step 202 : Write attribute NULLABLE_INT8U Invalid Value\n"); - err = TestWriteAttributeNullableInt8uInvalidValue_202(); + ChipLogProgress(chipTool, " ***** Test Step 202 : Write attribute NULLABLE_INT8U Min Value\n"); + err = TestWriteAttributeNullableInt8uMinValue_202(); break; case 203: - ChipLogProgress(chipTool, " ***** Test Step 203 : Read attribute NULLABLE_INT8U unchanged Value\n"); - err = TestReadAttributeNullableInt8uUnchangedValue_203(); + ChipLogProgress(chipTool, " ***** Test Step 203 : Read attribute NULLABLE_INT8U Min Value\n"); + err = TestReadAttributeNullableInt8uMinValue_203(); break; case 204: - ChipLogProgress(chipTool, " ***** Test Step 204 : Write attribute NULLABLE_INT8U null Value\n"); - err = TestWriteAttributeNullableInt8uNullValue_204(); + ChipLogProgress(chipTool, " ***** Test Step 204 : Write attribute NULLABLE_INT8U Max Value\n"); + err = TestWriteAttributeNullableInt8uMaxValue_204(); break; case 205: - ChipLogProgress(chipTool, " ***** Test Step 205 : Read attribute NULLABLE_INT8U null Value\n"); - err = TestReadAttributeNullableInt8uNullValue_205(); + ChipLogProgress(chipTool, " ***** Test Step 205 : Read attribute NULLABLE_INT8U Max Value\n"); + err = TestReadAttributeNullableInt8uMaxValue_205(); break; case 206: - ChipLogProgress(chipTool, " ***** Test Step 206 : Write attribute NULLABLE_INT16U Max Value\n"); - err = TestWriteAttributeNullableInt16uMaxValue_206(); + ChipLogProgress(chipTool, " ***** Test Step 206 : Write attribute NULLABLE_INT8U Invalid Value\n"); + err = TestWriteAttributeNullableInt8uInvalidValue_206(); break; case 207: - ChipLogProgress(chipTool, " ***** Test Step 207 : Read attribute NULLABLE_INT16U Max Value\n"); - err = TestReadAttributeNullableInt16uMaxValue_207(); + ChipLogProgress(chipTool, " ***** Test Step 207 : Read attribute NULLABLE_INT8U unchanged Value\n"); + err = TestReadAttributeNullableInt8uUnchangedValue_207(); break; case 208: - ChipLogProgress(chipTool, " ***** Test Step 208 : Write attribute NULLABLE_INT16U Invalid Value\n"); - err = TestWriteAttributeNullableInt16uInvalidValue_208(); + ChipLogProgress(chipTool, " ***** Test Step 208 : Read attribute NULLABLE_INT8U unchanged Value with constraint\n"); + err = TestReadAttributeNullableInt8uUnchangedValueWithConstraint_208(); break; case 209: - ChipLogProgress(chipTool, " ***** Test Step 209 : Read attribute NULLABLE_INT16U unchanged Value\n"); - err = TestReadAttributeNullableInt16uUnchangedValue_209(); + ChipLogProgress(chipTool, " ***** Test Step 209 : Write attribute NULLABLE_INT8U null Value\n"); + err = TestWriteAttributeNullableInt8uNullValue_209(); break; case 210: - ChipLogProgress(chipTool, " ***** Test Step 210 : Write attribute NULLABLE_INT16U null Value\n"); - err = TestWriteAttributeNullableInt16uNullValue_210(); + ChipLogProgress(chipTool, " ***** Test Step 210 : Read attribute NULLABLE_INT8U null Value\n"); + err = TestReadAttributeNullableInt8uNullValue_210(); break; case 211: - ChipLogProgress(chipTool, " ***** Test Step 211 : Read attribute NULLABLE_INT16U null Value\n"); - err = TestReadAttributeNullableInt16uNullValue_211(); + ChipLogProgress(chipTool, " ***** Test Step 211 : Read attribute NULLABLE_INT8U null Value & range\n"); + err = TestReadAttributeNullableInt8uNullValueRange_211(); break; case 212: - ChipLogProgress(chipTool, " ***** Test Step 212 : Write attribute NULLABLE_INT32U Max Value\n"); - err = TestWriteAttributeNullableInt32uMaxValue_212(); + ChipLogProgress(chipTool, " ***** Test Step 212 : Read attribute NULLABLE_INT8U null Value & not\n"); + err = TestReadAttributeNullableInt8uNullValueNot_212(); break; case 213: - ChipLogProgress(chipTool, " ***** Test Step 213 : Read attribute NULLABLE_INT32U Max Value\n"); - err = TestReadAttributeNullableInt32uMaxValue_213(); + ChipLogProgress(chipTool, " ***** Test Step 213 : Write attribute NULLABLE_INT8U Value\n"); + err = TestWriteAttributeNullableInt8uValue_213(); break; case 214: - ChipLogProgress(chipTool, " ***** Test Step 214 : Write attribute NULLABLE_INT32U Invalid Value\n"); - err = TestWriteAttributeNullableInt32uInvalidValue_214(); + ChipLogProgress(chipTool, " ***** Test Step 214 : Read attribute NULLABLE_INT8U Value in range\n"); + err = TestReadAttributeNullableInt8uValueInRange_214(); break; case 215: - ChipLogProgress(chipTool, " ***** Test Step 215 : Read attribute NULLABLE_INT32U unchanged Value\n"); - err = TestReadAttributeNullableInt32uUnchangedValue_215(); + ChipLogProgress(chipTool, " ***** Test Step 215 : Read attribute NULLABLE_INT8U notValue OK\n"); + err = TestReadAttributeNullableInt8uNotValueOk_215(); break; case 216: - ChipLogProgress(chipTool, " ***** Test Step 216 : Write attribute NULLABLE_INT32U null Value\n"); - err = TestWriteAttributeNullableInt32uNullValue_216(); + ChipLogProgress(chipTool, " ***** Test Step 216 : Write attribute NULLABLE_INT16U Min Value\n"); + err = TestWriteAttributeNullableInt16uMinValue_216(); break; case 217: - ChipLogProgress(chipTool, " ***** Test Step 217 : Read attribute NULLABLE_INT32U null Value\n"); - err = TestReadAttributeNullableInt32uNullValue_217(); + ChipLogProgress(chipTool, " ***** Test Step 217 : Read attribute NULLABLE_INT16U Min Value\n"); + err = TestReadAttributeNullableInt16uMinValue_217(); break; case 218: - ChipLogProgress(chipTool, " ***** Test Step 218 : Write attribute NULLABLE_INT64U Max Value\n"); - err = TestWriteAttributeNullableInt64uMaxValue_218(); + ChipLogProgress(chipTool, " ***** Test Step 218 : Write attribute NULLABLE_INT16U Max Value\n"); + err = TestWriteAttributeNullableInt16uMaxValue_218(); break; case 219: - ChipLogProgress(chipTool, " ***** Test Step 219 : Read attribute NULLABLE_INT64U Max Value\n"); - err = TestReadAttributeNullableInt64uMaxValue_219(); + ChipLogProgress(chipTool, " ***** Test Step 219 : Read attribute NULLABLE_INT16U Max Value\n"); + err = TestReadAttributeNullableInt16uMaxValue_219(); break; case 220: - ChipLogProgress(chipTool, " ***** Test Step 220 : Write attribute NULLABLE_INT64U Invalid Value\n"); - err = TestWriteAttributeNullableInt64uInvalidValue_220(); + ChipLogProgress(chipTool, " ***** Test Step 220 : Write attribute NULLABLE_INT16U Invalid Value\n"); + err = TestWriteAttributeNullableInt16uInvalidValue_220(); break; case 221: - ChipLogProgress(chipTool, " ***** Test Step 221 : Read attribute NULLABLE_INT64U unchanged Value\n"); - err = TestReadAttributeNullableInt64uUnchangedValue_221(); + ChipLogProgress(chipTool, " ***** Test Step 221 : Read attribute NULLABLE_INT16U unchanged Value\n"); + err = TestReadAttributeNullableInt16uUnchangedValue_221(); break; case 222: - ChipLogProgress(chipTool, " ***** Test Step 222 : Write attribute NULLABLE_INT64U null Value\n"); - err = TestWriteAttributeNullableInt64uNullValue_222(); + ChipLogProgress(chipTool, " ***** Test Step 222 : Write attribute NULLABLE_INT16U null Value\n"); + err = TestWriteAttributeNullableInt16uNullValue_222(); break; case 223: - ChipLogProgress(chipTool, " ***** Test Step 223 : Read attribute NULLABLE_INT64U null Value\n"); - err = TestReadAttributeNullableInt64uNullValue_223(); + ChipLogProgress(chipTool, " ***** Test Step 223 : Read attribute NULLABLE_INT16U null Value\n"); + err = TestReadAttributeNullableInt16uNullValue_223(); break; case 224: - ChipLogProgress(chipTool, " ***** Test Step 224 : Write attribute NULLABLE_INT8S Min Value\n"); - err = TestWriteAttributeNullableInt8sMinValue_224(); + ChipLogProgress(chipTool, " ***** Test Step 224 : Read attribute NULLABLE_INT16U null Value & range\n"); + err = TestReadAttributeNullableInt16uNullValueRange_224(); break; case 225: - ChipLogProgress(chipTool, " ***** Test Step 225 : Read attribute NULLABLE_INT8S Min Value\n"); - err = TestReadAttributeNullableInt8sMinValue_225(); + ChipLogProgress(chipTool, " ***** Test Step 225 : Read attribute NULLABLE_INT16U null Value & not\n"); + err = TestReadAttributeNullableInt16uNullValueNot_225(); break; case 226: - ChipLogProgress(chipTool, " ***** Test Step 226 : Write attribute NULLABLE_INT8S Invalid Value\n"); - err = TestWriteAttributeNullableInt8sInvalidValue_226(); + ChipLogProgress(chipTool, " ***** Test Step 226 : Write attribute NULLABLE_INT16U Value\n"); + err = TestWriteAttributeNullableInt16uValue_226(); break; case 227: - ChipLogProgress(chipTool, " ***** Test Step 227 : Read attribute NULLABLE_INT8S unchanged Value\n"); - err = TestReadAttributeNullableInt8sUnchangedValue_227(); + ChipLogProgress(chipTool, " ***** Test Step 227 : Read attribute NULLABLE_INT16U Value in range\n"); + err = TestReadAttributeNullableInt16uValueInRange_227(); break; case 228: - ChipLogProgress(chipTool, " ***** Test Step 228 : Write attribute NULLABLE_INT8S null Value\n"); - err = TestWriteAttributeNullableInt8sNullValue_228(); + ChipLogProgress(chipTool, " ***** Test Step 228 : Read attribute NULLABLE_INT16U notValue OK\n"); + err = TestReadAttributeNullableInt16uNotValueOk_228(); break; case 229: - ChipLogProgress(chipTool, " ***** Test Step 229 : Read attribute NULLABLE_INT8S null Value\n"); - err = TestReadAttributeNullableInt8sNullValue_229(); + ChipLogProgress(chipTool, " ***** Test Step 229 : Write attribute NULLABLE_INT32U Min Value\n"); + err = TestWriteAttributeNullableInt32uMinValue_229(); break; case 230: - ChipLogProgress(chipTool, " ***** Test Step 230 : Write attribute NULLABLE_INT16S Min Value\n"); - err = TestWriteAttributeNullableInt16sMinValue_230(); + ChipLogProgress(chipTool, " ***** Test Step 230 : Read attribute NULLABLE_INT32U Min Value\n"); + err = TestReadAttributeNullableInt32uMinValue_230(); break; case 231: - ChipLogProgress(chipTool, " ***** Test Step 231 : Read attribute NULLABLE_INT16S Min Value\n"); - err = TestReadAttributeNullableInt16sMinValue_231(); + ChipLogProgress(chipTool, " ***** Test Step 231 : Write attribute NULLABLE_INT32U Max Value\n"); + err = TestWriteAttributeNullableInt32uMaxValue_231(); break; case 232: - ChipLogProgress(chipTool, " ***** Test Step 232 : Write attribute NULLABLE_INT16S Invalid Value\n"); - err = TestWriteAttributeNullableInt16sInvalidValue_232(); + ChipLogProgress(chipTool, " ***** Test Step 232 : Read attribute NULLABLE_INT32U Max Value\n"); + err = TestReadAttributeNullableInt32uMaxValue_232(); break; case 233: - ChipLogProgress(chipTool, " ***** Test Step 233 : Read attribute NULLABLE_INT16S unchanged Value\n"); - err = TestReadAttributeNullableInt16sUnchangedValue_233(); + ChipLogProgress(chipTool, " ***** Test Step 233 : Write attribute NULLABLE_INT32U Invalid Value\n"); + err = TestWriteAttributeNullableInt32uInvalidValue_233(); break; case 234: - ChipLogProgress(chipTool, " ***** Test Step 234 : Write attribute NULLABLE_INT16S null Value\n"); - err = TestWriteAttributeNullableInt16sNullValue_234(); + ChipLogProgress(chipTool, " ***** Test Step 234 : Read attribute NULLABLE_INT32U unchanged Value\n"); + err = TestReadAttributeNullableInt32uUnchangedValue_234(); break; case 235: - ChipLogProgress(chipTool, " ***** Test Step 235 : Read attribute NULLABLE_INT16S null Value\n"); - err = TestReadAttributeNullableInt16sNullValue_235(); + ChipLogProgress(chipTool, " ***** Test Step 235 : Write attribute NULLABLE_INT32U null Value\n"); + err = TestWriteAttributeNullableInt32uNullValue_235(); break; case 236: - ChipLogProgress(chipTool, " ***** Test Step 236 : Write attribute NULLABLE_INT32S Min Value\n"); - err = TestWriteAttributeNullableInt32sMinValue_236(); + ChipLogProgress(chipTool, " ***** Test Step 236 : Read attribute NULLABLE_INT32U null Value\n"); + err = TestReadAttributeNullableInt32uNullValue_236(); break; case 237: - ChipLogProgress(chipTool, " ***** Test Step 237 : Read attribute NULLABLE_INT32S Min Value\n"); - err = TestReadAttributeNullableInt32sMinValue_237(); + ChipLogProgress(chipTool, " ***** Test Step 237 : Read attribute NULLABLE_INT32U null Value & range\n"); + err = TestReadAttributeNullableInt32uNullValueRange_237(); break; case 238: - ChipLogProgress(chipTool, " ***** Test Step 238 : Write attribute NULLABLE_INT32S Invalid Value\n"); - err = TestWriteAttributeNullableInt32sInvalidValue_238(); + ChipLogProgress(chipTool, " ***** Test Step 238 : Read attribute NULLABLE_INT32U null Value & not\n"); + err = TestReadAttributeNullableInt32uNullValueNot_238(); break; case 239: - ChipLogProgress(chipTool, " ***** Test Step 239 : Read attribute NULLABLE_INT32S unchanged Value\n"); - err = TestReadAttributeNullableInt32sUnchangedValue_239(); + ChipLogProgress(chipTool, " ***** Test Step 239 : Write attribute NULLABLE_INT32U Value\n"); + err = TestWriteAttributeNullableInt32uValue_239(); break; case 240: - ChipLogProgress(chipTool, " ***** Test Step 240 : Write attribute NULLABLE_INT32S null Value\n"); - err = TestWriteAttributeNullableInt32sNullValue_240(); + ChipLogProgress(chipTool, " ***** Test Step 240 : Read attribute NULLABLE_INT32U Value in range\n"); + err = TestReadAttributeNullableInt32uValueInRange_240(); break; case 241: - ChipLogProgress(chipTool, " ***** Test Step 241 : Read attribute NULLABLE_INT32S null Value\n"); - err = TestReadAttributeNullableInt32sNullValue_241(); + ChipLogProgress(chipTool, " ***** Test Step 241 : Read attribute NULLABLE_INT32U notValue OK\n"); + err = TestReadAttributeNullableInt32uNotValueOk_241(); break; case 242: - ChipLogProgress(chipTool, " ***** Test Step 242 : Write attribute NULLABLE_INT64S Min Value\n"); - err = TestWriteAttributeNullableInt64sMinValue_242(); + ChipLogProgress(chipTool, " ***** Test Step 242 : Write attribute NULLABLE_INT64U Min Value\n"); + err = TestWriteAttributeNullableInt64uMinValue_242(); break; case 243: - ChipLogProgress(chipTool, " ***** Test Step 243 : Read attribute NULLABLE_INT64S Min Value\n"); - err = TestReadAttributeNullableInt64sMinValue_243(); + ChipLogProgress(chipTool, " ***** Test Step 243 : Read attribute NULLABLE_INT64U Min Value\n"); + err = TestReadAttributeNullableInt64uMinValue_243(); break; case 244: - ChipLogProgress(chipTool, " ***** Test Step 244 : Write attribute NULLABLE_INT64S Invalid Value\n"); - err = TestWriteAttributeNullableInt64sInvalidValue_244(); + ChipLogProgress(chipTool, " ***** Test Step 244 : Write attribute NULLABLE_INT64U Max Value\n"); + err = TestWriteAttributeNullableInt64uMaxValue_244(); break; case 245: - ChipLogProgress(chipTool, " ***** Test Step 245 : Read attribute NULLABLE_INT64S unchanged Value\n"); - err = TestReadAttributeNullableInt64sUnchangedValue_245(); + ChipLogProgress(chipTool, " ***** Test Step 245 : Read attribute NULLABLE_INT64U Max Value\n"); + err = TestReadAttributeNullableInt64uMaxValue_245(); break; case 246: - ChipLogProgress(chipTool, " ***** Test Step 246 : Write attribute NULLABLE_INT64S null Value\n"); - err = TestWriteAttributeNullableInt64sNullValue_246(); + ChipLogProgress(chipTool, " ***** Test Step 246 : Write attribute NULLABLE_INT64U Invalid Value\n"); + err = TestWriteAttributeNullableInt64uInvalidValue_246(); break; case 247: - ChipLogProgress(chipTool, " ***** Test Step 247 : Read attribute NULLABLE_INT64S null Value\n"); - err = TestReadAttributeNullableInt64sNullValue_247(); + ChipLogProgress(chipTool, " ***** Test Step 247 : Read attribute NULLABLE_INT64U unchanged Value\n"); + err = TestReadAttributeNullableInt64uUnchangedValue_247(); break; case 248: - ChipLogProgress(chipTool, " ***** Test Step 248 : Write attribute NULLABLE_SINGLE medium Value\n"); - err = TestWriteAttributeNullableSingleMediumValue_248(); + ChipLogProgress(chipTool, " ***** Test Step 248 : Write attribute NULLABLE_INT64U null Value\n"); + err = TestWriteAttributeNullableInt64uNullValue_248(); break; case 249: - ChipLogProgress(chipTool, " ***** Test Step 249 : Read attribute NULLABLE_SINGLE medium Value\n"); - err = TestReadAttributeNullableSingleMediumValue_249(); + ChipLogProgress(chipTool, " ***** Test Step 249 : Read attribute NULLABLE_INT64U null Value\n"); + err = TestReadAttributeNullableInt64uNullValue_249(); break; case 250: - ChipLogProgress(chipTool, " ***** Test Step 250 : Write attribute NULLABLE_SINGLE largest Value\n"); - err = TestWriteAttributeNullableSingleLargestValue_250(); + ChipLogProgress(chipTool, " ***** Test Step 250 : Read attribute NULLABLE_INT64U null Value & range\n"); + err = TestReadAttributeNullableInt64uNullValueRange_250(); break; case 251: - ChipLogProgress(chipTool, " ***** Test Step 251 : Read attribute NULLABLE_SINGLE largest Value\n"); - err = TestReadAttributeNullableSingleLargestValue_251(); + ChipLogProgress(chipTool, " ***** Test Step 251 : Read attribute NULLABLE_INT64U null Value & not\n"); + err = TestReadAttributeNullableInt64uNullValueNot_251(); break; case 252: - ChipLogProgress(chipTool, " ***** Test Step 252 : Write attribute NULLABLE_SINGLE smallest Value\n"); - err = TestWriteAttributeNullableSingleSmallestValue_252(); + ChipLogProgress(chipTool, " ***** Test Step 252 : Write attribute NULLABLE_INT64U Value\n"); + err = TestWriteAttributeNullableInt64uValue_252(); break; case 253: - ChipLogProgress(chipTool, " ***** Test Step 253 : Read attribute NULLABLE_SINGLE smallest Value\n"); - err = TestReadAttributeNullableSingleSmallestValue_253(); + ChipLogProgress(chipTool, " ***** Test Step 253 : Read attribute NULLABLE_INT64U Value in range\n"); + err = TestReadAttributeNullableInt64uValueInRange_253(); break; case 254: - ChipLogProgress(chipTool, " ***** Test Step 254 : Write attribute NULLABLE_SINGLE null Value\n"); - err = TestWriteAttributeNullableSingleNullValue_254(); + ChipLogProgress(chipTool, " ***** Test Step 254 : Read attribute NULLABLE_INT64U notValue OK\n"); + err = TestReadAttributeNullableInt64uNotValueOk_254(); break; case 255: - ChipLogProgress(chipTool, " ***** Test Step 255 : Read attribute NULLABLE_SINGLE null Value\n"); - err = TestReadAttributeNullableSingleNullValue_255(); + ChipLogProgress(chipTool, " ***** Test Step 255 : Write attribute NULLABLE_INT8S Min Value\n"); + err = TestWriteAttributeNullableInt8sMinValue_255(); break; case 256: - ChipLogProgress(chipTool, " ***** Test Step 256 : Write attribute NULLABLE_SINGLE 0 Value\n"); - err = TestWriteAttributeNullableSingle0Value_256(); + ChipLogProgress(chipTool, " ***** Test Step 256 : Read attribute NULLABLE_INT8S Min Value\n"); + err = TestReadAttributeNullableInt8sMinValue_256(); break; case 257: - ChipLogProgress(chipTool, " ***** Test Step 257 : Read attribute NULLABLE_SINGLE 0 Value\n"); - err = TestReadAttributeNullableSingle0Value_257(); + ChipLogProgress(chipTool, " ***** Test Step 257 : Write attribute NULLABLE_INT8S Invalid Value\n"); + err = TestWriteAttributeNullableInt8sInvalidValue_257(); break; case 258: - ChipLogProgress(chipTool, " ***** Test Step 258 : Write attribute NULLABLE_DOUBLE medium Value\n"); - err = TestWriteAttributeNullableDoubleMediumValue_258(); + ChipLogProgress(chipTool, " ***** Test Step 258 : Read attribute NULLABLE_INT8S unchanged Value\n"); + err = TestReadAttributeNullableInt8sUnchangedValue_258(); break; case 259: - ChipLogProgress(chipTool, " ***** Test Step 259 : Read attribute NULLABLE_DOUBLE medium Value\n"); - err = TestReadAttributeNullableDoubleMediumValue_259(); + ChipLogProgress(chipTool, " ***** Test Step 259 : Write attribute NULLABLE_INT8S null Value\n"); + err = TestWriteAttributeNullableInt8sNullValue_259(); break; case 260: - ChipLogProgress(chipTool, " ***** Test Step 260 : Write attribute NULLABLE_DOUBLE largest Value\n"); - err = TestWriteAttributeNullableDoubleLargestValue_260(); + ChipLogProgress(chipTool, " ***** Test Step 260 : Read attribute NULLABLE_INT8S null Value\n"); + err = TestReadAttributeNullableInt8sNullValue_260(); break; case 261: - ChipLogProgress(chipTool, " ***** Test Step 261 : Read attribute NULLABLE_DOUBLE largest Value\n"); - err = TestReadAttributeNullableDoubleLargestValue_261(); + ChipLogProgress(chipTool, " ***** Test Step 261 : Read attribute NULLABLE_INT8S null Value & range\n"); + err = TestReadAttributeNullableInt8sNullValueRange_261(); break; case 262: - ChipLogProgress(chipTool, " ***** Test Step 262 : Write attribute NULLABLE_DOUBLE smallest Value\n"); - err = TestWriteAttributeNullableDoubleSmallestValue_262(); + ChipLogProgress(chipTool, " ***** Test Step 262 : Read attribute NULLABLE_INT8S null Value & not\n"); + err = TestReadAttributeNullableInt8sNullValueNot_262(); break; case 263: - ChipLogProgress(chipTool, " ***** Test Step 263 : Read attribute NULLABLE_DOUBLE smallest Value\n"); - err = TestReadAttributeNullableDoubleSmallestValue_263(); + ChipLogProgress(chipTool, " ***** Test Step 263 : Write attribute NULLABLE_INT8S Value\n"); + err = TestWriteAttributeNullableInt8sValue_263(); break; case 264: - ChipLogProgress(chipTool, " ***** Test Step 264 : Write attribute NULLABLE_DOUBLE null Value\n"); - err = TestWriteAttributeNullableDoubleNullValue_264(); + ChipLogProgress(chipTool, " ***** Test Step 264 : Read attribute NULLABLE_INT8S Value in range\n"); + err = TestReadAttributeNullableInt8sValueInRange_264(); break; case 265: - ChipLogProgress(chipTool, " ***** Test Step 265 : Read attribute NULLABLE_DOUBLE null Value\n"); - err = TestReadAttributeNullableDoubleNullValue_265(); + ChipLogProgress(chipTool, " ***** Test Step 265 : Read attribute NULLABLE_INT8S notValue OK\n"); + err = TestReadAttributeNullableInt8sNotValueOk_265(); break; case 266: - ChipLogProgress(chipTool, " ***** Test Step 266 : Write attribute NULLABLE_DOUBLE 0 Value\n"); - err = TestWriteAttributeNullableDouble0Value_266(); + ChipLogProgress(chipTool, " ***** Test Step 266 : Write attribute NULLABLE_INT16S Min Value\n"); + err = TestWriteAttributeNullableInt16sMinValue_266(); break; case 267: - ChipLogProgress(chipTool, " ***** Test Step 267 : Read attribute NULLABLE_DOUBLE 0 Value\n"); - err = TestReadAttributeNullableDouble0Value_267(); + ChipLogProgress(chipTool, " ***** Test Step 267 : Read attribute NULLABLE_INT16S Min Value\n"); + err = TestReadAttributeNullableInt16sMinValue_267(); break; case 268: - ChipLogProgress(chipTool, " ***** Test Step 268 : Write attribute NULLABLE_ENUM8 Max Value\n"); - err = TestWriteAttributeNullableEnum8MaxValue_268(); + ChipLogProgress(chipTool, " ***** Test Step 268 : Write attribute NULLABLE_INT16S Invalid Value\n"); + err = TestWriteAttributeNullableInt16sInvalidValue_268(); break; case 269: - ChipLogProgress(chipTool, " ***** Test Step 269 : Read attribute NULLABLE_ENUM8 Max Value\n"); - err = TestReadAttributeNullableEnum8MaxValue_269(); + ChipLogProgress(chipTool, " ***** Test Step 269 : Read attribute NULLABLE_INT16S unchanged Value\n"); + err = TestReadAttributeNullableInt16sUnchangedValue_269(); break; case 270: - ChipLogProgress(chipTool, " ***** Test Step 270 : Write attribute NULLABLE_ENUM8 Invalid Value\n"); - err = TestWriteAttributeNullableEnum8InvalidValue_270(); + ChipLogProgress(chipTool, " ***** Test Step 270 : Write attribute NULLABLE_INT16S null Value\n"); + err = TestWriteAttributeNullableInt16sNullValue_270(); break; case 271: - ChipLogProgress(chipTool, " ***** Test Step 271 : Read attribute NULLABLE_ENUM8 unchanged Value\n"); - err = TestReadAttributeNullableEnum8UnchangedValue_271(); + ChipLogProgress(chipTool, " ***** Test Step 271 : Read attribute NULLABLE_INT16S null Value\n"); + err = TestReadAttributeNullableInt16sNullValue_271(); break; case 272: - ChipLogProgress(chipTool, " ***** Test Step 272 : Write attribute NULLABLE_ENUM8 null Value\n"); - err = TestWriteAttributeNullableEnum8NullValue_272(); + ChipLogProgress(chipTool, " ***** Test Step 272 : Read attribute NULLABLE_INT16S null Value & range\n"); + err = TestReadAttributeNullableInt16sNullValueRange_272(); break; case 273: - ChipLogProgress(chipTool, " ***** Test Step 273 : Read attribute NULLABLE_ENUM8 null Value\n"); - err = TestReadAttributeNullableEnum8NullValue_273(); + ChipLogProgress(chipTool, " ***** Test Step 273 : Read attribute NULLABLE_INT16S null Value & not\n"); + err = TestReadAttributeNullableInt16sNullValueNot_273(); break; case 274: - ChipLogProgress(chipTool, " ***** Test Step 274 : Write attribute NULLABLE_ENUM16 Max Value\n"); - err = TestWriteAttributeNullableEnum16MaxValue_274(); + ChipLogProgress(chipTool, " ***** Test Step 274 : Write attribute NULLABLE_INT16S Value\n"); + err = TestWriteAttributeNullableInt16sValue_274(); break; case 275: - ChipLogProgress(chipTool, " ***** Test Step 275 : Read attribute NULLABLE_ENUM16 Max Value\n"); - err = TestReadAttributeNullableEnum16MaxValue_275(); + ChipLogProgress(chipTool, " ***** Test Step 275 : Read attribute NULLABLE_INT16S Value in range\n"); + err = TestReadAttributeNullableInt16sValueInRange_275(); break; case 276: - ChipLogProgress(chipTool, " ***** Test Step 276 : Write attribute NULLABLE_ENUM16 Invalid Value\n"); - err = TestWriteAttributeNullableEnum16InvalidValue_276(); + ChipLogProgress(chipTool, " ***** Test Step 276 : Read attribute NULLABLE_INT16S notValue OK\n"); + err = TestReadAttributeNullableInt16sNotValueOk_276(); break; case 277: - ChipLogProgress(chipTool, " ***** Test Step 277 : Read attribute NULLABLE_ENUM16 unchanged Value\n"); - err = TestReadAttributeNullableEnum16UnchangedValue_277(); + ChipLogProgress(chipTool, " ***** Test Step 277 : Write attribute NULLABLE_INT32S Min Value\n"); + err = TestWriteAttributeNullableInt32sMinValue_277(); break; case 278: - ChipLogProgress(chipTool, " ***** Test Step 278 : Write attribute NULLABLE_ENUM16 null Value\n"); - err = TestWriteAttributeNullableEnum16NullValue_278(); + ChipLogProgress(chipTool, " ***** Test Step 278 : Read attribute NULLABLE_INT32S Min Value\n"); + err = TestReadAttributeNullableInt32sMinValue_278(); break; case 279: - ChipLogProgress(chipTool, " ***** Test Step 279 : Read attribute NULLABLE_ENUM16 null Value\n"); - err = TestReadAttributeNullableEnum16NullValue_279(); + ChipLogProgress(chipTool, " ***** Test Step 279 : Write attribute NULLABLE_INT32S Invalid Value\n"); + err = TestWriteAttributeNullableInt32sInvalidValue_279(); break; case 280: - ChipLogProgress(chipTool, " ***** Test Step 280 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); - err = TestReadAttributeNullableOctetStringDefaultValue_280(); + ChipLogProgress(chipTool, " ***** Test Step 280 : Read attribute NULLABLE_INT32S unchanged Value\n"); + err = TestReadAttributeNullableInt32sUnchangedValue_280(); break; case 281: - ChipLogProgress(chipTool, " ***** Test Step 281 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_281(); + ChipLogProgress(chipTool, " ***** Test Step 281 : Write attribute NULLABLE_INT32S null Value\n"); + err = TestWriteAttributeNullableInt32sNullValue_281(); break; case 282: - ChipLogProgress(chipTool, " ***** Test Step 282 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_282(); + ChipLogProgress(chipTool, " ***** Test Step 282 : Read attribute NULLABLE_INT32S null Value\n"); + err = TestReadAttributeNullableInt32sNullValue_282(); break; case 283: - ChipLogProgress(chipTool, " ***** Test Step 283 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_283(); + ChipLogProgress(chipTool, " ***** Test Step 283 : Read attribute NULLABLE_INT32S null Value & range\n"); + err = TestReadAttributeNullableInt32sNullValueRange_283(); break; case 284: - ChipLogProgress(chipTool, " ***** Test Step 284 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_284(); + ChipLogProgress(chipTool, " ***** Test Step 284 : Read attribute NULLABLE_INT32S null Value & not\n"); + err = TestReadAttributeNullableInt32sNullValueNot_284(); break; case 285: - ChipLogProgress(chipTool, " ***** Test Step 285 : Write attribute NULLABLE_OCTET_STRING\n"); - err = TestWriteAttributeNullableOctetString_285(); + ChipLogProgress(chipTool, " ***** Test Step 285 : Write attribute NULLABLE_INT32S Value\n"); + err = TestWriteAttributeNullableInt32sValue_285(); break; case 286: - ChipLogProgress(chipTool, " ***** Test Step 286 : Read attribute NULLABLE_OCTET_STRING\n"); - err = TestReadAttributeNullableOctetString_286(); + ChipLogProgress(chipTool, " ***** Test Step 286 : Read attribute NULLABLE_INT32S Value in range\n"); + err = TestReadAttributeNullableInt32sValueInRange_286(); break; case 287: - ChipLogProgress(chipTool, " ***** Test Step 287 : Read attribute NULLABLE_CHAR_STRING Default Value\n"); - err = TestReadAttributeNullableCharStringDefaultValue_287(); + ChipLogProgress(chipTool, " ***** Test Step 287 : Read attribute NULLABLE_INT32S notValue OK\n"); + err = TestReadAttributeNullableInt32sNotValueOk_287(); break; case 288: - ChipLogProgress(chipTool, " ***** Test Step 288 : Write attribute NULLABLE_CHAR_STRING\n"); - err = TestWriteAttributeNullableCharString_288(); + ChipLogProgress(chipTool, " ***** Test Step 288 : Write attribute NULLABLE_INT64S Min Value\n"); + err = TestWriteAttributeNullableInt64sMinValue_288(); break; case 289: - ChipLogProgress(chipTool, " ***** Test Step 289 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_289(); + ChipLogProgress(chipTool, " ***** Test Step 289 : Read attribute NULLABLE_INT64S Min Value\n"); + err = TestReadAttributeNullableInt64sMinValue_289(); break; case 290: - ChipLogProgress(chipTool, " ***** Test Step 290 : Write attribute NULLABLE_CHAR_STRING - Value too long\n"); - err = TestWriteAttributeNullableCharStringValueTooLong_290(); + ChipLogProgress(chipTool, " ***** Test Step 290 : Write attribute NULLABLE_INT64S Invalid Value\n"); + err = TestWriteAttributeNullableInt64sInvalidValue_290(); break; case 291: - ChipLogProgress(chipTool, " ***** Test Step 291 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_291(); + ChipLogProgress(chipTool, " ***** Test Step 291 : Read attribute NULLABLE_INT64S unchanged Value\n"); + err = TestReadAttributeNullableInt64sUnchangedValue_291(); break; case 292: - ChipLogProgress(chipTool, " ***** Test Step 292 : Write attribute NULLABLE_CHAR_STRING - Empty\n"); - err = TestWriteAttributeNullableCharStringEmpty_292(); + ChipLogProgress(chipTool, " ***** Test Step 292 : Write attribute NULLABLE_INT64S null Value\n"); + err = TestWriteAttributeNullableInt64sNullValue_292(); break; case 293: - ChipLogProgress(chipTool, " ***** Test Step 293 : Read attribute NULLABLE_CHAR_STRING\n"); - err = TestReadAttributeNullableCharString_293(); + ChipLogProgress(chipTool, " ***** Test Step 293 : Read attribute NULLABLE_INT64S null Value\n"); + err = TestReadAttributeNullableInt64sNullValue_293(); break; case 294: - ChipLogProgress(chipTool, " ***** Test Step 294 : Read attribute from nonexistent endpoint.\n"); - err = TestReadAttributeFromNonexistentEndpoint_294(); + ChipLogProgress(chipTool, " ***** Test Step 294 : Read attribute NULLABLE_INT64S null Value & range\n"); + err = TestReadAttributeNullableInt64sNullValueRange_294(); break; case 295: - ChipLogProgress(chipTool, " ***** Test Step 295 : Read attribute from nonexistent cluster.\n"); - err = TestReadAttributeFromNonexistentCluster_295(); + ChipLogProgress(chipTool, " ***** Test Step 295 : Read attribute NULLABLE_INT64S null Value & not\n"); + err = TestReadAttributeNullableInt64sNullValueNot_295(); break; case 296: - ChipLogProgress(chipTool, - " ***** Test Step 296 : Send a command that takes an optional parameter but do not set it.\n"); - err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_296(); + ChipLogProgress(chipTool, " ***** Test Step 296 : Write attribute NULLABLE_INT64S Value\n"); + err = TestWriteAttributeNullableInt64sValue_296(); break; case 297: + ChipLogProgress(chipTool, " ***** Test Step 297 : Read attribute NULLABLE_INT64S Value in range\n"); + err = TestReadAttributeNullableInt64sValueInRange_297(); + break; + case 298: + ChipLogProgress(chipTool, " ***** Test Step 298 : Read attribute NULLABLE_INT64S notValue OK\n"); + err = TestReadAttributeNullableInt64sNotValueOk_298(); + break; + case 299: + ChipLogProgress(chipTool, " ***** Test Step 299 : Write attribute NULLABLE_SINGLE medium Value\n"); + err = TestWriteAttributeNullableSingleMediumValue_299(); + break; + case 300: + ChipLogProgress(chipTool, " ***** Test Step 300 : Read attribute NULLABLE_SINGLE medium Value\n"); + err = TestReadAttributeNullableSingleMediumValue_300(); + break; + case 301: + ChipLogProgress(chipTool, " ***** Test Step 301 : Write attribute NULLABLE_SINGLE largest Value\n"); + err = TestWriteAttributeNullableSingleLargestValue_301(); + break; + case 302: + ChipLogProgress(chipTool, " ***** Test Step 302 : Read attribute NULLABLE_SINGLE largest Value\n"); + err = TestReadAttributeNullableSingleLargestValue_302(); + break; + case 303: + ChipLogProgress(chipTool, " ***** Test Step 303 : Write attribute NULLABLE_SINGLE smallest Value\n"); + err = TestWriteAttributeNullableSingleSmallestValue_303(); + break; + case 304: + ChipLogProgress(chipTool, " ***** Test Step 304 : Read attribute NULLABLE_SINGLE smallest Value\n"); + err = TestReadAttributeNullableSingleSmallestValue_304(); + break; + case 305: + ChipLogProgress(chipTool, " ***** Test Step 305 : Write attribute NULLABLE_SINGLE null Value\n"); + err = TestWriteAttributeNullableSingleNullValue_305(); + break; + case 306: + ChipLogProgress(chipTool, " ***** Test Step 306 : Read attribute NULLABLE_SINGLE null Value\n"); + err = TestReadAttributeNullableSingleNullValue_306(); + break; + case 307: + ChipLogProgress(chipTool, " ***** Test Step 307 : Write attribute NULLABLE_SINGLE 0 Value\n"); + err = TestWriteAttributeNullableSingle0Value_307(); + break; + case 308: + ChipLogProgress(chipTool, " ***** Test Step 308 : Read attribute NULLABLE_SINGLE 0 Value\n"); + err = TestReadAttributeNullableSingle0Value_308(); + break; + case 309: + ChipLogProgress(chipTool, " ***** Test Step 309 : Write attribute NULLABLE_DOUBLE medium Value\n"); + err = TestWriteAttributeNullableDoubleMediumValue_309(); + break; + case 310: + ChipLogProgress(chipTool, " ***** Test Step 310 : Read attribute NULLABLE_DOUBLE medium Value\n"); + err = TestReadAttributeNullableDoubleMediumValue_310(); + break; + case 311: + ChipLogProgress(chipTool, " ***** Test Step 311 : Write attribute NULLABLE_DOUBLE largest Value\n"); + err = TestWriteAttributeNullableDoubleLargestValue_311(); + break; + case 312: + ChipLogProgress(chipTool, " ***** Test Step 312 : Read attribute NULLABLE_DOUBLE largest Value\n"); + err = TestReadAttributeNullableDoubleLargestValue_312(); + break; + case 313: + ChipLogProgress(chipTool, " ***** Test Step 313 : Write attribute NULLABLE_DOUBLE smallest Value\n"); + err = TestWriteAttributeNullableDoubleSmallestValue_313(); + break; + case 314: + ChipLogProgress(chipTool, " ***** Test Step 314 : Read attribute NULLABLE_DOUBLE smallest Value\n"); + err = TestReadAttributeNullableDoubleSmallestValue_314(); + break; + case 315: + ChipLogProgress(chipTool, " ***** Test Step 315 : Write attribute NULLABLE_DOUBLE null Value\n"); + err = TestWriteAttributeNullableDoubleNullValue_315(); + break; + case 316: + ChipLogProgress(chipTool, " ***** Test Step 316 : Read attribute NULLABLE_DOUBLE null Value\n"); + err = TestReadAttributeNullableDoubleNullValue_316(); + break; + case 317: + ChipLogProgress(chipTool, " ***** Test Step 317 : Write attribute NULLABLE_DOUBLE 0 Value\n"); + err = TestWriteAttributeNullableDouble0Value_317(); + break; + case 318: + ChipLogProgress(chipTool, " ***** Test Step 318 : Read attribute NULLABLE_DOUBLE 0 Value\n"); + err = TestReadAttributeNullableDouble0Value_318(); + break; + case 319: + ChipLogProgress(chipTool, " ***** Test Step 319 : Write attribute NULLABLE_ENUM8 Min Value\n"); + err = TestWriteAttributeNullableEnum8MinValue_319(); + break; + case 320: + ChipLogProgress(chipTool, " ***** Test Step 320 : Read attribute NULLABLE_ENUM8 Min Value\n"); + err = TestReadAttributeNullableEnum8MinValue_320(); + break; + case 321: + ChipLogProgress(chipTool, " ***** Test Step 321 : Write attribute NULLABLE_ENUM8 Max Value\n"); + err = TestWriteAttributeNullableEnum8MaxValue_321(); + break; + case 322: + ChipLogProgress(chipTool, " ***** Test Step 322 : Read attribute NULLABLE_ENUM8 Max Value\n"); + err = TestReadAttributeNullableEnum8MaxValue_322(); + break; + case 323: + ChipLogProgress(chipTool, " ***** Test Step 323 : Write attribute NULLABLE_ENUM8 Invalid Value\n"); + err = TestWriteAttributeNullableEnum8InvalidValue_323(); + break; + case 324: + ChipLogProgress(chipTool, " ***** Test Step 324 : Read attribute NULLABLE_ENUM8 unchanged Value\n"); + err = TestReadAttributeNullableEnum8UnchangedValue_324(); + break; + case 325: + ChipLogProgress(chipTool, " ***** Test Step 325 : Write attribute NULLABLE_ENUM8 null Value\n"); + err = TestWriteAttributeNullableEnum8NullValue_325(); + break; + case 326: + ChipLogProgress(chipTool, " ***** Test Step 326 : Read attribute NULLABLE_ENUM8 null Value\n"); + err = TestReadAttributeNullableEnum8NullValue_326(); + break; + case 327: + ChipLogProgress(chipTool, " ***** Test Step 327 : Write attribute NULLABLE_ENUM16 Min Value\n"); + err = TestWriteAttributeNullableEnum16MinValue_327(); + break; + case 328: + ChipLogProgress(chipTool, " ***** Test Step 328 : Read attribute NULLABLE_ENUM16 Min Value\n"); + err = TestReadAttributeNullableEnum16MinValue_328(); + break; + case 329: + ChipLogProgress(chipTool, " ***** Test Step 329 : Write attribute NULLABLE_ENUM16 Max Value\n"); + err = TestWriteAttributeNullableEnum16MaxValue_329(); + break; + case 330: + ChipLogProgress(chipTool, " ***** Test Step 330 : Read attribute NULLABLE_ENUM16 Max Value\n"); + err = TestReadAttributeNullableEnum16MaxValue_330(); + break; + case 331: + ChipLogProgress(chipTool, " ***** Test Step 331 : Write attribute NULLABLE_ENUM16 Invalid Value\n"); + err = TestWriteAttributeNullableEnum16InvalidValue_331(); + break; + case 332: + ChipLogProgress(chipTool, " ***** Test Step 332 : Read attribute NULLABLE_ENUM16 unchanged Value\n"); + err = TestReadAttributeNullableEnum16UnchangedValue_332(); + break; + case 333: + ChipLogProgress(chipTool, " ***** Test Step 333 : Write attribute NULLABLE_ENUM16 null Value\n"); + err = TestWriteAttributeNullableEnum16NullValue_333(); + break; + case 334: + ChipLogProgress(chipTool, " ***** Test Step 334 : Read attribute NULLABLE_ENUM16 null Value\n"); + err = TestReadAttributeNullableEnum16NullValue_334(); + break; + case 335: + ChipLogProgress(chipTool, " ***** Test Step 335 : Write attribute NULLABLE_SIMPLE_ENUM Min Value\n"); + err = TestWriteAttributeNullableSimpleEnumMinValue_335(); + break; + case 336: + ChipLogProgress(chipTool, " ***** Test Step 336 : Read attribute NULLABLE_SIMPLE_ENUM Min Value\n"); + err = TestReadAttributeNullableSimpleEnumMinValue_336(); + break; + case 337: + ChipLogProgress(chipTool, " ***** Test Step 337 : Write attribute NULLABLE_SIMPLE_ENUM Max Value\n"); + err = TestWriteAttributeNullableSimpleEnumMaxValue_337(); + break; + case 338: + ChipLogProgress(chipTool, " ***** Test Step 338 : Read attribute NULLABLE_SIMPLE_ENUM Max Value\n"); + err = TestReadAttributeNullableSimpleEnumMaxValue_338(); + break; + case 339: + ChipLogProgress(chipTool, " ***** Test Step 339 : Write attribute NULLABLE_SIMPLE_ENUM Invalid Value\n"); + err = TestWriteAttributeNullableSimpleEnumInvalidValue_339(); + break; + case 340: + ChipLogProgress(chipTool, " ***** Test Step 340 : Read attribute NULLABLE_SIMPLE_ENUM unchanged Value\n"); + err = TestReadAttributeNullableSimpleEnumUnchangedValue_340(); + break; + case 341: + ChipLogProgress(chipTool, " ***** Test Step 341 : Write attribute NULLABLE_SIMPLE_ENUM null Value\n"); + err = TestWriteAttributeNullableSimpleEnumNullValue_341(); + break; + case 342: + ChipLogProgress(chipTool, " ***** Test Step 342 : Read attribute NULLABLE_SIMPLE_ENUM null Value\n"); + err = TestReadAttributeNullableSimpleEnumNullValue_342(); + break; + case 343: + ChipLogProgress(chipTool, " ***** Test Step 343 : Read attribute NULLABLE_OCTET_STRING Default Value\n"); + err = TestReadAttributeNullableOctetStringDefaultValue_343(); + break; + case 344: + ChipLogProgress(chipTool, " ***** Test Step 344 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_344(); + break; + case 345: + ChipLogProgress(chipTool, " ***** Test Step 345 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_345(); + break; + case 346: + ChipLogProgress(chipTool, " ***** Test Step 346 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_346(); + break; + case 347: + ChipLogProgress(chipTool, " ***** Test Step 347 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_347(); + break; + case 348: + ChipLogProgress(chipTool, " ***** Test Step 348 : Write attribute NULLABLE_OCTET_STRING\n"); + err = TestWriteAttributeNullableOctetString_348(); + break; + case 349: + ChipLogProgress(chipTool, " ***** Test Step 349 : Read attribute NULLABLE_OCTET_STRING\n"); + err = TestReadAttributeNullableOctetString_349(); + break; + case 350: + ChipLogProgress(chipTool, " ***** Test Step 350 : Read attribute NULLABLE_CHAR_STRING Default Value\n"); + err = TestReadAttributeNullableCharStringDefaultValue_350(); + break; + case 351: + ChipLogProgress(chipTool, " ***** Test Step 351 : Write attribute NULLABLE_CHAR_STRING\n"); + err = TestWriteAttributeNullableCharString_351(); + break; + case 352: + ChipLogProgress(chipTool, " ***** Test Step 352 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_352(); + break; + case 353: + ChipLogProgress(chipTool, " ***** Test Step 353 : Write attribute NULLABLE_CHAR_STRING - Value too long\n"); + err = TestWriteAttributeNullableCharStringValueTooLong_353(); + break; + case 354: + ChipLogProgress(chipTool, " ***** Test Step 354 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_354(); + break; + case 355: + ChipLogProgress(chipTool, " ***** Test Step 355 : Write attribute NULLABLE_CHAR_STRING - Empty\n"); + err = TestWriteAttributeNullableCharStringEmpty_355(); + break; + case 356: + ChipLogProgress(chipTool, " ***** Test Step 356 : Read attribute NULLABLE_CHAR_STRING\n"); + err = TestReadAttributeNullableCharString_356(); + break; + case 357: + ChipLogProgress(chipTool, " ***** Test Step 357 : Read attribute from nonexistent endpoint.\n"); + err = TestReadAttributeFromNonexistentEndpoint_357(); + break; + case 358: + ChipLogProgress(chipTool, " ***** Test Step 358 : Read attribute from nonexistent cluster.\n"); + err = TestReadAttributeFromNonexistentCluster_358(); + break; + case 359: + ChipLogProgress(chipTool, + " ***** Test Step 359 : Send a command that takes an optional parameter but do not set it.\n"); + err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_359(); + break; + case 360: + ChipLogProgress(chipTool, + " ***** Test Step 360 : Send a command that takes an optional parameter but do not set it.\n"); + err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_360(); + break; + case 361: + ChipLogProgress(chipTool, " ***** Test Step 361 : Report: Subscribe to list attribute\n"); + err = TestReportSubscribeToListAttribute_361(); + break; + case 362: + ChipLogProgress(chipTool, " ***** Test Step 362 : Subscribe to list attribute\n"); + err = TestSubscribeToListAttribute_362(); + break; + case 363: + ChipLogProgress(chipTool, " ***** Test Step 363 : Write subscribed-to list attribute\n"); + err = TestWriteSubscribedToListAttribute_363(); + break; + case 364: + ChipLogProgress(chipTool, " ***** Test Step 364 : Check for list attribute report\n"); + err = TestCheckForListAttributeReport_364(); + break; + case 365: + ChipLogProgress(chipTool, " ***** Test Step 365 : Read range-restricted unsigned 8-bit integer\n"); + err = TestReadRangeRestrictedUnsigned8BitInteger_365(); + break; + case 366: + ChipLogProgress(chipTool, " ***** Test Step 366 : Write min value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_366(); + break; + case 367: + ChipLogProgress(chipTool, + " ***** Test Step 367 : Write just-below-range value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_367(); + break; + case 368: + ChipLogProgress(chipTool, + " ***** Test Step 368 : Write just-above-range value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_368(); + break; + case 369: + ChipLogProgress(chipTool, " ***** Test Step 369 : Write max value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_369(); + break; + case 370: + ChipLogProgress(chipTool, + " ***** Test Step 370 : Verify range-restricted unsigned 8-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_370(); + break; + case 371: + ChipLogProgress(chipTool, + " ***** Test Step 371 : Write min valid value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_371(); + break; + case 372: + ChipLogProgress(chipTool, + " ***** Test Step 372 : Verify range-restricted unsigned 8-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_372(); + break; + case 373: + ChipLogProgress(chipTool, + " ***** Test Step 373 : Write max valid value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_373(); + break; + case 374: + ChipLogProgress(chipTool, + " ***** Test Step 374 : Verify range-restricted unsigned 8-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_374(); + break; + case 375: + ChipLogProgress(chipTool, + " ***** Test Step 375 : Write middle valid value to a range-restricted unsigned 8-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_375(); + break; + case 376: + ChipLogProgress(chipTool, + " ***** Test Step 376 : Verify range-restricted unsigned 8-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_376(); + break; + case 377: + ChipLogProgress(chipTool, " ***** Test Step 377 : Read range-restricted unsigned 16-bit integer\n"); + err = TestReadRangeRestrictedUnsigned16BitInteger_377(); + break; + case 378: + ChipLogProgress(chipTool, " ***** Test Step 378 : Write min value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_378(); + break; + case 379: + ChipLogProgress(chipTool, + " ***** Test Step 379 : Write just-below-range value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_379(); + break; + case 380: + ChipLogProgress(chipTool, + " ***** Test Step 380 : Write just-above-range value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_380(); + break; + case 381: + ChipLogProgress(chipTool, " ***** Test Step 381 : Write max value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_381(); + break; + case 382: + ChipLogProgress(chipTool, + " ***** Test Step 382 : Verify range-restricted unsigned 16-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_382(); + break; + case 383: + ChipLogProgress(chipTool, + " ***** Test Step 383 : Write min valid value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_383(); + break; + case 384: + ChipLogProgress(chipTool, + " ***** Test Step 384 : Verify range-restricted unsigned 16-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_384(); + break; + case 385: + ChipLogProgress(chipTool, + " ***** Test Step 385 : Write max valid value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_385(); + break; + case 386: + ChipLogProgress(chipTool, + " ***** Test Step 386 : Verify range-restricted unsigned 16-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_386(); + break; + case 387: + ChipLogProgress(chipTool, + " ***** Test Step 387 : Write middle valid value to a range-restricted unsigned 16-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_387(); + break; + case 388: + ChipLogProgress(chipTool, + " ***** Test Step 388 : Verify range-restricted unsigned 16-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_388(); + break; + case 389: + ChipLogProgress(chipTool, " ***** Test Step 389 : Read range-restricted signed 8-bit integer\n"); + err = TestReadRangeRestrictedSigned8BitInteger_389(); + break; + case 390: + ChipLogProgress(chipTool, " ***** Test Step 390 : Write min value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedSigned8BitInteger_390(); + break; + case 391: + ChipLogProgress(chipTool, + " ***** Test Step 391 : Write just-below-range value to a range-restricted signed 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_391(); + break; + case 392: + ChipLogProgress(chipTool, + " ***** Test Step 392 : Write just-above-range value to a range-restricted signed 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_392(); + break; + case 393: + ChipLogProgress(chipTool, " ***** Test Step 393 : Write max value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedSigned8BitInteger_393(); + break; + case 394: + ChipLogProgress(chipTool, + " ***** Test Step 394 : Verify range-restricted signed 8-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_394(); + break; + case 395: + ChipLogProgress(chipTool, " ***** Test Step 395 : Write min valid value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_395(); + break; + case 396: + ChipLogProgress(chipTool, + " ***** Test Step 396 : Verify range-restricted signed 8-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_396(); + break; + case 397: + ChipLogProgress(chipTool, " ***** Test Step 397 : Write max valid value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_397(); + break; + case 398: + ChipLogProgress(chipTool, + " ***** Test Step 398 : Verify range-restricted signed 8-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_398(); + break; + case 399: + ChipLogProgress(chipTool, + " ***** Test Step 399 : Write middle valid value to a range-restricted signed 8-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_399(); + break; + case 400: + ChipLogProgress(chipTool, + " ***** Test Step 400 : Verify range-restricted signed 8-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_400(); + break; + case 401: + ChipLogProgress(chipTool, " ***** Test Step 401 : Read range-restricted signed 16-bit integer\n"); + err = TestReadRangeRestrictedSigned16BitInteger_401(); + break; + case 402: + ChipLogProgress(chipTool, " ***** Test Step 402 : Write min value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMinValueToARangeRestrictedSigned16BitInteger_402(); + break; + case 403: + ChipLogProgress(chipTool, + " ***** Test Step 403 : Write just-below-range value to a range-restricted signed 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_403(); + break; + case 404: + ChipLogProgress(chipTool, + " ***** Test Step 404 : Write just-above-range value to a range-restricted signed 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_404(); + break; + case 405: + ChipLogProgress(chipTool, " ***** Test Step 405 : Write max value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValueToARangeRestrictedSigned16BitInteger_405(); + break; + case 406: + ChipLogProgress(chipTool, + " ***** Test Step 406 : Verify range-restricted signed 16-bit integer value has not changed\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_406(); + break; + case 407: + ChipLogProgress(chipTool, " ***** Test Step 407 : Write min valid value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_407(); + break; + case 408: + ChipLogProgress(chipTool, + " ***** Test Step 408 : Verify range-restricted signed 16-bit integer value is at min valid\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_408(); + break; + case 409: + ChipLogProgress(chipTool, " ***** Test Step 409 : Write max valid value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_409(); + break; + case 410: + ChipLogProgress(chipTool, + " ***** Test Step 410 : Verify range-restricted signed 16-bit integer value is at max valid\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_410(); + break; + case 411: + ChipLogProgress(chipTool, + " ***** Test Step 411 : Write middle valid value to a range-restricted signed 16-bit integer\n"); + err = TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_411(); + break; + case 412: + ChipLogProgress(chipTool, + " ***** Test Step 412 : Verify range-restricted signed 16-bit integer value is at mid valid\n"); + err = TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_412(); + break; + case 413: + ChipLogProgress(chipTool, " ***** Test Step 413 : Read nullable range-restricted unsigned 8-bit integer\n"); + err = TestReadNullableRangeRestrictedUnsigned8BitInteger_413(); + break; + case 414: + ChipLogProgress(chipTool, + " ***** Test Step 414 : Write min value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_414(); + break; + case 415: + ChipLogProgress( + chipTool, + " ***** Test Step 415 : Write just-below-range value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_415(); + break; + case 416: + ChipLogProgress( + chipTool, + " ***** Test Step 416 : Write just-above-range value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_416(); + break; + case 417: + ChipLogProgress(chipTool, + " ***** Test Step 417 : Write max value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_417(); + break; + case 418: + ChipLogProgress( + chipTool, " ***** Test Step 418 : Verify nullable range-restricted unsigned 8-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_418(); + break; + case 419: + ChipLogProgress(chipTool, + " ***** Test Step 419 : Write min valid value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_419(); + break; + case 420: + ChipLogProgress( + chipTool, " ***** Test Step 420 : Verify nullable range-restricted unsigned 8-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_420(); + break; + case 421: + ChipLogProgress(chipTool, + " ***** Test Step 421 : Write max valid value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_421(); + break; + case 422: + ChipLogProgress( + chipTool, " ***** Test Step 422 : Verify nullable range-restricted unsigned 8-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_422(); + break; + case 423: + ChipLogProgress( + chipTool, + " ***** Test Step 423 : Write middle valid value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_423(); + break; + case 424: + ChipLogProgress( + chipTool, " ***** Test Step 424 : Verify nullable range-restricted unsigned 8-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_424(); + break; + case 425: + ChipLogProgress(chipTool, + " ***** Test Step 425 : Write null value to a nullable range-restricted unsigned 8-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_425(); + break; + case 426: + ChipLogProgress(chipTool, + " ***** Test Step 426 : Verify nullable range-restricted unsigned 8-bit integer value is null\n"); + err = TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_426(); + break; + case 427: + ChipLogProgress(chipTool, " ***** Test Step 427 : Read nullable range-restricted unsigned 16-bit integer\n"); + err = TestReadNullableRangeRestrictedUnsigned16BitInteger_427(); + break; + case 428: + ChipLogProgress(chipTool, + " ***** Test Step 428 : Write min value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_428(); + break; + case 429: + ChipLogProgress( + chipTool, + " ***** Test Step 429 : Write just-below-range value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_429(); + break; + case 430: + ChipLogProgress( + chipTool, + " ***** Test Step 430 : Write just-above-range value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_430(); + break; + case 431: + ChipLogProgress(chipTool, + " ***** Test Step 431 : Write max value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_431(); + break; + case 432: + ChipLogProgress( + chipTool, + " ***** Test Step 432 : Verify nullable range-restricted unsigned 16-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_432(); + break; + case 433: + ChipLogProgress( + chipTool, " ***** Test Step 433 : Write min valid value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_433(); + break; + case 434: + ChipLogProgress( + chipTool, + " ***** Test Step 434 : Verify nullable range-restricted unsigned 16-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_434(); + break; + case 435: + ChipLogProgress( + chipTool, " ***** Test Step 435 : Write max valid value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_435(); + break; + case 436: + ChipLogProgress( + chipTool, + " ***** Test Step 436 : Verify nullable range-restricted unsigned 16-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_436(); + break; + case 437: + ChipLogProgress( + chipTool, + " ***** Test Step 437 : Write middle valid value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_437(); + break; + case 438: + ChipLogProgress( + chipTool, + " ***** Test Step 438 : Verify nullable range-restricted unsigned 16-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_438(); + break; + case 439: + ChipLogProgress(chipTool, + " ***** Test Step 439 : Write null value to a nullable range-restricted unsigned 16-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_439(); + break; + case 440: + ChipLogProgress(chipTool, + " ***** Test Step 440 : Verify nullable range-restricted unsigned 16-bit integer value is null\n"); + err = TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_440(); + break; + case 441: + ChipLogProgress(chipTool, " ***** Test Step 441 : Read nullable range-restricted signed 8-bit integer\n"); + err = TestReadNullableRangeRestrictedSigned8BitInteger_441(); + break; + case 442: ChipLogProgress(chipTool, - " ***** Test Step 297 : Send a command that takes an optional parameter but do not set it.\n"); - err = TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_297(); + " ***** Test Step 442 : Write min value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_442(); + break; + case 443: + ChipLogProgress( + chipTool, + " ***** Test Step 443 : Write just-below-range value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_443(); + break; + case 444: + ChipLogProgress( + chipTool, + " ***** Test Step 444 : Write just-above-range value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_444(); + break; + case 445: + ChipLogProgress(chipTool, + " ***** Test Step 445 : Write max value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_445(); + break; + case 446: + ChipLogProgress(chipTool, + " ***** Test Step 446 : Verify nullable range-restricted signed 8-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_446(); + break; + case 447: + ChipLogProgress(chipTool, + " ***** Test Step 447 : Write min valid value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_447(); + break; + case 448: + ChipLogProgress(chipTool, + " ***** Test Step 448 : Verify nullable range-restricted signed 8-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_448(); + break; + case 449: + ChipLogProgress(chipTool, + " ***** Test Step 449 : Write max valid value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_449(); + break; + case 450: + ChipLogProgress(chipTool, + " ***** Test Step 450 : Verify nullable range-restricted signed 8-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_450(); + break; + case 451: + ChipLogProgress( + chipTool, " ***** Test Step 451 : Write middle valid value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_451(); + break; + case 452: + ChipLogProgress(chipTool, + " ***** Test Step 452 : Verify nullable range-restricted signed 8-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_452(); + break; + case 453: + ChipLogProgress(chipTool, + " ***** Test Step 453 : Write null value to a nullable range-restricted signed 8-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_453(); + break; + case 454: + ChipLogProgress(chipTool, + " ***** Test Step 454 : Verify nullable range-restricted signed 8-bit integer value is at null\n"); + err = TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_454(); + break; + case 455: + ChipLogProgress(chipTool, " ***** Test Step 455 : Read nullable range-restricted signed 16-bit integer\n"); + err = TestReadNullableRangeRestrictedSigned16BitInteger_455(); + break; + case 456: + ChipLogProgress(chipTool, + " ***** Test Step 456 : Write min value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_456(); + break; + case 457: + ChipLogProgress( + chipTool, + " ***** Test Step 457 : Write just-below-range value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_457(); + break; + case 458: + ChipLogProgress( + chipTool, + " ***** Test Step 458 : Write just-above-range value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_458(); + break; + case 459: + ChipLogProgress(chipTool, + " ***** Test Step 459 : Write max value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_459(); + break; + case 460: + ChipLogProgress( + chipTool, " ***** Test Step 460 : Verify nullable range-restricted signed 16-bit integer value has not changed\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_460(); + break; + case 461: + ChipLogProgress(chipTool, + " ***** Test Step 461 : Write min valid value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_461(); + break; + case 462: + ChipLogProgress( + chipTool, " ***** Test Step 462 : Verify nullable range-restricted signed 16-bit integer value is at min valid\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_462(); + break; + case 463: + ChipLogProgress(chipTool, + " ***** Test Step 463 : Write max valid value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_463(); + break; + case 464: + ChipLogProgress( + chipTool, " ***** Test Step 464 : Verify nullable range-restricted signed 16-bit integer value is at max valid\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_464(); + break; + case 465: + ChipLogProgress( + chipTool, " ***** Test Step 465 : Write middle valid value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_465(); + break; + case 466: + ChipLogProgress( + chipTool, " ***** Test Step 466 : Verify nullable range-restricted signed 16-bit integer value is at mid valid\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_466(); + break; + case 467: + ChipLogProgress(chipTool, + " ***** Test Step 467 : Write null value to a nullable range-restricted signed 16-bit integer\n"); + err = TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_467(); + break; + case 468: + ChipLogProgress(chipTool, + " ***** Test Step 468 : Verify nullable range-restricted signed 16-bit integer value is null\n"); + err = TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_468(); break; } @@ -35472,7 +36678,11 @@ class TestCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 298; + const uint16_t mTestCount = 469; + + typedef void (*Test_TestCluster_list_int8u_ReportCallback)(void * context, + const chip::app::DataModel::DecodableList & value); + Test_TestCluster_list_int8u_ReportCallback mTest_TestCluster_list_int8u_Reported = nullptr; static void OnFailureCallback_6(void * context, EmberAfStatus status) { @@ -36431,9 +37641,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_115(status); } - static void OnSuccessCallback_115(void * context, chip::ByteSpan longOctetString) + static void OnSuccessCallback_115(void * context, chip::ByteSpan octetString) { - (static_cast(context))->OnSuccessResponse_115(longOctetString); + (static_cast(context))->OnSuccessResponse_115(octetString); } static void OnFailureCallback_116(void * context, EmberAfStatus status) @@ -36465,9 +37675,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_119(status); } - static void OnSuccessCallback_119(void * context, chip::CharSpan charString) + static void OnSuccessCallback_119(void * context, chip::ByteSpan longOctetString) { - (static_cast(context))->OnSuccessResponse_119(charString); + (static_cast(context))->OnSuccessResponse_119(longOctetString); } static void OnFailureCallback_120(void * context, EmberAfStatus status) @@ -36516,9 +37726,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_125(status); } - static void OnSuccessCallback_125(void * context, chip::CharSpan longCharString) + static void OnSuccessCallback_125(void * context, chip::CharSpan charString) { - (static_cast(context))->OnSuccessResponse_125(longCharString); + (static_cast(context))->OnSuccessResponse_125(charString); } static void OnFailureCallback_126(void * context, EmberAfStatus status) @@ -36550,10 +37760,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_129(status); } - static void OnSuccessCallback_129(void * context, - const chip::app::DataModel::DecodableList & listLongOctetString) + static void OnSuccessCallback_129(void * context, chip::CharSpan longCharString) { - (static_cast(context))->OnSuccessResponse_129(listLongOctetString); + (static_cast(context))->OnSuccessResponse_129(longCharString); } static void OnFailureCallback_130(void * context, EmberAfStatus status) @@ -36561,17 +37770,18 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_130(status); } - static void OnSuccessCallback_130(void * context, uint64_t epochUs) - { - (static_cast(context))->OnSuccessResponse_130(epochUs); - } + static void OnSuccessCallback_130(void * context) { (static_cast(context))->OnSuccessResponse_130(); } static void OnFailureCallback_131(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_131(status); } - static void OnSuccessCallback_131(void * context) { (static_cast(context))->OnSuccessResponse_131(); } + static void OnSuccessCallback_131(void * context, + const chip::app::DataModel::DecodableList & listLongOctetString) + { + (static_cast(context))->OnSuccessResponse_131(listLongOctetString); + } static void OnFailureCallback_132(void * context, EmberAfStatus status) { @@ -36605,17 +37815,17 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_135(status); } - static void OnSuccessCallback_135(void * context, uint32_t epochS) - { - (static_cast(context))->OnSuccessResponse_135(epochS); - } + static void OnSuccessCallback_135(void * context) { (static_cast(context))->OnSuccessResponse_135(); } static void OnFailureCallback_136(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_136(status); } - static void OnSuccessCallback_136(void * context) { (static_cast(context))->OnSuccessResponse_136(); } + static void OnSuccessCallback_136(void * context, uint64_t epochUs) + { + (static_cast(context))->OnSuccessResponse_136(epochUs); + } static void OnFailureCallback_137(void * context, EmberAfStatus status) { @@ -36649,34 +37859,34 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_140(status); } - static void OnSuccessCallback_140(void * context, bool unsupported) - { - (static_cast(context))->OnSuccessResponse_140(unsupported); - } + static void OnSuccessCallback_140(void * context) { (static_cast(context))->OnSuccessResponse_140(); } static void OnFailureCallback_141(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_141(status); } - static void OnSuccessCallback_141(void * context) { (static_cast(context))->OnSuccessResponse_141(); } + static void OnSuccessCallback_141(void * context, uint32_t epochS) + { + (static_cast(context))->OnSuccessResponse_141(epochS); + } - static void OnFailureCallback_144(void * context, EmberAfStatus status) + static void OnFailureCallback_142(void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_144(status); + (static_cast(context))->OnFailureResponse_142(status); } - static void OnSuccessCallback_144(void * context, chip::VendorId vendorId) + static void OnSuccessCallback_142(void * context, bool unsupported) { - (static_cast(context))->OnSuccessResponse_144(vendorId); + (static_cast(context))->OnSuccessResponse_142(unsupported); } - static void OnFailureCallback_145(void * context, EmberAfStatus status) + static void OnFailureCallback_143(void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_145(status); + (static_cast(context))->OnFailureResponse_143(status); } - static void OnSuccessCallback_145(void * context) { (static_cast(context))->OnSuccessResponse_145(); } + static void OnSuccessCallback_143(void * context) { (static_cast(context))->OnSuccessResponse_143(); } static void OnFailureCallback_146(void * context, EmberAfStatus status) { @@ -36695,23 +37905,23 @@ class TestCluster : public TestCommand static void OnSuccessCallback_147(void * context) { (static_cast(context))->OnSuccessResponse_147(); } - static void OnFailureCallback_164(void * context, EmberAfStatus status) + static void OnFailureCallback_148(void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_164(status); + (static_cast(context))->OnFailureResponse_148(status); } - static void OnSuccessCallback_164(void * context) { (static_cast(context))->OnSuccessResponse_164(); } - - static void OnFailureCallback_165(void * context, EmberAfStatus status) + static void OnSuccessCallback_148(void * context, chip::VendorId vendorId) { - (static_cast(context))->OnFailureResponse_165(status); + (static_cast(context))->OnSuccessResponse_148(vendorId); } - static void OnSuccessCallback_165(void * context, const chip::app::DataModel::DecodableList & listInt8u) + static void OnFailureCallback_149(void * context, EmberAfStatus status) { - (static_cast(context))->OnSuccessResponse_165(listInt8u); + (static_cast(context))->OnFailureResponse_149(status); } + static void OnSuccessCallback_149(void * context) { (static_cast(context))->OnSuccessResponse_149(); } + static void OnFailureCallback_166(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_166(status); @@ -36724,9 +37934,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_167(status); } - static void OnSuccessCallback_167(void * context, const chip::app::DataModel::DecodableList & listOctetString) + static void OnSuccessCallback_167(void * context, const chip::app::DataModel::DecodableList & listInt8u) { - (static_cast(context))->OnSuccessResponse_167(listOctetString); + (static_cast(context))->OnSuccessResponse_167(listInt8u); } static void OnFailureCallback_168(void * context, EmberAfStatus status) @@ -36741,29 +37951,29 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_169(status); } - static void OnSuccessCallback_169( - void * context, - const chip::app::DataModel::DecodableList & - listStructOctetString) + static void OnSuccessCallback_169(void * context, const chip::app::DataModel::DecodableList & listOctetString) { - (static_cast(context))->OnSuccessResponse_169(listStructOctetString); + (static_cast(context))->OnSuccessResponse_169(listOctetString); } - static void OnFailureCallback_172(void * context, EmberAfStatus status) + static void OnFailureCallback_170(void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_172(status); + (static_cast(context))->OnFailureResponse_170(status); } - static void OnSuccessCallback_172(void * context) { (static_cast(context))->OnSuccessResponse_172(); } + static void OnSuccessCallback_170(void * context) { (static_cast(context))->OnSuccessResponse_170(); } - static void OnFailureCallback_173(void * context, EmberAfStatus status) + static void OnFailureCallback_171(void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_173(status); + (static_cast(context))->OnFailureResponse_171(status); } - static void OnSuccessCallback_173(void * context, const chip::app::DataModel::Nullable & nullableBoolean) + static void OnSuccessCallback_171( + void * context, + const chip::app::DataModel::DecodableList & + listStructOctetString) { - (static_cast(context))->OnSuccessResponse_173(nullableBoolean); + (static_cast(context))->OnSuccessResponse_171(listStructOctetString); } static void OnFailureCallback_174(void * context, EmberAfStatus status) @@ -36795,9 +38005,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_177(status); } - static void OnSuccessCallback_177(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) + static void OnSuccessCallback_177(void * context, const chip::app::DataModel::Nullable & nullableBoolean) { - (static_cast(context))->OnSuccessResponse_177(nullableBitmap8); + (static_cast(context))->OnSuccessResponse_177(nullableBoolean); } static void OnFailureCallback_178(void * context, EmberAfStatus status) @@ -36846,9 +38056,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_183(status); } - static void OnSuccessCallback_183(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) + static void OnSuccessCallback_183(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) { - (static_cast(context))->OnSuccessResponse_183(nullableBitmap16); + (static_cast(context))->OnSuccessResponse_183(nullableBitmap8); } static void OnFailureCallback_184(void * context, EmberAfStatus status) @@ -36897,9 +38107,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_189(status); } - static void OnSuccessCallback_189(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) + static void OnSuccessCallback_189(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) { - (static_cast(context))->OnSuccessResponse_189(nullableBitmap32); + (static_cast(context))->OnSuccessResponse_189(nullableBitmap16); } static void OnFailureCallback_190(void * context, EmberAfStatus status) @@ -36948,9 +38158,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_195(status); } - static void OnSuccessCallback_195(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) + static void OnSuccessCallback_195(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) { - (static_cast(context))->OnSuccessResponse_195(nullableBitmap64); + (static_cast(context))->OnSuccessResponse_195(nullableBitmap32); } static void OnFailureCallback_196(void * context, EmberAfStatus status) @@ -36999,9 +38209,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_201(status); } - static void OnSuccessCallback_201(void * context, const chip::app::DataModel::Nullable & nullableInt8u) + static void OnSuccessCallback_201(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) { - (static_cast(context))->OnSuccessResponse_201(nullableInt8u); + (static_cast(context))->OnSuccessResponse_201(nullableBitmap64); } static void OnFailureCallback_202(void * context, EmberAfStatus status) @@ -37050,9 +38260,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_207(status); } - static void OnSuccessCallback_207(void * context, const chip::app::DataModel::Nullable & nullableInt16u) + static void OnSuccessCallback_207(void * context, const chip::app::DataModel::Nullable & nullableInt8u) { - (static_cast(context))->OnSuccessResponse_207(nullableInt16u); + (static_cast(context))->OnSuccessResponse_207(nullableInt8u); } static void OnFailureCallback_208(void * context, EmberAfStatus status) @@ -37060,33 +38270,36 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_208(status); } - static void OnSuccessCallback_208(void * context) { (static_cast(context))->OnSuccessResponse_208(); } + static void OnSuccessCallback_208(void * context, const chip::app::DataModel::Nullable & nullableInt8u) + { + (static_cast(context))->OnSuccessResponse_208(nullableInt8u); + } static void OnFailureCallback_209(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_209(status); } - static void OnSuccessCallback_209(void * context, const chip::app::DataModel::Nullable & nullableInt16u) - { - (static_cast(context))->OnSuccessResponse_209(nullableInt16u); - } + static void OnSuccessCallback_209(void * context) { (static_cast(context))->OnSuccessResponse_209(); } static void OnFailureCallback_210(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_210(status); } - static void OnSuccessCallback_210(void * context) { (static_cast(context))->OnSuccessResponse_210(); } + static void OnSuccessCallback_210(void * context, const chip::app::DataModel::Nullable & nullableInt8u) + { + (static_cast(context))->OnSuccessResponse_210(nullableInt8u); + } static void OnFailureCallback_211(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_211(status); } - static void OnSuccessCallback_211(void * context, const chip::app::DataModel::Nullable & nullableInt16u) + static void OnSuccessCallback_211(void * context, const chip::app::DataModel::Nullable & nullableInt8u) { - (static_cast(context))->OnSuccessResponse_211(nullableInt16u); + (static_cast(context))->OnSuccessResponse_211(nullableInt8u); } static void OnFailureCallback_212(void * context, EmberAfStatus status) @@ -37094,33 +38307,36 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_212(status); } - static void OnSuccessCallback_212(void * context) { (static_cast(context))->OnSuccessResponse_212(); } + static void OnSuccessCallback_212(void * context, const chip::app::DataModel::Nullable & nullableInt8u) + { + (static_cast(context))->OnSuccessResponse_212(nullableInt8u); + } static void OnFailureCallback_213(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_213(status); } - static void OnSuccessCallback_213(void * context, const chip::app::DataModel::Nullable & nullableInt32u) - { - (static_cast(context))->OnSuccessResponse_213(nullableInt32u); - } + static void OnSuccessCallback_213(void * context) { (static_cast(context))->OnSuccessResponse_213(); } static void OnFailureCallback_214(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_214(status); } - static void OnSuccessCallback_214(void * context) { (static_cast(context))->OnSuccessResponse_214(); } + static void OnSuccessCallback_214(void * context, const chip::app::DataModel::Nullable & nullableInt8u) + { + (static_cast(context))->OnSuccessResponse_214(nullableInt8u); + } static void OnFailureCallback_215(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_215(status); } - static void OnSuccessCallback_215(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + static void OnSuccessCallback_215(void * context, const chip::app::DataModel::Nullable & nullableInt8u) { - (static_cast(context))->OnSuccessResponse_215(nullableInt32u); + (static_cast(context))->OnSuccessResponse_215(nullableInt8u); } static void OnFailureCallback_216(void * context, EmberAfStatus status) @@ -37135,9 +38351,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_217(status); } - static void OnSuccessCallback_217(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + static void OnSuccessCallback_217(void * context, const chip::app::DataModel::Nullable & nullableInt16u) { - (static_cast(context))->OnSuccessResponse_217(nullableInt32u); + (static_cast(context))->OnSuccessResponse_217(nullableInt16u); } static void OnFailureCallback_218(void * context, EmberAfStatus status) @@ -37152,9 +38368,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_219(status); } - static void OnSuccessCallback_219(void * context, const chip::app::DataModel::Nullable & nullableInt64u) + static void OnSuccessCallback_219(void * context, const chip::app::DataModel::Nullable & nullableInt16u) { - (static_cast(context))->OnSuccessResponse_219(nullableInt64u); + (static_cast(context))->OnSuccessResponse_219(nullableInt16u); } static void OnFailureCallback_220(void * context, EmberAfStatus status) @@ -37169,9 +38385,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_221(status); } - static void OnSuccessCallback_221(void * context, const chip::app::DataModel::Nullable & nullableInt64u) + static void OnSuccessCallback_221(void * context, const chip::app::DataModel::Nullable & nullableInt16u) { - (static_cast(context))->OnSuccessResponse_221(nullableInt64u); + (static_cast(context))->OnSuccessResponse_221(nullableInt16u); } static void OnFailureCallback_222(void * context, EmberAfStatus status) @@ -37186,9 +38402,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_223(status); } - static void OnSuccessCallback_223(void * context, const chip::app::DataModel::Nullable & nullableInt64u) + static void OnSuccessCallback_223(void * context, const chip::app::DataModel::Nullable & nullableInt16u) { - (static_cast(context))->OnSuccessResponse_223(nullableInt64u); + (static_cast(context))->OnSuccessResponse_223(nullableInt16u); } static void OnFailureCallback_224(void * context, EmberAfStatus status) @@ -37196,16 +38412,19 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_224(status); } - static void OnSuccessCallback_224(void * context) { (static_cast(context))->OnSuccessResponse_224(); } + static void OnSuccessCallback_224(void * context, const chip::app::DataModel::Nullable & nullableInt16u) + { + (static_cast(context))->OnSuccessResponse_224(nullableInt16u); + } static void OnFailureCallback_225(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_225(status); } - static void OnSuccessCallback_225(void * context, const chip::app::DataModel::Nullable & nullableInt8s) + static void OnSuccessCallback_225(void * context, const chip::app::DataModel::Nullable & nullableInt16u) { - (static_cast(context))->OnSuccessResponse_225(nullableInt8s); + (static_cast(context))->OnSuccessResponse_225(nullableInt16u); } static void OnFailureCallback_226(void * context, EmberAfStatus status) @@ -37220,9 +38439,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_227(status); } - static void OnSuccessCallback_227(void * context, const chip::app::DataModel::Nullable & nullableInt8s) + static void OnSuccessCallback_227(void * context, const chip::app::DataModel::Nullable & nullableInt16u) { - (static_cast(context))->OnSuccessResponse_227(nullableInt8s); + (static_cast(context))->OnSuccessResponse_227(nullableInt16u); } static void OnFailureCallback_228(void * context, EmberAfStatus status) @@ -37230,84 +38449,87 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_228(status); } - static void OnSuccessCallback_228(void * context) { (static_cast(context))->OnSuccessResponse_228(); } + static void OnSuccessCallback_228(void * context, const chip::app::DataModel::Nullable & nullableInt16u) + { + (static_cast(context))->OnSuccessResponse_228(nullableInt16u); + } static void OnFailureCallback_229(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_229(status); } - static void OnSuccessCallback_229(void * context, const chip::app::DataModel::Nullable & nullableInt8s) - { - (static_cast(context))->OnSuccessResponse_229(nullableInt8s); - } + static void OnSuccessCallback_229(void * context) { (static_cast(context))->OnSuccessResponse_229(); } static void OnFailureCallback_230(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_230(status); } - static void OnSuccessCallback_230(void * context) { (static_cast(context))->OnSuccessResponse_230(); } + static void OnSuccessCallback_230(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + { + (static_cast(context))->OnSuccessResponse_230(nullableInt32u); + } static void OnFailureCallback_231(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_231(status); } - static void OnSuccessCallback_231(void * context, const chip::app::DataModel::Nullable & nullableInt16s) - { - (static_cast(context))->OnSuccessResponse_231(nullableInt16s); - } + static void OnSuccessCallback_231(void * context) { (static_cast(context))->OnSuccessResponse_231(); } static void OnFailureCallback_232(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_232(status); } - static void OnSuccessCallback_232(void * context) { (static_cast(context))->OnSuccessResponse_232(); } + static void OnSuccessCallback_232(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + { + (static_cast(context))->OnSuccessResponse_232(nullableInt32u); + } static void OnFailureCallback_233(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_233(status); } - static void OnSuccessCallback_233(void * context, const chip::app::DataModel::Nullable & nullableInt16s) - { - (static_cast(context))->OnSuccessResponse_233(nullableInt16s); - } + static void OnSuccessCallback_233(void * context) { (static_cast(context))->OnSuccessResponse_233(); } static void OnFailureCallback_234(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_234(status); } - static void OnSuccessCallback_234(void * context) { (static_cast(context))->OnSuccessResponse_234(); } + static void OnSuccessCallback_234(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + { + (static_cast(context))->OnSuccessResponse_234(nullableInt32u); + } static void OnFailureCallback_235(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_235(status); } - static void OnSuccessCallback_235(void * context, const chip::app::DataModel::Nullable & nullableInt16s) - { - (static_cast(context))->OnSuccessResponse_235(nullableInt16s); - } + static void OnSuccessCallback_235(void * context) { (static_cast(context))->OnSuccessResponse_235(); } static void OnFailureCallback_236(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_236(status); } - static void OnSuccessCallback_236(void * context) { (static_cast(context))->OnSuccessResponse_236(); } + static void OnSuccessCallback_236(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + { + (static_cast(context))->OnSuccessResponse_236(nullableInt32u); + } static void OnFailureCallback_237(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_237(status); } - static void OnSuccessCallback_237(void * context, const chip::app::DataModel::Nullable & nullableInt32s) + static void OnSuccessCallback_237(void * context, const chip::app::DataModel::Nullable & nullableInt32u) { - (static_cast(context))->OnSuccessResponse_237(nullableInt32s); + (static_cast(context))->OnSuccessResponse_237(nullableInt32u); } static void OnFailureCallback_238(void * context, EmberAfStatus status) @@ -37315,33 +38537,36 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_238(status); } - static void OnSuccessCallback_238(void * context) { (static_cast(context))->OnSuccessResponse_238(); } + static void OnSuccessCallback_238(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + { + (static_cast(context))->OnSuccessResponse_238(nullableInt32u); + } static void OnFailureCallback_239(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_239(status); } - static void OnSuccessCallback_239(void * context, const chip::app::DataModel::Nullable & nullableInt32s) - { - (static_cast(context))->OnSuccessResponse_239(nullableInt32s); - } + static void OnSuccessCallback_239(void * context) { (static_cast(context))->OnSuccessResponse_239(); } static void OnFailureCallback_240(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_240(status); } - static void OnSuccessCallback_240(void * context) { (static_cast(context))->OnSuccessResponse_240(); } + static void OnSuccessCallback_240(void * context, const chip::app::DataModel::Nullable & nullableInt32u) + { + (static_cast(context))->OnSuccessResponse_240(nullableInt32u); + } static void OnFailureCallback_241(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_241(status); } - static void OnSuccessCallback_241(void * context, const chip::app::DataModel::Nullable & nullableInt32s) + static void OnSuccessCallback_241(void * context, const chip::app::DataModel::Nullable & nullableInt32u) { - (static_cast(context))->OnSuccessResponse_241(nullableInt32s); + (static_cast(context))->OnSuccessResponse_241(nullableInt32u); } static void OnFailureCallback_242(void * context, EmberAfStatus status) @@ -37356,9 +38581,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_243(status); } - static void OnSuccessCallback_243(void * context, const chip::app::DataModel::Nullable & nullableInt64s) + static void OnSuccessCallback_243(void * context, const chip::app::DataModel::Nullable & nullableInt64u) { - (static_cast(context))->OnSuccessResponse_243(nullableInt64s); + (static_cast(context))->OnSuccessResponse_243(nullableInt64u); } static void OnFailureCallback_244(void * context, EmberAfStatus status) @@ -37373,9 +38598,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_245(status); } - static void OnSuccessCallback_245(void * context, const chip::app::DataModel::Nullable & nullableInt64s) + static void OnSuccessCallback_245(void * context, const chip::app::DataModel::Nullable & nullableInt64u) { - (static_cast(context))->OnSuccessResponse_245(nullableInt64s); + (static_cast(context))->OnSuccessResponse_245(nullableInt64u); } static void OnFailureCallback_246(void * context, EmberAfStatus status) @@ -37390,9 +38615,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_247(status); } - static void OnSuccessCallback_247(void * context, const chip::app::DataModel::Nullable & nullableInt64s) + static void OnSuccessCallback_247(void * context, const chip::app::DataModel::Nullable & nullableInt64u) { - (static_cast(context))->OnSuccessResponse_247(nullableInt64s); + (static_cast(context))->OnSuccessResponse_247(nullableInt64u); } static void OnFailureCallback_248(void * context, EmberAfStatus status) @@ -37407,9 +38632,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_249(status); } - static void OnSuccessCallback_249(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) + static void OnSuccessCallback_249(void * context, const chip::app::DataModel::Nullable & nullableInt64u) { - (static_cast(context))->OnSuccessResponse_249(nullableFloatSingle); + (static_cast(context))->OnSuccessResponse_249(nullableInt64u); } static void OnFailureCallback_250(void * context, EmberAfStatus status) @@ -37417,16 +38642,19 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_250(status); } - static void OnSuccessCallback_250(void * context) { (static_cast(context))->OnSuccessResponse_250(); } + static void OnSuccessCallback_250(void * context, const chip::app::DataModel::Nullable & nullableInt64u) + { + (static_cast(context))->OnSuccessResponse_250(nullableInt64u); + } static void OnFailureCallback_251(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_251(status); } - static void OnSuccessCallback_251(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) + static void OnSuccessCallback_251(void * context, const chip::app::DataModel::Nullable & nullableInt64u) { - (static_cast(context))->OnSuccessResponse_251(nullableFloatSingle); + (static_cast(context))->OnSuccessResponse_251(nullableInt64u); } static void OnFailureCallback_252(void * context, EmberAfStatus status) @@ -37441,9 +38669,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_253(status); } - static void OnSuccessCallback_253(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) + static void OnSuccessCallback_253(void * context, const chip::app::DataModel::Nullable & nullableInt64u) { - (static_cast(context))->OnSuccessResponse_253(nullableFloatSingle); + (static_cast(context))->OnSuccessResponse_253(nullableInt64u); } static void OnFailureCallback_254(void * context, EmberAfStatus status) @@ -37451,67 +38679,70 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_254(status); } - static void OnSuccessCallback_254(void * context) { (static_cast(context))->OnSuccessResponse_254(); } + static void OnSuccessCallback_254(void * context, const chip::app::DataModel::Nullable & nullableInt64u) + { + (static_cast(context))->OnSuccessResponse_254(nullableInt64u); + } static void OnFailureCallback_255(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_255(status); } - static void OnSuccessCallback_255(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) - { - (static_cast(context))->OnSuccessResponse_255(nullableFloatSingle); - } + static void OnSuccessCallback_255(void * context) { (static_cast(context))->OnSuccessResponse_255(); } static void OnFailureCallback_256(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_256(status); } - static void OnSuccessCallback_256(void * context) { (static_cast(context))->OnSuccessResponse_256(); } + static void OnSuccessCallback_256(void * context, const chip::app::DataModel::Nullable & nullableInt8s) + { + (static_cast(context))->OnSuccessResponse_256(nullableInt8s); + } static void OnFailureCallback_257(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_257(status); } - static void OnSuccessCallback_257(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) - { - (static_cast(context))->OnSuccessResponse_257(nullableFloatSingle); - } + static void OnSuccessCallback_257(void * context) { (static_cast(context))->OnSuccessResponse_257(); } static void OnFailureCallback_258(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_258(status); } - static void OnSuccessCallback_258(void * context) { (static_cast(context))->OnSuccessResponse_258(); } + static void OnSuccessCallback_258(void * context, const chip::app::DataModel::Nullable & nullableInt8s) + { + (static_cast(context))->OnSuccessResponse_258(nullableInt8s); + } static void OnFailureCallback_259(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_259(status); } - static void OnSuccessCallback_259(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) - { - (static_cast(context))->OnSuccessResponse_259(nullableFloatDouble); - } + static void OnSuccessCallback_259(void * context) { (static_cast(context))->OnSuccessResponse_259(); } static void OnFailureCallback_260(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_260(status); } - static void OnSuccessCallback_260(void * context) { (static_cast(context))->OnSuccessResponse_260(); } + static void OnSuccessCallback_260(void * context, const chip::app::DataModel::Nullable & nullableInt8s) + { + (static_cast(context))->OnSuccessResponse_260(nullableInt8s); + } static void OnFailureCallback_261(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_261(status); } - static void OnSuccessCallback_261(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) + static void OnSuccessCallback_261(void * context, const chip::app::DataModel::Nullable & nullableInt8s) { - (static_cast(context))->OnSuccessResponse_261(nullableFloatDouble); + (static_cast(context))->OnSuccessResponse_261(nullableInt8s); } static void OnFailureCallback_262(void * context, EmberAfStatus status) @@ -37519,33 +38750,36 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_262(status); } - static void OnSuccessCallback_262(void * context) { (static_cast(context))->OnSuccessResponse_262(); } + static void OnSuccessCallback_262(void * context, const chip::app::DataModel::Nullable & nullableInt8s) + { + (static_cast(context))->OnSuccessResponse_262(nullableInt8s); + } static void OnFailureCallback_263(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_263(status); } - static void OnSuccessCallback_263(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) - { - (static_cast(context))->OnSuccessResponse_263(nullableFloatDouble); - } + static void OnSuccessCallback_263(void * context) { (static_cast(context))->OnSuccessResponse_263(); } static void OnFailureCallback_264(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_264(status); } - static void OnSuccessCallback_264(void * context) { (static_cast(context))->OnSuccessResponse_264(); } + static void OnSuccessCallback_264(void * context, const chip::app::DataModel::Nullable & nullableInt8s) + { + (static_cast(context))->OnSuccessResponse_264(nullableInt8s); + } static void OnFailureCallback_265(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_265(status); } - static void OnSuccessCallback_265(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) + static void OnSuccessCallback_265(void * context, const chip::app::DataModel::Nullable & nullableInt8s) { - (static_cast(context))->OnSuccessResponse_265(nullableFloatDouble); + (static_cast(context))->OnSuccessResponse_265(nullableInt8s); } static void OnFailureCallback_266(void * context, EmberAfStatus status) @@ -37560,9 +38794,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_267(status); } - static void OnSuccessCallback_267(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) + static void OnSuccessCallback_267(void * context, const chip::app::DataModel::Nullable & nullableInt16s) { - (static_cast(context))->OnSuccessResponse_267(nullableFloatDouble); + (static_cast(context))->OnSuccessResponse_267(nullableInt16s); } static void OnFailureCallback_268(void * context, EmberAfStatus status) @@ -37577,9 +38811,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_269(status); } - static void OnSuccessCallback_269(void * context, const chip::app::DataModel::Nullable & nullableEnum8) + static void OnSuccessCallback_269(void * context, const chip::app::DataModel::Nullable & nullableInt16s) { - (static_cast(context))->OnSuccessResponse_269(nullableEnum8); + (static_cast(context))->OnSuccessResponse_269(nullableInt16s); } static void OnFailureCallback_270(void * context, EmberAfStatus status) @@ -37594,9 +38828,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_271(status); } - static void OnSuccessCallback_271(void * context, const chip::app::DataModel::Nullable & nullableEnum8) + static void OnSuccessCallback_271(void * context, const chip::app::DataModel::Nullable & nullableInt16s) { - (static_cast(context))->OnSuccessResponse_271(nullableEnum8); + (static_cast(context))->OnSuccessResponse_271(nullableInt16s); } static void OnFailureCallback_272(void * context, EmberAfStatus status) @@ -37604,16 +38838,19 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_272(status); } - static void OnSuccessCallback_272(void * context) { (static_cast(context))->OnSuccessResponse_272(); } + static void OnSuccessCallback_272(void * context, const chip::app::DataModel::Nullable & nullableInt16s) + { + (static_cast(context))->OnSuccessResponse_272(nullableInt16s); + } static void OnFailureCallback_273(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_273(status); } - static void OnSuccessCallback_273(void * context, const chip::app::DataModel::Nullable & nullableEnum8) + static void OnSuccessCallback_273(void * context, const chip::app::DataModel::Nullable & nullableInt16s) { - (static_cast(context))->OnSuccessResponse_273(nullableEnum8); + (static_cast(context))->OnSuccessResponse_273(nullableInt16s); } static void OnFailureCallback_274(void * context, EmberAfStatus status) @@ -37628,9 +38865,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_275(status); } - static void OnSuccessCallback_275(void * context, const chip::app::DataModel::Nullable & nullableEnum16) + static void OnSuccessCallback_275(void * context, const chip::app::DataModel::Nullable & nullableInt16s) { - (static_cast(context))->OnSuccessResponse_275(nullableEnum16); + (static_cast(context))->OnSuccessResponse_275(nullableInt16s); } static void OnFailureCallback_276(void * context, EmberAfStatus status) @@ -37638,43 +38875,43 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_276(status); } - static void OnSuccessCallback_276(void * context) { (static_cast(context))->OnSuccessResponse_276(); } + static void OnSuccessCallback_276(void * context, const chip::app::DataModel::Nullable & nullableInt16s) + { + (static_cast(context))->OnSuccessResponse_276(nullableInt16s); + } static void OnFailureCallback_277(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_277(status); } - static void OnSuccessCallback_277(void * context, const chip::app::DataModel::Nullable & nullableEnum16) - { - (static_cast(context))->OnSuccessResponse_277(nullableEnum16); - } + static void OnSuccessCallback_277(void * context) { (static_cast(context))->OnSuccessResponse_277(); } static void OnFailureCallback_278(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_278(status); } - static void OnSuccessCallback_278(void * context) { (static_cast(context))->OnSuccessResponse_278(); } + static void OnSuccessCallback_278(void * context, const chip::app::DataModel::Nullable & nullableInt32s) + { + (static_cast(context))->OnSuccessResponse_278(nullableInt32s); + } static void OnFailureCallback_279(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_279(status); } - static void OnSuccessCallback_279(void * context, const chip::app::DataModel::Nullable & nullableEnum16) - { - (static_cast(context))->OnSuccessResponse_279(nullableEnum16); - } + static void OnSuccessCallback_279(void * context) { (static_cast(context))->OnSuccessResponse_279(); } static void OnFailureCallback_280(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_280(status); } - static void OnSuccessCallback_280(void * context, const chip::app::DataModel::Nullable & nullableOctetString) + static void OnSuccessCallback_280(void * context, const chip::app::DataModel::Nullable & nullableInt32s) { - (static_cast(context))->OnSuccessResponse_280(nullableOctetString); + (static_cast(context))->OnSuccessResponse_280(nullableInt32s); } static void OnFailureCallback_281(void * context, EmberAfStatus status) @@ -37689,9 +38926,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_282(status); } - static void OnSuccessCallback_282(void * context, const chip::app::DataModel::Nullable & nullableOctetString) + static void OnSuccessCallback_282(void * context, const chip::app::DataModel::Nullable & nullableInt32s) { - (static_cast(context))->OnSuccessResponse_282(nullableOctetString); + (static_cast(context))->OnSuccessResponse_282(nullableInt32s); } static void OnFailureCallback_283(void * context, EmberAfStatus status) @@ -37699,16 +38936,19 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_283(status); } - static void OnSuccessCallback_283(void * context) { (static_cast(context))->OnSuccessResponse_283(); } + static void OnSuccessCallback_283(void * context, const chip::app::DataModel::Nullable & nullableInt32s) + { + (static_cast(context))->OnSuccessResponse_283(nullableInt32s); + } static void OnFailureCallback_284(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_284(status); } - static void OnSuccessCallback_284(void * context, const chip::app::DataModel::Nullable & nullableOctetString) + static void OnSuccessCallback_284(void * context, const chip::app::DataModel::Nullable & nullableInt32s) { - (static_cast(context))->OnSuccessResponse_284(nullableOctetString); + (static_cast(context))->OnSuccessResponse_284(nullableInt32s); } static void OnFailureCallback_285(void * context, EmberAfStatus status) @@ -37723,9 +38963,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_286(status); } - static void OnSuccessCallback_286(void * context, const chip::app::DataModel::Nullable & nullableOctetString) + static void OnSuccessCallback_286(void * context, const chip::app::DataModel::Nullable & nullableInt32s) { - (static_cast(context))->OnSuccessResponse_286(nullableOctetString); + (static_cast(context))->OnSuccessResponse_286(nullableInt32s); } static void OnFailureCallback_287(void * context, EmberAfStatus status) @@ -37733,9 +38973,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_287(status); } - static void OnSuccessCallback_287(void * context, const chip::app::DataModel::Nullable & nullableCharString) + static void OnSuccessCallback_287(void * context, const chip::app::DataModel::Nullable & nullableInt32s) { - (static_cast(context))->OnSuccessResponse_287(nullableCharString); + (static_cast(context))->OnSuccessResponse_287(nullableInt32s); } static void OnFailureCallback_288(void * context, EmberAfStatus status) @@ -37750,9 +38990,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_289(status); } - static void OnSuccessCallback_289(void * context, const chip::app::DataModel::Nullable & nullableCharString) + static void OnSuccessCallback_289(void * context, const chip::app::DataModel::Nullable & nullableInt64s) { - (static_cast(context))->OnSuccessResponse_289(nullableCharString); + (static_cast(context))->OnSuccessResponse_289(nullableInt64s); } static void OnFailureCallback_290(void * context, EmberAfStatus status) @@ -37767,9 +39007,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_291(status); } - static void OnSuccessCallback_291(void * context, const chip::app::DataModel::Nullable & nullableCharString) + static void OnSuccessCallback_291(void * context, const chip::app::DataModel::Nullable & nullableInt64s) { - (static_cast(context))->OnSuccessResponse_291(nullableCharString); + (static_cast(context))->OnSuccessResponse_291(nullableInt64s); } static void OnFailureCallback_292(void * context, EmberAfStatus status) @@ -37784,9 +39024,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_293(status); } - static void OnSuccessCallback_293(void * context, const chip::app::DataModel::Nullable & nullableCharString) + static void OnSuccessCallback_293(void * context, const chip::app::DataModel::Nullable & nullableInt64s) { - (static_cast(context))->OnSuccessResponse_293(nullableCharString); + (static_cast(context))->OnSuccessResponse_293(nullableInt64s); } static void OnFailureCallback_294(void * context, EmberAfStatus status) @@ -37794,9 +39034,9 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_294(status); } - static void OnSuccessCallback_294(void * context, const chip::app::DataModel::DecodableList & listInt8u) + static void OnSuccessCallback_294(void * context, const chip::app::DataModel::Nullable & nullableInt64s) { - (static_cast(context))->OnSuccessResponse_294(listInt8u); + (static_cast(context))->OnSuccessResponse_294(nullableInt64s); } static void OnFailureCallback_295(void * context, EmberAfStatus status) @@ -37804,6571 +39044,11548 @@ class TestCluster : public TestCommand (static_cast(context))->OnFailureResponse_295(status); } - static void OnSuccessCallback_295(void * context, const chip::app::DataModel::DecodableList & listInt8u) + static void OnSuccessCallback_295(void * context, const chip::app::DataModel::Nullable & nullableInt64s) { - (static_cast(context))->OnSuccessResponse_295(listInt8u); + (static_cast(context))->OnSuccessResponse_295(nullableInt64s); } - // - // Tests methods - // - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + static void OnFailureCallback_296(void * context, EmberAfStatus status) { - SetIdentity(kIdentityAlpha); - return WaitForCommissionee(); + (static_cast(context))->OnFailureResponse_296(status); } - CHIP_ERROR TestSendTestCommand_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; + static void OnSuccessCallback_296(void * context) { (static_cast(context))->OnSuccessResponse_296(); } - RequestType request; + static void OnFailureCallback_297(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_297(status); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_1(); - }; + static void OnSuccessCallback_297(void * context, const chip::app::DataModel::Nullable & nullableInt64s) + { + (static_cast(context))->OnSuccessResponse_297(nullableInt64s); + } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_1(status); - }; + static void OnFailureCallback_298(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_298(status); + } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_298(void * context, const chip::app::DataModel::Nullable & nullableInt64s) + { + (static_cast(context))->OnSuccessResponse_298(nullableInt64s); } - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnFailureCallback_299(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_299(status); + } - void OnSuccessResponse_1() { NextTest(); } + static void OnSuccessCallback_299(void * context) { (static_cast(context))->OnSuccessResponse_299(); } - CHIP_ERROR TestSendTestNotHandledCommand_2() + static void OnFailureCallback_300(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type; + (static_cast(context))->OnFailureResponse_300(status); + } - RequestType request; + static void OnSuccessCallback_300(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) + { + (static_cast(context))->OnSuccessResponse_300(nullableFloatSingle); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; + static void OnFailureCallback_301(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_301(status); + } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; + static void OnSuccessCallback_301(void * context) { (static_cast(context))->OnSuccessResponse_301(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; + static void OnFailureCallback_302(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_302(status); } - void OnFailureResponse_2(EmberAfStatus status) + static void OnSuccessCallback_302(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_INVALID_COMMAND)); - NextTest(); + (static_cast(context))->OnSuccessResponse_302(nullableFloatSingle); } - void OnSuccessResponse_2() { ThrowSuccessResponse(); } - - CHIP_ERROR TestSendTestSpecificCommand_3() + static void OnFailureCallback_303(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestSpecific::Type; + (static_cast(context))->OnFailureResponse_303(status); + } - RequestType request; + static void OnSuccessCallback_303(void * context) { (static_cast(context))->OnSuccessResponse_303(); } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_3(data.returnValue); - }; + static void OnFailureCallback_304(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_304(status); + } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_3(status); - }; + static void OnSuccessCallback_304(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) + { + (static_cast(context))->OnSuccessResponse_304(nullableFloatSingle); + } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; + static void OnFailureCallback_305(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_305(status); } - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_305(void * context) { (static_cast(context))->OnSuccessResponse_305(); } - void OnSuccessResponse_3(uint8_t returnValue) + static void OnFailureCallback_306(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("returnValue", returnValue, 7)); + (static_cast(context))->OnFailureResponse_306(status); + } - NextTest(); + static void OnSuccessCallback_306(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) + { + (static_cast(context))->OnSuccessResponse_306(nullableFloatSingle); } - CHIP_ERROR TestSendTestAddArgumentsCommand_4() + static void OnFailureCallback_307(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; + (static_cast(context))->OnFailureResponse_307(status); + } - RequestType request; - request.arg1 = 3; - request.arg2 = 17; + static void OnSuccessCallback_307(void * context) { (static_cast(context))->OnSuccessResponse_307(); } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_4(data.returnValue); - }; + static void OnFailureCallback_308(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_308(status); + } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; + static void OnSuccessCallback_308(void * context, const chip::app::DataModel::Nullable & nullableFloatSingle) + { + (static_cast(context))->OnSuccessResponse_308(nullableFloatSingle); + } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; + static void OnFailureCallback_309(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_309(status); } - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_309(void * context) { (static_cast(context))->OnSuccessResponse_309(); } - void OnSuccessResponse_4(uint8_t returnValue) + static void OnFailureCallback_310(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("returnValue", returnValue, 20)); - - NextTest(); + (static_cast(context))->OnFailureResponse_310(status); } - CHIP_ERROR TestSendFailingTestAddArgumentsCommand_5() + static void OnSuccessCallback_310(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; + (static_cast(context))->OnSuccessResponse_310(nullableFloatDouble); + } - RequestType request; - request.arg1 = 250; - request.arg2 = 6; + static void OnFailureCallback_311(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_311(status); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_5(data.returnValue); - }; + static void OnSuccessCallback_311(void * context) { (static_cast(context))->OnSuccessResponse_311(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_5(status); - }; + static void OnFailureCallback_312(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_312(status); + } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_312(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) + { + (static_cast(context))->OnSuccessResponse_312(nullableFloatDouble); } - void OnFailureResponse_5(EmberAfStatus status) + static void OnFailureCallback_313(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_INVALID_COMMAND)); - NextTest(); + (static_cast(context))->OnFailureResponse_313(status); } - void OnSuccessResponse_5(uint8_t returnValue) { ThrowSuccessResponse(); } + static void OnSuccessCallback_313(void * context) { (static_cast(context))->OnSuccessResponse_313(); } - CHIP_ERROR TestReadAttributeBooleanDefaultValue_6() + static void OnFailureCallback_314(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_6, OnFailureCallback_6)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_314(status); } - void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(bool boolean) + static void OnSuccessCallback_314(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) { - VerifyOrReturn(CheckValue("boolean", boolean, 0)); + (static_cast(context))->OnSuccessResponse_314(nullableFloatDouble); + } - NextTest(); + static void OnFailureCallback_315(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_315(status); } - CHIP_ERROR TestWriteAttributeBooleanTrue_7() + static void OnSuccessCallback_315(void * context) { (static_cast(context))->OnSuccessResponse_315(); } + + static void OnFailureCallback_316(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_316(status); + } - bool booleanArgument; - booleanArgument = 1; + static void OnSuccessCallback_316(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) + { + (static_cast(context))->OnSuccessResponse_316(nullableFloatDouble); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - booleanArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); - return CHIP_NO_ERROR; + static void OnFailureCallback_317(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_317(status); } - void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_317(void * context) { (static_cast(context))->OnSuccessResponse_317(); } - void OnSuccessResponse_7() { NextTest(); } + static void OnFailureCallback_318(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_318(status); + } - CHIP_ERROR TestReadAttributeBooleanTrue_8() + static void OnSuccessCallback_318(void * context, const chip::app::DataModel::Nullable & nullableFloatDouble) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_318(nullableFloatDouble); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_8, OnFailureCallback_8)); - return CHIP_NO_ERROR; + static void OnFailureCallback_319(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_319(status); } - void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_319(void * context) { (static_cast(context))->OnSuccessResponse_319(); } - void OnSuccessResponse_8(bool boolean) + static void OnFailureCallback_320(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("boolean", boolean, 1)); - - NextTest(); + (static_cast(context))->OnFailureResponse_320(status); } - CHIP_ERROR TestWriteAttributeBooleanFalse_9() + static void OnSuccessCallback_320(void * context, const chip::app::DataModel::Nullable & nullableEnum8) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - bool booleanArgument; - booleanArgument = 0; + (static_cast(context))->OnSuccessResponse_320(nullableEnum8); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - booleanArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); - return CHIP_NO_ERROR; + static void OnFailureCallback_321(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_321(status); } - void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_321(void * context) { (static_cast(context))->OnSuccessResponse_321(); } - void OnSuccessResponse_9() { NextTest(); } + static void OnFailureCallback_322(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_322(status); + } - CHIP_ERROR TestReadAttributeBooleanFalse_10() + static void OnSuccessCallback_322(void * context, const chip::app::DataModel::Nullable & nullableEnum8) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_322(nullableEnum8); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_10, OnFailureCallback_10)); - return CHIP_NO_ERROR; + static void OnFailureCallback_323(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_323(status); } - void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_323(void * context) { (static_cast(context))->OnSuccessResponse_323(); } - void OnSuccessResponse_10(bool boolean) + static void OnFailureCallback_324(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("boolean", boolean, 0)); - - NextTest(); + (static_cast(context))->OnFailureResponse_324(status); } - CHIP_ERROR TestReadAttributeBitmap8DefaultValue_11() + static void OnSuccessCallback_324(void * context, const chip::app::DataModel::Nullable & nullableEnum8) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_324(nullableEnum8); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_11, OnFailureCallback_11)); - return CHIP_NO_ERROR; + static void OnFailureCallback_325(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_325(status); } - void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_325(void * context) { (static_cast(context))->OnSuccessResponse_325(); } - void OnSuccessResponse_11(uint8_t bitmap8) + static void OnFailureCallback_326(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); - - NextTest(); + (static_cast(context))->OnFailureResponse_326(status); } - CHIP_ERROR TestWriteAttributeBitmap8MaxValue_12() + static void OnSuccessCallback_326(void * context, const chip::app::DataModel::Nullable & nullableEnum8) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t bitmap8Argument; - bitmap8Argument = 255; + (static_cast(context))->OnSuccessResponse_326(nullableEnum8); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap8Argument, this, OnSuccessCallback_12, OnFailureCallback_12)); - return CHIP_NO_ERROR; + static void OnFailureCallback_327(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_327(status); } - void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_327(void * context) { (static_cast(context))->OnSuccessResponse_327(); } - void OnSuccessResponse_12() { NextTest(); } + static void OnFailureCallback_328(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_328(status); + } - CHIP_ERROR TestReadAttributeBitmap8MaxValue_13() + static void OnSuccessCallback_328(void * context, const chip::app::DataModel::Nullable & nullableEnum16) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_328(nullableEnum16); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_13, OnFailureCallback_13)); - return CHIP_NO_ERROR; + static void OnFailureCallback_329(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_329(status); } - void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_329(void * context) { (static_cast(context))->OnSuccessResponse_329(); } - void OnSuccessResponse_13(uint8_t bitmap8) + static void OnFailureCallback_330(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, 255)); - - NextTest(); + (static_cast(context))->OnFailureResponse_330(status); } - CHIP_ERROR TestWriteAttributeBitmap8MinValue_14() + static void OnSuccessCallback_330(void * context, const chip::app::DataModel::Nullable & nullableEnum16) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint8_t bitmap8Argument; - bitmap8Argument = 0; + (static_cast(context))->OnSuccessResponse_330(nullableEnum16); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap8Argument, this, OnSuccessCallback_14, OnFailureCallback_14)); - return CHIP_NO_ERROR; + static void OnFailureCallback_331(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_331(status); } - void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_331(void * context) { (static_cast(context))->OnSuccessResponse_331(); } - void OnSuccessResponse_14() { NextTest(); } + static void OnFailureCallback_332(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_332(status); + } - CHIP_ERROR TestReadAttributeBitmap8MinValue_15() + static void OnSuccessCallback_332(void * context, const chip::app::DataModel::Nullable & nullableEnum16) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_332(nullableEnum16); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_15, OnFailureCallback_15)); - return CHIP_NO_ERROR; + static void OnFailureCallback_333(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_333(status); } - void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_333(void * context) { (static_cast(context))->OnSuccessResponse_333(); } - void OnSuccessResponse_15(uint8_t bitmap8) + static void OnFailureCallback_334(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); - - NextTest(); + (static_cast(context))->OnFailureResponse_334(status); } - CHIP_ERROR TestReadAttributeBitmap16DefaultValue_16() + static void OnSuccessCallback_334(void * context, const chip::app::DataModel::Nullable & nullableEnum16) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_334(nullableEnum16); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_16, OnFailureCallback_16)); - return CHIP_NO_ERROR; + static void OnFailureCallback_335(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_335(status); } - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_335(void * context) { (static_cast(context))->OnSuccessResponse_335(); } - void OnSuccessResponse_16(uint16_t bitmap16) + static void OnFailureCallback_336(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); - - NextTest(); + (static_cast(context))->OnFailureResponse_336(status); } - CHIP_ERROR TestWriteAttributeBitmap16MaxValue_17() + static void + OnSuccessCallback_336(void * context, + const chip::app::DataModel::Nullable & nullableEnumAttr) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - uint16_t bitmap16Argument; - bitmap16Argument = 65535U; + (static_cast(context))->OnSuccessResponse_336(nullableEnumAttr); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap16Argument, this, OnSuccessCallback_17, OnFailureCallback_17)); - return CHIP_NO_ERROR; + static void OnFailureCallback_337(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_337(status); } - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_337(void * context) { (static_cast(context))->OnSuccessResponse_337(); } - void OnSuccessResponse_17() { NextTest(); } + static void OnFailureCallback_338(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_338(status); + } - CHIP_ERROR TestReadAttributeBitmap16MaxValue_18() + static void + OnSuccessCallback_338(void * context, + const chip::app::DataModel::Nullable & nullableEnumAttr) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_338(nullableEnumAttr); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_18, OnFailureCallback_18)); - return CHIP_NO_ERROR; + static void OnFailureCallback_339(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_339(status); } - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_339(void * context) { (static_cast(context))->OnSuccessResponse_339(); } - void OnSuccessResponse_18(uint16_t bitmap16) + static void OnFailureCallback_340(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, 65535U)); + (static_cast(context))->OnFailureResponse_340(status); + } - NextTest(); + static void + OnSuccessCallback_340(void * context, + const chip::app::DataModel::Nullable & nullableEnumAttr) + { + (static_cast(context))->OnSuccessResponse_340(nullableEnumAttr); } - CHIP_ERROR TestWriteAttributeBitmap16MinValue_19() + static void OnFailureCallback_341(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_341(status); + } - uint16_t bitmap16Argument; - bitmap16Argument = 0U; + static void OnSuccessCallback_341(void * context) { (static_cast(context))->OnSuccessResponse_341(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap16Argument, this, OnSuccessCallback_19, OnFailureCallback_19)); - return CHIP_NO_ERROR; + static void OnFailureCallback_342(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_342(status); } - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } + static void + OnSuccessCallback_342(void * context, + const chip::app::DataModel::Nullable & nullableEnumAttr) + { + (static_cast(context))->OnSuccessResponse_342(nullableEnumAttr); + } - void OnSuccessResponse_19() { NextTest(); } + static void OnFailureCallback_343(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_343(status); + } - CHIP_ERROR TestReadAttributeBitmap16MinValue_20() + static void OnSuccessCallback_343(void * context, const chip::app::DataModel::Nullable & nullableOctetString) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_343(nullableOctetString); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_20, OnFailureCallback_20)); - return CHIP_NO_ERROR; + static void OnFailureCallback_344(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_344(status); } - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_344(void * context) { (static_cast(context))->OnSuccessResponse_344(); } - void OnSuccessResponse_20(uint16_t bitmap16) + static void OnFailureCallback_345(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); - - NextTest(); + (static_cast(context))->OnFailureResponse_345(status); } - CHIP_ERROR TestReadAttributeBitmap32DefaultValue_21() + static void OnSuccessCallback_345(void * context, const chip::app::DataModel::Nullable & nullableOctetString) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_345(nullableOctetString); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_21, OnFailureCallback_21)); - return CHIP_NO_ERROR; + static void OnFailureCallback_346(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_346(status); } - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_346(void * context) { (static_cast(context))->OnSuccessResponse_346(); } - void OnSuccessResponse_21(uint32_t bitmap32) + static void OnFailureCallback_347(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); + (static_cast(context))->OnFailureResponse_347(status); + } - NextTest(); + static void OnSuccessCallback_347(void * context, const chip::app::DataModel::Nullable & nullableOctetString) + { + (static_cast(context))->OnSuccessResponse_347(nullableOctetString); } - CHIP_ERROR TestWriteAttributeBitmap32MaxValue_22() + static void OnFailureCallback_348(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_348(status); + } - uint32_t bitmap32Argument; - bitmap32Argument = 4294967295UL; + static void OnSuccessCallback_348(void * context) { (static_cast(context))->OnSuccessResponse_348(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap32Argument, this, OnSuccessCallback_22, OnFailureCallback_22)); - return CHIP_NO_ERROR; + static void OnFailureCallback_349(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_349(status); } - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_349(void * context, const chip::app::DataModel::Nullable & nullableOctetString) + { + (static_cast(context))->OnSuccessResponse_349(nullableOctetString); + } - void OnSuccessResponse_22() { NextTest(); } + static void OnFailureCallback_350(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_350(status); + } - CHIP_ERROR TestReadAttributeBitmap32MaxValue_23() + static void OnSuccessCallback_350(void * context, const chip::app::DataModel::Nullable & nullableCharString) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_350(nullableCharString); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_23, OnFailureCallback_23)); - return CHIP_NO_ERROR; + static void OnFailureCallback_351(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_351(status); } - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_351(void * context) { (static_cast(context))->OnSuccessResponse_351(); } - void OnSuccessResponse_23(uint32_t bitmap32) + static void OnFailureCallback_352(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, 4294967295UL)); + (static_cast(context))->OnFailureResponse_352(status); + } - NextTest(); + static void OnSuccessCallback_352(void * context, const chip::app::DataModel::Nullable & nullableCharString) + { + (static_cast(context))->OnSuccessResponse_352(nullableCharString); } - CHIP_ERROR TestWriteAttributeBitmap32MinValue_24() + static void OnFailureCallback_353(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_353(status); + } - uint32_t bitmap32Argument; - bitmap32Argument = 0UL; + static void OnSuccessCallback_353(void * context) { (static_cast(context))->OnSuccessResponse_353(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap32Argument, this, OnSuccessCallback_24, OnFailureCallback_24)); - return CHIP_NO_ERROR; + static void OnFailureCallback_354(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_354(status); } - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24() { NextTest(); } - - CHIP_ERROR TestReadAttributeBitmap32MinValue_25() + static void OnSuccessCallback_354(void * context, const chip::app::DataModel::Nullable & nullableCharString) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_354(nullableCharString); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_25, OnFailureCallback_25)); - return CHIP_NO_ERROR; + static void OnFailureCallback_355(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_355(status); } - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_355(void * context) { (static_cast(context))->OnSuccessResponse_355(); } - void OnSuccessResponse_25(uint32_t bitmap32) + static void OnFailureCallback_356(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); + (static_cast(context))->OnFailureResponse_356(status); + } - NextTest(); + static void OnSuccessCallback_356(void * context, const chip::app::DataModel::Nullable & nullableCharString) + { + (static_cast(context))->OnSuccessResponse_356(nullableCharString); } - CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() + static void OnFailureCallback_357(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_357(status); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_26, OnFailureCallback_26)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_357(void * context, const chip::app::DataModel::DecodableList & listInt8u) + { + (static_cast(context))->OnSuccessResponse_357(listInt8u); } - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnFailureCallback_358(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_358(status); + } - void OnSuccessResponse_26(uint64_t bitmap64) + static void OnSuccessCallback_358(void * context, const chip::app::DataModel::DecodableList & listInt8u) { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); + (static_cast(context))->OnSuccessResponse_358(listInt8u); + } - NextTest(); + static void OnFailureCallback_361(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_361(status); } - CHIP_ERROR TestWriteAttributeBitmap64MaxValue_27() + static void OnSuccessCallback_361(void * context, const chip::app::DataModel::DecodableList & listInt8u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_361(listInt8u); + } - uint64_t bitmap64Argument; - bitmap64Argument = 18446744073709551615ULL; + bool mReceivedReport_361 = false; - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap64Argument, this, OnSuccessCallback_27, OnFailureCallback_27)); - return CHIP_NO_ERROR; + static void OnFailureCallback_362(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_362(status); } - void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_362(void * context, const chip::app::DataModel::DecodableList & listInt8u) + { + (static_cast(context))->OnSuccessResponse_362(listInt8u); + } - void OnSuccessResponse_27() { NextTest(); } + static void OnSubscriptionEstablished_362(void * context) + { + (static_cast(context))->OnSubscriptionEstablishedResponse_362(); + } - CHIP_ERROR TestReadAttributeBitmap64MaxValue_28() + static void OnFailureCallback_363(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_363(status); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_28, OnFailureCallback_28)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_363(void * context) { (static_cast(context))->OnSuccessResponse_363(); } + + static void OnFailureCallback_364(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_364(status); } - void OnFailureResponse_28(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_364(void * context, const chip::app::DataModel::DecodableList & listInt8u) + { + (static_cast(context))->OnSuccessResponse_364(listInt8u); + } - void OnSuccessResponse_28(uint64_t bitmap64) + bool mReceivedReport_364 = false; + + static void OnFailureCallback_365(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, 18446744073709551615ULL)); + (static_cast(context))->OnFailureResponse_365(status); + } - NextTest(); + static void OnSuccessCallback_365(void * context, uint8_t rangeRestrictedInt8u) + { + (static_cast(context))->OnSuccessResponse_365(rangeRestrictedInt8u); } - CHIP_ERROR TestWriteAttributeBitmap64MinValue_29() + static void OnFailureCallback_366(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_366(status); + } - uint64_t bitmap64Argument; - bitmap64Argument = 0ULL; + static void OnSuccessCallback_366(void * context) { (static_cast(context))->OnSuccessResponse_366(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - bitmap64Argument, this, OnSuccessCallback_29, OnFailureCallback_29)); - return CHIP_NO_ERROR; + static void OnFailureCallback_367(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_367(status); } - void OnFailureResponse_29(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_367(void * context) { (static_cast(context))->OnSuccessResponse_367(); } - void OnSuccessResponse_29() { NextTest(); } + static void OnFailureCallback_368(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_368(status); + } - CHIP_ERROR TestReadAttributeBitmap64MinValue_30() + static void OnSuccessCallback_368(void * context) { (static_cast(context))->OnSuccessResponse_368(); } + + static void OnFailureCallback_369(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_369(status); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_30, OnFailureCallback_30)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_369(void * context) { (static_cast(context))->OnSuccessResponse_369(); } + + static void OnFailureCallback_370(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_370(status); } - void OnFailureResponse_30(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_370(void * context, uint8_t rangeRestrictedInt8u) + { + (static_cast(context))->OnSuccessResponse_370(rangeRestrictedInt8u); + } - void OnSuccessResponse_30(uint64_t bitmap64) + static void OnFailureCallback_371(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); + (static_cast(context))->OnFailureResponse_371(status); + } - NextTest(); + static void OnSuccessCallback_371(void * context) { (static_cast(context))->OnSuccessResponse_371(); } + + static void OnFailureCallback_372(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_372(status); } - CHIP_ERROR TestReadAttributeInt8uDefaultValue_31() + static void OnSuccessCallback_372(void * context, uint8_t rangeRestrictedInt8u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_372(rangeRestrictedInt8u); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_31, OnFailureCallback_31)); - return CHIP_NO_ERROR; + static void OnFailureCallback_373(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_373(status); } - void OnFailureResponse_31(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_373(void * context) { (static_cast(context))->OnSuccessResponse_373(); } - void OnSuccessResponse_31(uint8_t int8u) + static void OnFailureCallback_374(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int8u", int8u, 0)); + (static_cast(context))->OnFailureResponse_374(status); + } - NextTest(); + static void OnSuccessCallback_374(void * context, uint8_t rangeRestrictedInt8u) + { + (static_cast(context))->OnSuccessResponse_374(rangeRestrictedInt8u); } - CHIP_ERROR TestWriteAttributeInt8uMaxValue_32() + static void OnFailureCallback_375(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_375(status); + } - uint8_t int8uArgument; - int8uArgument = 255; + static void OnSuccessCallback_375(void * context) { (static_cast(context))->OnSuccessResponse_375(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int8uArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); - return CHIP_NO_ERROR; + static void OnFailureCallback_376(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_376(status); } - void OnFailureResponse_32(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_376(void * context, uint8_t rangeRestrictedInt8u) + { + (static_cast(context))->OnSuccessResponse_376(rangeRestrictedInt8u); + } - void OnSuccessResponse_32() { NextTest(); } + static void OnFailureCallback_377(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_377(status); + } - CHIP_ERROR TestReadAttributeInt8uMaxValue_33() + static void OnSuccessCallback_377(void * context, uint16_t rangeRestrictedInt16u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_377(rangeRestrictedInt16u); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_33, OnFailureCallback_33)); - return CHIP_NO_ERROR; + static void OnFailureCallback_378(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_378(status); } - void OnFailureResponse_33(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_378(void * context) { (static_cast(context))->OnSuccessResponse_378(); } - void OnSuccessResponse_33(uint8_t int8u) + static void OnFailureCallback_379(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int8u", int8u, 255)); - - NextTest(); + (static_cast(context))->OnFailureResponse_379(status); } - CHIP_ERROR TestWriteAttributeInt8uMinValue_34() + static void OnSuccessCallback_379(void * context) { (static_cast(context))->OnSuccessResponse_379(); } + + static void OnFailureCallback_380(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_380(status); + } - uint8_t int8uArgument; - int8uArgument = 0; + static void OnSuccessCallback_380(void * context) { (static_cast(context))->OnSuccessResponse_380(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int8uArgument, this, OnSuccessCallback_34, OnFailureCallback_34)); - return CHIP_NO_ERROR; + static void OnFailureCallback_381(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_381(status); } - void OnFailureResponse_34(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_381(void * context) { (static_cast(context))->OnSuccessResponse_381(); } - void OnSuccessResponse_34() { NextTest(); } + static void OnFailureCallback_382(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_382(status); + } - CHIP_ERROR TestReadAttributeInt8uMinValue_35() + static void OnSuccessCallback_382(void * context, uint16_t rangeRestrictedInt16u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_382(rangeRestrictedInt16u); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_35, OnFailureCallback_35)); - return CHIP_NO_ERROR; + static void OnFailureCallback_383(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_383(status); } - void OnFailureResponse_35(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_383(void * context) { (static_cast(context))->OnSuccessResponse_383(); } - void OnSuccessResponse_35(uint8_t int8u) + static void OnFailureCallback_384(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int8u", int8u, 0)); - - NextTest(); + (static_cast(context))->OnFailureResponse_384(status); } - CHIP_ERROR TestReadAttributeInt16uDefaultValue_36() + static void OnSuccessCallback_384(void * context, uint16_t rangeRestrictedInt16u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_384(rangeRestrictedInt16u); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_36, OnFailureCallback_36)); - return CHIP_NO_ERROR; + static void OnFailureCallback_385(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_385(status); } - void OnFailureResponse_36(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_385(void * context) { (static_cast(context))->OnSuccessResponse_385(); } - void OnSuccessResponse_36(uint16_t int16u) + static void OnFailureCallback_386(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int16u", int16u, 0U)); + (static_cast(context))->OnFailureResponse_386(status); + } - NextTest(); + static void OnSuccessCallback_386(void * context, uint16_t rangeRestrictedInt16u) + { + (static_cast(context))->OnSuccessResponse_386(rangeRestrictedInt16u); } - CHIP_ERROR TestWriteAttributeInt16uMaxValue_37() + static void OnFailureCallback_387(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_387(status); + } - uint16_t int16uArgument; - int16uArgument = 65535U; + static void OnSuccessCallback_387(void * context) { (static_cast(context))->OnSuccessResponse_387(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int16uArgument, this, OnSuccessCallback_37, OnFailureCallback_37)); - return CHIP_NO_ERROR; + static void OnFailureCallback_388(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_388(status); } - void OnFailureResponse_37(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_388(void * context, uint16_t rangeRestrictedInt16u) + { + (static_cast(context))->OnSuccessResponse_388(rangeRestrictedInt16u); + } - void OnSuccessResponse_37() { NextTest(); } + static void OnFailureCallback_389(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_389(status); + } - CHIP_ERROR TestReadAttributeInt16uMaxValue_38() + static void OnSuccessCallback_389(void * context, int8_t rangeRestrictedInt8s) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_389(rangeRestrictedInt8s); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_38, OnFailureCallback_38)); - return CHIP_NO_ERROR; + static void OnFailureCallback_390(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_390(status); } - void OnFailureResponse_38(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_390(void * context) { (static_cast(context))->OnSuccessResponse_390(); } - void OnSuccessResponse_38(uint16_t int16u) + static void OnFailureCallback_391(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int16u", int16u, 65535U)); - - NextTest(); + (static_cast(context))->OnFailureResponse_391(status); } - CHIP_ERROR TestWriteAttributeInt16uMinValue_39() + static void OnSuccessCallback_391(void * context) { (static_cast(context))->OnSuccessResponse_391(); } + + static void OnFailureCallback_392(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_392(status); + } - uint16_t int16uArgument; - int16uArgument = 0U; + static void OnSuccessCallback_392(void * context) { (static_cast(context))->OnSuccessResponse_392(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int16uArgument, this, OnSuccessCallback_39, OnFailureCallback_39)); - return CHIP_NO_ERROR; + static void OnFailureCallback_393(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_393(status); } - void OnFailureResponse_39(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_393(void * context) { (static_cast(context))->OnSuccessResponse_393(); } - void OnSuccessResponse_39() { NextTest(); } + static void OnFailureCallback_394(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_394(status); + } - CHIP_ERROR TestReadAttributeInt16uMinValue_40() + static void OnSuccessCallback_394(void * context, int8_t rangeRestrictedInt8s) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_394(rangeRestrictedInt8s); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_40, OnFailureCallback_40)); - return CHIP_NO_ERROR; + static void OnFailureCallback_395(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_395(status); } - void OnFailureResponse_40(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_395(void * context) { (static_cast(context))->OnSuccessResponse_395(); } - void OnSuccessResponse_40(uint16_t int16u) + static void OnFailureCallback_396(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int16u", int16u, 0U)); - - NextTest(); + (static_cast(context))->OnFailureResponse_396(status); } - CHIP_ERROR TestReadAttributeInt32uDefaultValue_41() + static void OnSuccessCallback_396(void * context, int8_t rangeRestrictedInt8s) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_396(rangeRestrictedInt8s); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_41, OnFailureCallback_41)); - return CHIP_NO_ERROR; + static void OnFailureCallback_397(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_397(status); } - void OnFailureResponse_41(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_397(void * context) { (static_cast(context))->OnSuccessResponse_397(); } - void OnSuccessResponse_41(uint32_t int32u) + static void OnFailureCallback_398(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); + (static_cast(context))->OnFailureResponse_398(status); + } - NextTest(); + static void OnSuccessCallback_398(void * context, int8_t rangeRestrictedInt8s) + { + (static_cast(context))->OnSuccessResponse_398(rangeRestrictedInt8s); } - CHIP_ERROR TestWriteAttributeInt32uMaxValue_42() + static void OnFailureCallback_399(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_399(status); + } - uint32_t int32uArgument; - int32uArgument = 4294967295UL; + static void OnSuccessCallback_399(void * context) { (static_cast(context))->OnSuccessResponse_399(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int32uArgument, this, OnSuccessCallback_42, OnFailureCallback_42)); - return CHIP_NO_ERROR; + static void OnFailureCallback_400(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_400(status); } - void OnFailureResponse_42(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_400(void * context, int8_t rangeRestrictedInt8s) + { + (static_cast(context))->OnSuccessResponse_400(rangeRestrictedInt8s); + } - void OnSuccessResponse_42() { NextTest(); } + static void OnFailureCallback_401(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_401(status); + } - CHIP_ERROR TestReadAttributeInt32uMaxValue_43() + static void OnSuccessCallback_401(void * context, int16_t rangeRestrictedInt16s) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_401(rangeRestrictedInt16s); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_43, OnFailureCallback_43)); - return CHIP_NO_ERROR; + static void OnFailureCallback_402(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_402(status); } - void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_402(void * context) { (static_cast(context))->OnSuccessResponse_402(); } - void OnSuccessResponse_43(uint32_t int32u) + static void OnFailureCallback_403(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int32u", int32u, 4294967295UL)); - - NextTest(); + (static_cast(context))->OnFailureResponse_403(status); } - CHIP_ERROR TestWriteAttributeInt32uMinValue_44() + static void OnSuccessCallback_403(void * context) { (static_cast(context))->OnSuccessResponse_403(); } + + static void OnFailureCallback_404(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_404(status); + } - uint32_t int32uArgument; - int32uArgument = 0UL; + static void OnSuccessCallback_404(void * context) { (static_cast(context))->OnSuccessResponse_404(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int32uArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); - return CHIP_NO_ERROR; + static void OnFailureCallback_405(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_405(status); } - void OnFailureResponse_44(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_405(void * context) { (static_cast(context))->OnSuccessResponse_405(); } - void OnSuccessResponse_44() { NextTest(); } + static void OnFailureCallback_406(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_406(status); + } - CHIP_ERROR TestReadAttributeInt32uMinValue_45() + static void OnSuccessCallback_406(void * context, int16_t rangeRestrictedInt16s) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_406(rangeRestrictedInt16s); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_45, OnFailureCallback_45)); - return CHIP_NO_ERROR; + static void OnFailureCallback_407(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_407(status); } - void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_407(void * context) { (static_cast(context))->OnSuccessResponse_407(); } - void OnSuccessResponse_45(uint32_t int32u) + static void OnFailureCallback_408(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); - - NextTest(); + (static_cast(context))->OnFailureResponse_408(status); } - CHIP_ERROR TestReadAttributeInt64uDefaultValue_46() + static void OnSuccessCallback_408(void * context, int16_t rangeRestrictedInt16s) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_408(rangeRestrictedInt16s); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_46, OnFailureCallback_46)); - return CHIP_NO_ERROR; + static void OnFailureCallback_409(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_409(status); } - void OnFailureResponse_46(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_409(void * context) { (static_cast(context))->OnSuccessResponse_409(); } - void OnSuccessResponse_46(uint64_t int64u) + static void OnFailureCallback_410(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); + (static_cast(context))->OnFailureResponse_410(status); + } - NextTest(); + static void OnSuccessCallback_410(void * context, int16_t rangeRestrictedInt16s) + { + (static_cast(context))->OnSuccessResponse_410(rangeRestrictedInt16s); } - CHIP_ERROR TestWriteAttributeInt64uMaxValue_47() + static void OnFailureCallback_411(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_411(status); + } - uint64_t int64uArgument; - int64uArgument = 18446744073709551615ULL; + static void OnSuccessCallback_411(void * context) { (static_cast(context))->OnSuccessResponse_411(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int64uArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); - return CHIP_NO_ERROR; + static void OnFailureCallback_412(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_412(status); } - void OnFailureResponse_47(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_412(void * context, int16_t rangeRestrictedInt16s) + { + (static_cast(context))->OnSuccessResponse_412(rangeRestrictedInt16s); + } - void OnSuccessResponse_47() { NextTest(); } + static void OnFailureCallback_413(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_413(status); + } - CHIP_ERROR TestReadAttributeInt64uMaxValue_48() + static void OnSuccessCallback_413(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_413(nullableRangeRestrictedInt8u); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_48, OnFailureCallback_48)); - return CHIP_NO_ERROR; + static void OnFailureCallback_414(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_414(status); } - void OnFailureResponse_48(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_414(void * context) { (static_cast(context))->OnSuccessResponse_414(); } - void OnSuccessResponse_48(uint64_t int64u) + static void OnFailureCallback_415(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int64u", int64u, 18446744073709551615ULL)); - - NextTest(); + (static_cast(context))->OnFailureResponse_415(status); } - CHIP_ERROR TestWriteAttributeInt64uMinValue_49() + static void OnSuccessCallback_415(void * context) { (static_cast(context))->OnSuccessResponse_415(); } + + static void OnFailureCallback_416(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_416(status); + } - uint64_t int64uArgument; - int64uArgument = 0ULL; + static void OnSuccessCallback_416(void * context) { (static_cast(context))->OnSuccessResponse_416(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int64uArgument, this, OnSuccessCallback_49, OnFailureCallback_49)); - return CHIP_NO_ERROR; + static void OnFailureCallback_417(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_417(status); } - void OnFailureResponse_49(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_417(void * context) { (static_cast(context))->OnSuccessResponse_417(); } - void OnSuccessResponse_49() { NextTest(); } + static void OnFailureCallback_418(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_418(status); + } - CHIP_ERROR TestReadAttributeInt64uMinValue_50() + static void OnSuccessCallback_418(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_418(nullableRangeRestrictedInt8u); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_50, OnFailureCallback_50)); - return CHIP_NO_ERROR; + static void OnFailureCallback_419(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_419(status); } - void OnFailureResponse_50(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_419(void * context) { (static_cast(context))->OnSuccessResponse_419(); } - void OnSuccessResponse_50(uint64_t int64u) + static void OnFailureCallback_420(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); - - NextTest(); + (static_cast(context))->OnFailureResponse_420(status); } - CHIP_ERROR TestReadAttributeInt8sDefaultValue_51() + static void OnSuccessCallback_420(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_420(nullableRangeRestrictedInt8u); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_51, OnFailureCallback_51)); - return CHIP_NO_ERROR; + static void OnFailureCallback_421(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_421(status); } - void OnFailureResponse_51(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_421(void * context) { (static_cast(context))->OnSuccessResponse_421(); } - void OnSuccessResponse_51(int8_t int8s) + static void OnFailureCallback_422(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int8s", int8s, 0)); - - NextTest(); + (static_cast(context))->OnFailureResponse_422(status); } - CHIP_ERROR TestWriteAttributeInt8sMaxValue_52() + static void OnSuccessCallback_422(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - int8_t int8sArgument; - int8sArgument = 127; + (static_cast(context))->OnSuccessResponse_422(nullableRangeRestrictedInt8u); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - int8sArgument, this, OnSuccessCallback_52, OnFailureCallback_52)); - return CHIP_NO_ERROR; + static void OnFailureCallback_423(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_423(status); } - void OnFailureResponse_52(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_423(void * context) { (static_cast(context))->OnSuccessResponse_423(); } - void OnSuccessResponse_52() { NextTest(); } + static void OnFailureCallback_424(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_424(status); + } - CHIP_ERROR TestReadAttributeInt8sMaxValue_53() + static void OnSuccessCallback_424(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_424(nullableRangeRestrictedInt8u); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_53, OnFailureCallback_53)); - return CHIP_NO_ERROR; + static void OnFailureCallback_425(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_425(status); } - void OnFailureResponse_53(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_425(void * context) { (static_cast(context))->OnSuccessResponse_425(); } - void OnSuccessResponse_53(int8_t int8s) + static void OnFailureCallback_426(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int8s", int8s, 127)); + (static_cast(context))->OnFailureResponse_426(status); + } - NextTest(); + static void OnSuccessCallback_426(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) + { + (static_cast(context))->OnSuccessResponse_426(nullableRangeRestrictedInt8u); } - CHIP_ERROR TestWriteAttributeInt8sMinValue_54() + static void OnFailureCallback_427(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_427(status); + } - int8_t int8sArgument; - int8sArgument = -128; + static void OnSuccessCallback_427(void * context, + const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) + { + (static_cast(context))->OnSuccessResponse_427(nullableRangeRestrictedInt16u); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - int8sArgument, this, OnSuccessCallback_54, OnFailureCallback_54)); - return CHIP_NO_ERROR; + static void OnFailureCallback_428(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_428(status); } - void OnFailureResponse_54(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_428(void * context) { (static_cast(context))->OnSuccessResponse_428(); } - void OnSuccessResponse_54() { NextTest(); } + static void OnFailureCallback_429(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_429(status); + } - CHIP_ERROR TestReadAttributeInt8sMinValue_55() + static void OnSuccessCallback_429(void * context) { (static_cast(context))->OnSuccessResponse_429(); } + + static void OnFailureCallback_430(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_430(status); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_55, OnFailureCallback_55)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_430(void * context) { (static_cast(context))->OnSuccessResponse_430(); } + + static void OnFailureCallback_431(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_431(status); } - void OnFailureResponse_55(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_431(void * context) { (static_cast(context))->OnSuccessResponse_431(); } - void OnSuccessResponse_55(int8_t int8s) + static void OnFailureCallback_432(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int8s", int8s, -128)); + (static_cast(context))->OnFailureResponse_432(status); + } - NextTest(); + static void OnSuccessCallback_432(void * context, + const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) + { + (static_cast(context))->OnSuccessResponse_432(nullableRangeRestrictedInt16u); } - CHIP_ERROR TestWriteAttributeInt8sDefaultValue_56() + static void OnFailureCallback_433(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_433(status); + } - int8_t int8sArgument; - int8sArgument = 0; + static void OnSuccessCallback_433(void * context) { (static_cast(context))->OnSuccessResponse_433(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int8sArgument, this, OnSuccessCallback_56, OnFailureCallback_56)); - return CHIP_NO_ERROR; + static void OnFailureCallback_434(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_434(status); } - void OnFailureResponse_56(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_434(void * context, + const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) + { + (static_cast(context))->OnSuccessResponse_434(nullableRangeRestrictedInt16u); + } - void OnSuccessResponse_56() { NextTest(); } + static void OnFailureCallback_435(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_435(status); + } - CHIP_ERROR TestReadAttributeInt8sDefaultValue_57() + static void OnSuccessCallback_435(void * context) { (static_cast(context))->OnSuccessResponse_435(); } + + static void OnFailureCallback_436(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_57, OnFailureCallback_57)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_436(status); } - void OnFailureResponse_57(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_436(void * context, + const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) + { + (static_cast(context))->OnSuccessResponse_436(nullableRangeRestrictedInt16u); + } - void OnSuccessResponse_57(int8_t int8s) + static void OnFailureCallback_437(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int8s", int8s, 0)); + (static_cast(context))->OnFailureResponse_437(status); + } - NextTest(); + static void OnSuccessCallback_437(void * context) { (static_cast(context))->OnSuccessResponse_437(); } + + static void OnFailureCallback_438(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_438(status); } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() + static void OnSuccessCallback_438(void * context, + const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_438(nullableRangeRestrictedInt16u); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_58, OnFailureCallback_58)); - return CHIP_NO_ERROR; + static void OnFailureCallback_439(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_439(status); } - void OnFailureResponse_58(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_439(void * context) { (static_cast(context))->OnSuccessResponse_439(); } - void OnSuccessResponse_58(int16_t int16s) + static void OnFailureCallback_440(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int16s", int16s, 0)); + (static_cast(context))->OnFailureResponse_440(status); + } - NextTest(); + static void OnSuccessCallback_440(void * context, + const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) + { + (static_cast(context))->OnSuccessResponse_440(nullableRangeRestrictedInt16u); } - CHIP_ERROR TestWriteAttributeInt16sMaxValue_59() + static void OnFailureCallback_441(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_441(status); + } - int16_t int16sArgument; - int16sArgument = 32767; + static void OnSuccessCallback_441(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) + { + (static_cast(context))->OnSuccessResponse_441(nullableRangeRestrictedInt8s); + } - ReturnErrorOnFailure(cluster.WriteAttribute( - int16sArgument, this, OnSuccessCallback_59, OnFailureCallback_59)); - return CHIP_NO_ERROR; + static void OnFailureCallback_442(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_442(status); } - void OnFailureResponse_59(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_442(void * context) { (static_cast(context))->OnSuccessResponse_442(); } - void OnSuccessResponse_59() { NextTest(); } + static void OnFailureCallback_443(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_443(status); + } - CHIP_ERROR TestReadAttributeInt16sMaxValue_60() + static void OnSuccessCallback_443(void * context) { (static_cast(context))->OnSuccessResponse_443(); } + + static void OnFailureCallback_444(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_444(status); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_60, OnFailureCallback_60)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_444(void * context) { (static_cast(context))->OnSuccessResponse_444(); } + + static void OnFailureCallback_445(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_445(status); } - void OnFailureResponse_60(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_445(void * context) { (static_cast(context))->OnSuccessResponse_445(); } - void OnSuccessResponse_60(int16_t int16s) + static void OnFailureCallback_446(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int16s", int16s, 32767)); + (static_cast(context))->OnFailureResponse_446(status); + } - NextTest(); + static void OnSuccessCallback_446(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) + { + (static_cast(context))->OnSuccessResponse_446(nullableRangeRestrictedInt8s); } - CHIP_ERROR TestWriteAttributeInt16sMinValue_61() + static void OnFailureCallback_447(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_447(status); + } - int16_t int16sArgument; - int16sArgument = -32768; + static void OnSuccessCallback_447(void * context) { (static_cast(context))->OnSuccessResponse_447(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int16sArgument, this, OnSuccessCallback_61, OnFailureCallback_61)); - return CHIP_NO_ERROR; + static void OnFailureCallback_448(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_448(status); } - void OnFailureResponse_61(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_448(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) + { + (static_cast(context))->OnSuccessResponse_448(nullableRangeRestrictedInt8s); + } - void OnSuccessResponse_61() { NextTest(); } + static void OnFailureCallback_449(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_449(status); + } - CHIP_ERROR TestReadAttributeInt16sMinValue_62() + static void OnSuccessCallback_449(void * context) { (static_cast(context))->OnSuccessResponse_449(); } + + static void OnFailureCallback_450(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_450(status); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_62, OnFailureCallback_62)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_450(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) + { + (static_cast(context))->OnSuccessResponse_450(nullableRangeRestrictedInt8s); } - void OnFailureResponse_62(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnFailureCallback_451(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_451(status); + } - void OnSuccessResponse_62(int16_t int16s) + static void OnSuccessCallback_451(void * context) { (static_cast(context))->OnSuccessResponse_451(); } + + static void OnFailureCallback_452(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int16s", int16s, -32768)); + (static_cast(context))->OnFailureResponse_452(status); + } - NextTest(); + static void OnSuccessCallback_452(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) + { + (static_cast(context))->OnSuccessResponse_452(nullableRangeRestrictedInt8s); } - CHIP_ERROR TestWriteAttributeInt16sDefaultValue_63() + static void OnFailureCallback_453(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_453(status); + } - int16_t int16sArgument; - int16sArgument = 0; + static void OnSuccessCallback_453(void * context) { (static_cast(context))->OnSuccessResponse_453(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int16sArgument, this, OnSuccessCallback_63, OnFailureCallback_63)); - return CHIP_NO_ERROR; + static void OnFailureCallback_454(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_454(status); } - void OnFailureResponse_63(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_454(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) + { + (static_cast(context))->OnSuccessResponse_454(nullableRangeRestrictedInt8s); + } - void OnSuccessResponse_63() { NextTest(); } + static void OnFailureCallback_455(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_455(status); + } - CHIP_ERROR TestReadAttributeInt16sDefaultValue_64() + static void OnSuccessCallback_455(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnSuccessResponse_455(nullableRangeRestrictedInt16s); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_64, OnFailureCallback_64)); - return CHIP_NO_ERROR; + static void OnFailureCallback_456(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_456(status); } - void OnFailureResponse_64(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_456(void * context) { (static_cast(context))->OnSuccessResponse_456(); } - void OnSuccessResponse_64(int16_t int16s) + static void OnFailureCallback_457(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int16s", int16s, 0)); - - NextTest(); + (static_cast(context))->OnFailureResponse_457(status); } - CHIP_ERROR TestReadAttributeInt32sDefaultValue_65() + static void OnSuccessCallback_457(void * context) { (static_cast(context))->OnSuccessResponse_457(); } + + static void OnFailureCallback_458(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_458(status); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_65, OnFailureCallback_65)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_458(void * context) { (static_cast(context))->OnSuccessResponse_458(); } + + static void OnFailureCallback_459(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_459(status); } - void OnFailureResponse_65(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_459(void * context) { (static_cast(context))->OnSuccessResponse_459(); } - void OnSuccessResponse_65(int32_t int32s) + static void OnFailureCallback_460(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int32s", int32s, 0L)); + (static_cast(context))->OnFailureResponse_460(status); + } - NextTest(); + static void OnSuccessCallback_460(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) + { + (static_cast(context))->OnSuccessResponse_460(nullableRangeRestrictedInt16s); } - CHIP_ERROR TestWriteAttributeInt32sMaxValue_66() + static void OnFailureCallback_461(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_461(status); + } - int32_t int32sArgument; - int32sArgument = 2147483647L; + static void OnSuccessCallback_461(void * context) { (static_cast(context))->OnSuccessResponse_461(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int32sArgument, this, OnSuccessCallback_66, OnFailureCallback_66)); - return CHIP_NO_ERROR; + static void OnFailureCallback_462(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_462(status); } - void OnFailureResponse_66(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_462(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) + { + (static_cast(context))->OnSuccessResponse_462(nullableRangeRestrictedInt16s); + } - void OnSuccessResponse_66() { NextTest(); } + static void OnFailureCallback_463(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_463(status); + } - CHIP_ERROR TestReadAttributeInt32sMaxValue_67() + static void OnSuccessCallback_463(void * context) { (static_cast(context))->OnSuccessResponse_463(); } + + static void OnFailureCallback_464(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_464(status); + } - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_67, OnFailureCallback_67)); - return CHIP_NO_ERROR; + static void OnSuccessCallback_464(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) + { + (static_cast(context))->OnSuccessResponse_464(nullableRangeRestrictedInt16s); } - void OnFailureResponse_67(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnFailureCallback_465(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_465(status); + } - void OnSuccessResponse_67(int32_t int32s) + static void OnSuccessCallback_465(void * context) { (static_cast(context))->OnSuccessResponse_465(); } + + static void OnFailureCallback_466(void * context, EmberAfStatus status) { - VerifyOrReturn(CheckValue("int32s", int32s, 2147483647L)); + (static_cast(context))->OnFailureResponse_466(status); + } - NextTest(); + static void OnSuccessCallback_466(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) + { + (static_cast(context))->OnSuccessResponse_466(nullableRangeRestrictedInt16s); } - CHIP_ERROR TestWriteAttributeInt32sMinValue_68() + static void OnFailureCallback_467(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + (static_cast(context))->OnFailureResponse_467(status); + } - int32_t int32sArgument; - int32sArgument = -2147483648L; + static void OnSuccessCallback_467(void * context) { (static_cast(context))->OnSuccessResponse_467(); } - ReturnErrorOnFailure(cluster.WriteAttribute( - int32sArgument, this, OnSuccessCallback_68, OnFailureCallback_68)); - return CHIP_NO_ERROR; + static void OnFailureCallback_468(void * context, EmberAfStatus status) + { + (static_cast(context))->OnFailureResponse_468(status); } - void OnFailureResponse_68(EmberAfStatus status) { ThrowFailureResponse(); } + static void OnSuccessCallback_468(void * context, const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) + { + (static_cast(context))->OnSuccessResponse_468(nullableRangeRestrictedInt16s); + } - void OnSuccessResponse_68() { NextTest(); } + // + // Tests methods + // - CHIP_ERROR TestReadAttributeInt32sMinValue_69() + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); + } + + CHIP_ERROR TestSendTestCommand_1() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_69, OnFailureCallback_69)); - return CHIP_NO_ERROR; - } + RequestType request; - void OnFailureResponse_69(EmberAfStatus status) { ThrowFailureResponse(); } + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_1(); + }; - void OnSuccessResponse_69(int32_t int32s) - { - VerifyOrReturn(CheckValue("int32s", int32s, -2147483648L)); + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_1(status); + }; - NextTest(); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeInt32sDefaultValue_70() + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR TestSendTestNotHandledCommand_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type; - int32_t int32sArgument; - int32sArgument = 0L; + RequestType request; - ReturnErrorOnFailure(cluster.WriteAttribute( - int32sArgument, this, OnSuccessCallback_70, OnFailureCallback_70)); + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_2(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_2(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_70(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_2(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + } - void OnSuccessResponse_70() { NextTest(); } + void OnSuccessResponse_2() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeInt32sDefaultValue_71() + CHIP_ERROR TestSendTestSpecificCommand_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + using RequestType = chip::app::Clusters::TestCluster::Commands::TestSpecific::Type; - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_71, OnFailureCallback_71)); + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_3(data.returnValue); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_3(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_71(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_71(int32_t int32s) + void OnSuccessResponse_3(uint8_t returnValue) { - VerifyOrReturn(CheckValue("int32s", int32s, 0L)); + VerifyOrReturn(CheckValue("returnValue", returnValue, 7)); NextTest(); } - CHIP_ERROR TestReadAttributeInt64sDefaultValue_72() + CHIP_ERROR TestSendTestAddArgumentsCommand_4() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_72, OnFailureCallback_72)); + RequestType request; + request.arg1 = 3; + request.arg2 = 17; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_4(data.returnValue); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_4(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_72(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_72(int64_t int64s) + void OnSuccessResponse_4(uint8_t returnValue) { - VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); + VerifyOrReturn(CheckValue("returnValue", returnValue, 20)); NextTest(); } - CHIP_ERROR TestWriteAttributeInt64sMaxValue_73() + CHIP_ERROR TestSendFailingTestAddArgumentsCommand_5() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + using RequestType = chip::app::Clusters::TestCluster::Commands::TestAddArguments::Type; - int64_t int64sArgument; - int64sArgument = 9223372036854775807LL; + RequestType request; + request.arg1 = 250; + request.arg2 = 6; - ReturnErrorOnFailure(cluster.WriteAttribute( - int64sArgument, this, OnSuccessCallback_73, OnFailureCallback_73)); + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_5(data.returnValue); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_5(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_73(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_5(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + } - void OnSuccessResponse_73() { NextTest(); } + void OnSuccessResponse_5(uint8_t returnValue) { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeInt64sMaxValue_74() + CHIP_ERROR TestReadAttributeBooleanDefaultValue_6() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_74, OnFailureCallback_74)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_6, OnFailureCallback_6)); return CHIP_NO_ERROR; } - void OnFailureResponse_74(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_6(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_74(int64_t int64s) + void OnSuccessResponse_6(bool boolean) { - VerifyOrReturn(CheckValue("int64s", int64s, 9223372036854775807LL)); + VerifyOrReturn(CheckValue("boolean", boolean, 0)); NextTest(); } - CHIP_ERROR TestWriteAttributeInt64sMinValue_75() + CHIP_ERROR TestWriteAttributeBooleanTrue_7() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int64_t int64sArgument; - int64sArgument = -9223372036854775807LL; + bool booleanArgument; + booleanArgument = 1; - ReturnErrorOnFailure(cluster.WriteAttribute( - int64sArgument, this, OnSuccessCallback_75, OnFailureCallback_75)); + ReturnErrorOnFailure(cluster.WriteAttribute( + booleanArgument, this, OnSuccessCallback_7, OnFailureCallback_7)); return CHIP_NO_ERROR; } - void OnFailureResponse_75(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_75() { NextTest(); } + void OnSuccessResponse_7() { NextTest(); } - CHIP_ERROR TestReadAttributeInt64sMinValue_76() + CHIP_ERROR TestReadAttributeBooleanTrue_8() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_76, OnFailureCallback_76)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_8, OnFailureCallback_8)); return CHIP_NO_ERROR; } - void OnFailureResponse_76(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_8(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_76(int64_t int64s) + void OnSuccessResponse_8(bool boolean) { - VerifyOrReturn(CheckValue("int64s", int64s, -9223372036854775807LL)); + VerifyOrReturn(CheckValue("boolean", boolean, 1)); NextTest(); } - CHIP_ERROR TestWriteAttributeInt64sDefaultValue_77() + CHIP_ERROR TestWriteAttributeBooleanFalse_9() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - int64_t int64sArgument; - int64sArgument = 0LL; + bool booleanArgument; + booleanArgument = 0; - ReturnErrorOnFailure(cluster.WriteAttribute( - int64sArgument, this, OnSuccessCallback_77, OnFailureCallback_77)); + ReturnErrorOnFailure(cluster.WriteAttribute( + booleanArgument, this, OnSuccessCallback_9, OnFailureCallback_9)); return CHIP_NO_ERROR; } - void OnFailureResponse_77(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_77() { NextTest(); } + void OnSuccessResponse_9() { NextTest(); } - CHIP_ERROR TestReadAttributeInt64sDefaultValue_78() + CHIP_ERROR TestReadAttributeBooleanFalse_10() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_78, OnFailureCallback_78)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_10, OnFailureCallback_10)); return CHIP_NO_ERROR; } - void OnFailureResponse_78(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_10(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_78(int64_t int64s) + void OnSuccessResponse_10(bool boolean) { - VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); + VerifyOrReturn(CheckValue("boolean", boolean, 0)); NextTest(); } - CHIP_ERROR TestReadAttributeSingleDefaultValue_79() + CHIP_ERROR TestReadAttributeBitmap8DefaultValue_11() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_79, OnFailureCallback_79)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_11, OnFailureCallback_11)); return CHIP_NO_ERROR; } - void OnFailureResponse_79(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_11(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_79(float floatSingle) + void OnSuccessResponse_11(uint8_t bitmap8) { - VerifyOrReturn(CheckValue("floatSingle", floatSingle, 0.0f)); + VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); NextTest(); } - CHIP_ERROR TestWriteAttributeSingleMediumValue_80() + CHIP_ERROR TestWriteAttributeBitmap8MaxValue_12() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - float floatSingleArgument; - floatSingleArgument = 0.1f; + uint8_t bitmap8Argument; + bitmap8Argument = 255; - ReturnErrorOnFailure(cluster.WriteAttribute( - floatSingleArgument, this, OnSuccessCallback_80, OnFailureCallback_80)); + ReturnErrorOnFailure(cluster.WriteAttribute( + bitmap8Argument, this, OnSuccessCallback_12, OnFailureCallback_12)); return CHIP_NO_ERROR; } - void OnFailureResponse_80(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_12(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_80() { NextTest(); } + void OnSuccessResponse_12() { NextTest(); } - CHIP_ERROR TestReadAttributeSingleMediumValue_81() + CHIP_ERROR TestReadAttributeBitmap8MaxValue_13() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_81, OnFailureCallback_81)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_13, OnFailureCallback_13)); return CHIP_NO_ERROR; } - void OnFailureResponse_81(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_13(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_81(float floatSingle) + void OnSuccessResponse_13(uint8_t bitmap8) { - VerifyOrReturn(CheckValue("floatSingle", floatSingle, 0.1f)); + VerifyOrReturn(CheckValue("bitmap8", bitmap8, 255)); NextTest(); } - CHIP_ERROR TestWriteAttributeSingleLargeValue_82() + CHIP_ERROR TestWriteAttributeBitmap8MinValue_14() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - float floatSingleArgument; - floatSingleArgument = 17000000000.0f; + uint8_t bitmap8Argument; + bitmap8Argument = 0; - ReturnErrorOnFailure(cluster.WriteAttribute( - floatSingleArgument, this, OnSuccessCallback_82, OnFailureCallback_82)); + ReturnErrorOnFailure(cluster.WriteAttribute( + bitmap8Argument, this, OnSuccessCallback_14, OnFailureCallback_14)); return CHIP_NO_ERROR; } - void OnFailureResponse_82(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_82() { NextTest(); } + void OnSuccessResponse_14() { NextTest(); } - CHIP_ERROR TestReadAttributeSingleLargeValue_83() + CHIP_ERROR TestReadAttributeBitmap8MinValue_15() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_83, OnFailureCallback_83)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_15, OnFailureCallback_15)); return CHIP_NO_ERROR; } - void OnFailureResponse_83(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_83(float floatSingle) + void OnSuccessResponse_15(uint8_t bitmap8) { - VerifyOrReturn(CheckValue("floatSingle", floatSingle, 17000000000.0f)); + VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); NextTest(); } - CHIP_ERROR TestWriteAttributeSingleSmallValue_84() + CHIP_ERROR TestReadAttributeBitmap16DefaultValue_16() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - float floatSingleArgument; - floatSingleArgument = 1.7e-10f; - - ReturnErrorOnFailure(cluster.WriteAttribute( - floatSingleArgument, this, OnSuccessCallback_84, OnFailureCallback_84)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_16, OnFailureCallback_16)); return CHIP_NO_ERROR; } - void OnFailureResponse_84(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_84() { NextTest(); } + void OnSuccessResponse_16(uint16_t bitmap16) + { + VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); - CHIP_ERROR TestReadAttributeSingleSmallValue_85() + NextTest(); + } + + CHIP_ERROR TestWriteAttributeBitmap16MaxValue_17() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_85, OnFailureCallback_85)); + uint16_t bitmap16Argument; + bitmap16Argument = 65535U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + bitmap16Argument, this, OnSuccessCallback_17, OnFailureCallback_17)); return CHIP_NO_ERROR; } - void OnFailureResponse_85(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_85(float floatSingle) - { - VerifyOrReturn(CheckValue("floatSingle", floatSingle, 1.7e-10f)); + void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - NextTest(); - } + void OnSuccessResponse_17() { NextTest(); } - CHIP_ERROR TestWriteAttributeSingleDefaultValue_86() + CHIP_ERROR TestReadAttributeBitmap16MaxValue_18() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - float floatSingleArgument; - floatSingleArgument = 0.0f; - - ReturnErrorOnFailure(cluster.WriteAttribute( - floatSingleArgument, this, OnSuccessCallback_86, OnFailureCallback_86)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_18, OnFailureCallback_18)); return CHIP_NO_ERROR; } - void OnFailureResponse_86(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_86() { NextTest(); } + void OnSuccessResponse_18(uint16_t bitmap16) + { + VerifyOrReturn(CheckValue("bitmap16", bitmap16, 65535U)); - CHIP_ERROR TestReadAttributeSingleDefaultValue_87() + NextTest(); + } + + CHIP_ERROR TestWriteAttributeBitmap16MinValue_19() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_87, OnFailureCallback_87)); + uint16_t bitmap16Argument; + bitmap16Argument = 0U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + bitmap16Argument, this, OnSuccessCallback_19, OnFailureCallback_19)); return CHIP_NO_ERROR; } - void OnFailureResponse_87(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_87(float floatSingle) + void OnSuccessResponse_19() { NextTest(); } + + CHIP_ERROR TestReadAttributeBitmap16MinValue_20() { - VerifyOrReturn(CheckValue("floatSingle", floatSingle, 0.0f)); + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_20, OnFailureCallback_20)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_20(uint16_t bitmap16) + { + VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); NextTest(); } - CHIP_ERROR TestReadAttributeDoubleDefaultValue_88() + CHIP_ERROR TestReadAttributeBitmap32DefaultValue_21() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_88, OnFailureCallback_88)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_21, OnFailureCallback_21)); return CHIP_NO_ERROR; } - void OnFailureResponse_88(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_88(double floatDouble) + void OnSuccessResponse_21(uint32_t bitmap32) { - VerifyOrReturn(CheckValue("floatDouble", floatDouble, 0)); + VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); NextTest(); } - CHIP_ERROR TestWriteAttributeDoubleMediumValue_89() + CHIP_ERROR TestWriteAttributeBitmap32MaxValue_22() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - double floatDoubleArgument; - floatDoubleArgument = 0.1234567890123; + uint32_t bitmap32Argument; + bitmap32Argument = 4294967295UL; - ReturnErrorOnFailure(cluster.WriteAttribute( - floatDoubleArgument, this, OnSuccessCallback_89, OnFailureCallback_89)); + ReturnErrorOnFailure(cluster.WriteAttribute( + bitmap32Argument, this, OnSuccessCallback_22, OnFailureCallback_22)); return CHIP_NO_ERROR; } - void OnFailureResponse_89(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_89() { NextTest(); } + void OnSuccessResponse_22() { NextTest(); } - CHIP_ERROR TestReadAttributeDoubleMediumValue_90() + CHIP_ERROR TestReadAttributeBitmap32MaxValue_23() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_90, OnFailureCallback_90)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_23, OnFailureCallback_23)); return CHIP_NO_ERROR; } - void OnFailureResponse_90(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_90(double floatDouble) + void OnSuccessResponse_23(uint32_t bitmap32) { - VerifyOrReturn(CheckValue("floatDouble", floatDouble, 0.1234567890123)); + VerifyOrReturn(CheckValue("bitmap32", bitmap32, 4294967295UL)); NextTest(); } - CHIP_ERROR TestWriteAttributeDoubleLargeValue_91() + CHIP_ERROR TestWriteAttributeBitmap32MinValue_24() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - double floatDoubleArgument; - floatDoubleArgument = 1.7e+200; + uint32_t bitmap32Argument; + bitmap32Argument = 0UL; - ReturnErrorOnFailure(cluster.WriteAttribute( - floatDoubleArgument, this, OnSuccessCallback_91, OnFailureCallback_91)); + ReturnErrorOnFailure(cluster.WriteAttribute( + bitmap32Argument, this, OnSuccessCallback_24, OnFailureCallback_24)); return CHIP_NO_ERROR; } - void OnFailureResponse_91(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_91() { NextTest(); } + void OnSuccessResponse_24() { NextTest(); } - CHIP_ERROR TestReadAttributeDoubleLargeValue_92() + CHIP_ERROR TestReadAttributeBitmap32MinValue_25() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_92, OnFailureCallback_92)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_25, OnFailureCallback_25)); return CHIP_NO_ERROR; } - void OnFailureResponse_92(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_92(double floatDouble) + void OnSuccessResponse_25(uint32_t bitmap32) { - VerifyOrReturn(CheckValue("floatDouble", floatDouble, 1.7e+200)); + VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); NextTest(); } - CHIP_ERROR TestWriteAttributeDoubleSmallValue_93() + CHIP_ERROR TestReadAttributeBitmap64DefaultValue_26() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - double floatDoubleArgument; - floatDoubleArgument = 1.7e-200; + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_26, OnFailureCallback_26)); + return CHIP_NO_ERROR; + } - ReturnErrorOnFailure(cluster.WriteAttribute( - floatDoubleArgument, this, OnSuccessCallback_93, OnFailureCallback_93)); + void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_26(uint64_t bitmap64) + { + VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeBitmap64MaxValue_27() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint64_t bitmap64Argument; + bitmap64Argument = 18446744073709551615ULL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + bitmap64Argument, this, OnSuccessCallback_27, OnFailureCallback_27)); return CHIP_NO_ERROR; } - void OnFailureResponse_93(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_27(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_93() { NextTest(); } + void OnSuccessResponse_27() { NextTest(); } - CHIP_ERROR TestReadAttributeDoubleSmallValue_94() + CHIP_ERROR TestReadAttributeBitmap64MaxValue_28() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_94, OnFailureCallback_94)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_28, OnFailureCallback_28)); return CHIP_NO_ERROR; } - void OnFailureResponse_94(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_28(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_94(double floatDouble) + void OnSuccessResponse_28(uint64_t bitmap64) { - VerifyOrReturn(CheckValue("floatDouble", floatDouble, 1.7e-200)); + VerifyOrReturn(CheckValue("bitmap64", bitmap64, 18446744073709551615ULL)); NextTest(); } - CHIP_ERROR TestWriteAttributeDoubleDefaultValue_95() + CHIP_ERROR TestWriteAttributeBitmap64MinValue_29() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - double floatDoubleArgument; - floatDoubleArgument = 0; + uint64_t bitmap64Argument; + bitmap64Argument = 0ULL; - ReturnErrorOnFailure(cluster.WriteAttribute( - floatDoubleArgument, this, OnSuccessCallback_95, OnFailureCallback_95)); + ReturnErrorOnFailure(cluster.WriteAttribute( + bitmap64Argument, this, OnSuccessCallback_29, OnFailureCallback_29)); return CHIP_NO_ERROR; } - void OnFailureResponse_95(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_29(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_95() { NextTest(); } + void OnSuccessResponse_29() { NextTest(); } - CHIP_ERROR TestReadAttributeDoubleDefaultValue_96() + CHIP_ERROR TestReadAttributeBitmap64MinValue_30() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_96, OnFailureCallback_96)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_30, OnFailureCallback_30)); return CHIP_NO_ERROR; } - void OnFailureResponse_96(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_30(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_96(double floatDouble) + void OnSuccessResponse_30(uint64_t bitmap64) { - VerifyOrReturn(CheckValue("floatDouble", floatDouble, 0)); + VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); NextTest(); } - CHIP_ERROR TestReadAttributeEnum8DefaultValue_97() + CHIP_ERROR TestReadAttributeInt8uDefaultValue_31() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_97, OnFailureCallback_97)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_31, OnFailureCallback_31)); return CHIP_NO_ERROR; } - void OnFailureResponse_97(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_31(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_97(uint8_t enum8) + void OnSuccessResponse_31(uint8_t int8u) { - VerifyOrReturn(CheckValue("enum8", enum8, 0)); + VerifyOrReturn(CheckValue("int8u", int8u, 0)); NextTest(); } - CHIP_ERROR TestWriteAttributeEnum8MaxValue_98() + CHIP_ERROR TestWriteAttributeInt8uMaxValue_32() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t enum8Argument; - enum8Argument = 255; + uint8_t int8uArgument; + int8uArgument = 255; - ReturnErrorOnFailure(cluster.WriteAttribute( - enum8Argument, this, OnSuccessCallback_98, OnFailureCallback_98)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int8uArgument, this, OnSuccessCallback_32, OnFailureCallback_32)); return CHIP_NO_ERROR; } - void OnFailureResponse_98(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_32(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_98() { NextTest(); } + void OnSuccessResponse_32() { NextTest(); } - CHIP_ERROR TestReadAttributeEnum8MaxValue_99() + CHIP_ERROR TestReadAttributeInt8uMaxValue_33() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_99, OnFailureCallback_99)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_33, OnFailureCallback_33)); return CHIP_NO_ERROR; } - void OnFailureResponse_99(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_33(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_99(uint8_t enum8) + void OnSuccessResponse_33(uint8_t int8u) { - VerifyOrReturn(CheckValue("enum8", enum8, 255)); + VerifyOrReturn(CheckValue("int8u", int8u, 255)); NextTest(); } - CHIP_ERROR TestWriteAttributeEnum8MinValue_100() + CHIP_ERROR TestWriteAttributeInt8uMinValue_34() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t enum8Argument; - enum8Argument = 0; + uint8_t int8uArgument; + int8uArgument = 0; - ReturnErrorOnFailure(cluster.WriteAttribute( - enum8Argument, this, OnSuccessCallback_100, OnFailureCallback_100)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int8uArgument, this, OnSuccessCallback_34, OnFailureCallback_34)); return CHIP_NO_ERROR; } - void OnFailureResponse_100(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_34(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_100() { NextTest(); } + void OnSuccessResponse_34() { NextTest(); } - CHIP_ERROR TestReadAttributeEnum8MinValue_101() + CHIP_ERROR TestReadAttributeInt8uMinValue_35() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_101, OnFailureCallback_101)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_35, OnFailureCallback_35)); return CHIP_NO_ERROR; } - void OnFailureResponse_101(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_35(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_101(uint8_t enum8) + void OnSuccessResponse_35(uint8_t int8u) { - VerifyOrReturn(CheckValue("enum8", enum8, 0)); + VerifyOrReturn(CheckValue("int8u", int8u, 0)); NextTest(); } - CHIP_ERROR TestReadAttributeEnum16DefaultValue_102() + CHIP_ERROR TestReadAttributeInt16uDefaultValue_36() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_102, OnFailureCallback_102)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_36, OnFailureCallback_36)); return CHIP_NO_ERROR; } - void OnFailureResponse_102(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_36(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_102(uint16_t enum16) + void OnSuccessResponse_36(uint16_t int16u) { - VerifyOrReturn(CheckValue("enum16", enum16, 0U)); + VerifyOrReturn(CheckValue("int16u", int16u, 0U)); NextTest(); } - CHIP_ERROR TestWriteAttributeEnum16MaxValue_103() + CHIP_ERROR TestWriteAttributeInt16uMaxValue_37() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t enum16Argument; - enum16Argument = 65535U; + uint16_t int16uArgument; + int16uArgument = 65535U; - ReturnErrorOnFailure(cluster.WriteAttribute( - enum16Argument, this, OnSuccessCallback_103, OnFailureCallback_103)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int16uArgument, this, OnSuccessCallback_37, OnFailureCallback_37)); return CHIP_NO_ERROR; } - void OnFailureResponse_103(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_37(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_103() { NextTest(); } + void OnSuccessResponse_37() { NextTest(); } - CHIP_ERROR TestReadAttributeEnum16MaxValue_104() + CHIP_ERROR TestReadAttributeInt16uMaxValue_38() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_104, OnFailureCallback_104)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_38, OnFailureCallback_38)); return CHIP_NO_ERROR; } - void OnFailureResponse_104(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_38(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_104(uint16_t enum16) + void OnSuccessResponse_38(uint16_t int16u) { - VerifyOrReturn(CheckValue("enum16", enum16, 65535U)); + VerifyOrReturn(CheckValue("int16u", int16u, 65535U)); NextTest(); } - CHIP_ERROR TestWriteAttributeEnum16MinValue_105() + CHIP_ERROR TestWriteAttributeInt16uMinValue_39() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t enum16Argument; - enum16Argument = 0U; + uint16_t int16uArgument; + int16uArgument = 0U; - ReturnErrorOnFailure(cluster.WriteAttribute( - enum16Argument, this, OnSuccessCallback_105, OnFailureCallback_105)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int16uArgument, this, OnSuccessCallback_39, OnFailureCallback_39)); return CHIP_NO_ERROR; } - void OnFailureResponse_105(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_39(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_105() { NextTest(); } + void OnSuccessResponse_39() { NextTest(); } - CHIP_ERROR TestReadAttributeEnum16MinValue_106() + CHIP_ERROR TestReadAttributeInt16uMinValue_40() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_106, OnFailureCallback_106)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_40, OnFailureCallback_40)); return CHIP_NO_ERROR; } - void OnFailureResponse_106(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_40(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_106(uint16_t enum16) + void OnSuccessResponse_40(uint16_t int16u) { - VerifyOrReturn(CheckValue("enum16", enum16, 0U)); + VerifyOrReturn(CheckValue("int16u", int16u, 0U)); NextTest(); } - CHIP_ERROR TestReadAttributeOctetStringDefaultValue_107() + CHIP_ERROR TestReadAttributeInt32uDefaultValue_41() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_107, OnFailureCallback_107)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_41, OnFailureCallback_41)); return CHIP_NO_ERROR; } - void OnFailureResponse_107(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_41(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_107(chip::ByteSpan octetString) + void OnSuccessResponse_41(uint32_t int32u) { - VerifyOrReturn(CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); NextTest(); } - CHIP_ERROR TestWriteAttributeOctetStringWithEmbeddedNull_108() + CHIP_ERROR TestWriteAttributeInt32uMaxValue_42() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::ByteSpan octetStringArgument; - octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("Tes\x00ti\x00nggarbage: not in length on purpose"), 9); + uint32_t int32uArgument; + int32uArgument = 4294967295UL; - ReturnErrorOnFailure(cluster.WriteAttribute( - octetStringArgument, this, OnSuccessCallback_108, OnFailureCallback_108)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int32uArgument, this, OnSuccessCallback_42, OnFailureCallback_42)); return CHIP_NO_ERROR; } - void OnFailureResponse_108(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_42(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_108() { NextTest(); } + void OnSuccessResponse_42() { NextTest(); } - CHIP_ERROR TestReadAttributeOctetStringWithEmbeddedNull_109() + CHIP_ERROR TestReadAttributeInt32uMaxValue_43() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_109, OnFailureCallback_109)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_43, OnFailureCallback_43)); return CHIP_NO_ERROR; } - void OnFailureResponse_109(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_43(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_109(chip::ByteSpan octetString) + void OnSuccessResponse_43(uint32_t int32u) { - VerifyOrReturn( - CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char("Tes\x00ti\x00ng"), 9))); + VerifyOrReturn(CheckValue("int32u", int32u, 4294967295UL)); NextTest(); } - CHIP_ERROR TestWriteAttributeOctetString_110() + CHIP_ERROR TestWriteAttributeInt32uMinValue_44() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::ByteSpan octetStringArgument; - octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); + uint32_t int32uArgument; + int32uArgument = 0UL; - ReturnErrorOnFailure(cluster.WriteAttribute( - octetStringArgument, this, OnSuccessCallback_110, OnFailureCallback_110)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int32uArgument, this, OnSuccessCallback_44, OnFailureCallback_44)); return CHIP_NO_ERROR; } - void OnFailureResponse_110(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_44(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_110() { NextTest(); } + void OnSuccessResponse_44() { NextTest(); } - CHIP_ERROR TestReadAttributeOctetString_111() + CHIP_ERROR TestReadAttributeInt32uMinValue_45() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_111, OnFailureCallback_111)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_45, OnFailureCallback_45)); return CHIP_NO_ERROR; } - void OnFailureResponse_111(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_111(chip::ByteSpan octetString) - { - VerifyOrReturn( - CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); - - NextTest(); - } + void OnFailureResponse_45(EmberAfStatus status) { ThrowFailureResponse(); } - CHIP_ERROR TestWriteAttributeOctetString_112() + void OnSuccessResponse_45(uint32_t int32u) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::ByteSpan octetStringArgument; - octetStringArgument = - chip::ByteSpan(chip::Uint8::from_const_char("TestValueLongerThan10garbage: not in length on purpose"), 21); - - ReturnErrorOnFailure(cluster.WriteAttribute( - octetStringArgument, this, OnSuccessCallback_112, OnFailureCallback_112)); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("int32u", int32u, 0UL)); - void OnFailureResponse_112(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - void OnSuccessResponse_112() { ThrowSuccessResponse(); } - - CHIP_ERROR TestReadAttributeOctetString_113() + CHIP_ERROR TestReadAttributeInt64uDefaultValue_46() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_113, OnFailureCallback_113)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_46, OnFailureCallback_46)); return CHIP_NO_ERROR; } - void OnFailureResponse_113(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_46(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_113(chip::ByteSpan octetString) + void OnSuccessResponse_46(uint64_t int64u) { - VerifyOrReturn( - CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); + VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); NextTest(); } - CHIP_ERROR TestWriteAttributeOctetString_114() + CHIP_ERROR TestWriteAttributeInt64uMaxValue_47() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::ByteSpan octetStringArgument; - octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + uint64_t int64uArgument; + int64uArgument = 18446744073709551615ULL; - ReturnErrorOnFailure(cluster.WriteAttribute( - octetStringArgument, this, OnSuccessCallback_114, OnFailureCallback_114)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int64uArgument, this, OnSuccessCallback_47, OnFailureCallback_47)); return CHIP_NO_ERROR; } - void OnFailureResponse_114(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_47(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_114() { NextTest(); } + void OnSuccessResponse_47() { NextTest(); } - CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_115() + CHIP_ERROR TestReadAttributeInt64uMaxValue_48() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_115, OnFailureCallback_115)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_48, OnFailureCallback_48)); return CHIP_NO_ERROR; } - void OnFailureResponse_115(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_48(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_115(chip::ByteSpan longOctetString) + void OnSuccessResponse_48(uint64_t int64u) { - VerifyOrReturn(CheckValueAsString("longOctetString", longOctetString, chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + VerifyOrReturn(CheckValue("int64u", int64u, 18446744073709551615ULL)); NextTest(); } - CHIP_ERROR TestWriteAttributeLongOctetString_116() + CHIP_ERROR TestWriteAttributeInt64uMinValue_49() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::ByteSpan longOctetStringArgument; - longOctetStringArgument = chip::ByteSpan( - chip::Uint8::from_const_char( - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "111111111111111111111111111111111111111111111111111111111111111111111111garbage: not in length on purpose"), - 300); + uint64_t int64uArgument; + int64uArgument = 0ULL; - ReturnErrorOnFailure(cluster.WriteAttribute( - longOctetStringArgument, this, OnSuccessCallback_116, OnFailureCallback_116)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int64uArgument, this, OnSuccessCallback_49, OnFailureCallback_49)); return CHIP_NO_ERROR; } - void OnFailureResponse_116(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_49(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_116() { NextTest(); } + void OnSuccessResponse_49() { NextTest(); } - CHIP_ERROR TestReadAttributeLongOctetString_117() + CHIP_ERROR TestReadAttributeInt64uMinValue_50() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_117, OnFailureCallback_117)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_50, OnFailureCallback_50)); return CHIP_NO_ERROR; } - void OnFailureResponse_117(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_50(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_117(chip::ByteSpan longOctetString) + void OnSuccessResponse_50(uint64_t int64u) { - VerifyOrReturn(CheckValueAsString( - "longOctetString", longOctetString, - chip::ByteSpan( - chip::Uint8::from_const_char( - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" - "11111111111111111111111111111111111111111111111111111111111111111111111111111111"), - 300))); + VerifyOrReturn(CheckValue("int64u", int64u, 0ULL)); NextTest(); } - CHIP_ERROR TestWriteAttributeLongOctetString_118() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - chip::ByteSpan longOctetStringArgument; - longOctetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - longOctetStringArgument, this, OnSuccessCallback_118, OnFailureCallback_118)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_118(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_118() { NextTest(); } - - CHIP_ERROR TestReadAttributeCharStringDefaultValue_119() + CHIP_ERROR TestReadAttributeInt8sDefaultValue_51() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_119, OnFailureCallback_119)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_51, OnFailureCallback_51)); return CHIP_NO_ERROR; } - void OnFailureResponse_119(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_51(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_119(chip::CharSpan charString) + void OnSuccessResponse_51(int8_t int8s) { - VerifyOrReturn(CheckValueAsString("charString", charString, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("int8s", int8s, 0)); NextTest(); } - CHIP_ERROR TestWriteAttributeCharString_120() + CHIP_ERROR TestWriteAttributeInt8sMaxValue_52() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::CharSpan charStringArgument; - charStringArgument = chip::Span("☉T☉garbage: not in length on purpose", 7); + int8_t int8sArgument; + int8sArgument = 127; - ReturnErrorOnFailure(cluster.WriteAttribute( - charStringArgument, this, OnSuccessCallback_120, OnFailureCallback_120)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int8sArgument, this, OnSuccessCallback_52, OnFailureCallback_52)); return CHIP_NO_ERROR; } - void OnFailureResponse_120(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_52(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_120() { NextTest(); } + void OnSuccessResponse_52() { NextTest(); } - CHIP_ERROR TestReadAttributeCharString_121() + CHIP_ERROR TestReadAttributeInt8sMaxValue_53() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_121, OnFailureCallback_121)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_53, OnFailureCallback_53)); return CHIP_NO_ERROR; } - void OnFailureResponse_121(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_53(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_121(chip::CharSpan charString) + void OnSuccessResponse_53(int8_t int8s) { - VerifyOrReturn(CheckValueAsString("charString", charString, chip::CharSpan("☉T☉", 7))); + VerifyOrReturn(CheckValue("int8s", int8s, 127)); NextTest(); } - CHIP_ERROR TestWriteAttributeCharStringValueTooLong_122() + CHIP_ERROR TestWriteAttributeInt8sMinValue_54() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::CharSpan charStringArgument; - charStringArgument = chip::Span("☉TestValueLongerThan10☉garbage: not in length on purpose", 27); + int8_t int8sArgument; + int8sArgument = -128; - ReturnErrorOnFailure(cluster.WriteAttribute( - charStringArgument, this, OnSuccessCallback_122, OnFailureCallback_122)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int8sArgument, this, OnSuccessCallback_54, OnFailureCallback_54)); return CHIP_NO_ERROR; } - void OnFailureResponse_122(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } + void OnFailureResponse_54(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_122() { ThrowSuccessResponse(); } + void OnSuccessResponse_54() { NextTest(); } - CHIP_ERROR TestReadAttributeCharString_123() + CHIP_ERROR TestReadAttributeInt8sMinValue_55() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_123, OnFailureCallback_123)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_55, OnFailureCallback_55)); return CHIP_NO_ERROR; } - void OnFailureResponse_123(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_55(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_123(chip::CharSpan charString) + void OnSuccessResponse_55(int8_t int8s) { - VerifyOrReturn(CheckValueAsString("charString", charString, chip::CharSpan("☉T☉", 7))); + VerifyOrReturn(CheckValue("int8s", int8s, -128)); NextTest(); } - CHIP_ERROR TestWriteAttributeCharStringEmpty_124() + CHIP_ERROR TestWriteAttributeInt8sDefaultValue_56() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::CharSpan charStringArgument; - charStringArgument = chip::Span("garbage: not in length on purpose", 0); + int8_t int8sArgument; + int8sArgument = 0; - ReturnErrorOnFailure(cluster.WriteAttribute( - charStringArgument, this, OnSuccessCallback_124, OnFailureCallback_124)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int8sArgument, this, OnSuccessCallback_56, OnFailureCallback_56)); return CHIP_NO_ERROR; } - void OnFailureResponse_124(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_56(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_124() { NextTest(); } + void OnSuccessResponse_56() { NextTest(); } - CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_125() + CHIP_ERROR TestReadAttributeInt8sDefaultValue_57() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_125, OnFailureCallback_125)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_57, OnFailureCallback_57)); return CHIP_NO_ERROR; } - void OnFailureResponse_125(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_57(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_125(chip::CharSpan longCharString) + void OnSuccessResponse_57(int8_t int8s) { - VerifyOrReturn(CheckValueAsString("longCharString", longCharString, chip::CharSpan("", 0))); + VerifyOrReturn(CheckValue("int8s", int8s, 0)); NextTest(); } - CHIP_ERROR TestWriteAttributeLongCharString_126() + CHIP_ERROR TestReadAttributeInt16sDefaultValue_58() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::CharSpan longCharStringArgument; - longCharStringArgument = chip::Span( - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉garbage: not in length on purpose", - 900); - - ReturnErrorOnFailure(cluster.WriteAttribute( - longCharStringArgument, this, OnSuccessCallback_126, OnFailureCallback_126)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_58, OnFailureCallback_58)); return CHIP_NO_ERROR; } - void OnFailureResponse_126(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_58(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_126() { NextTest(); } + void OnSuccessResponse_58(int16_t int16s) + { + VerifyOrReturn(CheckValue("int16s", int16s, 0)); + + NextTest(); + } - CHIP_ERROR TestReadAttributeLongCharString_127() + CHIP_ERROR TestWriteAttributeInt16sMaxValue_59() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_127, OnFailureCallback_127)); + int16_t int16sArgument; + int16sArgument = 32767; + + ReturnErrorOnFailure(cluster.WriteAttribute( + int16sArgument, this, OnSuccessCallback_59, OnFailureCallback_59)); return CHIP_NO_ERROR; } - void OnFailureResponse_127(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_127(chip::CharSpan longCharString) - { - VerifyOrReturn(CheckValueAsString( - "longCharString", longCharString, - chip::CharSpan("☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" - "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉", - 900))); + void OnFailureResponse_59(EmberAfStatus status) { ThrowFailureResponse(); } - NextTest(); - } + void OnSuccessResponse_59() { NextTest(); } - CHIP_ERROR TestWriteAttributeLongCharString_128() + CHIP_ERROR TestReadAttributeInt16sMaxValue_60() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::CharSpan longCharStringArgument; - longCharStringArgument = chip::Span("garbage: not in length on purpose", 0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - longCharStringArgument, this, OnSuccessCallback_128, OnFailureCallback_128)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_60, OnFailureCallback_60)); return CHIP_NO_ERROR; } - void OnFailureResponse_128(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_60(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_128() { NextTest(); } + void OnSuccessResponse_60(int16_t int16s) + { + VerifyOrReturn(CheckValue("int16s", int16s, 32767)); + + NextTest(); + } - CHIP_ERROR TestReadAttributeListLongOctetString_129() + CHIP_ERROR TestWriteAttributeInt16sMinValue_61() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_129, OnFailureCallback_129)); + int16_t int16sArgument; + int16sArgument = -32768; + + ReturnErrorOnFailure(cluster.WriteAttribute( + int16sArgument, this, OnSuccessCallback_61, OnFailureCallback_61)); return CHIP_NO_ERROR; } - void OnFailureResponse_129(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_129(const chip::app::DataModel::DecodableList & listLongOctetString) - { - auto iter = listLongOctetString.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 0)); - VerifyOrReturn(CheckValueAsString( - "listLongOctetString[0]", iter.GetValue(), - chip::ByteSpan( - chip::Uint8::from_const_char( - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), - 512))); - VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 1)); - VerifyOrReturn(CheckValueAsString( - "listLongOctetString[1]", iter.GetValue(), - chip::ByteSpan( - chip::Uint8::from_const_char( - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), - 512))); - VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 2)); - VerifyOrReturn(CheckValueAsString( - "listLongOctetString[2]", iter.GetValue(), - chip::ByteSpan( - chip::Uint8::from_const_char( - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), - 512))); - VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 3)); - VerifyOrReturn(CheckValueAsString( - "listLongOctetString[3]", iter.GetValue(), - chip::ByteSpan( - chip::Uint8::from_const_char( - "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" - "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" - "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" - "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" - "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), - 512))); - VerifyOrReturn(CheckNoMoreListItems("listLongOctetString", iter, 4)); + void OnFailureResponse_61(EmberAfStatus status) { ThrowFailureResponse(); } - NextTest(); - } + void OnSuccessResponse_61() { NextTest(); } - CHIP_ERROR TestReadAttributeEpochUsDefaultValue_130() + CHIP_ERROR TestReadAttributeInt16sMinValue_62() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_130, OnFailureCallback_130)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_62, OnFailureCallback_62)); return CHIP_NO_ERROR; } - void OnFailureResponse_130(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_62(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_130(uint64_t epochUs) + void OnSuccessResponse_62(int16_t int16s) { - VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); + VerifyOrReturn(CheckValue("int16s", int16s, -32768)); NextTest(); } - CHIP_ERROR TestWriteAttributeEpochUsMaxValue_131() + CHIP_ERROR TestWriteAttributeInt16sDefaultValue_63() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint64_t epochUsArgument; - epochUsArgument = 18446744073709551615ULL; + int16_t int16sArgument; + int16sArgument = 0; - ReturnErrorOnFailure(cluster.WriteAttribute( - epochUsArgument, this, OnSuccessCallback_131, OnFailureCallback_131)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int16sArgument, this, OnSuccessCallback_63, OnFailureCallback_63)); return CHIP_NO_ERROR; } - void OnFailureResponse_131(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_63(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_131() { NextTest(); } + void OnSuccessResponse_63() { NextTest(); } - CHIP_ERROR TestReadAttributeEpochUsMaxValue_132() + CHIP_ERROR TestReadAttributeInt16sDefaultValue_64() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_132, OnFailureCallback_132)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_64, OnFailureCallback_64)); return CHIP_NO_ERROR; } - void OnFailureResponse_132(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_64(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_132(uint64_t epochUs) + void OnSuccessResponse_64(int16_t int16s) { - VerifyOrReturn(CheckValue("epochUs", epochUs, 18446744073709551615ULL)); + VerifyOrReturn(CheckValue("int16s", int16s, 0)); NextTest(); } - CHIP_ERROR TestWriteAttributeEpochUsMinValue_133() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_65() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint64_t epochUsArgument; - epochUsArgument = 0ULL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - epochUsArgument, this, OnSuccessCallback_133, OnFailureCallback_133)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_65, OnFailureCallback_65)); return CHIP_NO_ERROR; } - void OnFailureResponse_133(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_65(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_133() { NextTest(); } + void OnSuccessResponse_65(int32_t int32s) + { + VerifyOrReturn(CheckValue("int32s", int32s, 0L)); - CHIP_ERROR TestReadAttributeEpochUsMinValue_134() + NextTest(); + } + + CHIP_ERROR TestWriteAttributeInt32sMaxValue_66() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_134, OnFailureCallback_134)); + int32_t int32sArgument; + int32sArgument = 2147483647L; + + ReturnErrorOnFailure(cluster.WriteAttribute( + int32sArgument, this, OnSuccessCallback_66, OnFailureCallback_66)); return CHIP_NO_ERROR; } - void OnFailureResponse_134(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_134(uint64_t epochUs) - { - VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); + void OnFailureResponse_66(EmberAfStatus status) { ThrowFailureResponse(); } - NextTest(); - } + void OnSuccessResponse_66() { NextTest(); } - CHIP_ERROR TestReadAttributeEpochSDefaultValue_135() + CHIP_ERROR TestReadAttributeInt32sMaxValue_67() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_135, OnFailureCallback_135)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_67, OnFailureCallback_67)); return CHIP_NO_ERROR; } - void OnFailureResponse_135(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_67(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_135(uint32_t epochS) + void OnSuccessResponse_67(int32_t int32s) { - VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); + VerifyOrReturn(CheckValue("int32s", int32s, 2147483647L)); NextTest(); } - CHIP_ERROR TestWriteAttributeEpochSMaxValue_136() + CHIP_ERROR TestWriteAttributeInt32sMinValue_68() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint32_t epochSArgument; - epochSArgument = 4294967295UL; + int32_t int32sArgument; + int32sArgument = -2147483648L; - ReturnErrorOnFailure(cluster.WriteAttribute( - epochSArgument, this, OnSuccessCallback_136, OnFailureCallback_136)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int32sArgument, this, OnSuccessCallback_68, OnFailureCallback_68)); return CHIP_NO_ERROR; } - void OnFailureResponse_136(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_68(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_136() { NextTest(); } + void OnSuccessResponse_68() { NextTest(); } - CHIP_ERROR TestReadAttributeEpochSMaxValue_137() + CHIP_ERROR TestReadAttributeInt32sMinValue_69() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_137, OnFailureCallback_137)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_69, OnFailureCallback_69)); return CHIP_NO_ERROR; } - void OnFailureResponse_137(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_69(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_137(uint32_t epochS) + void OnSuccessResponse_69(int32_t int32s) { - VerifyOrReturn(CheckValue("epochS", epochS, 4294967295UL)); + VerifyOrReturn(CheckValue("int32s", int32s, -2147483648L)); NextTest(); } - CHIP_ERROR TestWriteAttributeEpochSMinValue_138() + CHIP_ERROR TestWriteAttributeInt32sDefaultValue_70() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint32_t epochSArgument; - epochSArgument = 0UL; + int32_t int32sArgument; + int32sArgument = 0L; - ReturnErrorOnFailure(cluster.WriteAttribute( - epochSArgument, this, OnSuccessCallback_138, OnFailureCallback_138)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int32sArgument, this, OnSuccessCallback_70, OnFailureCallback_70)); return CHIP_NO_ERROR; } - void OnFailureResponse_138(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_70(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_138() { NextTest(); } + void OnSuccessResponse_70() { NextTest(); } - CHIP_ERROR TestReadAttributeEpochSMinValue_139() + CHIP_ERROR TestReadAttributeInt32sDefaultValue_71() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_139, OnFailureCallback_139)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_71, OnFailureCallback_71)); return CHIP_NO_ERROR; } - void OnFailureResponse_139(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_71(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_139(uint32_t epochS) + void OnSuccessResponse_71(int32_t int32s) { - VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); + VerifyOrReturn(CheckValue("int32s", int32s, 0L)); NextTest(); } - CHIP_ERROR TestReadAttributeUnsupported_140() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_72() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_140, OnFailureCallback_140)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_72, OnFailureCallback_72)); return CHIP_NO_ERROR; } - void OnFailureResponse_140(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } + void OnFailureResponse_72(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_140(bool unsupported) + void OnSuccessResponse_72(int64_t int64s) { - VerifyOrReturn(CheckValue("unsupported", unsupported, 0)); + VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); NextTest(); } - CHIP_ERROR TestWriteattributeUnsupported_141() + CHIP_ERROR TestWriteAttributeInt64sMaxValue_73() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - bool unsupportedArgument; - unsupportedArgument = 0; + int64_t int64sArgument; + int64sArgument = 9223372036854775807LL; - ReturnErrorOnFailure(cluster.WriteAttribute( - unsupportedArgument, this, OnSuccessCallback_141, OnFailureCallback_141)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int64sArgument, this, OnSuccessCallback_73, OnFailureCallback_73)); return CHIP_NO_ERROR; } - void OnFailureResponse_141(EmberAfStatus status) - { - (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); - } + void OnFailureResponse_73(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_141() { NextTest(); } + void OnSuccessResponse_73() { NextTest(); } - CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_142() + CHIP_ERROR TestReadAttributeInt64sMaxValue_74() { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 200; - using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_142(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_142(status); - }; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_74, OnFailureCallback_74)); return CHIP_NO_ERROR; } - void OnFailureResponse_142(EmberAfStatus status) + void OnFailureResponse_74(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_74(int64_t int64s) { - VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); + VerifyOrReturn(CheckValue("int64s", int64s, 9223372036854775807LL)); + NextTest(); } - void OnSuccessResponse_142() { ThrowSuccessResponse(); } - - CHIP_ERROR TestSendTestCommandToUnsupportedCluster_143() + CHIP_ERROR TestWriteAttributeInt64sMinValue_75() { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_143(); - }; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_143(status); - }; + int64_t int64sArgument; + int64sArgument = -9223372036854775807LL; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int64sArgument, this, OnSuccessCallback_75, OnFailureCallback_75)); return CHIP_NO_ERROR; } - void OnFailureResponse_143(EmberAfStatus status) - { - VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); - NextTest(); - } + void OnFailureResponse_75(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_143() { ThrowSuccessResponse(); } + void OnSuccessResponse_75() { NextTest(); } - CHIP_ERROR TestReadAttributeVendorIdDefaultValue_144() + CHIP_ERROR TestReadAttributeInt64sMinValue_76() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_144, OnFailureCallback_144)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_76, OnFailureCallback_76)); return CHIP_NO_ERROR; } - void OnFailureResponse_144(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_76(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_144(chip::VendorId vendorId) + void OnSuccessResponse_76(int64_t int64s) { - VerifyOrReturn(CheckValue("vendorId", vendorId, 0U)); + VerifyOrReturn(CheckValue("int64s", int64s, -9223372036854775807LL)); NextTest(); } - CHIP_ERROR TestWriteAttributeVendorId_145() + CHIP_ERROR TestWriteAttributeInt64sDefaultValue_77() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::VendorId vendorIdArgument; - vendorIdArgument = static_cast(17); + int64_t int64sArgument; + int64sArgument = 0LL; - ReturnErrorOnFailure(cluster.WriteAttribute( - vendorIdArgument, this, OnSuccessCallback_145, OnFailureCallback_145)); + ReturnErrorOnFailure(cluster.WriteAttribute( + int64sArgument, this, OnSuccessCallback_77, OnFailureCallback_77)); return CHIP_NO_ERROR; } - void OnFailureResponse_145(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_77(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_145() { NextTest(); } + void OnSuccessResponse_77() { NextTest(); } - CHIP_ERROR TestReadAttributeVendorId_146() + CHIP_ERROR TestReadAttributeInt64sDefaultValue_78() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_146, OnFailureCallback_146)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_78, OnFailureCallback_78)); return CHIP_NO_ERROR; } - void OnFailureResponse_146(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_78(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_146(chip::VendorId vendorId) + void OnSuccessResponse_78(int64_t int64s) { - VerifyOrReturn(CheckValue("vendorId", vendorId, 17U)); + VerifyOrReturn(CheckValue("int64s", int64s, 0LL)); NextTest(); } - CHIP_ERROR TestRestoreAttributeVendorId_147() + CHIP_ERROR TestReadAttributeSingleDefaultValue_79() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::VendorId vendorIdArgument; - vendorIdArgument = static_cast(0); - - ReturnErrorOnFailure(cluster.WriteAttribute( - vendorIdArgument, this, OnSuccessCallback_147, OnFailureCallback_147)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_79, OnFailureCallback_79)); return CHIP_NO_ERROR; } - void OnFailureResponse_147(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_79(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_147() { NextTest(); } + void OnSuccessResponse_79(float floatSingle) + { + VerifyOrReturn(CheckValue("floatSingle", floatSingle, 0.0f)); + + NextTest(); + } - CHIP_ERROR TestSendACommandWithAVendorIdAndEnum_148() + CHIP_ERROR TestWriteAttributeSingleMediumValue_80() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; - request.arg1 = static_cast(20003); - request.arg2 = static_cast(101); + float floatSingleArgument; + floatSingleArgument = 0.1f; - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_148(data.arg1, data.arg2); - }; + ReturnErrorOnFailure(cluster.WriteAttribute( + floatSingleArgument, this, OnSuccessCallback_80, OnFailureCallback_80)); + return CHIP_NO_ERROR; + } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_148(status); - }; + void OnFailureResponse_80(EmberAfStatus status) { ThrowFailureResponse(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + void OnSuccessResponse_80() { NextTest(); } + + CHIP_ERROR TestReadAttributeSingleMediumValue_81() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_81, OnFailureCallback_81)); return CHIP_NO_ERROR; } - void OnFailureResponse_148(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_81(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_148(chip::VendorId arg1, chip::app::Clusters::TestCluster::SimpleEnum arg2) + void OnSuccessResponse_81(float floatSingle) { - VerifyOrReturn(CheckValue("arg1", arg1, 20003U)); - - VerifyOrReturn(CheckValue("arg2", arg2, 101)); + VerifyOrReturn(CheckValue("floatSingle", floatSingle, 0.1f)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsTrue_149() + CHIP_ERROR TestWriteAttributeSingleLargeValue_82() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + float floatSingleArgument; + floatSingleArgument = 17000000000.0f; - request.arg1.a = 0; - request.arg1.b = true; - request.arg1.c = static_cast(2); - request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.f = static_cast>(1); - request.arg1.g = 0.0f; - request.arg1.h = 0; + ReturnErrorOnFailure(cluster.WriteAttribute( + floatSingleArgument, this, OnSuccessCallback_82, OnFailureCallback_82)); + return CHIP_NO_ERROR; + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_149(data.value); - }; + void OnFailureResponse_82(EmberAfStatus status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_149(status); - }; + void OnSuccessResponse_82() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + CHIP_ERROR TestReadAttributeSingleLargeValue_83() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_83, OnFailureCallback_83)); return CHIP_NO_ERROR; } - void OnFailureResponse_149(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_83(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_149(bool value) + void OnSuccessResponse_83(float floatSingle) { - VerifyOrReturn(CheckValue("value", value, true)); + VerifyOrReturn(CheckValue("floatSingle", floatSingle, 17000000000.0f)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsFalse_150() + CHIP_ERROR TestWriteAttributeSingleSmallValue_84() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + float floatSingleArgument; + floatSingleArgument = 1.7e-10f; - request.arg1.a = 0; - request.arg1.b = false; - request.arg1.c = static_cast(2); - request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.f = static_cast>(1); - request.arg1.g = 0.0f; - request.arg1.h = 0; + ReturnErrorOnFailure(cluster.WriteAttribute( + floatSingleArgument, this, OnSuccessCallback_84, OnFailureCallback_84)); + return CHIP_NO_ERROR; + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_150(data.value); - }; + void OnFailureResponse_84(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_84() { NextTest(); } + + CHIP_ERROR TestReadAttributeSingleSmallValue_85() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_85, OnFailureCallback_85)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_85(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_85(float floatSingle) + { + VerifyOrReturn(CheckValue("floatSingle", floatSingle, 1.7e-10f)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeSingleDefaultValue_86() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + float floatSingleArgument; + floatSingleArgument = 0.0f; + + ReturnErrorOnFailure(cluster.WriteAttribute( + floatSingleArgument, this, OnSuccessCallback_86, OnFailureCallback_86)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_86(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_86() { NextTest(); } + + CHIP_ERROR TestReadAttributeSingleDefaultValue_87() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_87, OnFailureCallback_87)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_87(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_87(float floatSingle) + { + VerifyOrReturn(CheckValue("floatSingle", floatSingle, 0.0f)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeDoubleDefaultValue_88() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_88, OnFailureCallback_88)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_88(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_88(double floatDouble) + { + VerifyOrReturn(CheckValue("floatDouble", floatDouble, 0)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeDoubleMediumValue_89() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + double floatDoubleArgument; + floatDoubleArgument = 0.1234567890123; + + ReturnErrorOnFailure(cluster.WriteAttribute( + floatDoubleArgument, this, OnSuccessCallback_89, OnFailureCallback_89)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_89(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_89() { NextTest(); } + + CHIP_ERROR TestReadAttributeDoubleMediumValue_90() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_90, OnFailureCallback_90)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_90(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_90(double floatDouble) + { + VerifyOrReturn(CheckValue("floatDouble", floatDouble, 0.1234567890123)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeDoubleLargeValue_91() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + double floatDoubleArgument; + floatDoubleArgument = 1.7e+200; + + ReturnErrorOnFailure(cluster.WriteAttribute( + floatDoubleArgument, this, OnSuccessCallback_91, OnFailureCallback_91)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_91(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_91() { NextTest(); } + + CHIP_ERROR TestReadAttributeDoubleLargeValue_92() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_92, OnFailureCallback_92)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_92(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_92(double floatDouble) + { + VerifyOrReturn(CheckValue("floatDouble", floatDouble, 1.7e+200)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeDoubleSmallValue_93() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + double floatDoubleArgument; + floatDoubleArgument = 1.7e-200; + + ReturnErrorOnFailure(cluster.WriteAttribute( + floatDoubleArgument, this, OnSuccessCallback_93, OnFailureCallback_93)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_93(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_93() { NextTest(); } + + CHIP_ERROR TestReadAttributeDoubleSmallValue_94() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_94, OnFailureCallback_94)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_94(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_94(double floatDouble) + { + VerifyOrReturn(CheckValue("floatDouble", floatDouble, 1.7e-200)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeDoubleDefaultValue_95() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + double floatDoubleArgument; + floatDoubleArgument = 0; + + ReturnErrorOnFailure(cluster.WriteAttribute( + floatDoubleArgument, this, OnSuccessCallback_95, OnFailureCallback_95)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_95(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_95() { NextTest(); } + + CHIP_ERROR TestReadAttributeDoubleDefaultValue_96() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_96, OnFailureCallback_96)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_96(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_96(double floatDouble) + { + VerifyOrReturn(CheckValue("floatDouble", floatDouble, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeEnum8DefaultValue_97() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_97, OnFailureCallback_97)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_97(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_97(uint8_t enum8) + { + VerifyOrReturn(CheckValue("enum8", enum8, 0)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeEnum8MaxValue_98() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t enum8Argument; + enum8Argument = 255; + + ReturnErrorOnFailure(cluster.WriteAttribute( + enum8Argument, this, OnSuccessCallback_98, OnFailureCallback_98)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_98(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_98() { NextTest(); } + + CHIP_ERROR TestReadAttributeEnum8MaxValue_99() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_99, OnFailureCallback_99)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_99(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_99(uint8_t enum8) + { + VerifyOrReturn(CheckValue("enum8", enum8, 255)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeEnum8MinValue_100() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint8_t enum8Argument; + enum8Argument = 0; + + ReturnErrorOnFailure(cluster.WriteAttribute( + enum8Argument, this, OnSuccessCallback_100, OnFailureCallback_100)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_100(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_100() { NextTest(); } + + CHIP_ERROR TestReadAttributeEnum8MinValue_101() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_101, OnFailureCallback_101)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_101(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_101(uint8_t enum8) + { + VerifyOrReturn(CheckValue("enum8", enum8, 0)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeEnum16DefaultValue_102() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_102, OnFailureCallback_102)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_102(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_102(uint16_t enum16) + { + VerifyOrReturn(CheckValue("enum16", enum16, 0U)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeEnum16MaxValue_103() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint16_t enum16Argument; + enum16Argument = 65535U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + enum16Argument, this, OnSuccessCallback_103, OnFailureCallback_103)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_103(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_103() { NextTest(); } + + CHIP_ERROR TestReadAttributeEnum16MaxValue_104() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_104, OnFailureCallback_104)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_104(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_104(uint16_t enum16) + { + VerifyOrReturn(CheckValue("enum16", enum16, 65535U)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeEnum16MinValue_105() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint16_t enum16Argument; + enum16Argument = 0U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + enum16Argument, this, OnSuccessCallback_105, OnFailureCallback_105)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_105(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_105() { NextTest(); } + + CHIP_ERROR TestReadAttributeEnum16MinValue_106() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_106, OnFailureCallback_106)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_106(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_106(uint16_t enum16) + { + VerifyOrReturn(CheckValue("enum16", enum16, 0U)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeOctetStringDefaultValue_107() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_107, OnFailureCallback_107)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_107(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_107(chip::ByteSpan octetString) + { + VerifyOrReturn(CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeOctetStringWithEmbeddedNull_108() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::ByteSpan octetStringArgument; + octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("Tes\x00ti\x00nggarbage: not in length on purpose"), 9); + + ReturnErrorOnFailure(cluster.WriteAttribute( + octetStringArgument, this, OnSuccessCallback_108, OnFailureCallback_108)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_108(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_108() { NextTest(); } + + CHIP_ERROR TestReadAttributeOctetStringWithEmbeddedNull_109() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_109, OnFailureCallback_109)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_109(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_109(chip::ByteSpan octetString) + { + VerifyOrReturn( + CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char("Tes\x00ti\x00ng"), 9))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeOctetStringWithWeirdChars_110() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::ByteSpan octetStringArgument; + octetStringArgument = + chip::ByteSpan(chip::Uint8::from_const_char("\x0d\x0a\xff\x22\xa0garbage: not in length on purpose"), 5); + + ReturnErrorOnFailure(cluster.WriteAttribute( + octetStringArgument, this, OnSuccessCallback_110, OnFailureCallback_110)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_110(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_110() { NextTest(); } + + CHIP_ERROR TestReadAttributeOctetStringWithWeirdChars_111() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_111, OnFailureCallback_111)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_111(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_111(chip::ByteSpan octetString) + { + VerifyOrReturn(CheckValueAsString("octetString", octetString, + chip::ByteSpan(chip::Uint8::from_const_char("\x0d\x0a\xff\x22\xa0"), 5))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeOctetString_112() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::ByteSpan octetStringArgument; + octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); + + ReturnErrorOnFailure(cluster.WriteAttribute( + octetStringArgument, this, OnSuccessCallback_112, OnFailureCallback_112)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_112(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_112() { NextTest(); } + + CHIP_ERROR TestReadAttributeOctetString_113() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_113, OnFailureCallback_113)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_113(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_113(chip::ByteSpan octetString) + { + VerifyOrReturn( + CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeOctetString_114() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::ByteSpan octetStringArgument; + octetStringArgument = + chip::ByteSpan(chip::Uint8::from_const_char("TestValueLongerThan10garbage: not in length on purpose"), 21); + + ReturnErrorOnFailure(cluster.WriteAttribute( + octetStringArgument, this, OnSuccessCallback_114, OnFailureCallback_114)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_114(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_114() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeOctetString_115() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_115, OnFailureCallback_115)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_115(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_115(chip::ByteSpan octetString) + { + VerifyOrReturn( + CheckValueAsString("octetString", octetString, chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeOctetString_116() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::ByteSpan octetStringArgument; + octetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + + ReturnErrorOnFailure(cluster.WriteAttribute( + octetStringArgument, this, OnSuccessCallback_116, OnFailureCallback_116)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_116(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_116() { NextTest(); } + + CHIP_ERROR TestReadAttributeLongOctetStringDefaultValue_117() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_117, OnFailureCallback_117)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_117(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_117(chip::ByteSpan longOctetString) + { + VerifyOrReturn(CheckValueAsString("longOctetString", longOctetString, chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeLongOctetString_118() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::ByteSpan longOctetStringArgument; + longOctetStringArgument = chip::ByteSpan( + chip::Uint8::from_const_char( + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111garbage: not in length on purpose"), + 300); + + ReturnErrorOnFailure(cluster.WriteAttribute( + longOctetStringArgument, this, OnSuccessCallback_118, OnFailureCallback_118)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_118(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_118() { NextTest(); } + + CHIP_ERROR TestReadAttributeLongOctetString_119() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_119, OnFailureCallback_119)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_119(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_119(chip::ByteSpan longOctetString) + { + VerifyOrReturn(CheckValueAsString( + "longOctetString", longOctetString, + chip::ByteSpan( + chip::Uint8::from_const_char( + "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "11111111111111111111111111111111111111111111111111111111111111111111111111111111"), + 300))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeLongOctetString_120() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::ByteSpan longOctetStringArgument; + longOctetStringArgument = chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + + ReturnErrorOnFailure(cluster.WriteAttribute( + longOctetStringArgument, this, OnSuccessCallback_120, OnFailureCallback_120)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_120(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_120() { NextTest(); } + + CHIP_ERROR TestReadAttributeCharStringDefaultValue_121() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_121, OnFailureCallback_121)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_121(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_121(chip::CharSpan charString) + { + VerifyOrReturn(CheckValueAsString("charString", charString, chip::CharSpan("", 0))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeCharString_122() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan charStringArgument; + charStringArgument = chip::Span("☉T☉garbage: not in length on purpose", 7); + + ReturnErrorOnFailure(cluster.WriteAttribute( + charStringArgument, this, OnSuccessCallback_122, OnFailureCallback_122)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_122(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_122() { NextTest(); } + + CHIP_ERROR TestReadAttributeCharString_123() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_123, OnFailureCallback_123)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_123(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_123(chip::CharSpan charString) + { + VerifyOrReturn(CheckValueAsString("charString", charString, chip::CharSpan("☉T☉", 7))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeCharStringValueTooLong_124() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan charStringArgument; + charStringArgument = chip::Span("☉TestValueLongerThan10☉garbage: not in length on purpose", 27); + + ReturnErrorOnFailure(cluster.WriteAttribute( + charStringArgument, this, OnSuccessCallback_124, OnFailureCallback_124)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_124(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_124() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeCharString_125() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_125, OnFailureCallback_125)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_125(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_125(chip::CharSpan charString) + { + VerifyOrReturn(CheckValueAsString("charString", charString, chip::CharSpan("☉T☉", 7))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeCharStringEmpty_126() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan charStringArgument; + charStringArgument = chip::Span("garbage: not in length on purpose", 0); + + ReturnErrorOnFailure(cluster.WriteAttribute( + charStringArgument, this, OnSuccessCallback_126, OnFailureCallback_126)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_126(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_126() { NextTest(); } + + CHIP_ERROR TestReadAttributeLongCharStringDefaultValue_127() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_127, OnFailureCallback_127)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_127(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_127(chip::CharSpan longCharString) + { + VerifyOrReturn(CheckValueAsString("longCharString", longCharString, chip::CharSpan("", 0))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeLongCharString_128() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan longCharStringArgument; + longCharStringArgument = chip::Span( + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉garbage: not in length on purpose", + 900); + + ReturnErrorOnFailure(cluster.WriteAttribute( + longCharStringArgument, this, OnSuccessCallback_128, OnFailureCallback_128)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_128(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_128() { NextTest(); } + + CHIP_ERROR TestReadAttributeLongCharString_129() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_129, OnFailureCallback_129)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_129(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_129(chip::CharSpan longCharString) + { + VerifyOrReturn(CheckValueAsString( + "longCharString", longCharString, + chip::CharSpan("☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉" + "☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉☉", + 900))); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeLongCharString_130() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::CharSpan longCharStringArgument; + longCharStringArgument = chip::Span("garbage: not in length on purpose", 0); + + ReturnErrorOnFailure(cluster.WriteAttribute( + longCharStringArgument, this, OnSuccessCallback_130, OnFailureCallback_130)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_130(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_130() { NextTest(); } + + CHIP_ERROR TestReadAttributeListLongOctetString_131() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_131, OnFailureCallback_131)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_131(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_131(const chip::app::DataModel::DecodableList & listLongOctetString) + { + auto iter = listLongOctetString.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 0)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[0]", iter.GetValue(), + chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 1)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[1]", iter.GetValue(), + chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 2)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[2]", iter.GetValue(), + chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNextListItemDecodes("listLongOctetString", iter, 3)); + VerifyOrReturn(CheckValueAsString( + "listLongOctetString[3]", iter.GetValue(), + chip::ByteSpan( + chip::Uint8::from_const_char( + "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcd" + "ef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789ab" + "cdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" + "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01234567" + "89abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"), + 512))); + VerifyOrReturn(CheckNoMoreListItems("listLongOctetString", iter, 4)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeEpochUsDefaultValue_132() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_132, OnFailureCallback_132)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_132(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_132(uint64_t epochUs) + { + VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeEpochUsMaxValue_133() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint64_t epochUsArgument; + epochUsArgument = 18446744073709551615ULL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + epochUsArgument, this, OnSuccessCallback_133, OnFailureCallback_133)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_133(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_133() { NextTest(); } + + CHIP_ERROR TestReadAttributeEpochUsMaxValue_134() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_134, OnFailureCallback_134)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_134(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_134(uint64_t epochUs) + { + VerifyOrReturn(CheckValue("epochUs", epochUs, 18446744073709551615ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeEpochUsMinValue_135() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint64_t epochUsArgument; + epochUsArgument = 0ULL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + epochUsArgument, this, OnSuccessCallback_135, OnFailureCallback_135)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_135(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_135() { NextTest(); } + + CHIP_ERROR TestReadAttributeEpochUsMinValue_136() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_136, OnFailureCallback_136)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_136(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_136(uint64_t epochUs) + { + VerifyOrReturn(CheckValue("epochUs", epochUs, 0ULL)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeEpochSDefaultValue_137() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_137, OnFailureCallback_137)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_137(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_137(uint32_t epochS) + { + VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeEpochSMaxValue_138() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint32_t epochSArgument; + epochSArgument = 4294967295UL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + epochSArgument, this, OnSuccessCallback_138, OnFailureCallback_138)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_138(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_138() { NextTest(); } + + CHIP_ERROR TestReadAttributeEpochSMaxValue_139() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_139, OnFailureCallback_139)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_139(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_139(uint32_t epochS) + { + VerifyOrReturn(CheckValue("epochS", epochS, 4294967295UL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeEpochSMinValue_140() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + uint32_t epochSArgument; + epochSArgument = 0UL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + epochSArgument, this, OnSuccessCallback_140, OnFailureCallback_140)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_140(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_140() { NextTest(); } + + CHIP_ERROR TestReadAttributeEpochSMinValue_141() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_141, OnFailureCallback_141)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_141(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_141(uint32_t epochS) + { + VerifyOrReturn(CheckValue("epochS", epochS, 0UL)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeUnsupported_142() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_142, OnFailureCallback_142)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_142(EmberAfStatus status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_142(bool unsupported) + { + VerifyOrReturn(CheckValue("unsupported", unsupported, 0)); + + NextTest(); + } + + CHIP_ERROR TestWriteattributeUnsupported_143() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + bool unsupportedArgument; + unsupportedArgument = 0; + + ReturnErrorOnFailure(cluster.WriteAttribute( + unsupportedArgument, this, OnSuccessCallback_143, OnFailureCallback_143)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_143(EmberAfStatus status) + { + (status == EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE) ? NextTest() : ThrowFailureResponse(); + } + + void OnSuccessResponse_143() { NextTest(); } + + CHIP_ERROR TestSendTestCommandToUnsupportedEndpoint_144() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 200; + using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_144(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_144(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_144(EmberAfStatus status) + { + VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); + NextTest(); + } + + void OnSuccessResponse_144() { ThrowSuccessResponse(); } + + CHIP_ERROR TestSendTestCommandToUnsupportedCluster_145() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; + using RequestType = chip::app::Clusters::TestCluster::Commands::Test::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_145(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_145(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_145(EmberAfStatus status) + { + VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); + NextTest(); + } + + void OnSuccessResponse_145() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeVendorIdDefaultValue_146() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_146, OnFailureCallback_146)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_146(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_146(chip::VendorId vendorId) + { + VerifyOrReturn(CheckValue("vendorId", vendorId, 0U)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeVendorId_147() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::VendorId vendorIdArgument; + vendorIdArgument = static_cast(17); + + ReturnErrorOnFailure(cluster.WriteAttribute( + vendorIdArgument, this, OnSuccessCallback_147, OnFailureCallback_147)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_147(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_147() { NextTest(); } + + CHIP_ERROR TestReadAttributeVendorId_148() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_148, OnFailureCallback_148)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_148(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_148(chip::VendorId vendorId) + { + VerifyOrReturn(CheckValue("vendorId", vendorId, 17U)); + + NextTest(); + } + + CHIP_ERROR TestRestoreAttributeVendorId_149() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::VendorId vendorIdArgument; + vendorIdArgument = static_cast(0); + + ReturnErrorOnFailure(cluster.WriteAttribute( + vendorIdArgument, this, OnSuccessCallback_149, OnFailureCallback_149)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_149(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_149() { NextTest(); } + + CHIP_ERROR TestSendACommandWithAVendorIdAndEnum_150() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::Type; + + RequestType request; + request.arg1 = static_cast(20003); + request.arg2 = static_cast(101); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_150(data.arg1, data.arg2); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_150(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_150(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_150(chip::VendorId arg1, chip::app::Clusters::TestCluster::SimpleEnum arg2) + { + VerifyOrReturn(CheckValue("arg1", arg1, 20003U)); + + VerifyOrReturn(CheckValue("arg2", arg2, 101)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsTrue_151() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type; + + RequestType request; + + request.arg1.a = 0; + request.arg1.b = true; + request.arg1.c = static_cast(2); + request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + request.arg1.f = static_cast>(1); + request.arg1.g = 0.0f; + request.arg1.h = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_151(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_151(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_151(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_151(bool value) + { + VerifyOrReturn(CheckValue("value", value, true)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithStructArgumentAndArg1bIsFalse_152() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::Type; + + RequestType request; + + request.arg1.a = 0; + request.arg1.b = false; + request.arg1.c = static_cast(2); + request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + request.arg1.f = static_cast>(1); + request.arg1.g = 0.0f; + request.arg1.h = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_152(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_152(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_152(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_152(bool value) + { + VerifyOrReturn(CheckValue("value", value, false)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_153() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type; + + RequestType request; + + request.arg1.a = 0; + request.arg1.b = true; + + request.arg1.c.a = 0; + request.arg1.c.b = true; + request.arg1.c.c = static_cast(2); + request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + request.arg1.c.f = static_cast>(1); + request.arg1.c.g = 0.0f; + request.arg1.c.h = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_153(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_153(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_153(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_153(bool value) + { + VerifyOrReturn(CheckValue("value", value, true)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_154() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type; + + RequestType request; + + request.arg1.a = 0; + request.arg1.b = true; + + request.arg1.c.a = 0; + request.arg1.c.b = false; + request.arg1.c.c = static_cast(2); + request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + request.arg1.c.f = static_cast>(1); + request.arg1.c.g = 0.0f; + request.arg1.c.h = 0; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_154(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_154(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_154(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_154(bool value) + { + VerifyOrReturn(CheckValue("value", value, false)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_155() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type; + + RequestType request; + + request.arg1.a = 0; + request.arg1.b = true; + + request.arg1.c.a = 0; + request.arg1.c.b = true; + request.arg1.c.c = static_cast(2); + request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + request.arg1.c.f = static_cast>(1); + request.arg1.c.g = 0.0f; + request.arg1.c.h = 0; + + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; + + dList[0].a = 1; + dList[0].b = true; + dList[0].c = static_cast(3); + dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + dList[0].f = static_cast>(1); + dList[0].g = 0.0f; + dList[0].h = 0; + + dList[1].a = 2; + dList[1].b = true; + dList[1].c = static_cast(3); + dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + dList[1].f = static_cast>(1); + dList[1].g = 0.0f; + dList[1].h = 0; + + request.arg1.d = dList; + + uint32_t eList[3]; + eList[0] = 1UL; + eList[1] = 2UL; + eList[2] = 3UL; + request.arg1.e = eList; + + chip::ByteSpan fList[3]; + fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); + fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); + fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); + request.arg1.f = fList; + + uint8_t gList[2]; + gList[0] = 0; + gList[1] = 255; + request.arg1.g = gList; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_155(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_155(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_155(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_155(bool value) + { + VerifyOrReturn(CheckValue("value", value, true)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_156() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type; + + RequestType request; + + request.arg1.a = 0; + request.arg1.b = true; + + request.arg1.c.a = 0; + request.arg1.c.b = true; + request.arg1.c.c = static_cast(2); + request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + request.arg1.c.f = static_cast>(1); + request.arg1.c.g = 0.0f; + request.arg1.c.h = 0; + + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; + + dList[0].a = 1; + dList[0].b = true; + dList[0].c = static_cast(3); + dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + dList[0].f = static_cast>(1); + dList[0].g = 0.0f; + dList[0].h = 0; + + dList[1].a = 2; + dList[1].b = false; + dList[1].c = static_cast(3); + dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + dList[1].f = static_cast>(1); + dList[1].g = 0.0f; + dList[1].h = 0; + + request.arg1.d = dList; + + uint32_t eList[3]; + eList[0] = 1UL; + eList[1] = 2UL; + eList[2] = 3UL; + request.arg1.e = eList; + + chip::ByteSpan fList[3]; + fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); + fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); + fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); + request.arg1.f = fList; + + uint8_t gList[2]; + gList[0] = 0; + gList[1] = 255; + request.arg1.g = gList; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_156(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_156(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_156(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_156(bool value) + { + VerifyOrReturn(CheckValue("value", value, false)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_157() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type; + + RequestType request; + + request.arg1.a = 17; + request.arg1.b = false; + request.arg1.c = static_cast(2); + request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + request.arg1.f = static_cast>(1); + request.arg1.g = 0.1f; + request.arg1.h = 0.1; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_157(data.arg1); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_157(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_157(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_157(const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & arg1) + { + VerifyOrReturn(CheckValue("arg1.a", arg1.a, 17)); + VerifyOrReturn(CheckValue("arg1.b", arg1.b, false)); + VerifyOrReturn(CheckValue("arg1.c", arg1.c, 2)); + VerifyOrReturn(CheckValueAsString("arg1.d", arg1.d, chip::ByteSpan(chip::Uint8::from_const_char("octet_string"), 12))); + VerifyOrReturn(CheckValueAsString("arg1.e", arg1.e, chip::CharSpan("char_string", 11))); + VerifyOrReturn(CheckValue("arg1.f", arg1.f, 1)); + VerifyOrReturn(CheckValue("arg1.g", arg1.g, 0.1f)); + VerifyOrReturn(CheckValue("arg1.h", arg1.h, 0.1)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_158() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type; + + RequestType request; + + uint8_t arg1List[9]; + arg1List[0] = 1; + arg1List[1] = 2; + arg1List[2] = 3; + arg1List[3] = 4; + arg1List[4] = 5; + arg1List[5] = 6; + arg1List[6] = 7; + arg1List[7] = 8; + arg1List[8] = 9; + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_158(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_158(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_158(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_158(bool value) + { + VerifyOrReturn(CheckValue("value", value, true)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_159() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type; + + RequestType request; + + uint8_t arg1List[10]; + arg1List[0] = 1; + arg1List[1] = 2; + arg1List[2] = 3; + arg1List[3] = 4; + arg1List[4] = 5; + arg1List[5] = 6; + arg1List[6] = 7; + arg1List[7] = 8; + arg1List[8] = 9; + arg1List[9] = 0; + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_159(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_159(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_159(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_159(bool value) + { + VerifyOrReturn(CheckValue("value", value, false)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfInt8uAndGetItReversed_160() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type; + + RequestType request; + + uint8_t arg1List[9]; + arg1List[0] = 1; + arg1List[1] = 2; + arg1List[2] = 3; + arg1List[3] = 4; + arg1List[4] = 5; + arg1List[5] = 6; + arg1List[6] = 7; + arg1List[7] = 8; + arg1List[8] = 9; + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_160(data.arg1); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_160(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_160(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_160(const chip::app::DataModel::DecodableList & arg1) + { + auto iter = arg1.begin(); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 0)); + VerifyOrReturn(CheckValue("arg1[0]", iter.GetValue(), 9)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 1)); + VerifyOrReturn(CheckValue("arg1[1]", iter.GetValue(), 8)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 2)); + VerifyOrReturn(CheckValue("arg1[2]", iter.GetValue(), 7)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 3)); + VerifyOrReturn(CheckValue("arg1[3]", iter.GetValue(), 6)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 4)); + VerifyOrReturn(CheckValue("arg1[4]", iter.GetValue(), 5)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 5)); + VerifyOrReturn(CheckValue("arg1[5]", iter.GetValue(), 4)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 6)); + VerifyOrReturn(CheckValue("arg1[6]", iter.GetValue(), 3)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 7)); + VerifyOrReturn(CheckValue("arg1[7]", iter.GetValue(), 2)); + VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 8)); + VerifyOrReturn(CheckValue("arg1[8]", iter.GetValue(), 1)); + VerifyOrReturn(CheckNoMoreListItems("arg1", iter, 9)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_161() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type; + + RequestType request; + + request.arg1 = chip::app::DataModel::List(); + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_161(data.arg1); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_161(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_161(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_161(const chip::app::DataModel::DecodableList & arg1) + { + auto iter = arg1.begin(); + VerifyOrReturn(CheckNoMoreListItems("arg1", iter, 0)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_162() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type; + + RequestType request; + + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type arg1List[2]; + + arg1List[0].a = 0; + arg1List[0].b = true; + arg1List[0].c = static_cast(2); + arg1List[0].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); + arg1List[0].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); + arg1List[0].f = static_cast>(1); + arg1List[0].g = 0.0f; + arg1List[0].h = 0; + + arg1List[1].a = 1; + arg1List[1].b = true; + arg1List[1].c = static_cast(3); + arg1List[1].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); + arg1List[1].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); + arg1List[1].f = static_cast>(1); + arg1List[1].g = 0.0f; + arg1List[1].h = 0; + + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_162(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_162(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_162(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_162(bool value) + { + VerifyOrReturn(CheckValue("value", value, true)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_163() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type; + + RequestType request; + + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type arg1List[2]; + + arg1List[0].a = 1; + arg1List[0].b = true; + arg1List[0].c = static_cast(3); + arg1List[0].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); + arg1List[0].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); + arg1List[0].f = static_cast>(1); + arg1List[0].g = 0.0f; + arg1List[0].h = 0; + + arg1List[1].a = 0; + arg1List[1].b = false; + arg1List[1].c = static_cast(2); + arg1List[1].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); + arg1List[1].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); + arg1List[1].f = static_cast>(1); + arg1List[1].g = 0.0f; + arg1List[1].h = 0; + + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_163(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_163(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_163(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_163(bool value) + { + VerifyOrReturn(CheckValue("value", value, false)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_164() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type; + + RequestType request; + + chip::app::Clusters::TestCluster::Structs::NestedStructList::Type arg1List[1]; + + arg1List[0].a = 0; + arg1List[0].b = true; + + arg1List[0].c.a = 0; + arg1List[0].c.b = true; + arg1List[0].c.c = static_cast(2); + arg1List[0].c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + arg1List[0].c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + arg1List[0].c.f = static_cast>(1); + arg1List[0].c.g = 0.0f; + arg1List[0].c.h = 0; + + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; + + dList[0].a = 1; + dList[0].b = true; + dList[0].c = static_cast(3); + dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + dList[0].f = static_cast>(1); + dList[0].g = 0.0f; + dList[0].h = 0; + + dList[1].a = 2; + dList[1].b = true; + dList[1].c = static_cast(3); + dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + dList[1].f = static_cast>(1); + dList[1].g = 0.0f; + dList[1].h = 0; + + arg1List[0].d = dList; + + uint32_t eList[3]; + eList[0] = 1UL; + eList[1] = 2UL; + eList[2] = 3UL; + arg1List[0].e = eList; + + chip::ByteSpan fList[3]; + fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); + fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); + fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); + arg1List[0].f = fList; + + uint8_t gList[2]; + gList[0] = 0; + gList[1] = 255; + arg1List[0].g = gList; + + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_164(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_164(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_164(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_164(bool value) + { + VerifyOrReturn(CheckValue("value", value, true)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_165() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type; + + RequestType request; + + chip::app::Clusters::TestCluster::Structs::NestedStructList::Type arg1List[1]; + + arg1List[0].a = 0; + arg1List[0].b = true; + + arg1List[0].c.a = 0; + arg1List[0].c.b = true; + arg1List[0].c.c = static_cast(2); + arg1List[0].c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); + arg1List[0].c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); + arg1List[0].c.f = static_cast>(1); + arg1List[0].c.g = 0.0f; + arg1List[0].c.h = 0; + + chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; + + dList[0].a = 1; + dList[0].b = true; + dList[0].c = static_cast(3); + dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + dList[0].f = static_cast>(1); + dList[0].g = 0.0f; + dList[0].h = 0; + + dList[1].a = 2; + dList[1].b = false; + dList[1].c = static_cast(3); + dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); + dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); + dList[1].f = static_cast>(1); + dList[1].g = 0.0f; + dList[1].h = 0; + + arg1List[0].d = dList; + + uint32_t eList[3]; + eList[0] = 1UL; + eList[1] = 2UL; + eList[2] = 3UL; + arg1List[0].e = eList; + + chip::ByteSpan fList[3]; + fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); + fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); + fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); + arg1List[0].f = fList; + + uint8_t gList[2]; + gList[0] = 0; + gList[1] = 255; + arg1List[0].g = gList; + + request.arg1 = arg1List; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_165(data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_165(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_165(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_165(bool value) + { + VerifyOrReturn(CheckValue("value", value, false)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_166() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::List listInt8uArgument; + + uint8_t listInt8uList[4]; + listInt8uList[0] = 1; + listInt8uList[1] = 2; + listInt8uList[2] = 3; + listInt8uList[3] = 4; + listInt8uArgument = listInt8uList; + + ReturnErrorOnFailure(cluster.WriteAttribute( + listInt8uArgument, this, OnSuccessCallback_166, OnFailureCallback_166)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_166(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_166() { NextTest(); } + + CHIP_ERROR TestReadAttributeListWithListOfInt8u_167() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_167, OnFailureCallback_167)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_167(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_167(const chip::app::DataModel::DecodableList & listInt8u) + { + auto iter = listInt8u.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 0)); + VerifyOrReturn(CheckValue("listInt8u[0]", iter.GetValue(), 1)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 1)); + VerifyOrReturn(CheckValue("listInt8u[1]", iter.GetValue(), 2)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 2)); + VerifyOrReturn(CheckValue("listInt8u[2]", iter.GetValue(), 3)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 3)); + VerifyOrReturn(CheckValue("listInt8u[3]", iter.GetValue(), 4)); + VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter, 4)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeListWithListOfOctetString_168() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::List listOctetStringArgument; + + chip::ByteSpan listOctetStringList[4]; + listOctetStringList[0] = chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); + listOctetStringList[1] = chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); + listOctetStringList[2] = chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); + listOctetStringList[3] = chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); + listOctetStringArgument = listOctetStringList; + + ReturnErrorOnFailure(cluster.WriteAttribute( + listOctetStringArgument, this, OnSuccessCallback_168, OnFailureCallback_168)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_168(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_168() { NextTest(); } + + CHIP_ERROR TestReadAttributeListWithListOfOctetString_169() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_169, OnFailureCallback_169)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_169(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_169(const chip::app::DataModel::DecodableList & listOctetString) + { + auto iter = listOctetString.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 0)); + VerifyOrReturn( + CheckValueAsString("listOctetString[0]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 1)); + VerifyOrReturn( + CheckValueAsString("listOctetString[1]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 2)); + VerifyOrReturn( + CheckValueAsString("listOctetString[2]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 3)); + VerifyOrReturn( + CheckValueAsString("listOctetString[3]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); + VerifyOrReturn(CheckNoMoreListItems("listOctetString", iter, 4)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeListWithListOfListStructOctetString_170() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::List + listStructOctetStringArgument; + + chip::app::Clusters::TestCluster::Structs::TestListStructOctet::Type listStructOctetStringList[4]; + + listStructOctetStringList[0].fabricIndex = 0ULL; + listStructOctetStringList[0].operationalCert = + chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); + + listStructOctetStringList[1].fabricIndex = 1ULL; + listStructOctetStringList[1].operationalCert = + chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); + + listStructOctetStringList[2].fabricIndex = 2ULL; + listStructOctetStringList[2].operationalCert = + chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); + + listStructOctetStringList[3].fabricIndex = 3ULL; + listStructOctetStringList[3].operationalCert = + chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); + + listStructOctetStringArgument = listStructOctetStringList; + + ReturnErrorOnFailure(cluster.WriteAttribute( + listStructOctetStringArgument, this, OnSuccessCallback_170, OnFailureCallback_170)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_170(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_170() { NextTest(); } + + CHIP_ERROR TestReadAttributeListWithListOfListStructOctetString_171() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_171, OnFailureCallback_171)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_171(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_171( + const chip::app::DataModel::DecodableList & + listStructOctetString) + { + auto iter = listStructOctetString.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 0)); + VerifyOrReturn(CheckValue("listStructOctetString[0].fabricIndex", iter.GetValue().fabricIndex, 0ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[0].operationalCert", iter.GetValue().operationalCert, + chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 1)); + VerifyOrReturn(CheckValue("listStructOctetString[1].fabricIndex", iter.GetValue().fabricIndex, 1ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[1].operationalCert", iter.GetValue().operationalCert, + chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 2)); + VerifyOrReturn(CheckValue("listStructOctetString[2].fabricIndex", iter.GetValue().fabricIndex, 2ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[2].operationalCert", iter.GetValue().operationalCert, + chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); + VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 3)); + VerifyOrReturn(CheckValue("listStructOctetString[3].fabricIndex", iter.GetValue().fabricIndex, 3ULL)); + VerifyOrReturn(CheckValueAsString("listStructOctetString[3].operationalCert", iter.GetValue().operationalCert, + chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); + VerifyOrReturn(CheckNoMoreListItems("listStructOctetString", iter, 4)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithOptionalArgSet_172() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; + + RequestType request; + request.arg1.Emplace().SetNonNull() = 5; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context)) + ->OnSuccessResponse_172(data.wasPresent, data.wasNull, data.value, data.originalValue); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_172(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_172(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_172(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, + const chip::Optional> & originalValue) + { + VerifyOrReturn(CheckValue("wasPresent", wasPresent, true)); + + VerifyOrReturn(CheckValuePresent("wasNull", wasNull)); + VerifyOrReturn(CheckValue("wasNull.Value()", wasNull.Value(), false)); + + VerifyOrReturn(CheckValuePresent("value", value)); + VerifyOrReturn(CheckValue("value.Value()", value.Value(), 5)); + + VerifyOrReturn(CheckValuePresent("originalValue", originalValue)); + VerifyOrReturn(CheckValueNonNull("originalValue.Value()", originalValue.Value())); + VerifyOrReturn(CheckValue("originalValue.Value().Value()", originalValue.Value().Value(), 5)); + + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_173() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; + + RequestType request; + + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context)) + ->OnSuccessResponse_173(data.wasPresent, data.wasNull, data.value, data.originalValue); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_173(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_173(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_173(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, + const chip::Optional> & originalValue) + { + VerifyOrReturn(CheckValue("wasPresent", wasPresent, false)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBooleanNull_174() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBooleanArgument; + nullableBooleanArgument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBooleanArgument, this, OnSuccessCallback_174, OnFailureCallback_174)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_174(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_174() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBooleanNull_175() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_175, OnFailureCallback_175)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_175(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_175(const chip::app::DataModel::Nullable & nullableBoolean) + { + VerifyOrReturn(CheckValueNull("nullableBoolean", nullableBoolean)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBooleanTrue_176() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBooleanArgument; + nullableBooleanArgument.SetNonNull() = true; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBooleanArgument, this, OnSuccessCallback_176, OnFailureCallback_176)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_176(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_176() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBooleanTrue_177() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_177, OnFailureCallback_177)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_177(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_177(const chip::app::DataModel::Nullable & nullableBoolean) + { + VerifyOrReturn(CheckValueNonNull("nullableBoolean", nullableBoolean)); + VerifyOrReturn(CheckValue("nullableBoolean.Value()", nullableBoolean.Value(), true)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap8MaxValue_178() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap8Argument; + nullableBitmap8Argument.SetNonNull() = 254; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap8Argument, this, OnSuccessCallback_178, OnFailureCallback_178)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_178(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_178() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap8MaxValue_179() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_179, OnFailureCallback_179)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_179(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_179(const chip::app::DataModel::Nullable & nullableBitmap8) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap8", nullableBitmap8)); + VerifyOrReturn(CheckValue("nullableBitmap8.Value()", nullableBitmap8.Value(), 254)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap8InvalidValue_180() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap8Argument; + nullableBitmap8Argument.SetNonNull() = 255; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap8Argument, this, OnSuccessCallback_180, OnFailureCallback_180)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_180(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_180() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableBitmap8UnchangedValue_181() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_181, OnFailureCallback_181)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_181(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_181(const chip::app::DataModel::Nullable & nullableBitmap8) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap8", nullableBitmap8)); + VerifyOrReturn(CheckValue("nullableBitmap8.Value()", nullableBitmap8.Value(), 254)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap8NullValue_182() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap8Argument; + nullableBitmap8Argument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap8Argument, this, OnSuccessCallback_182, OnFailureCallback_182)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_182(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_182() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap8NullValue_183() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_183, OnFailureCallback_183)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_183(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_183(const chip::app::DataModel::Nullable & nullableBitmap8) + { + VerifyOrReturn(CheckValueNull("nullableBitmap8", nullableBitmap8)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap16MaxValue_184() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap16Argument; + nullableBitmap16Argument.SetNonNull() = 65534U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap16Argument, this, OnSuccessCallback_184, OnFailureCallback_184)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_184(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_184() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap16MaxValue_185() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_185, OnFailureCallback_185)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_185(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_185(const chip::app::DataModel::Nullable & nullableBitmap16) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap16", nullableBitmap16)); + VerifyOrReturn(CheckValue("nullableBitmap16.Value()", nullableBitmap16.Value(), 65534U)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap16InvalidValue_186() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap16Argument; + nullableBitmap16Argument.SetNonNull() = 65535U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap16Argument, this, OnSuccessCallback_186, OnFailureCallback_186)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_186(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_186() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableBitmap16UnchangedValue_187() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_187, OnFailureCallback_187)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_187(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_187(const chip::app::DataModel::Nullable & nullableBitmap16) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap16", nullableBitmap16)); + VerifyOrReturn(CheckValue("nullableBitmap16.Value()", nullableBitmap16.Value(), 65534U)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap16NullValue_188() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap16Argument; + nullableBitmap16Argument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap16Argument, this, OnSuccessCallback_188, OnFailureCallback_188)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_188(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_188() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap16NullValue_189() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_189, OnFailureCallback_189)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_189(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_189(const chip::app::DataModel::Nullable & nullableBitmap16) + { + VerifyOrReturn(CheckValueNull("nullableBitmap16", nullableBitmap16)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap32MaxValue_190() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap32Argument; + nullableBitmap32Argument.SetNonNull() = 4294967294UL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap32Argument, this, OnSuccessCallback_190, OnFailureCallback_190)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_190(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_190() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap32MaxValue_191() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_191, OnFailureCallback_191)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_191(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_191(const chip::app::DataModel::Nullable & nullableBitmap32) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap32", nullableBitmap32)); + VerifyOrReturn(CheckValue("nullableBitmap32.Value()", nullableBitmap32.Value(), 4294967294UL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap32InvalidValue_192() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap32Argument; + nullableBitmap32Argument.SetNonNull() = 4294967295UL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap32Argument, this, OnSuccessCallback_192, OnFailureCallback_192)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_192(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_192() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableBitmap32UnchangedValue_193() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_193, OnFailureCallback_193)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_193(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_193(const chip::app::DataModel::Nullable & nullableBitmap32) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap32", nullableBitmap32)); + VerifyOrReturn(CheckValue("nullableBitmap32.Value()", nullableBitmap32.Value(), 4294967294UL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap32NullValue_194() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap32Argument; + nullableBitmap32Argument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap32Argument, this, OnSuccessCallback_194, OnFailureCallback_194)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_194(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_194() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap32NullValue_195() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_195, OnFailureCallback_195)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_195(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_195(const chip::app::DataModel::Nullable & nullableBitmap32) + { + VerifyOrReturn(CheckValueNull("nullableBitmap32", nullableBitmap32)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap64MaxValue_196() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap64Argument; + nullableBitmap64Argument.SetNonNull() = 18446744073709551614ULL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap64Argument, this, OnSuccessCallback_196, OnFailureCallback_196)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_196(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_196() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap64MaxValue_197() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_197, OnFailureCallback_197)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_197(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_197(const chip::app::DataModel::Nullable & nullableBitmap64) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap64", nullableBitmap64)); + VerifyOrReturn(CheckValue("nullableBitmap64.Value()", nullableBitmap64.Value(), 18446744073709551614ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap64InvalidValue_198() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap64Argument; + nullableBitmap64Argument.SetNonNull() = 18446744073709551615ULL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap64Argument, this, OnSuccessCallback_198, OnFailureCallback_198)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_198(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_198() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableBitmap64UnchangedValue_199() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_199, OnFailureCallback_199)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_199(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_199(const chip::app::DataModel::Nullable & nullableBitmap64) + { + VerifyOrReturn(CheckValueNonNull("nullableBitmap64", nullableBitmap64)); + VerifyOrReturn(CheckValue("nullableBitmap64.Value()", nullableBitmap64.Value(), 18446744073709551614ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableBitmap64NullValue_200() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableBitmap64Argument; + nullableBitmap64Argument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableBitmap64Argument, this, OnSuccessCallback_200, OnFailureCallback_200)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_200(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_200() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableBitmap64NullValue_201() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_201, OnFailureCallback_201)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_201(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_201(const chip::app::DataModel::Nullable & nullableBitmap64) + { + VerifyOrReturn(CheckValueNull("nullableBitmap64", nullableBitmap64)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8uMinValue_202() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt8uArgument; + nullableInt8uArgument.SetNonNull() = 0; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt8uArgument, this, OnSuccessCallback_202, OnFailureCallback_202)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_202(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_202() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8uMinValue_203() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_203, OnFailureCallback_203)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_203(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_203(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", nullableInt8u.Value(), 0)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8uMaxValue_204() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt8uArgument; + nullableInt8uArgument.SetNonNull() = 254; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt8uArgument, this, OnSuccessCallback_204, OnFailureCallback_204)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_204(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_204() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8uMaxValue_205() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_205, OnFailureCallback_205)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_205(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_205(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", nullableInt8u.Value(), 254)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8uInvalidValue_206() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt8uArgument; + nullableInt8uArgument.SetNonNull() = 255; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt8uArgument, this, OnSuccessCallback_206, OnFailureCallback_206)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_206(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_206() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValue_207() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_207, OnFailureCallback_207)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_207(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_207(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); + VerifyOrReturn(CheckValue("nullableInt8u.Value()", nullableInt8u.Value(), 254)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValueWithConstraint_208() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_208, OnFailureCallback_208)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_208(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_208(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8uNullValue_209() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt8uArgument; + nullableInt8uArgument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt8uArgument, this, OnSuccessCallback_209, OnFailureCallback_209)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_209(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_209() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8uNullValue_210() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_210, OnFailureCallback_210)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_210(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_210(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckValueNull("nullableInt8u", nullableInt8u)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt8uNullValueRange_211() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_211, OnFailureCallback_211)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_211(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_211(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", nullableInt8u, 254)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt8uNullValueNot_212() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_212, OnFailureCallback_212)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_212(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_212(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", nullableInt8u, 254)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8uValue_213() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt8uArgument; + nullableInt8uArgument.SetNonNull() = 128; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt8uArgument, this, OnSuccessCallback_213, OnFailureCallback_213)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_213(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_213() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8uValueInRange_214() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_214, OnFailureCallback_214)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_214(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_214(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8u", nullableInt8u, 254)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt8uNotValueOk_215() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_215, OnFailureCallback_215)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_215(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_215(const chip::app::DataModel::Nullable & nullableInt8u) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8u", nullableInt8u, 129)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16uMinValue_216() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt16uArgument; + nullableInt16uArgument.SetNonNull() = 0U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt16uArgument, this, OnSuccessCallback_216, OnFailureCallback_216)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_216(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_216() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16uMinValue_217() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_217, OnFailureCallback_217)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_217(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_217(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt16u", nullableInt16u)); + VerifyOrReturn(CheckValue("nullableInt16u.Value()", nullableInt16u.Value(), 0U)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16uMaxValue_218() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt16uArgument; + nullableInt16uArgument.SetNonNull() = 65534U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt16uArgument, this, OnSuccessCallback_218, OnFailureCallback_218)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_218(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_218() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16uMaxValue_219() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_219, OnFailureCallback_219)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_219(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_219(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt16u", nullableInt16u)); + VerifyOrReturn(CheckValue("nullableInt16u.Value()", nullableInt16u.Value(), 65534U)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16uInvalidValue_220() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt16uArgument; + nullableInt16uArgument.SetNonNull() = 65535U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt16uArgument, this, OnSuccessCallback_220, OnFailureCallback_220)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_220(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_220() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt16uUnchangedValue_221() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_221, OnFailureCallback_221)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_221(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_221(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt16u", nullableInt16u)); + VerifyOrReturn(CheckValue("nullableInt16u.Value()", nullableInt16u.Value(), 65534U)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16uNullValue_222() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt16uArgument; + nullableInt16uArgument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt16uArgument, this, OnSuccessCallback_222, OnFailureCallback_222)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_222(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_222() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16uNullValue_223() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_223, OnFailureCallback_223)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_223(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_223(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckValueNull("nullableInt16u", nullableInt16u)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt16uNullValueRange_224() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_224, OnFailureCallback_224)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_224(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_224(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", nullableInt16u, 65534U)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt16uNullValueNot_225() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_225, OnFailureCallback_225)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_225(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_225(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", nullableInt16u, 65534U)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16uValue_226() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt16uArgument; + nullableInt16uArgument.SetNonNull() = 32000U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt16uArgument, this, OnSuccessCallback_226, OnFailureCallback_226)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_226(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_226() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16uValueInRange_227() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_227, OnFailureCallback_227)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_227(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_227(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16u", nullableInt16u, 65534U)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt16uNotValueOk_228() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_228, OnFailureCallback_228)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_228(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_228(const chip::app::DataModel::Nullable & nullableInt16u) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt16u", nullableInt16u, 32001U)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32uMinValue_229() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt32uArgument; + nullableInt32uArgument.SetNonNull() = 0UL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt32uArgument, this, OnSuccessCallback_229, OnFailureCallback_229)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_229(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_229() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32uMinValue_230() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_230, OnFailureCallback_230)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_230(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_230(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt32u", nullableInt32u)); + VerifyOrReturn(CheckValue("nullableInt32u.Value()", nullableInt32u.Value(), 0UL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32uMaxValue_231() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt32uArgument; + nullableInt32uArgument.SetNonNull() = 4294967294UL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt32uArgument, this, OnSuccessCallback_231, OnFailureCallback_231)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_231(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_231() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32uMaxValue_232() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_232, OnFailureCallback_232)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_232(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_232(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt32u", nullableInt32u)); + VerifyOrReturn(CheckValue("nullableInt32u.Value()", nullableInt32u.Value(), 4294967294UL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32uInvalidValue_233() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt32uArgument; + nullableInt32uArgument.SetNonNull() = 4294967295UL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt32uArgument, this, OnSuccessCallback_233, OnFailureCallback_233)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_233(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_233() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt32uUnchangedValue_234() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_234, OnFailureCallback_234)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_234(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_234(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt32u", nullableInt32u)); + VerifyOrReturn(CheckValue("nullableInt32u.Value()", nullableInt32u.Value(), 4294967294UL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32uNullValue_235() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt32uArgument; + nullableInt32uArgument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt32uArgument, this, OnSuccessCallback_235, OnFailureCallback_235)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_235(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_235() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32uNullValue_236() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_236, OnFailureCallback_236)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_236(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_236(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckValueNull("nullableInt32u", nullableInt32u)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt32uNullValueRange_237() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_237, OnFailureCallback_237)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_237(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_237(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", nullableInt32u, 4294967294UL)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt32uNullValueNot_238() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_238, OnFailureCallback_238)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_238(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_238(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", nullableInt32u, 4294967294UL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32uValue_239() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt32uArgument; + nullableInt32uArgument.SetNonNull() = 2147483647UL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt32uArgument, this, OnSuccessCallback_239, OnFailureCallback_239)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_239(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_239() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32uValueInRange_240() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_240, OnFailureCallback_240)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_240(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_240(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32u", nullableInt32u, 4294967294UL)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt32uNotValueOk_241() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_241, OnFailureCallback_241)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_241(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_241(const chip::app::DataModel::Nullable & nullableInt32u) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt32u", nullableInt32u, 2147483648UL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64uMinValue_242() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt64uArgument; + nullableInt64uArgument.SetNonNull() = 0ULL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt64uArgument, this, OnSuccessCallback_242, OnFailureCallback_242)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_242(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_242() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt64uMinValue_243() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_243, OnFailureCallback_243)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_243(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_243(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt64u", nullableInt64u)); + VerifyOrReturn(CheckValue("nullableInt64u.Value()", nullableInt64u.Value(), 0ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64uMaxValue_244() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt64uArgument; + nullableInt64uArgument.SetNonNull() = 18446744073709551614ULL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt64uArgument, this, OnSuccessCallback_244, OnFailureCallback_244)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_244(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_244() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt64uMaxValue_245() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_245, OnFailureCallback_245)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_245(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_245(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt64u", nullableInt64u)); + VerifyOrReturn(CheckValue("nullableInt64u.Value()", nullableInt64u.Value(), 18446744073709551614ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64uInvalidValue_246() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt64uArgument; + nullableInt64uArgument.SetNonNull() = 18446744073709551615ULL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt64uArgument, this, OnSuccessCallback_246, OnFailureCallback_246)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_246(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_246() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt64uUnchangedValue_247() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_247, OnFailureCallback_247)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_247(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_247(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckValueNonNull("nullableInt64u", nullableInt64u)); + VerifyOrReturn(CheckValue("nullableInt64u.Value()", nullableInt64u.Value(), 18446744073709551614ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64uNullValue_248() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt64uArgument; + nullableInt64uArgument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt64uArgument, this, OnSuccessCallback_248, OnFailureCallback_248)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_248(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_248() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt64uNullValue_249() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_249, OnFailureCallback_249)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_249(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_249(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckValueNull("nullableInt64u", nullableInt64u)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt64uNullValueRange_250() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_250, OnFailureCallback_250)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_250(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_250(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt64u", nullableInt64u, 18446744073709551614ULL)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt64uNullValueNot_251() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_251, OnFailureCallback_251)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_251(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_251(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", nullableInt64u, 18446744073709551614ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64uValue_252() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt64uArgument; + nullableInt64uArgument.SetNonNull() = 18000000000000000000ULL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt64uArgument, this, OnSuccessCallback_252, OnFailureCallback_252)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_252(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_252() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt64uValueInRange_253() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_253, OnFailureCallback_253)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_253(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_253(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckConstraintMaxValue("nullableInt64u", nullableInt64u, 18446744073709551614ULL)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt64uNotValueOk_254() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_254, OnFailureCallback_254)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_254(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_254(const chip::app::DataModel::Nullable & nullableInt64u) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt64u", nullableInt64u, 18000000000000000001ULL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8sMinValue_255() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt8sArgument; + nullableInt8sArgument.SetNonNull() = -127; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt8sArgument, this, OnSuccessCallback_255, OnFailureCallback_255)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_255(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_255() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8sMinValue_256() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_256, OnFailureCallback_256)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_256(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_256(const chip::app::DataModel::Nullable & nullableInt8s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt8s", nullableInt8s)); + VerifyOrReturn(CheckValue("nullableInt8s.Value()", nullableInt8s.Value(), -127)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8sInvalidValue_257() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt8sArgument; + nullableInt8sArgument.SetNonNull() = -128; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt8sArgument, this, OnSuccessCallback_257, OnFailureCallback_257)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_257(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_257() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt8sUnchangedValue_258() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_258, OnFailureCallback_258)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_258(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_258(const chip::app::DataModel::Nullable & nullableInt8s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt8s", nullableInt8s)); + VerifyOrReturn(CheckValue("nullableInt8s.Value()", nullableInt8s.Value(), -127)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8sNullValue_259() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt8sArgument; + nullableInt8sArgument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt8sArgument, this, OnSuccessCallback_259, OnFailureCallback_259)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_259(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_259() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8sNullValue_260() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_260, OnFailureCallback_260)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_260(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_260(const chip::app::DataModel::Nullable & nullableInt8s) + { + VerifyOrReturn(CheckValueNull("nullableInt8s", nullableInt8s)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt8sNullValueRange_261() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_261, OnFailureCallback_261)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_261(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_261(const chip::app::DataModel::Nullable & nullableInt8s) + { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", nullableInt8s, -127)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", nullableInt8s, 127)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt8sNullValueNot_262() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_262, OnFailureCallback_262)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_262(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_262(const chip::app::DataModel::Nullable & nullableInt8s) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", nullableInt8s, -127)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt8sValue_263() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt8sArgument; + nullableInt8sArgument.SetNonNull() = -127; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt8sArgument, this, OnSuccessCallback_263, OnFailureCallback_263)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_263(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_263() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt8sValueInRange_264() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_264, OnFailureCallback_264)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_264(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_264(const chip::app::DataModel::Nullable & nullableInt8s) + { + VerifyOrReturn(CheckConstraintMinValue("nullableInt8s", nullableInt8s, -127)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt8s", nullableInt8s, 127)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt8sNotValueOk_265() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_265, OnFailureCallback_265)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_265(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_265(const chip::app::DataModel::Nullable & nullableInt8s) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt8s", nullableInt8s, -126)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16sMinValue_266() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt16sArgument; + nullableInt16sArgument.SetNonNull() = -32767; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt16sArgument, this, OnSuccessCallback_266, OnFailureCallback_266)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_266(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_266() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16sMinValue_267() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_267, OnFailureCallback_267)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_267(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_267(const chip::app::DataModel::Nullable & nullableInt16s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt16s", nullableInt16s)); + VerifyOrReturn(CheckValue("nullableInt16s.Value()", nullableInt16s.Value(), -32767)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16sInvalidValue_268() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt16sArgument; + nullableInt16sArgument.SetNonNull() = -32768; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt16sArgument, this, OnSuccessCallback_268, OnFailureCallback_268)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_268(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_268() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt16sUnchangedValue_269() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_269, OnFailureCallback_269)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_269(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_269(const chip::app::DataModel::Nullable & nullableInt16s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt16s", nullableInt16s)); + VerifyOrReturn(CheckValue("nullableInt16s.Value()", nullableInt16s.Value(), -32767)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16sNullValue_270() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt16sArgument; + nullableInt16sArgument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt16sArgument, this, OnSuccessCallback_270, OnFailureCallback_270)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_270(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_270() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16sNullValue_271() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_271, OnFailureCallback_271)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_271(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_271(const chip::app::DataModel::Nullable & nullableInt16s) + { + VerifyOrReturn(CheckValueNull("nullableInt16s", nullableInt16s)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt16sNullValueRange_272() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_272, OnFailureCallback_272)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_272(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_272(const chip::app::DataModel::Nullable & nullableInt16s) + { + VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", nullableInt16s, -32767)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", nullableInt16s, 32767)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt16sNullValueNot_273() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_273, OnFailureCallback_273)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_273(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_273(const chip::app::DataModel::Nullable & nullableInt16s) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", nullableInt16s, -32767)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt16sValue_274() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt16sArgument; + nullableInt16sArgument.SetNonNull() = -32767; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt16sArgument, this, OnSuccessCallback_274, OnFailureCallback_274)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_274(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_274() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt16sValueInRange_275() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_275, OnFailureCallback_275)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_275(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_275(const chip::app::DataModel::Nullable & nullableInt16s) + { + VerifyOrReturn(CheckConstraintMinValue("nullableInt16s", nullableInt16s, -32767)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt16s", nullableInt16s, 32767)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt16sNotValueOk_276() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_276, OnFailureCallback_276)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_276(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_276(const chip::app::DataModel::Nullable & nullableInt16s) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt16s", nullableInt16s, -32766)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32sMinValue_277() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt32sArgument; + nullableInt32sArgument.SetNonNull() = -2147483647L; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt32sArgument, this, OnSuccessCallback_277, OnFailureCallback_277)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_277(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_277() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32sMinValue_278() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_278, OnFailureCallback_278)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_278(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_278(const chip::app::DataModel::Nullable & nullableInt32s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt32s", nullableInt32s)); + VerifyOrReturn(CheckValue("nullableInt32s.Value()", nullableInt32s.Value(), -2147483647L)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32sInvalidValue_279() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt32sArgument; + nullableInt32sArgument.SetNonNull() = -2147483648L; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt32sArgument, this, OnSuccessCallback_279, OnFailureCallback_279)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_279(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_279() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt32sUnchangedValue_280() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_280, OnFailureCallback_280)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_280(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_280(const chip::app::DataModel::Nullable & nullableInt32s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt32s", nullableInt32s)); + VerifyOrReturn(CheckValue("nullableInt32s.Value()", nullableInt32s.Value(), -2147483647L)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32sNullValue_281() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt32sArgument; + nullableInt32sArgument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt32sArgument, this, OnSuccessCallback_281, OnFailureCallback_281)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_281(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_281() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32sNullValue_282() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_282, OnFailureCallback_282)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_282(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_282(const chip::app::DataModel::Nullable & nullableInt32s) + { + VerifyOrReturn(CheckValueNull("nullableInt32s", nullableInt32s)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt32sNullValueRange_283() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_283, OnFailureCallback_283)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_283(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_283(const chip::app::DataModel::Nullable & nullableInt32s) + { + VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", nullableInt32s, -2147483647L)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", nullableInt32s, 2147483647L)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt32sNullValueNot_284() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_284, OnFailureCallback_284)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_284(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_284(const chip::app::DataModel::Nullable & nullableInt32s) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", nullableInt32s, -2147483647L)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt32sValue_285() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt32sArgument; + nullableInt32sArgument.SetNonNull() = -2147483647L; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt32sArgument, this, OnSuccessCallback_285, OnFailureCallback_285)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_285(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_285() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt32sValueInRange_286() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_286, OnFailureCallback_286)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_286(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_286(const chip::app::DataModel::Nullable & nullableInt32s) + { + VerifyOrReturn(CheckConstraintMinValue("nullableInt32s", nullableInt32s, -2147483647L)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt32s", nullableInt32s, 2147483647L)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt32sNotValueOk_287() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_287, OnFailureCallback_287)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_287(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_287(const chip::app::DataModel::Nullable & nullableInt32s) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt32s", nullableInt32s, -2147483646L)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64sMinValue_288() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt64sArgument; + nullableInt64sArgument.SetNonNull() = -9223372036854775807LL; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt64sArgument, this, OnSuccessCallback_288, OnFailureCallback_288)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_288(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_288() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt64sMinValue_289() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_289, OnFailureCallback_289)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_289(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_289(const chip::app::DataModel::Nullable & nullableInt64s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt64s", nullableInt64s)); + VerifyOrReturn(CheckValue("nullableInt64s.Value()", nullableInt64s.Value(), -9223372036854775807LL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64sInvalidValue_290() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt64sArgument; + nullableInt64sArgument.SetNonNull() = -9223372036854775807LL - 1; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt64sArgument, this, OnSuccessCallback_290, OnFailureCallback_290)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_290(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } + + void OnSuccessResponse_290() { ThrowSuccessResponse(); } + + CHIP_ERROR TestReadAttributeNullableInt64sUnchangedValue_291() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_291, OnFailureCallback_291)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_291(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_291(const chip::app::DataModel::Nullable & nullableInt64s) + { + VerifyOrReturn(CheckValueNonNull("nullableInt64s", nullableInt64s)); + VerifyOrReturn(CheckValue("nullableInt64s.Value()", nullableInt64s.Value(), -9223372036854775807LL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64sNullValue_292() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableInt64sArgument; + nullableInt64sArgument.SetNull(); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt64sArgument, this, OnSuccessCallback_292, OnFailureCallback_292)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_292(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_292() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt64sNullValue_293() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_293, OnFailureCallback_293)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_293(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_293(const chip::app::DataModel::Nullable & nullableInt64s) + { + VerifyOrReturn(CheckValueNull("nullableInt64s", nullableInt64s)); + + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt64sNullValueRange_294() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_294, OnFailureCallback_294)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_294(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_294(const chip::app::DataModel::Nullable & nullableInt64s) + { + VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", nullableInt64s, -9223372036854775807LL)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", nullableInt64s, 9223372036854775807LL)); + NextTest(); + } + + CHIP_ERROR TestReadAttributeNullableInt64sNullValueNot_295() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_295, OnFailureCallback_295)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_295(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_295(const chip::app::DataModel::Nullable & nullableInt64s) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", nullableInt64s, -9223372036854775807LL)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableInt64sValue_296() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_150(status); - }; + chip::app::DataModel::Nullable nullableInt64sArgument; + nullableInt64sArgument.SetNonNull() = -9223372036854775807LL; - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableInt64sArgument, this, OnSuccessCallback_296, OnFailureCallback_296)); return CHIP_NO_ERROR; } - void OnFailureResponse_150(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_296(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_150(bool value) + void OnSuccessResponse_296() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableInt64sValueInRange_297() { - VerifyOrReturn(CheckValue("value", value, false)); + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_297, OnFailureCallback_297)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_297(EmberAfStatus status) { ThrowFailureResponse(); } + void OnSuccessResponse_297(const chip::app::DataModel::Nullable & nullableInt64s) + { + VerifyOrReturn(CheckConstraintMinValue("nullableInt64s", nullableInt64s, -9223372036854775807LL)); + VerifyOrReturn(CheckConstraintMaxValue("nullableInt64s", nullableInt64s, 9223372036854775807LL)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithNestedStructArgumentAndArg1cbIsTrue_151() + CHIP_ERROR TestReadAttributeNullableInt64sNotValueOk_298() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_298, OnFailureCallback_298)); + return CHIP_NO_ERROR; + } - request.arg1.a = 0; - request.arg1.b = true; + void OnFailureResponse_298(EmberAfStatus status) { ThrowFailureResponse(); } - request.arg1.c.a = 0; - request.arg1.c.b = true; - request.arg1.c.c = static_cast(2); - request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.c.f = static_cast>(1); - request.arg1.c.g = 0.0f; - request.arg1.c.h = 0; + void OnSuccessResponse_298(const chip::app::DataModel::Nullable & nullableInt64s) + { + VerifyOrReturn(CheckConstraintNotValue("nullableInt64s", nullableInt64s, -9223372036854775806LL)); - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_151(data.value); - }; + NextTest(); + } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_151(status); - }; + CHIP_ERROR TestWriteAttributeNullableSingleMediumValue_299() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + chip::app::DataModel::Nullable nullableFloatSingleArgument; + nullableFloatSingleArgument.SetNonNull() = 0.1f; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableFloatSingleArgument, this, OnSuccessCallback_299, OnFailureCallback_299)); return CHIP_NO_ERROR; } - void OnFailureResponse_151(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_299(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_151(bool value) + void OnSuccessResponse_299() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableSingleMediumValue_300() { - VerifyOrReturn(CheckValue("value", value, true)); + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_300, OnFailureCallback_300)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_300(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_300(const chip::app::DataModel::Nullable & nullableFloatSingle) + { + VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); + VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), 0.1f)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithNestedStructArgumentArg1cbIsFalse_152() + CHIP_ERROR TestWriteAttributeNullableSingleLargestValue_301() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructArgumentRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableFloatSingleArgument; + nullableFloatSingleArgument.SetNonNull() = INFINITY; - request.arg1.a = 0; - request.arg1.b = true; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableFloatSingleArgument, this, OnSuccessCallback_301, OnFailureCallback_301)); + return CHIP_NO_ERROR; + } - request.arg1.c.a = 0; - request.arg1.c.b = false; - request.arg1.c.c = static_cast(2); - request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.c.f = static_cast>(1); - request.arg1.c.g = 0.0f; - request.arg1.c.h = 0; + void OnFailureResponse_301(EmberAfStatus status) { ThrowFailureResponse(); } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_152(data.value); - }; + void OnSuccessResponse_301() { NextTest(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_152(status); - }; + CHIP_ERROR TestReadAttributeNullableSingleLargestValue_302() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_302, OnFailureCallback_302)); return CHIP_NO_ERROR; } - void OnFailureResponse_152(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_302(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_152(bool value) + void OnSuccessResponse_302(const chip::app::DataModel::Nullable & nullableFloatSingle) { - VerifyOrReturn(CheckValue("value", value, false)); + VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); + VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), INFINITY)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndAllFieldsBOfArg1dAreTrue_153() + CHIP_ERROR TestWriteAttributeNullableSingleSmallestValue_303() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableFloatSingleArgument; + nullableFloatSingleArgument.SetNonNull() = -INFINITY; - request.arg1.a = 0; - request.arg1.b = true; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableFloatSingleArgument, this, OnSuccessCallback_303, OnFailureCallback_303)); + return CHIP_NO_ERROR; + } - request.arg1.c.a = 0; - request.arg1.c.b = true; - request.arg1.c.c = static_cast(2); - request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.c.f = static_cast>(1); - request.arg1.c.g = 0.0f; - request.arg1.c.h = 0; + void OnFailureResponse_303(EmberAfStatus status) { ThrowFailureResponse(); } - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; + void OnSuccessResponse_303() { NextTest(); } - dList[0].a = 1; - dList[0].b = true; - dList[0].c = static_cast(3); - dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[0].f = static_cast>(1); - dList[0].g = 0.0f; - dList[0].h = 0; + CHIP_ERROR TestReadAttributeNullableSingleSmallestValue_304() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - dList[1].a = 2; - dList[1].b = true; - dList[1].c = static_cast(3); - dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[1].f = static_cast>(1); - dList[1].g = 0.0f; - dList[1].h = 0; + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_304, OnFailureCallback_304)); + return CHIP_NO_ERROR; + } - request.arg1.d = dList; + void OnFailureResponse_304(EmberAfStatus status) { ThrowFailureResponse(); } - uint32_t eList[3]; - eList[0] = 1UL; - eList[1] = 2UL; - eList[2] = 3UL; - request.arg1.e = eList; + void OnSuccessResponse_304(const chip::app::DataModel::Nullable & nullableFloatSingle) + { + VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); + VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), -INFINITY)); - chip::ByteSpan fList[3]; - fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); - fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); - fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); - request.arg1.f = fList; + NextTest(); + } - uint8_t gList[2]; - gList[0] = 0; - gList[1] = 255; - request.arg1.g = gList; + CHIP_ERROR TestWriteAttributeNullableSingleNullValue_305() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_153(data.value); - }; + chip::app::DataModel::Nullable nullableFloatSingleArgument; + nullableFloatSingleArgument.SetNull(); - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_153(status); - }; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableFloatSingleArgument, this, OnSuccessCallback_305, OnFailureCallback_305)); + return CHIP_NO_ERROR; + } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + void OnFailureResponse_305(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_305() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableSingleNullValue_306() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_306, OnFailureCallback_306)); return CHIP_NO_ERROR; } - void OnFailureResponse_153(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_306(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_153(bool value) + void OnSuccessResponse_306(const chip::app::DataModel::Nullable & nullableFloatSingle) { - VerifyOrReturn(CheckValue("value", value, true)); + VerifyOrReturn(CheckValueNull("nullableFloatSingle", nullableFloatSingle)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfArg1dAreFalse_154() + CHIP_ERROR TestWriteAttributeNullableSingle0Value_307() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNestedStructListArgumentRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableFloatSingleArgument; + nullableFloatSingleArgument.SetNonNull() = 0.0f; - request.arg1.a = 0; - request.arg1.b = true; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableFloatSingleArgument, this, OnSuccessCallback_307, OnFailureCallback_307)); + return CHIP_NO_ERROR; + } - request.arg1.c.a = 0; - request.arg1.c.b = true; - request.arg1.c.c = static_cast(2); - request.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.c.f = static_cast>(1); - request.arg1.c.g = 0.0f; - request.arg1.c.h = 0; + void OnFailureResponse_307(EmberAfStatus status) { ThrowFailureResponse(); } - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; + void OnSuccessResponse_307() { NextTest(); } - dList[0].a = 1; - dList[0].b = true; - dList[0].c = static_cast(3); - dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[0].f = static_cast>(1); - dList[0].g = 0.0f; - dList[0].h = 0; + CHIP_ERROR TestReadAttributeNullableSingle0Value_308() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - dList[1].a = 2; - dList[1].b = false; - dList[1].c = static_cast(3); - dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[1].f = static_cast>(1); - dList[1].g = 0.0f; - dList[1].h = 0; + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_308, OnFailureCallback_308)); + return CHIP_NO_ERROR; + } - request.arg1.d = dList; + void OnFailureResponse_308(EmberAfStatus status) { ThrowFailureResponse(); } - uint32_t eList[3]; - eList[0] = 1UL; - eList[1] = 2UL; - eList[2] = 3UL; - request.arg1.e = eList; + void OnSuccessResponse_308(const chip::app::DataModel::Nullable & nullableFloatSingle) + { + VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); + VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), 0.0f)); - chip::ByteSpan fList[3]; - fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); - fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); - fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); - request.arg1.f = fList; + NextTest(); + } - uint8_t gList[2]; - gList[0] = 0; - gList[1] = 255; - request.arg1.g = gList; + CHIP_ERROR TestWriteAttributeNullableDoubleMediumValue_309() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_154(data.value); - }; + chip::app::DataModel::Nullable nullableFloatDoubleArgument; + nullableFloatDoubleArgument.SetNonNull() = 0.1234567890123; - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_154(status); - }; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableFloatDoubleArgument, this, OnSuccessCallback_309, OnFailureCallback_309)); + return CHIP_NO_ERROR; + } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + void OnFailureResponse_309(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_309() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableDoubleMediumValue_310() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_310, OnFailureCallback_310)); return CHIP_NO_ERROR; } - void OnFailureResponse_154(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_310(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_154(bool value) + void OnSuccessResponse_310(const chip::app::DataModel::Nullable & nullableFloatDouble) { - VerifyOrReturn(CheckValue("value", value, false)); + VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); + VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), 0.1234567890123)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithStructArgumentAndSeeWhatWeGetBack_155() + CHIP_ERROR TestWriteAttributeNullableDoubleLargestValue_311() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::SimpleStructEchoRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableFloatDoubleArgument; + nullableFloatDoubleArgument.SetNonNull() = INFINITY; - request.arg1.a = 17; - request.arg1.b = false; - request.arg1.c = static_cast(2); - request.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - request.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - request.arg1.f = static_cast>(1); - request.arg1.g = 0.1f; - request.arg1.h = 0.1; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableFloatDoubleArgument, this, OnSuccessCallback_311, OnFailureCallback_311)); + return CHIP_NO_ERROR; + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_155(data.arg1); - }; + void OnFailureResponse_311(EmberAfStatus status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_155(status); - }; + void OnSuccessResponse_311() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + CHIP_ERROR TestReadAttributeNullableDoubleLargestValue_312() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_312, OnFailureCallback_312)); return CHIP_NO_ERROR; } - void OnFailureResponse_155(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_312(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_155(const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType & arg1) + void OnSuccessResponse_312(const chip::app::DataModel::Nullable & nullableFloatDouble) { - VerifyOrReturn(CheckValue("arg1.a", arg1.a, 17)); - VerifyOrReturn(CheckValue("arg1.b", arg1.b, false)); - VerifyOrReturn(CheckValue("arg1.c", arg1.c, 2)); - VerifyOrReturn(CheckValueAsString("arg1.d", arg1.d, chip::ByteSpan(chip::Uint8::from_const_char("octet_string"), 12))); - VerifyOrReturn(CheckValueAsString("arg1.e", arg1.e, chip::CharSpan("char_string", 11))); - VerifyOrReturn(CheckValue("arg1.f", arg1.f, 1)); - VerifyOrReturn(CheckValue("arg1.g", arg1.g, 0.1f)); - VerifyOrReturn(CheckValue("arg1.h", arg1.h, 0.1)); + VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); + VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), INFINITY)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndNoneOfThemIsSetTo0_156() + CHIP_ERROR TestWriteAttributeNullableDoubleSmallestValue_313() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableFloatDoubleArgument; + nullableFloatDoubleArgument.SetNonNull() = -INFINITY; - uint8_t arg1List[9]; - arg1List[0] = 1; - arg1List[1] = 2; - arg1List[2] = 3; - arg1List[3] = 4; - arg1List[4] = 5; - arg1List[5] = 6; - arg1List[6] = 7; - arg1List[7] = 8; - arg1List[8] = 9; - request.arg1 = arg1List; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableFloatDoubleArgument, this, OnSuccessCallback_313, OnFailureCallback_313)); + return CHIP_NO_ERROR; + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_156(data.value); - }; + void OnFailureResponse_313(EmberAfStatus status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_156(status); - }; + void OnSuccessResponse_313() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + CHIP_ERROR TestReadAttributeNullableDoubleSmallestValue_314() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_314, OnFailureCallback_314)); return CHIP_NO_ERROR; } - void OnFailureResponse_156(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_314(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_156(bool value) + void OnSuccessResponse_314(const chip::app::DataModel::Nullable & nullableFloatDouble) { - VerifyOrReturn(CheckValue("value", value, true)); + VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); + VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), -INFINITY)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndOneOfThemIsSetTo0_157() + CHIP_ERROR TestWriteAttributeNullableDoubleNullValue_315() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UArgumentRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableFloatDoubleArgument; + nullableFloatDoubleArgument.SetNull(); - uint8_t arg1List[10]; - arg1List[0] = 1; - arg1List[1] = 2; - arg1List[2] = 3; - arg1List[3] = 4; - arg1List[4] = 5; - arg1List[5] = 6; - arg1List[6] = 7; - arg1List[7] = 8; - arg1List[8] = 9; - arg1List[9] = 0; - request.arg1 = arg1List; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableFloatDoubleArgument, this, OnSuccessCallback_315, OnFailureCallback_315)); + return CHIP_NO_ERROR; + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_157(data.value); - }; + void OnFailureResponse_315(EmberAfStatus status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_157(status); - }; + void OnSuccessResponse_315() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + CHIP_ERROR TestReadAttributeNullableDoubleNullValue_316() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_316, OnFailureCallback_316)); return CHIP_NO_ERROR; } - void OnFailureResponse_157(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_316(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_157(bool value) + void OnSuccessResponse_316(const chip::app::DataModel::Nullable & nullableFloatDouble) { - VerifyOrReturn(CheckValue("value", value, false)); + VerifyOrReturn(CheckValueNull("nullableFloatDouble", nullableFloatDouble)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfInt8uAndGetItReversed_158() + CHIP_ERROR TestWriteAttributeNullableDouble0Value_317() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableFloatDoubleArgument; + nullableFloatDoubleArgument.SetNonNull() = 0; - uint8_t arg1List[9]; - arg1List[0] = 1; - arg1List[1] = 2; - arg1List[2] = 3; - arg1List[3] = 4; - arg1List[4] = 5; - arg1List[5] = 6; - arg1List[6] = 7; - arg1List[7] = 8; - arg1List[8] = 9; - request.arg1 = arg1List; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableFloatDoubleArgument, this, OnSuccessCallback_317, OnFailureCallback_317)); + return CHIP_NO_ERROR; + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_158(data.arg1); - }; + void OnFailureResponse_317(EmberAfStatus status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_158(status); - }; + void OnSuccessResponse_317() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + CHIP_ERROR TestReadAttributeNullableDouble0Value_318() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_318, OnFailureCallback_318)); return CHIP_NO_ERROR; } - void OnFailureResponse_158(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_318(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_158(const chip::app::DataModel::DecodableList & arg1) + void OnSuccessResponse_318(const chip::app::DataModel::Nullable & nullableFloatDouble) { - auto iter = arg1.begin(); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 0)); - VerifyOrReturn(CheckValue("arg1[0]", iter.GetValue(), 9)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 1)); - VerifyOrReturn(CheckValue("arg1[1]", iter.GetValue(), 8)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 2)); - VerifyOrReturn(CheckValue("arg1[2]", iter.GetValue(), 7)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 3)); - VerifyOrReturn(CheckValue("arg1[3]", iter.GetValue(), 6)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 4)); - VerifyOrReturn(CheckValue("arg1[4]", iter.GetValue(), 5)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 5)); - VerifyOrReturn(CheckValue("arg1[5]", iter.GetValue(), 4)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 6)); - VerifyOrReturn(CheckValue("arg1[6]", iter.GetValue(), 3)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 7)); - VerifyOrReturn(CheckValue("arg1[7]", iter.GetValue(), 2)); - VerifyOrReturn(CheckNextListItemDecodes("arg1", iter, 8)); - VerifyOrReturn(CheckValue("arg1[8]", iter.GetValue(), 1)); - VerifyOrReturn(CheckNoMoreListItems("arg1", iter, 9)); + VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); + VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), 0)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithEmptyListOfInt8uAndGetAnEmptyListBack_159() + CHIP_ERROR TestWriteAttributeNullableEnum8MinValue_319() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListInt8UReverseRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableEnum8Argument; + nullableEnum8Argument.SetNonNull() = 0; - request.arg1 = chip::app::DataModel::List(); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnum8Argument, this, OnSuccessCallback_319, OnFailureCallback_319)); + return CHIP_NO_ERROR; + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_159(data.arg1); - }; + void OnFailureResponse_319(EmberAfStatus status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_159(status); - }; + void OnSuccessResponse_319() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + CHIP_ERROR TestReadAttributeNullableEnum8MinValue_320() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_320, OnFailureCallback_320)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_320(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_320(const chip::app::DataModel::Nullable & nullableEnum8) + { + VerifyOrReturn(CheckValueNonNull("nullableEnum8", nullableEnum8)); + VerifyOrReturn(CheckValue("nullableEnum8.Value()", nullableEnum8.Value(), 0)); + + NextTest(); + } + + CHIP_ERROR TestWriteAttributeNullableEnum8MaxValue_321() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableEnum8Argument; + nullableEnum8Argument.SetNonNull() = 254; + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnum8Argument, this, OnSuccessCallback_321, OnFailureCallback_321)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_321(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_321() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableEnum8MaxValue_322() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_322, OnFailureCallback_322)); return CHIP_NO_ERROR; } - void OnFailureResponse_159(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_322(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_159(const chip::app::DataModel::DecodableList & arg1) + void OnSuccessResponse_322(const chip::app::DataModel::Nullable & nullableEnum8) { - auto iter = arg1.begin(); - VerifyOrReturn(CheckNoMoreListItems("arg1", iter, 0)); + VerifyOrReturn(CheckValueNonNull("nullableEnum8", nullableEnum8)); + VerifyOrReturn(CheckValue("nullableEnum8.Value()", nullableEnum8.Value(), 254)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsTrue_160() + CHIP_ERROR TestWriteAttributeNullableEnum8InvalidValue_323() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type; - - RequestType request; - - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type arg1List[2]; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - arg1List[0].a = 0; - arg1List[0].b = true; - arg1List[0].c = static_cast(2); - arg1List[0].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); - arg1List[0].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); - arg1List[0].f = static_cast>(1); - arg1List[0].g = 0.0f; - arg1List[0].h = 0; + chip::app::DataModel::Nullable nullableEnum8Argument; + nullableEnum8Argument.SetNonNull() = 255; - arg1List[1].a = 1; - arg1List[1].b = true; - arg1List[1].c = static_cast(3); - arg1List[1].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); - arg1List[1].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); - arg1List[1].f = static_cast>(1); - arg1List[1].g = 0.0f; - arg1List[1].h = 0; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnum8Argument, this, OnSuccessCallback_323, OnFailureCallback_323)); + return CHIP_NO_ERROR; + } - request.arg1 = arg1List; + void OnFailureResponse_323(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_160(data.value); - }; + void OnSuccessResponse_323() { ThrowSuccessResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_160(status); - }; + CHIP_ERROR TestReadAttributeNullableEnum8UnchangedValue_324() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_324, OnFailureCallback_324)); return CHIP_NO_ERROR; } - void OnFailureResponse_160(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_324(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_160(bool value) + void OnSuccessResponse_324(const chip::app::DataModel::Nullable & nullableEnum8) { - VerifyOrReturn(CheckValue("value", value, true)); + VerifyOrReturn(CheckValueNonNull("nullableEnum8", nullableEnum8)); + VerifyOrReturn(CheckValue("nullableEnum8.Value()", nullableEnum8.Value(), 254)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_161() + CHIP_ERROR TestWriteAttributeNullableEnum8NullValue_325() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListStructArgumentRequest::Type; - - RequestType request; - - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type arg1List[2]; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - arg1List[0].a = 1; - arg1List[0].b = true; - arg1List[0].c = static_cast(3); - arg1List[0].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); - arg1List[0].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); - arg1List[0].f = static_cast>(1); - arg1List[0].g = 0.0f; - arg1List[0].h = 0; + chip::app::DataModel::Nullable nullableEnum8Argument; + nullableEnum8Argument.SetNull(); - arg1List[1].a = 0; - arg1List[1].b = false; - arg1List[1].c = static_cast(2); - arg1List[1].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); - arg1List[1].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); - arg1List[1].f = static_cast>(1); - arg1List[1].g = 0.0f; - arg1List[1].h = 0; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnum8Argument, this, OnSuccessCallback_325, OnFailureCallback_325)); + return CHIP_NO_ERROR; + } - request.arg1 = arg1List; + void OnFailureResponse_325(EmberAfStatus status) { ThrowFailureResponse(); } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_161(data.value); - }; + void OnSuccessResponse_325() { NextTest(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_161(status); - }; + CHIP_ERROR TestReadAttributeNullableEnum8NullValue_326() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_326, OnFailureCallback_326)); return CHIP_NO_ERROR; } - void OnFailureResponse_161(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_326(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_161(bool value) + void OnSuccessResponse_326(const chip::app::DataModel::Nullable & nullableEnum8) { - VerifyOrReturn(CheckValue("value", value, false)); + VerifyOrReturn(CheckValueNull("nullableEnum8", nullableEnum8)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithListOfNestedStructListArgumentAndAllFieldsBOfElementsOfArg1dAreTrue_162() + CHIP_ERROR TestWriteAttributeNullableEnum16MinValue_327() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableEnum16Argument; + nullableEnum16Argument.SetNonNull() = 0U; - chip::app::Clusters::TestCluster::Structs::NestedStructList::Type arg1List[1]; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnum16Argument, this, OnSuccessCallback_327, OnFailureCallback_327)); + return CHIP_NO_ERROR; + } - arg1List[0].a = 0; - arg1List[0].b = true; + void OnFailureResponse_327(EmberAfStatus status) { ThrowFailureResponse(); } - arg1List[0].c.a = 0; - arg1List[0].c.b = true; - arg1List[0].c.c = static_cast(2); - arg1List[0].c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - arg1List[0].c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - arg1List[0].c.f = static_cast>(1); - arg1List[0].c.g = 0.0f; - arg1List[0].c.h = 0; + void OnSuccessResponse_327() { NextTest(); } - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; + CHIP_ERROR TestReadAttributeNullableEnum16MinValue_328() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - dList[0].a = 1; - dList[0].b = true; - dList[0].c = static_cast(3); - dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[0].f = static_cast>(1); - dList[0].g = 0.0f; - dList[0].h = 0; + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_328, OnFailureCallback_328)); + return CHIP_NO_ERROR; + } - dList[1].a = 2; - dList[1].b = true; - dList[1].c = static_cast(3); - dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[1].f = static_cast>(1); - dList[1].g = 0.0f; - dList[1].h = 0; + void OnFailureResponse_328(EmberAfStatus status) { ThrowFailureResponse(); } - arg1List[0].d = dList; + void OnSuccessResponse_328(const chip::app::DataModel::Nullable & nullableEnum16) + { + VerifyOrReturn(CheckValueNonNull("nullableEnum16", nullableEnum16)); + VerifyOrReturn(CheckValue("nullableEnum16.Value()", nullableEnum16.Value(), 0U)); - uint32_t eList[3]; - eList[0] = 1UL; - eList[1] = 2UL; - eList[2] = 3UL; - arg1List[0].e = eList; + NextTest(); + } - chip::ByteSpan fList[3]; - fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); - fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); - fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); - arg1List[0].f = fList; + CHIP_ERROR TestWriteAttributeNullableEnum16MaxValue_329() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t gList[2]; - gList[0] = 0; - gList[1] = 255; - arg1List[0].g = gList; + chip::app::DataModel::Nullable nullableEnum16Argument; + nullableEnum16Argument.SetNonNull() = 65534U; - request.arg1 = arg1List; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnum16Argument, this, OnSuccessCallback_329, OnFailureCallback_329)); + return CHIP_NO_ERROR; + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_162(data.value); - }; + void OnFailureResponse_329(EmberAfStatus status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_162(status); - }; + void OnSuccessResponse_329() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + CHIP_ERROR TestReadAttributeNullableEnum16MaxValue_330() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_330, OnFailureCallback_330)); return CHIP_NO_ERROR; } - void OnFailureResponse_162(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_330(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_162(bool value) + void OnSuccessResponse_330(const chip::app::DataModel::Nullable & nullableEnum16) { - VerifyOrReturn(CheckValue("value", value, true)); + VerifyOrReturn(CheckValueNonNull("nullableEnum16", nullableEnum16)); + VerifyOrReturn(CheckValue("nullableEnum16.Value()", nullableEnum16.Value(), 65534U)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithNestedStructListArgumentAndSomeFieldsBOfElementsOfArg1dAreFalse_163() + CHIP_ERROR TestWriteAttributeNullableEnum16InvalidValue_331() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestListNestedStructListArgumentRequest::Type; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - RequestType request; + chip::app::DataModel::Nullable nullableEnum16Argument; + nullableEnum16Argument.SetNonNull() = 65535U; - chip::app::Clusters::TestCluster::Structs::NestedStructList::Type arg1List[1]; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnum16Argument, this, OnSuccessCallback_331, OnFailureCallback_331)); + return CHIP_NO_ERROR; + } - arg1List[0].a = 0; - arg1List[0].b = true; + void OnFailureResponse_331(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - arg1List[0].c.a = 0; - arg1List[0].c.b = true; - arg1List[0].c.c = static_cast(2); - arg1List[0].c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); - arg1List[0].c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - arg1List[0].c.f = static_cast>(1); - arg1List[0].c.g = 0.0f; - arg1List[0].c.h = 0; + void OnSuccessResponse_331() { ThrowSuccessResponse(); } - chip::app::Clusters::TestCluster::Structs::SimpleStruct::Type dList[2]; + CHIP_ERROR TestReadAttributeNullableEnum16UnchangedValue_332() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - dList[0].a = 1; - dList[0].b = true; - dList[0].c = static_cast(3); - dList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[0].f = static_cast>(1); - dList[0].g = 0.0f; - dList[0].h = 0; + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_332, OnFailureCallback_332)); + return CHIP_NO_ERROR; + } - dList[1].a = 2; - dList[1].b = false; - dList[1].c = static_cast(3); - dList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); - dList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - dList[1].f = static_cast>(1); - dList[1].g = 0.0f; - dList[1].h = 0; + void OnFailureResponse_332(EmberAfStatus status) { ThrowFailureResponse(); } - arg1List[0].d = dList; + void OnSuccessResponse_332(const chip::app::DataModel::Nullable & nullableEnum16) + { + VerifyOrReturn(CheckValueNonNull("nullableEnum16", nullableEnum16)); + VerifyOrReturn(CheckValue("nullableEnum16.Value()", nullableEnum16.Value(), 65534U)); - uint32_t eList[3]; - eList[0] = 1UL; - eList[1] = 2UL; - eList[2] = 3UL; - arg1List[0].e = eList; + NextTest(); + } - chip::ByteSpan fList[3]; - fList[0] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_1garbage: not in length on purpose"), 14); - fList[1] = chip::ByteSpan(chip::Uint8::from_const_char("octect_string_2garbage: not in length on purpose"), 15); - fList[2] = chip::ByteSpan(chip::Uint8::from_const_char("octet_string_3garbage: not in length on purpose"), 14); - arg1List[0].f = fList; + CHIP_ERROR TestWriteAttributeNullableEnum16NullValue_333() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t gList[2]; - gList[0] = 0; - gList[1] = 255; - arg1List[0].g = gList; + chip::app::DataModel::Nullable nullableEnum16Argument; + nullableEnum16Argument.SetNull(); - request.arg1 = arg1List; + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnum16Argument, this, OnSuccessCallback_333, OnFailureCallback_333)); + return CHIP_NO_ERROR; + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_163(data.value); - }; + void OnFailureResponse_333(EmberAfStatus status) { ThrowFailureResponse(); } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_163(status); - }; + void OnSuccessResponse_333() { NextTest(); } - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + CHIP_ERROR TestReadAttributeNullableEnum16NullValue_334() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_334, OnFailureCallback_334)); return CHIP_NO_ERROR; } - void OnFailureResponse_163(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_334(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_163(bool value) + void OnSuccessResponse_334(const chip::app::DataModel::Nullable & nullableEnum16) { - VerifyOrReturn(CheckValue("value", value, false)); + VerifyOrReturn(CheckValueNull("nullableEnum16", nullableEnum16)); NextTest(); } - CHIP_ERROR TestWriteAttributeListWithListOfInt8uAndNoneOfThemIsSetTo0_164() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumMinValue_335() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::List listInt8uArgument; - - uint8_t listInt8uList[4]; - listInt8uList[0] = 1; - listInt8uList[1] = 2; - listInt8uList[2] = 3; - listInt8uList[3] = 4; - listInt8uArgument = listInt8uList; + chip::app::DataModel::Nullable nullableEnumAttrArgument; + nullableEnumAttrArgument.SetNonNull() = static_cast(0); - ReturnErrorOnFailure(cluster.WriteAttribute( - listInt8uArgument, this, OnSuccessCallback_164, OnFailureCallback_164)); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnumAttrArgument, this, OnSuccessCallback_335, OnFailureCallback_335)); return CHIP_NO_ERROR; } - void OnFailureResponse_164(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_335(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_164() { NextTest(); } + void OnSuccessResponse_335() { NextTest(); } - CHIP_ERROR TestReadAttributeListWithListOfInt8u_165() + CHIP_ERROR TestReadAttributeNullableSimpleEnumMinValue_336() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_165, OnFailureCallback_165)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_336, OnFailureCallback_336)); return CHIP_NO_ERROR; } - void OnFailureResponse_165(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_336(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_165(const chip::app::DataModel::DecodableList & listInt8u) + void + OnSuccessResponse_336(const chip::app::DataModel::Nullable & nullableEnumAttr) { - auto iter = listInt8u.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 0)); - VerifyOrReturn(CheckValue("listInt8u[0]", iter.GetValue(), 1)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 1)); - VerifyOrReturn(CheckValue("listInt8u[1]", iter.GetValue(), 2)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 2)); - VerifyOrReturn(CheckValue("listInt8u[2]", iter.GetValue(), 3)); - VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 3)); - VerifyOrReturn(CheckValue("listInt8u[3]", iter.GetValue(), 4)); - VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter, 4)); + VerifyOrReturn(CheckValueNonNull("nullableEnumAttr", nullableEnumAttr)); + VerifyOrReturn(CheckValue("nullableEnumAttr.Value()", nullableEnumAttr.Value(), 0)); NextTest(); } - CHIP_ERROR TestWriteAttributeListWithListOfOctetString_166() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumMaxValue_337() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::List listOctetStringArgument; - - chip::ByteSpan listOctetStringList[4]; - listOctetStringList[0] = chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); - listOctetStringList[1] = chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); - listOctetStringList[2] = chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); - listOctetStringList[3] = chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); - listOctetStringArgument = listOctetStringList; + chip::app::DataModel::Nullable nullableEnumAttrArgument; + nullableEnumAttrArgument.SetNonNull() = static_cast(254); - ReturnErrorOnFailure(cluster.WriteAttribute( - listOctetStringArgument, this, OnSuccessCallback_166, OnFailureCallback_166)); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnumAttrArgument, this, OnSuccessCallback_337, OnFailureCallback_337)); return CHIP_NO_ERROR; } - void OnFailureResponse_166(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_337(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_166() { NextTest(); } + void OnSuccessResponse_337() { NextTest(); } - CHIP_ERROR TestReadAttributeListWithListOfOctetString_167() + CHIP_ERROR TestReadAttributeNullableSimpleEnumMaxValue_338() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_167, OnFailureCallback_167)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_338, OnFailureCallback_338)); return CHIP_NO_ERROR; } - void OnFailureResponse_167(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_338(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_167(const chip::app::DataModel::DecodableList & listOctetString) + void + OnSuccessResponse_338(const chip::app::DataModel::Nullable & nullableEnumAttr) { - auto iter = listOctetString.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 0)); - VerifyOrReturn( - CheckValueAsString("listOctetString[0]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 1)); - VerifyOrReturn( - CheckValueAsString("listOctetString[1]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 2)); - VerifyOrReturn( - CheckValueAsString("listOctetString[2]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listOctetString", iter, 3)); - VerifyOrReturn( - CheckValueAsString("listOctetString[3]", iter.GetValue(), chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); - VerifyOrReturn(CheckNoMoreListItems("listOctetString", iter, 4)); + VerifyOrReturn(CheckValueNonNull("nullableEnumAttr", nullableEnumAttr)); + VerifyOrReturn(CheckValue("nullableEnumAttr.Value()", nullableEnumAttr.Value(), 254)); NextTest(); } - CHIP_ERROR TestWriteAttributeListWithListOfListStructOctetString_168() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumInvalidValue_339() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::List - listStructOctetStringArgument; - - chip::app::Clusters::TestCluster::Structs::TestListStructOctet::Type listStructOctetStringList[4]; - - listStructOctetStringList[0].fabricIndex = 0ULL; - listStructOctetStringList[0].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test0garbage: not in length on purpose"), 5); - - listStructOctetStringList[1].fabricIndex = 1ULL; - listStructOctetStringList[1].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test1garbage: not in length on purpose"), 5); - - listStructOctetStringList[2].fabricIndex = 2ULL; - listStructOctetStringList[2].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test2garbage: not in length on purpose"), 5); - - listStructOctetStringList[3].fabricIndex = 3ULL; - listStructOctetStringList[3].operationalCert = - chip::ByteSpan(chip::Uint8::from_const_char("Test3garbage: not in length on purpose"), 5); - - listStructOctetStringArgument = listStructOctetStringList; + chip::app::DataModel::Nullable nullableEnumAttrArgument; + nullableEnumAttrArgument.SetNonNull() = static_cast(255); - ReturnErrorOnFailure(cluster.WriteAttribute( - listStructOctetStringArgument, this, OnSuccessCallback_168, OnFailureCallback_168)); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnumAttrArgument, this, OnSuccessCallback_339, OnFailureCallback_339)); return CHIP_NO_ERROR; } - void OnFailureResponse_168(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_339(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_168() { NextTest(); } + void OnSuccessResponse_339() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeListWithListOfListStructOctetString_169() + CHIP_ERROR TestReadAttributeNullableSimpleEnumUnchangedValue_340() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_169, OnFailureCallback_169)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_340, OnFailureCallback_340)); return CHIP_NO_ERROR; } - void OnFailureResponse_169(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_340(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_169( - const chip::app::DataModel::DecodableList & - listStructOctetString) + void + OnSuccessResponse_340(const chip::app::DataModel::Nullable & nullableEnumAttr) { - auto iter = listStructOctetString.begin(); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 0)); - VerifyOrReturn(CheckValue("listStructOctetString[0].fabricIndex", iter.GetValue().fabricIndex, 0ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[0].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test0"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 1)); - VerifyOrReturn(CheckValue("listStructOctetString[1].fabricIndex", iter.GetValue().fabricIndex, 1ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[1].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test1"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 2)); - VerifyOrReturn(CheckValue("listStructOctetString[2].fabricIndex", iter.GetValue().fabricIndex, 2ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[2].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test2"), 5))); - VerifyOrReturn(CheckNextListItemDecodes("listStructOctetString", iter, 3)); - VerifyOrReturn(CheckValue("listStructOctetString[3].fabricIndex", iter.GetValue().fabricIndex, 3ULL)); - VerifyOrReturn(CheckValueAsString("listStructOctetString[3].operationalCert", iter.GetValue().operationalCert, - chip::ByteSpan(chip::Uint8::from_const_char("Test3"), 5))); - VerifyOrReturn(CheckNoMoreListItems("listStructOctetString", iter, 4)); + VerifyOrReturn(CheckValueNonNull("nullableEnumAttr", nullableEnumAttr)); + VerifyOrReturn(CheckValue("nullableEnumAttr.Value()", nullableEnumAttr.Value(), 254)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithOptionalArgSet_170() + CHIP_ERROR TestWriteAttributeNullableSimpleEnumNullValue_341() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; - - RequestType request; - request.arg1.Emplace().SetNonNull() = 5; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context)) - ->OnSuccessResponse_170(data.wasPresent, data.wasNull, data.value, data.originalValue); - }; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_170(status); - }; + chip::app::DataModel::Nullable nullableEnumAttrArgument; + nullableEnumAttrArgument.SetNull(); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableEnumAttrArgument, this, OnSuccessCallback_341, OnFailureCallback_341)); return CHIP_NO_ERROR; } - void OnFailureResponse_170(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_341(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_170(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, - const chip::Optional> & originalValue) + void OnSuccessResponse_341() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableSimpleEnumNullValue_342() { - VerifyOrReturn(CheckValue("wasPresent", wasPresent, true)); + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - VerifyOrReturn(CheckValuePresent("wasNull", wasNull)); - VerifyOrReturn(CheckValue("wasNull.Value()", wasNull.Value(), false)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_342, OnFailureCallback_342)); + return CHIP_NO_ERROR; + } - VerifyOrReturn(CheckValuePresent("value", value)); - VerifyOrReturn(CheckValue("value.Value()", value.Value(), 5)); + void OnFailureResponse_342(EmberAfStatus status) { ThrowFailureResponse(); } - VerifyOrReturn(CheckValuePresent("originalValue", originalValue)); - VerifyOrReturn(CheckValueNonNull("originalValue.Value()", originalValue.Value())); - VerifyOrReturn(CheckValue("originalValue.Value().Value()", originalValue.Value().Value(), 5)); + void + OnSuccessResponse_342(const chip::app::DataModel::Nullable & nullableEnumAttr) + { + VerifyOrReturn(CheckValueNull("nullableEnumAttr", nullableEnumAttr)); NextTest(); } - CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_171() + CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_343() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; - - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context)) - ->OnSuccessResponse_171(data.wasPresent, data.wasNull, data.value, data.originalValue); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_171(status); - }; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_343, OnFailureCallback_343)); return CHIP_NO_ERROR; } - void OnFailureResponse_171(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_343(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_171(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value, - const chip::Optional> & originalValue) + void OnSuccessResponse_343(const chip::app::DataModel::Nullable & nullableOctetString) { - VerifyOrReturn(CheckValue("wasPresent", wasPresent, false)); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), + chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBooleanNull_172() + CHIP_ERROR TestWriteAttributeNullableOctetString_344() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBooleanArgument; - nullableBooleanArgument.SetNull(); + chip::app::DataModel::Nullable nullableOctetStringArgument; + nullableOctetStringArgument.SetNonNull() = + chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBooleanArgument, this, OnSuccessCallback_172, OnFailureCallback_172)); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableOctetStringArgument, this, OnSuccessCallback_344, OnFailureCallback_344)); return CHIP_NO_ERROR; } - void OnFailureResponse_172(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_344(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_172() { NextTest(); } + void OnSuccessResponse_344() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableBooleanNull_173() + CHIP_ERROR TestReadAttributeNullableOctetString_345() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_173, OnFailureCallback_173)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_345, OnFailureCallback_345)); return CHIP_NO_ERROR; } - void OnFailureResponse_173(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_345(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_173(const chip::app::DataModel::Nullable & nullableBoolean) + void OnSuccessResponse_345(const chip::app::DataModel::Nullable & nullableOctetString) { - VerifyOrReturn(CheckValueNull("nullableBoolean", nullableBoolean)); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), + chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBooleanTrue_174() + CHIP_ERROR TestWriteAttributeNullableOctetString_346() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBooleanArgument; - nullableBooleanArgument.SetNonNull() = true; + chip::app::DataModel::Nullable nullableOctetStringArgument; + nullableOctetStringArgument.SetNull(); - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBooleanArgument, this, OnSuccessCallback_174, OnFailureCallback_174)); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableOctetStringArgument, this, OnSuccessCallback_346, OnFailureCallback_346)); return CHIP_NO_ERROR; } - void OnFailureResponse_174(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_346(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_174() { NextTest(); } + void OnSuccessResponse_346() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableBooleanTrue_175() + CHIP_ERROR TestReadAttributeNullableOctetString_347() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_175, OnFailureCallback_175)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_347, OnFailureCallback_347)); return CHIP_NO_ERROR; } - void OnFailureResponse_175(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_347(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_175(const chip::app::DataModel::Nullable & nullableBoolean) + void OnSuccessResponse_347(const chip::app::DataModel::Nullable & nullableOctetString) { - VerifyOrReturn(CheckValueNonNull("nullableBoolean", nullableBoolean)); - VerifyOrReturn(CheckValue("nullableBoolean.Value()", nullableBoolean.Value(), true)); + VerifyOrReturn(CheckValueNull("nullableOctetString", nullableOctetString)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap8MaxValue_176() + CHIP_ERROR TestWriteAttributeNullableOctetString_348() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap8Argument; - nullableBitmap8Argument.SetNonNull() = 254; + chip::app::DataModel::Nullable nullableOctetStringArgument; + nullableOctetStringArgument.SetNonNull() = + chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap8Argument, this, OnSuccessCallback_176, OnFailureCallback_176)); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableOctetStringArgument, this, OnSuccessCallback_348, OnFailureCallback_348)); return CHIP_NO_ERROR; } - void OnFailureResponse_176(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_348(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_176() { NextTest(); } + void OnSuccessResponse_348() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableBitmap8MaxValue_177() + CHIP_ERROR TestReadAttributeNullableOctetString_349() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_177, OnFailureCallback_177)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_349, OnFailureCallback_349)); return CHIP_NO_ERROR; } - void OnFailureResponse_177(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_349(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_177(const chip::app::DataModel::Nullable & nullableBitmap8) + void OnSuccessResponse_349(const chip::app::DataModel::Nullable & nullableOctetString) { - VerifyOrReturn(CheckValueNonNull("nullableBitmap8", nullableBitmap8)); - VerifyOrReturn(CheckValue("nullableBitmap8.Value()", nullableBitmap8.Value(), 254)); + VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); + VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), + chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap8InvalidValue_178() + CHIP_ERROR TestReadAttributeNullableCharStringDefaultValue_350() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap8Argument; - nullableBitmap8Argument.SetNonNull() = 255; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap8Argument, this, OnSuccessCallback_178, OnFailureCallback_178)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_350, OnFailureCallback_350)); return CHIP_NO_ERROR; } - void OnFailureResponse_178(EmberAfStatus status) + void OnFailureResponse_350(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_350(const chip::app::DataModel::Nullable & nullableCharString) { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); + VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("", 0))); + NextTest(); } - void OnSuccessResponse_178() { ThrowSuccessResponse(); } + CHIP_ERROR TestWriteAttributeNullableCharString_351() + { + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + chip::app::DataModel::Nullable nullableCharStringArgument; + nullableCharStringArgument.SetNonNull() = chip::Span("☉T☉garbage: not in length on purpose", 7); + + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableCharStringArgument, this, OnSuccessCallback_351, OnFailureCallback_351)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_351(EmberAfStatus status) { ThrowFailureResponse(); } - CHIP_ERROR TestReadAttributeNullableBitmap8UnchangedValue_179() + void OnSuccessResponse_351() { NextTest(); } + + CHIP_ERROR TestReadAttributeNullableCharString_352() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_179, OnFailureCallback_179)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_352, OnFailureCallback_352)); return CHIP_NO_ERROR; } - void OnFailureResponse_179(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_352(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_179(const chip::app::DataModel::Nullable & nullableBitmap8) + void OnSuccessResponse_352(const chip::app::DataModel::Nullable & nullableCharString) { - VerifyOrReturn(CheckValueNonNull("nullableBitmap8", nullableBitmap8)); - VerifyOrReturn(CheckValue("nullableBitmap8.Value()", nullableBitmap8.Value(), 254)); + VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); + VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("☉T☉", 7))); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap8NullValue_180() + CHIP_ERROR TestWriteAttributeNullableCharStringValueTooLong_353() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap8Argument; - nullableBitmap8Argument.SetNull(); + chip::app::DataModel::Nullable nullableCharStringArgument; + nullableCharStringArgument.SetNull(); - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap8Argument, this, OnSuccessCallback_180, OnFailureCallback_180)); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableCharStringArgument, this, OnSuccessCallback_353, OnFailureCallback_353)); return CHIP_NO_ERROR; } - void OnFailureResponse_180(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_353(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_180() { NextTest(); } + void OnSuccessResponse_353() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableBitmap8NullValue_181() + CHIP_ERROR TestReadAttributeNullableCharString_354() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_181, OnFailureCallback_181)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_354, OnFailureCallback_354)); return CHIP_NO_ERROR; } - void OnFailureResponse_181(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_354(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_181(const chip::app::DataModel::Nullable & nullableBitmap8) + void OnSuccessResponse_354(const chip::app::DataModel::Nullable & nullableCharString) { - VerifyOrReturn(CheckValueNull("nullableBitmap8", nullableBitmap8)); + VerifyOrReturn(CheckValueNull("nullableCharString", nullableCharString)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap16MaxValue_182() + CHIP_ERROR TestWriteAttributeNullableCharStringEmpty_355() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap16Argument; - nullableBitmap16Argument.SetNonNull() = 65534U; + chip::app::DataModel::Nullable nullableCharStringArgument; + nullableCharStringArgument.SetNonNull() = chip::Span("garbage: not in length on purpose", 0); - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap16Argument, this, OnSuccessCallback_182, OnFailureCallback_182)); + ReturnErrorOnFailure(cluster.WriteAttribute( + nullableCharStringArgument, this, OnSuccessCallback_355, OnFailureCallback_355)); return CHIP_NO_ERROR; } - void OnFailureResponse_182(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_355(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_182() { NextTest(); } + void OnSuccessResponse_355() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableBitmap16MaxValue_183() + CHIP_ERROR TestReadAttributeNullableCharString_356() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_183, OnFailureCallback_183)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_356, OnFailureCallback_356)); return CHIP_NO_ERROR; } - void OnFailureResponse_183(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_356(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_183(const chip::app::DataModel::Nullable & nullableBitmap16) + void OnSuccessResponse_356(const chip::app::DataModel::Nullable & nullableCharString) { - VerifyOrReturn(CheckValueNonNull("nullableBitmap16", nullableBitmap16)); - VerifyOrReturn(CheckValue("nullableBitmap16.Value()", nullableBitmap16.Value(), 65534U)); + VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); + VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("", 0))); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap16InvalidValue_184() + CHIP_ERROR TestReadAttributeFromNonexistentEndpoint_357() { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 200; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap16Argument; - nullableBitmap16Argument.SetNonNull() = 65535U; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap16Argument, this, OnSuccessCallback_184, OnFailureCallback_184)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_357, OnFailureCallback_357)); return CHIP_NO_ERROR; } - void OnFailureResponse_184(EmberAfStatus status) + void OnFailureResponse_357(EmberAfStatus status) { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); NextTest(); } - void OnSuccessResponse_184() { ThrowSuccessResponse(); } + void OnSuccessResponse_357(const chip::app::DataModel::DecodableList & listInt8u) { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableBitmap16UnchangedValue_185() + CHIP_ERROR TestReadAttributeFromNonexistentCluster_358() { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_185, OnFailureCallback_185)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_358, OnFailureCallback_358)); return CHIP_NO_ERROR; } - void OnFailureResponse_185(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_185(const chip::app::DataModel::Nullable & nullableBitmap16) + void OnFailureResponse_358(EmberAfStatus status) { - VerifyOrReturn(CheckValueNonNull("nullableBitmap16", nullableBitmap16)); - VerifyOrReturn(CheckValue("nullableBitmap16.Value()", nullableBitmap16.Value(), 65534U)); - + VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap16NullValue_186() + void OnSuccessResponse_358(const chip::app::DataModel::DecodableList & listInt8u) { ThrowSuccessResponse(); } + + CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_359() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + using RequestType = chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type; - chip::app::DataModel::Nullable nullableBitmap16Argument; - nullableBitmap16Argument.SetNull(); + RequestType request; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap16Argument, this, OnSuccessCallback_186, OnFailureCallback_186)); + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_359(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_359(status); + }; + + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_186(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_359(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_INVALID_VALUE)); + NextTest(); + } - void OnSuccessResponse_186() { NextTest(); } + void OnSuccessResponse_359() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableBitmap16NullValue_187() + CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_360() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - chip::Controller::TestClusterClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); + using RequestType = chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type; - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_187, OnFailureCallback_187)); - return CHIP_NO_ERROR; - } + RequestType request; + request.arg1.Emplace() = 1; - void OnFailureResponse_187(EmberAfStatus status) { ThrowFailureResponse(); } + auto success = [](void * context, const typename RequestType::ResponseType & data) { + (static_cast(context))->OnSuccessResponse_360(); + }; - void OnSuccessResponse_187(const chip::app::DataModel::Nullable & nullableBitmap16) - { - VerifyOrReturn(CheckValueNull("nullableBitmap16", nullableBitmap16)); + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_360(status); + }; - NextTest(); + ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteAttributeNullableBitmap32MaxValue_188() + void OnFailureResponse_360(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_360() { NextTest(); } + + CHIP_ERROR TestReportSubscribeToListAttribute_361() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap32Argument; - nullableBitmap32Argument.SetNonNull() = 4294967294UL; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap32Argument, this, OnSuccessCallback_188, OnFailureCallback_188)); - return CHIP_NO_ERROR; + mTest_TestCluster_list_int8u_Reported = OnSuccessCallback_361; + return WaitForMs(0); } - void OnFailureResponse_188(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_361(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_188() { NextTest(); } + void OnSuccessResponse_361(const chip::app::DataModel::DecodableList & listInt8u) + { + mReceivedReport_361 = true; + + auto iter = listInt8u.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 0)); + VerifyOrReturn(CheckValue("listInt8u[0]", iter.GetValue(), 1)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 1)); + VerifyOrReturn(CheckValue("listInt8u[1]", iter.GetValue(), 2)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 2)); + VerifyOrReturn(CheckValue("listInt8u[2]", iter.GetValue(), 3)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 3)); + VerifyOrReturn(CheckValue("listInt8u[3]", iter.GetValue(), 4)); + VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter, 4)); + } - CHIP_ERROR TestReadAttributeNullableBitmap32MaxValue_189() + CHIP_ERROR TestSubscribeToListAttribute_362() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_189, OnFailureCallback_189)); + uint16_t minIntervalArgument; + minIntervalArgument = 2U; + uint16_t maxIntervalArgument; + maxIntervalArgument = 10U; + + ReturnErrorOnFailure(cluster.SubscribeAttribute( + this, OnSuccessCallback_362, OnFailureCallback_362, minIntervalArgument, maxIntervalArgument, + OnSubscriptionEstablished_362)); return CHIP_NO_ERROR; } - void OnFailureResponse_189(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_362(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_189(const chip::app::DataModel::Nullable & nullableBitmap32) + void OnSuccessResponse_362(const chip::app::DataModel::DecodableList & value) { - VerifyOrReturn(CheckValueNonNull("nullableBitmap32", nullableBitmap32)); - VerifyOrReturn(CheckValue("nullableBitmap32.Value()", nullableBitmap32.Value(), 4294967294UL)); + if (mTest_TestCluster_list_int8u_Reported) + { + auto callback = mTest_TestCluster_list_int8u_Reported; + mTest_TestCluster_list_int8u_Reported = nullptr; + callback(this, value); + } + } + void OnSubscriptionEstablishedResponse_362() + { + VerifyOrReturn(mReceivedReport_361, Exit("Initial report not received!")); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap32InvalidValue_190() + CHIP_ERROR TestWriteSubscribedToListAttribute_363() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap32Argument; - nullableBitmap32Argument.SetNonNull() = 4294967295UL; + chip::app::DataModel::List listInt8uArgument; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap32Argument, this, OnSuccessCallback_190, OnFailureCallback_190)); + uint8_t listInt8uList[4]; + listInt8uList[0] = 5; + listInt8uList[1] = 6; + listInt8uList[2] = 7; + listInt8uList[3] = 8; + listInt8uArgument = listInt8uList; + + ReturnErrorOnFailure(cluster.WriteAttribute( + listInt8uArgument, this, OnSuccessCallback_363, OnFailureCallback_363)); return CHIP_NO_ERROR; } - void OnFailureResponse_190(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } + void OnFailureResponse_363(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_190() { ThrowSuccessResponse(); } + void OnSuccessResponse_363() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableBitmap32UnchangedValue_191() + CHIP_ERROR TestCheckForListAttributeReport_364() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_191, OnFailureCallback_191)); + mTest_TestCluster_list_int8u_Reported = OnSuccessCallback_364; return CHIP_NO_ERROR; } - void OnFailureResponse_191(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_364(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_191(const chip::app::DataModel::Nullable & nullableBitmap32) + void OnSuccessResponse_364(const chip::app::DataModel::DecodableList & listInt8u) { - VerifyOrReturn(CheckValueNonNull("nullableBitmap32", nullableBitmap32)); - VerifyOrReturn(CheckValue("nullableBitmap32.Value()", nullableBitmap32.Value(), 4294967294UL)); + mReceivedReport_364 = true; + + auto iter = listInt8u.begin(); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 0)); + VerifyOrReturn(CheckValue("listInt8u[0]", iter.GetValue(), 5)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 1)); + VerifyOrReturn(CheckValue("listInt8u[1]", iter.GetValue(), 6)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 2)); + VerifyOrReturn(CheckValue("listInt8u[2]", iter.GetValue(), 7)); + VerifyOrReturn(CheckNextListItemDecodes("listInt8u", iter, 3)); + VerifyOrReturn(CheckValue("listInt8u[3]", iter.GetValue(), 8)); + VerifyOrReturn(CheckNoMoreListItems("listInt8u", iter, 4)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap32NullValue_192() + CHIP_ERROR TestReadRangeRestrictedUnsigned8BitInteger_365() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap32Argument; - nullableBitmap32Argument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap32Argument, this, OnSuccessCallback_192, OnFailureCallback_192)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_365, OnFailureCallback_365)); return CHIP_NO_ERROR; } - void OnFailureResponse_192(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_365(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_365(uint8_t rangeRestrictedInt8u) + { + VerifyOrReturn(CheckValue("rangeRestrictedInt8u", rangeRestrictedInt8u, 70)); - void OnSuccessResponse_192() { NextTest(); } + NextTest(); + } - CHIP_ERROR TestReadAttributeNullableBitmap32NullValue_193() + CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned8BitInteger_366() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_193, OnFailureCallback_193)); + uint8_t rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = 0; + + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8uArgument, this, OnSuccessCallback_366, OnFailureCallback_366)); return CHIP_NO_ERROR; } - void OnFailureResponse_193(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_193(const chip::app::DataModel::Nullable & nullableBitmap32) + void OnFailureResponse_366(EmberAfStatus status) { - VerifyOrReturn(CheckValueNull("nullableBitmap32", nullableBitmap32)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap64MaxValue_194() + void OnSuccessResponse_366() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned8BitInteger_367() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap64Argument; - nullableBitmap64Argument.SetNonNull() = 18446744073709551614ULL; + uint8_t rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = 19; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap64Argument, this, OnSuccessCallback_194, OnFailureCallback_194)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8uArgument, this, OnSuccessCallback_367, OnFailureCallback_367)); return CHIP_NO_ERROR; } - void OnFailureResponse_194(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_367(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_194() { NextTest(); } + void OnSuccessResponse_367() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableBitmap64MaxValue_195() + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned8BitInteger_368() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_195, OnFailureCallback_195)); + uint8_t rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = 101; + + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8uArgument, this, OnSuccessCallback_368, OnFailureCallback_368)); return CHIP_NO_ERROR; } - void OnFailureResponse_195(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_195(const chip::app::DataModel::Nullable & nullableBitmap64) + void OnFailureResponse_368(EmberAfStatus status) { - VerifyOrReturn(CheckValueNonNull("nullableBitmap64", nullableBitmap64)); - VerifyOrReturn(CheckValue("nullableBitmap64.Value()", nullableBitmap64.Value(), 18446744073709551614ULL)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap64InvalidValue_196() + void OnSuccessResponse_368() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned8BitInteger_369() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap64Argument; - nullableBitmap64Argument.SetNonNull() = 18446744073709551615ULL; + uint8_t rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = 255; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap64Argument, this, OnSuccessCallback_196, OnFailureCallback_196)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8uArgument, this, OnSuccessCallback_369, OnFailureCallback_369)); return CHIP_NO_ERROR; } - void OnFailureResponse_196(EmberAfStatus status) + void OnFailureResponse_369(EmberAfStatus status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - void OnSuccessResponse_196() { ThrowSuccessResponse(); } + void OnSuccessResponse_369() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableBitmap64UnchangedValue_197() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_370() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_197, OnFailureCallback_197)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_370, OnFailureCallback_370)); return CHIP_NO_ERROR; } - void OnFailureResponse_197(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_370(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_197(const chip::app::DataModel::Nullable & nullableBitmap64) + void OnSuccessResponse_370(uint8_t rangeRestrictedInt8u) { - VerifyOrReturn(CheckValueNonNull("nullableBitmap64", nullableBitmap64)); - VerifyOrReturn(CheckValue("nullableBitmap64.Value()", nullableBitmap64.Value(), 18446744073709551614ULL)); + VerifyOrReturn(CheckValue("rangeRestrictedInt8u", rangeRestrictedInt8u, 70)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableBitmap64NullValue_198() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned8BitInteger_371() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap64Argument; - nullableBitmap64Argument.SetNull(); + uint8_t rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = 20; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableBitmap64Argument, this, OnSuccessCallback_198, OnFailureCallback_198)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8uArgument, this, OnSuccessCallback_371, OnFailureCallback_371)); return CHIP_NO_ERROR; } - void OnFailureResponse_198(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_371(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_198() { NextTest(); } + void OnSuccessResponse_371() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableBitmap64NullValue_199() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_372() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_199, OnFailureCallback_199)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_372, OnFailureCallback_372)); return CHIP_NO_ERROR; } - void OnFailureResponse_199(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_372(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_199(const chip::app::DataModel::Nullable & nullableBitmap64) + void OnSuccessResponse_372(uint8_t rangeRestrictedInt8u) { - VerifyOrReturn(CheckValueNull("nullableBitmap64", nullableBitmap64)); + VerifyOrReturn(CheckValue("rangeRestrictedInt8u", rangeRestrictedInt8u, 20)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt8uMaxValue_200() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned8BitInteger_373() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt8uArgument; - nullableInt8uArgument.SetNonNull() = 254; + uint8_t rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = 100; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8uArgument, this, OnSuccessCallback_200, OnFailureCallback_200)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8uArgument, this, OnSuccessCallback_373, OnFailureCallback_373)); return CHIP_NO_ERROR; } - void OnFailureResponse_200(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_373(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_200() { NextTest(); } + void OnSuccessResponse_373() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt8uMaxValue_201() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_374() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_201, OnFailureCallback_201)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_374, OnFailureCallback_374)); return CHIP_NO_ERROR; } - void OnFailureResponse_201(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_374(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_201(const chip::app::DataModel::Nullable & nullableInt8u) + void OnSuccessResponse_374(uint8_t rangeRestrictedInt8u) { - VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); - VerifyOrReturn(CheckValue("nullableInt8u.Value()", nullableInt8u.Value(), 254)); + VerifyOrReturn(CheckValue("rangeRestrictedInt8u", rangeRestrictedInt8u, 100)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt8uInvalidValue_202() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned8BitInteger_375() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt8uArgument; - nullableInt8uArgument.SetNonNull() = 255; + uint8_t rangeRestrictedInt8uArgument; + rangeRestrictedInt8uArgument = 50; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8uArgument, this, OnSuccessCallback_202, OnFailureCallback_202)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8uArgument, this, OnSuccessCallback_375, OnFailureCallback_375)); return CHIP_NO_ERROR; } - void OnFailureResponse_202(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } + void OnFailureResponse_375(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_202() { ThrowSuccessResponse(); } + void OnSuccessResponse_375() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt8uUnchangedValue_203() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_376() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_203, OnFailureCallback_203)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_376, OnFailureCallback_376)); return CHIP_NO_ERROR; } - void OnFailureResponse_203(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_376(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_203(const chip::app::DataModel::Nullable & nullableInt8u) + void OnSuccessResponse_376(uint8_t rangeRestrictedInt8u) { - VerifyOrReturn(CheckValueNonNull("nullableInt8u", nullableInt8u)); - VerifyOrReturn(CheckValue("nullableInt8u.Value()", nullableInt8u.Value(), 254)); + VerifyOrReturn(CheckValue("rangeRestrictedInt8u", rangeRestrictedInt8u, 50)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt8uNullValue_204() + CHIP_ERROR TestReadRangeRestrictedUnsigned16BitInteger_377() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt8uArgument; - nullableInt8uArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8uArgument, this, OnSuccessCallback_204, OnFailureCallback_204)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_377, OnFailureCallback_377)); return CHIP_NO_ERROR; } - void OnFailureResponse_204(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_377(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_204() { NextTest(); } + void OnSuccessResponse_377(uint16_t rangeRestrictedInt16u) + { + VerifyOrReturn(CheckValue("rangeRestrictedInt16u", rangeRestrictedInt16u, 200U)); + + NextTest(); + } - CHIP_ERROR TestReadAttributeNullableInt8uNullValue_205() + CHIP_ERROR TestWriteMinValueToARangeRestrictedUnsigned16BitInteger_378() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_205, OnFailureCallback_205)); + uint16_t rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = 0U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16uArgument, this, OnSuccessCallback_378, OnFailureCallback_378)); return CHIP_NO_ERROR; } - void OnFailureResponse_205(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_205(const chip::app::DataModel::Nullable & nullableInt8u) + void OnFailureResponse_378(EmberAfStatus status) { - VerifyOrReturn(CheckValueNull("nullableInt8u", nullableInt8u)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt16uMaxValue_206() + void OnSuccessResponse_378() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedUnsigned16BitInteger_379() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt16uArgument; - nullableInt16uArgument.SetNonNull() = 65534U; + uint16_t rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = 99U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16uArgument, this, OnSuccessCallback_206, OnFailureCallback_206)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16uArgument, this, OnSuccessCallback_379, OnFailureCallback_379)); return CHIP_NO_ERROR; } - void OnFailureResponse_206(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_379(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_206() { NextTest(); } + void OnSuccessResponse_379() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableInt16uMaxValue_207() + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedUnsigned16BitInteger_380() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_207, OnFailureCallback_207)); + uint16_t rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = 1001U; + + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16uArgument, this, OnSuccessCallback_380, OnFailureCallback_380)); return CHIP_NO_ERROR; } - void OnFailureResponse_207(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_207(const chip::app::DataModel::Nullable & nullableInt16u) + void OnFailureResponse_380(EmberAfStatus status) { - VerifyOrReturn(CheckValueNonNull("nullableInt16u", nullableInt16u)); - VerifyOrReturn(CheckValue("nullableInt16u.Value()", nullableInt16u.Value(), 65534U)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt16uInvalidValue_208() + void OnSuccessResponse_380() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteMaxValueToARangeRestrictedUnsigned16BitInteger_381() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt16uArgument; - nullableInt16uArgument.SetNonNull() = 65535U; + uint16_t rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = 65535U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16uArgument, this, OnSuccessCallback_208, OnFailureCallback_208)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16uArgument, this, OnSuccessCallback_381, OnFailureCallback_381)); return CHIP_NO_ERROR; } - void OnFailureResponse_208(EmberAfStatus status) + void OnFailureResponse_381(EmberAfStatus status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - void OnSuccessResponse_208() { ThrowSuccessResponse(); } + void OnSuccessResponse_381() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableInt16uUnchangedValue_209() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_382() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_209, OnFailureCallback_209)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_382, OnFailureCallback_382)); return CHIP_NO_ERROR; } - void OnFailureResponse_209(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_382(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_209(const chip::app::DataModel::Nullable & nullableInt16u) + void OnSuccessResponse_382(uint16_t rangeRestrictedInt16u) { - VerifyOrReturn(CheckValueNonNull("nullableInt16u", nullableInt16u)); - VerifyOrReturn(CheckValue("nullableInt16u.Value()", nullableInt16u.Value(), 65534U)); + VerifyOrReturn(CheckValue("rangeRestrictedInt16u", rangeRestrictedInt16u, 200U)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt16uNullValue_210() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedUnsigned16BitInteger_383() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt16uArgument; - nullableInt16uArgument.SetNull(); + uint16_t rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = 100U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16uArgument, this, OnSuccessCallback_210, OnFailureCallback_210)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16uArgument, this, OnSuccessCallback_383, OnFailureCallback_383)); return CHIP_NO_ERROR; } - void OnFailureResponse_210(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_383(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_210() { NextTest(); } + void OnSuccessResponse_383() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt16uNullValue_211() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_384() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_211, OnFailureCallback_211)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_384, OnFailureCallback_384)); return CHIP_NO_ERROR; } - void OnFailureResponse_211(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_384(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_211(const chip::app::DataModel::Nullable & nullableInt16u) + void OnSuccessResponse_384(uint16_t rangeRestrictedInt16u) { - VerifyOrReturn(CheckValueNull("nullableInt16u", nullableInt16u)); + VerifyOrReturn(CheckValue("rangeRestrictedInt16u", rangeRestrictedInt16u, 100U)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt32uMaxValue_212() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedUnsigned16BitInteger_385() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt32uArgument; - nullableInt32uArgument.SetNonNull() = 4294967294UL; + uint16_t rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = 1000U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32uArgument, this, OnSuccessCallback_212, OnFailureCallback_212)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16uArgument, this, OnSuccessCallback_385, OnFailureCallback_385)); return CHIP_NO_ERROR; } - void OnFailureResponse_212(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_385(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_212() { NextTest(); } + void OnSuccessResponse_385() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt32uMaxValue_213() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_386() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_213, OnFailureCallback_213)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_386, OnFailureCallback_386)); return CHIP_NO_ERROR; } - void OnFailureResponse_213(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_386(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_213(const chip::app::DataModel::Nullable & nullableInt32u) + void OnSuccessResponse_386(uint16_t rangeRestrictedInt16u) { - VerifyOrReturn(CheckValueNonNull("nullableInt32u", nullableInt32u)); - VerifyOrReturn(CheckValue("nullableInt32u.Value()", nullableInt32u.Value(), 4294967294UL)); + VerifyOrReturn(CheckValue("rangeRestrictedInt16u", rangeRestrictedInt16u, 1000U)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt32uInvalidValue_214() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedUnsigned16BitInteger_387() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt32uArgument; - nullableInt32uArgument.SetNonNull() = 4294967295UL; + uint16_t rangeRestrictedInt16uArgument; + rangeRestrictedInt16uArgument = 500U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32uArgument, this, OnSuccessCallback_214, OnFailureCallback_214)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16uArgument, this, OnSuccessCallback_387, OnFailureCallback_387)); return CHIP_NO_ERROR; } - void OnFailureResponse_214(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } + void OnFailureResponse_387(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_214() { ThrowSuccessResponse(); } + void OnSuccessResponse_387() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt32uUnchangedValue_215() + CHIP_ERROR TestVerifyRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_388() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_215, OnFailureCallback_215)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_388, OnFailureCallback_388)); return CHIP_NO_ERROR; } - void OnFailureResponse_215(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_388(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_215(const chip::app::DataModel::Nullable & nullableInt32u) + void OnSuccessResponse_388(uint16_t rangeRestrictedInt16u) { - VerifyOrReturn(CheckValueNonNull("nullableInt32u", nullableInt32u)); - VerifyOrReturn(CheckValue("nullableInt32u.Value()", nullableInt32u.Value(), 4294967294UL)); + VerifyOrReturn(CheckValue("rangeRestrictedInt16u", rangeRestrictedInt16u, 500U)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt32uNullValue_216() + CHIP_ERROR TestReadRangeRestrictedSigned8BitInteger_389() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt32uArgument; - nullableInt32uArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32uArgument, this, OnSuccessCallback_216, OnFailureCallback_216)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_389, OnFailureCallback_389)); return CHIP_NO_ERROR; } - void OnFailureResponse_216(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_389(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_216() { NextTest(); } + void OnSuccessResponse_389(int8_t rangeRestrictedInt8s) + { + VerifyOrReturn(CheckValue("rangeRestrictedInt8s", rangeRestrictedInt8s, -20)); + + NextTest(); + } - CHIP_ERROR TestReadAttributeNullableInt32uNullValue_217() + CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned8BitInteger_390() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_217, OnFailureCallback_217)); + int8_t rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = -128; + + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8sArgument, this, OnSuccessCallback_390, OnFailureCallback_390)); return CHIP_NO_ERROR; } - void OnFailureResponse_217(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_217(const chip::app::DataModel::Nullable & nullableInt32u) + void OnFailureResponse_390(EmberAfStatus status) { - VerifyOrReturn(CheckValueNull("nullableInt32u", nullableInt32u)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt64uMaxValue_218() + void OnSuccessResponse_390() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned8BitInteger_391() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt64uArgument; - nullableInt64uArgument.SetNonNull() = 18446744073709551614ULL; + int8_t rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = -41; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64uArgument, this, OnSuccessCallback_218, OnFailureCallback_218)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8sArgument, this, OnSuccessCallback_391, OnFailureCallback_391)); return CHIP_NO_ERROR; } - void OnFailureResponse_218(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_391(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_218() { NextTest(); } + void OnSuccessResponse_391() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableInt64uMaxValue_219() + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned8BitInteger_392() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_219, OnFailureCallback_219)); + int8_t rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = 51; + + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8sArgument, this, OnSuccessCallback_392, OnFailureCallback_392)); return CHIP_NO_ERROR; } - void OnFailureResponse_219(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_219(const chip::app::DataModel::Nullable & nullableInt64u) + void OnFailureResponse_392(EmberAfStatus status) { - VerifyOrReturn(CheckValueNonNull("nullableInt64u", nullableInt64u)); - VerifyOrReturn(CheckValue("nullableInt64u.Value()", nullableInt64u.Value(), 18446744073709551614ULL)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt64uInvalidValue_220() + void OnSuccessResponse_392() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned8BitInteger_393() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt64uArgument; - nullableInt64uArgument.SetNonNull() = 18446744073709551615ULL; + int8_t rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = 127; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64uArgument, this, OnSuccessCallback_220, OnFailureCallback_220)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8sArgument, this, OnSuccessCallback_393, OnFailureCallback_393)); return CHIP_NO_ERROR; } - void OnFailureResponse_220(EmberAfStatus status) + void OnFailureResponse_393(EmberAfStatus status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - void OnSuccessResponse_220() { ThrowSuccessResponse(); } + void OnSuccessResponse_393() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableInt64uUnchangedValue_221() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueHasNotChanged_394() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_221, OnFailureCallback_221)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_394, OnFailureCallback_394)); return CHIP_NO_ERROR; } - void OnFailureResponse_221(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_394(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_221(const chip::app::DataModel::Nullable & nullableInt64u) + void OnSuccessResponse_394(int8_t rangeRestrictedInt8s) { - VerifyOrReturn(CheckValueNonNull("nullableInt64u", nullableInt64u)); - VerifyOrReturn(CheckValue("nullableInt64u.Value()", nullableInt64u.Value(), 18446744073709551614ULL)); + VerifyOrReturn(CheckValue("rangeRestrictedInt8s", rangeRestrictedInt8s, -20)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt64uNullValue_222() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned8BitInteger_395() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt64uArgument; - nullableInt64uArgument.SetNull(); + int8_t rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = -40; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64uArgument, this, OnSuccessCallback_222, OnFailureCallback_222)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8sArgument, this, OnSuccessCallback_395, OnFailureCallback_395)); return CHIP_NO_ERROR; } - void OnFailureResponse_222(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_395(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_222() { NextTest(); } + void OnSuccessResponse_395() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt64uNullValue_223() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMinValid_396() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_223, OnFailureCallback_223)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_396, OnFailureCallback_396)); return CHIP_NO_ERROR; } - void OnFailureResponse_223(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_396(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_223(const chip::app::DataModel::Nullable & nullableInt64u) + void OnSuccessResponse_396(int8_t rangeRestrictedInt8s) { - VerifyOrReturn(CheckValueNull("nullableInt64u", nullableInt64u)); + VerifyOrReturn(CheckValue("rangeRestrictedInt8s", rangeRestrictedInt8s, -40)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt8sMinValue_224() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned8BitInteger_397() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt8sArgument; - nullableInt8sArgument.SetNonNull() = -127; + int8_t rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = 50; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8sArgument, this, OnSuccessCallback_224, OnFailureCallback_224)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8sArgument, this, OnSuccessCallback_397, OnFailureCallback_397)); return CHIP_NO_ERROR; } - void OnFailureResponse_224(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_397(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_224() { NextTest(); } + void OnSuccessResponse_397() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt8sMinValue_225() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_398() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_225, OnFailureCallback_225)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_398, OnFailureCallback_398)); return CHIP_NO_ERROR; } - void OnFailureResponse_225(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_398(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_225(const chip::app::DataModel::Nullable & nullableInt8s) + void OnSuccessResponse_398(int8_t rangeRestrictedInt8s) { - VerifyOrReturn(CheckValueNonNull("nullableInt8s", nullableInt8s)); - VerifyOrReturn(CheckValue("nullableInt8s.Value()", nullableInt8s.Value(), -127)); + VerifyOrReturn(CheckValue("rangeRestrictedInt8s", rangeRestrictedInt8s, 50)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt8sInvalidValue_226() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned8BitInteger_399() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt8sArgument; - nullableInt8sArgument.SetNonNull() = -128; + int8_t rangeRestrictedInt8sArgument; + rangeRestrictedInt8sArgument = 6; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8sArgument, this, OnSuccessCallback_226, OnFailureCallback_226)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt8sArgument, this, OnSuccessCallback_399, OnFailureCallback_399)); return CHIP_NO_ERROR; } - void OnFailureResponse_226(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } + void OnFailureResponse_399(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_226() { ThrowSuccessResponse(); } + void OnSuccessResponse_399() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt8sUnchangedValue_227() + CHIP_ERROR TestVerifyRangeRestrictedSigned8BitIntegerValueIsAtMidValid_400() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_227, OnFailureCallback_227)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_400, OnFailureCallback_400)); return CHIP_NO_ERROR; } - void OnFailureResponse_227(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_400(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_227(const chip::app::DataModel::Nullable & nullableInt8s) + void OnSuccessResponse_400(int8_t rangeRestrictedInt8s) { - VerifyOrReturn(CheckValueNonNull("nullableInt8s", nullableInt8s)); - VerifyOrReturn(CheckValue("nullableInt8s.Value()", nullableInt8s.Value(), -127)); + VerifyOrReturn(CheckValue("rangeRestrictedInt8s", rangeRestrictedInt8s, 6)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt8sNullValue_228() + CHIP_ERROR TestReadRangeRestrictedSigned16BitInteger_401() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt8sArgument; - nullableInt8sArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt8sArgument, this, OnSuccessCallback_228, OnFailureCallback_228)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_401, OnFailureCallback_401)); return CHIP_NO_ERROR; } - void OnFailureResponse_228(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_401(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_401(int16_t rangeRestrictedInt16s) + { + VerifyOrReturn(CheckValue("rangeRestrictedInt16s", rangeRestrictedInt16s, -100)); - void OnSuccessResponse_228() { NextTest(); } + NextTest(); + } - CHIP_ERROR TestReadAttributeNullableInt8sNullValue_229() + CHIP_ERROR TestWriteMinValueToARangeRestrictedSigned16BitInteger_402() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_229, OnFailureCallback_229)); + int16_t rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = -32768; + + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16sArgument, this, OnSuccessCallback_402, OnFailureCallback_402)); return CHIP_NO_ERROR; } - void OnFailureResponse_229(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_229(const chip::app::DataModel::Nullable & nullableInt8s) + void OnFailureResponse_402(EmberAfStatus status) { - VerifyOrReturn(CheckValueNull("nullableInt8s", nullableInt8s)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt16sMinValue_230() + void OnSuccessResponse_402() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteJustBelowRangeValueToARangeRestrictedSigned16BitInteger_403() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt16sArgument; - nullableInt16sArgument.SetNonNull() = -32767; + int16_t rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = -151; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16sArgument, this, OnSuccessCallback_230, OnFailureCallback_230)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16sArgument, this, OnSuccessCallback_403, OnFailureCallback_403)); return CHIP_NO_ERROR; } - void OnFailureResponse_230(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_403(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_230() { NextTest(); } + void OnSuccessResponse_403() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableInt16sMinValue_231() + CHIP_ERROR TestWriteJustAboveRangeValueToARangeRestrictedSigned16BitInteger_404() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_231, OnFailureCallback_231)); + int16_t rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = 201; + + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16sArgument, this, OnSuccessCallback_404, OnFailureCallback_404)); return CHIP_NO_ERROR; } - void OnFailureResponse_231(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_231(const chip::app::DataModel::Nullable & nullableInt16s) + void OnFailureResponse_404(EmberAfStatus status) { - VerifyOrReturn(CheckValueNonNull("nullableInt16s", nullableInt16s)); - VerifyOrReturn(CheckValue("nullableInt16s.Value()", nullableInt16s.Value(), -32767)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt16sInvalidValue_232() + void OnSuccessResponse_404() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteMaxValueToARangeRestrictedSigned16BitInteger_405() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt16sArgument; - nullableInt16sArgument.SetNonNull() = -32768; + int16_t rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = 32767; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16sArgument, this, OnSuccessCallback_232, OnFailureCallback_232)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16sArgument, this, OnSuccessCallback_405, OnFailureCallback_405)); return CHIP_NO_ERROR; } - void OnFailureResponse_232(EmberAfStatus status) + void OnFailureResponse_405(EmberAfStatus status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - void OnSuccessResponse_232() { ThrowSuccessResponse(); } + void OnSuccessResponse_405() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableInt16sUnchangedValue_233() + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueHasNotChanged_406() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_233, OnFailureCallback_233)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_406, OnFailureCallback_406)); return CHIP_NO_ERROR; } - void OnFailureResponse_233(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_406(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_233(const chip::app::DataModel::Nullable & nullableInt16s) + void OnSuccessResponse_406(int16_t rangeRestrictedInt16s) { - VerifyOrReturn(CheckValueNonNull("nullableInt16s", nullableInt16s)); - VerifyOrReturn(CheckValue("nullableInt16s.Value()", nullableInt16s.Value(), -32767)); + VerifyOrReturn(CheckValue("rangeRestrictedInt16s", rangeRestrictedInt16s, -100)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt16sNullValue_234() + CHIP_ERROR TestWriteMinValidValueToARangeRestrictedSigned16BitInteger_407() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt16sArgument; - nullableInt16sArgument.SetNull(); + int16_t rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = -150; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt16sArgument, this, OnSuccessCallback_234, OnFailureCallback_234)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16sArgument, this, OnSuccessCallback_407, OnFailureCallback_407)); return CHIP_NO_ERROR; } - void OnFailureResponse_234(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_407(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_234() { NextTest(); } + void OnSuccessResponse_407() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt16sNullValue_235() + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMinValid_408() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_235, OnFailureCallback_235)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_408, OnFailureCallback_408)); return CHIP_NO_ERROR; } - void OnFailureResponse_235(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_408(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_235(const chip::app::DataModel::Nullable & nullableInt16s) + void OnSuccessResponse_408(int16_t rangeRestrictedInt16s) { - VerifyOrReturn(CheckValueNull("nullableInt16s", nullableInt16s)); + VerifyOrReturn(CheckValue("rangeRestrictedInt16s", rangeRestrictedInt16s, -150)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt32sMinValue_236() + CHIP_ERROR TestWriteMaxValidValueToARangeRestrictedSigned16BitInteger_409() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt32sArgument; - nullableInt32sArgument.SetNonNull() = -2147483647L; + int16_t rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = 200; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32sArgument, this, OnSuccessCallback_236, OnFailureCallback_236)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16sArgument, this, OnSuccessCallback_409, OnFailureCallback_409)); return CHIP_NO_ERROR; } - void OnFailureResponse_236(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_409(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_236() { NextTest(); } + void OnSuccessResponse_409() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt32sMinValue_237() + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_410() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_237, OnFailureCallback_237)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_410, OnFailureCallback_410)); return CHIP_NO_ERROR; } - void OnFailureResponse_237(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_410(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_237(const chip::app::DataModel::Nullable & nullableInt32s) + void OnSuccessResponse_410(int16_t rangeRestrictedInt16s) { - VerifyOrReturn(CheckValueNonNull("nullableInt32s", nullableInt32s)); - VerifyOrReturn(CheckValue("nullableInt32s.Value()", nullableInt32s.Value(), -2147483647L)); + VerifyOrReturn(CheckValue("rangeRestrictedInt16s", rangeRestrictedInt16s, 200)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt32sInvalidValue_238() + CHIP_ERROR TestWriteMiddleValidValueToARangeRestrictedSigned16BitInteger_411() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt32sArgument; - nullableInt32sArgument.SetNonNull() = -2147483648L; + int16_t rangeRestrictedInt16sArgument; + rangeRestrictedInt16sArgument = 7; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32sArgument, this, OnSuccessCallback_238, OnFailureCallback_238)); + ReturnErrorOnFailure(cluster.WriteAttribute( + rangeRestrictedInt16sArgument, this, OnSuccessCallback_411, OnFailureCallback_411)); return CHIP_NO_ERROR; } - void OnFailureResponse_238(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } + void OnFailureResponse_411(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_238() { ThrowSuccessResponse(); } + void OnSuccessResponse_411() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt32sUnchangedValue_239() + CHIP_ERROR TestVerifyRangeRestrictedSigned16BitIntegerValueIsAtMidValid_412() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_239, OnFailureCallback_239)); + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_412, OnFailureCallback_412)); return CHIP_NO_ERROR; } - void OnFailureResponse_239(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_412(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_239(const chip::app::DataModel::Nullable & nullableInt32s) + void OnSuccessResponse_412(int16_t rangeRestrictedInt16s) { - VerifyOrReturn(CheckValueNonNull("nullableInt32s", nullableInt32s)); - VerifyOrReturn(CheckValue("nullableInt32s.Value()", nullableInt32s.Value(), -2147483647L)); + VerifyOrReturn(CheckValue("rangeRestrictedInt16s", rangeRestrictedInt16s, 7)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt32sNullValue_240() + CHIP_ERROR TestReadNullableRangeRestrictedUnsigned8BitInteger_413() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt32sArgument; - nullableInt32sArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt32sArgument, this, OnSuccessCallback_240, OnFailureCallback_240)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_413, OnFailureCallback_413)); return CHIP_NO_ERROR; } - void OnFailureResponse_240(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_413(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_413(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) + { + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", nullableRangeRestrictedInt8u.Value(), 70)); - void OnSuccessResponse_240() { NextTest(); } + NextTest(); + } - CHIP_ERROR TestReadAttributeNullableInt32sNullValue_241() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned8BitInteger_414() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_241, OnFailureCallback_241)); + chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument.SetNonNull() = 0; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_414, OnFailureCallback_414)); return CHIP_NO_ERROR; } - void OnFailureResponse_241(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_241(const chip::app::DataModel::Nullable & nullableInt32s) + void OnFailureResponse_414(EmberAfStatus status) { - VerifyOrReturn(CheckValueNull("nullableInt32s", nullableInt32s)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt64sMinValue_242() + void OnSuccessResponse_414() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned8BitInteger_415() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt64sArgument; - nullableInt64sArgument.SetNonNull() = -9223372036854775807LL; + chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument.SetNonNull() = 19; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64sArgument, this, OnSuccessCallback_242, OnFailureCallback_242)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_415, OnFailureCallback_415)); return CHIP_NO_ERROR; } - void OnFailureResponse_242(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_415(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_242() { NextTest(); } + void OnSuccessResponse_415() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableInt64sMinValue_243() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned8BitInteger_416() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_243, OnFailureCallback_243)); + chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument.SetNonNull() = 101; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_416, OnFailureCallback_416)); return CHIP_NO_ERROR; } - void OnFailureResponse_243(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_243(const chip::app::DataModel::Nullable & nullableInt64s) + void OnFailureResponse_416(EmberAfStatus status) { - VerifyOrReturn(CheckValueNonNull("nullableInt64s", nullableInt64s)); - VerifyOrReturn(CheckValue("nullableInt64s.Value()", nullableInt64s.Value(), -9223372036854775807LL)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt64sInvalidValue_244() + void OnSuccessResponse_416() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned8BitInteger_417() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt64sArgument; - nullableInt64sArgument.SetNonNull() = -9223372036854775807LL - 1; + chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument.SetNonNull() = 254; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64sArgument, this, OnSuccessCallback_244, OnFailureCallback_244)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_417, OnFailureCallback_417)); return CHIP_NO_ERROR; } - void OnFailureResponse_244(EmberAfStatus status) + void OnFailureResponse_417(EmberAfStatus status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - void OnSuccessResponse_244() { ThrowSuccessResponse(); } + void OnSuccessResponse_417() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableInt64sUnchangedValue_245() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueHasNotChanged_418() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_245, OnFailureCallback_245)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_418, OnFailureCallback_418)); return CHIP_NO_ERROR; } - void OnFailureResponse_245(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_418(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_245(const chip::app::DataModel::Nullable & nullableInt64s) + void OnSuccessResponse_418(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) { - VerifyOrReturn(CheckValueNonNull("nullableInt64s", nullableInt64s)); - VerifyOrReturn(CheckValue("nullableInt64s.Value()", nullableInt64s.Value(), -9223372036854775807LL)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", nullableRangeRestrictedInt8u.Value(), 70)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableInt64sNullValue_246() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned8BitInteger_419() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableInt64sArgument; - nullableInt64sArgument.SetNull(); + chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument.SetNonNull() = 20; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableInt64sArgument, this, OnSuccessCallback_246, OnFailureCallback_246)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_419, OnFailureCallback_419)); return CHIP_NO_ERROR; } - void OnFailureResponse_246(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_419(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_246() { NextTest(); } + void OnSuccessResponse_419() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableInt64sNullValue_247() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMinValid_420() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_247, OnFailureCallback_247)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_420, OnFailureCallback_420)); return CHIP_NO_ERROR; } - void OnFailureResponse_247(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_420(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_247(const chip::app::DataModel::Nullable & nullableInt64s) + void OnSuccessResponse_420(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) { - VerifyOrReturn(CheckValueNull("nullableInt64s", nullableInt64s)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", nullableRangeRestrictedInt8u.Value(), 20)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableSingleMediumValue_248() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned8BitInteger_421() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableFloatSingleArgument; - nullableFloatSingleArgument.SetNonNull() = 0.1f; + chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument.SetNonNull() = 100; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatSingleArgument, this, OnSuccessCallback_248, OnFailureCallback_248)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_421, OnFailureCallback_421)); return CHIP_NO_ERROR; } - void OnFailureResponse_248(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_421(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_248() { NextTest(); } + void OnSuccessResponse_421() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableSingleMediumValue_249() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMaxValid_422() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_249, OnFailureCallback_249)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_422, OnFailureCallback_422)); return CHIP_NO_ERROR; } - void OnFailureResponse_249(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_422(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_249(const chip::app::DataModel::Nullable & nullableFloatSingle) + void OnSuccessResponse_422(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) { - VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); - VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), 0.1f)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", nullableRangeRestrictedInt8u.Value(), 100)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableSingleLargestValue_250() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned8BitInteger_423() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableFloatSingleArgument; - nullableFloatSingleArgument.SetNonNull() = INFINITY; + chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument.SetNonNull() = 50; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatSingleArgument, this, OnSuccessCallback_250, OnFailureCallback_250)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_423, OnFailureCallback_423)); return CHIP_NO_ERROR; } - void OnFailureResponse_250(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_423(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_250() { NextTest(); } + void OnSuccessResponse_423() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableSingleLargestValue_251() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsAtMidValid_424() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_251, OnFailureCallback_251)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_424, OnFailureCallback_424)); return CHIP_NO_ERROR; } - void OnFailureResponse_251(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_424(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_251(const chip::app::DataModel::Nullable & nullableFloatSingle) + void OnSuccessResponse_424(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) { - VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); - VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), INFINITY)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8u.Value()", nullableRangeRestrictedInt8u.Value(), 50)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableSingleSmallestValue_252() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned8BitInteger_425() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableFloatSingleArgument; - nullableFloatSingleArgument.SetNonNull() = -INFINITY; + chip::app::DataModel::Nullable nullableRangeRestrictedInt8uArgument; + nullableRangeRestrictedInt8uArgument.SetNull(); - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatSingleArgument, this, OnSuccessCallback_252, OnFailureCallback_252)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8uArgument, this, OnSuccessCallback_425, OnFailureCallback_425)); return CHIP_NO_ERROR; } - void OnFailureResponse_252(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_425(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_252() { NextTest(); } + void OnSuccessResponse_425() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableSingleSmallestValue_253() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned8BitIntegerValueIsNull_426() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_253, OnFailureCallback_253)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_426, OnFailureCallback_426)); return CHIP_NO_ERROR; } - void OnFailureResponse_253(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_426(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_253(const chip::app::DataModel::Nullable & nullableFloatSingle) + void OnSuccessResponse_426(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8u) { - VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); - VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), -INFINITY)); + VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt8u", nullableRangeRestrictedInt8u)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableSingleNullValue_254() + CHIP_ERROR TestReadNullableRangeRestrictedUnsigned16BitInteger_427() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableFloatSingleArgument; - nullableFloatSingleArgument.SetNull(); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatSingleArgument, this, OnSuccessCallback_254, OnFailureCallback_254)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_427, OnFailureCallback_427)); return CHIP_NO_ERROR; } - void OnFailureResponse_254(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_427(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_254() { NextTest(); } + void OnSuccessResponse_427(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) + { + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", nullableRangeRestrictedInt16u.Value(), 200U)); + + NextTest(); + } - CHIP_ERROR TestReadAttributeNullableSingleNullValue_255() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedUnsigned16BitInteger_428() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_255, OnFailureCallback_255)); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument.SetNonNull() = 0U; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_428, OnFailureCallback_428)); return CHIP_NO_ERROR; } - void OnFailureResponse_255(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_255(const chip::app::DataModel::Nullable & nullableFloatSingle) + void OnFailureResponse_428(EmberAfStatus status) { - VerifyOrReturn(CheckValueNull("nullableFloatSingle", nullableFloatSingle)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableSingle0Value_256() + void OnSuccessResponse_428() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedUnsigned16BitInteger_429() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableFloatSingleArgument; - nullableFloatSingleArgument.SetNonNull() = 0.0f; + chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument.SetNonNull() = 99U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatSingleArgument, this, OnSuccessCallback_256, OnFailureCallback_256)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_429, OnFailureCallback_429)); return CHIP_NO_ERROR; } - void OnFailureResponse_256(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_429(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_256() { NextTest(); } + void OnSuccessResponse_429() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableSingle0Value_257() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedUnsigned16BitInteger_430() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_257, OnFailureCallback_257)); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument.SetNonNull() = 1001U; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_430, OnFailureCallback_430)); return CHIP_NO_ERROR; } - void OnFailureResponse_257(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_257(const chip::app::DataModel::Nullable & nullableFloatSingle) + void OnFailureResponse_430(EmberAfStatus status) { - VerifyOrReturn(CheckValueNonNull("nullableFloatSingle", nullableFloatSingle)); - VerifyOrReturn(CheckValue("nullableFloatSingle.Value()", nullableFloatSingle.Value(), 0.0f)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableDoubleMediumValue_258() + void OnSuccessResponse_430() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedUnsigned16BitInteger_431() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableFloatDoubleArgument; - nullableFloatDoubleArgument.SetNonNull() = 0.1234567890123; + chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument.SetNonNull() = 65534U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatDoubleArgument, this, OnSuccessCallback_258, OnFailureCallback_258)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_431, OnFailureCallback_431)); return CHIP_NO_ERROR; } - void OnFailureResponse_258(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_431(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_258() { NextTest(); } + void OnSuccessResponse_431() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableDoubleMediumValue_259() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueHasNotChanged_432() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_259, OnFailureCallback_259)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_432, OnFailureCallback_432)); return CHIP_NO_ERROR; } - void OnFailureResponse_259(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_432(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_259(const chip::app::DataModel::Nullable & nullableFloatDouble) + void OnSuccessResponse_432(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) { - VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); - VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), 0.1234567890123)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", nullableRangeRestrictedInt16u.Value(), 200U)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableDoubleLargestValue_260() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedUnsigned16BitInteger_433() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableFloatDoubleArgument; - nullableFloatDoubleArgument.SetNonNull() = INFINITY; + chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument.SetNonNull() = 100U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatDoubleArgument, this, OnSuccessCallback_260, OnFailureCallback_260)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_433, OnFailureCallback_433)); return CHIP_NO_ERROR; } - void OnFailureResponse_260(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_433(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_260() { NextTest(); } + void OnSuccessResponse_433() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableDoubleLargestValue_261() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMinValid_434() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_261, OnFailureCallback_261)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_434, OnFailureCallback_434)); return CHIP_NO_ERROR; } - void OnFailureResponse_261(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_434(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_261(const chip::app::DataModel::Nullable & nullableFloatDouble) + void OnSuccessResponse_434(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) { - VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); - VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), INFINITY)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", nullableRangeRestrictedInt16u.Value(), 100U)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableDoubleSmallestValue_262() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedUnsigned16BitInteger_435() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableFloatDoubleArgument; - nullableFloatDoubleArgument.SetNonNull() = -INFINITY; + chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument.SetNonNull() = 1000U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatDoubleArgument, this, OnSuccessCallback_262, OnFailureCallback_262)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_435, OnFailureCallback_435)); return CHIP_NO_ERROR; } - void OnFailureResponse_262(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_435(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_262() { NextTest(); } + void OnSuccessResponse_435() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableDoubleSmallestValue_263() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMaxValid_436() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_263, OnFailureCallback_263)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_436, OnFailureCallback_436)); return CHIP_NO_ERROR; } - void OnFailureResponse_263(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_436(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_263(const chip::app::DataModel::Nullable & nullableFloatDouble) + void OnSuccessResponse_436(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) { - VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); - VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), -INFINITY)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", nullableRangeRestrictedInt16u.Value(), 1000U)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableDoubleNullValue_264() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedUnsigned16BitInteger_437() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableFloatDoubleArgument; - nullableFloatDoubleArgument.SetNull(); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument.SetNonNull() = 500U; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatDoubleArgument, this, OnSuccessCallback_264, OnFailureCallback_264)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_437, OnFailureCallback_437)); return CHIP_NO_ERROR; } - void OnFailureResponse_264(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_437(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_264() { NextTest(); } + void OnSuccessResponse_437() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableDoubleNullValue_265() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsAtMidValid_438() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_265, OnFailureCallback_265)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_438, OnFailureCallback_438)); return CHIP_NO_ERROR; } - void OnFailureResponse_265(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_438(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_265(const chip::app::DataModel::Nullable & nullableFloatDouble) + void OnSuccessResponse_438(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) { - VerifyOrReturn(CheckValueNull("nullableFloatDouble", nullableFloatDouble)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16u.Value()", nullableRangeRestrictedInt16u.Value(), 500U)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableDouble0Value_266() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedUnsigned16BitInteger_439() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableFloatDoubleArgument; - nullableFloatDoubleArgument.SetNonNull() = 0; + chip::app::DataModel::Nullable nullableRangeRestrictedInt16uArgument; + nullableRangeRestrictedInt16uArgument.SetNull(); - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableFloatDoubleArgument, this, OnSuccessCallback_266, OnFailureCallback_266)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16uArgument, this, OnSuccessCallback_439, OnFailureCallback_439)); return CHIP_NO_ERROR; } - void OnFailureResponse_266(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_439(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_266() { NextTest(); } + void OnSuccessResponse_439() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableDouble0Value_267() + CHIP_ERROR TestVerifyNullableRangeRestrictedUnsigned16BitIntegerValueIsNull_440() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_267, OnFailureCallback_267)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_440, OnFailureCallback_440)); return CHIP_NO_ERROR; } - void OnFailureResponse_267(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_440(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_267(const chip::app::DataModel::Nullable & nullableFloatDouble) + void OnSuccessResponse_440(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16u) { - VerifyOrReturn(CheckValueNonNull("nullableFloatDouble", nullableFloatDouble)); - VerifyOrReturn(CheckValue("nullableFloatDouble.Value()", nullableFloatDouble.Value(), 0)); + VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt16u", nullableRangeRestrictedInt16u)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableEnum8MaxValue_268() + CHIP_ERROR TestReadNullableRangeRestrictedSigned8BitInteger_441() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableEnum8Argument; - nullableEnum8Argument.SetNonNull() = 254; - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum8Argument, this, OnSuccessCallback_268, OnFailureCallback_268)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_441, OnFailureCallback_441)); return CHIP_NO_ERROR; } - void OnFailureResponse_268(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_441(EmberAfStatus status) { ThrowFailureResponse(); } + + void OnSuccessResponse_441(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) + { + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", nullableRangeRestrictedInt8s.Value(), -20)); - void OnSuccessResponse_268() { NextTest(); } + NextTest(); + } - CHIP_ERROR TestReadAttributeNullableEnum8MaxValue_269() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned8BitInteger_442() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_269, OnFailureCallback_269)); + chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument.SetNonNull() = -127; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_442, OnFailureCallback_442)); return CHIP_NO_ERROR; } - void OnFailureResponse_269(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_269(const chip::app::DataModel::Nullable & nullableEnum8) + void OnFailureResponse_442(EmberAfStatus status) { - VerifyOrReturn(CheckValueNonNull("nullableEnum8", nullableEnum8)); - VerifyOrReturn(CheckValue("nullableEnum8.Value()", nullableEnum8.Value(), 254)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableEnum8InvalidValue_270() + void OnSuccessResponse_442() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned8BitInteger_443() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableEnum8Argument; - nullableEnum8Argument.SetNonNull() = 255; + chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument.SetNonNull() = -41; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum8Argument, this, OnSuccessCallback_270, OnFailureCallback_270)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_443, OnFailureCallback_443)); return CHIP_NO_ERROR; } - void OnFailureResponse_270(EmberAfStatus status) + void OnFailureResponse_443(EmberAfStatus status) { VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - void OnSuccessResponse_270() { ThrowSuccessResponse(); } + void OnSuccessResponse_443() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableEnum8UnchangedValue_271() + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned8BitInteger_444() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_271, OnFailureCallback_271)); + chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument.SetNonNull() = 51; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_444, OnFailureCallback_444)); return CHIP_NO_ERROR; } - void OnFailureResponse_271(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_271(const chip::app::DataModel::Nullable & nullableEnum8) + void OnFailureResponse_444(EmberAfStatus status) { - VerifyOrReturn(CheckValueNonNull("nullableEnum8", nullableEnum8)); - VerifyOrReturn(CheckValue("nullableEnum8.Value()", nullableEnum8.Value(), 254)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableEnum8NullValue_272() + void OnSuccessResponse_444() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned8BitInteger_445() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableEnum8Argument; - nullableEnum8Argument.SetNull(); + chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument.SetNonNull() = 127; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum8Argument, this, OnSuccessCallback_272, OnFailureCallback_272)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_445, OnFailureCallback_445)); return CHIP_NO_ERROR; } - void OnFailureResponse_272(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_445(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_272() { NextTest(); } + void OnSuccessResponse_445() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableEnum8NullValue_273() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueHasNotChanged_446() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_273, OnFailureCallback_273)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_446, OnFailureCallback_446)); return CHIP_NO_ERROR; } - void OnFailureResponse_273(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_446(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_273(const chip::app::DataModel::Nullable & nullableEnum8) + void OnSuccessResponse_446(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) { - VerifyOrReturn(CheckValueNull("nullableEnum8", nullableEnum8)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", nullableRangeRestrictedInt8s.Value(), -20)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableEnum16MaxValue_274() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned8BitInteger_447() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableEnum16Argument; - nullableEnum16Argument.SetNonNull() = 65534U; + chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument.SetNonNull() = -40; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum16Argument, this, OnSuccessCallback_274, OnFailureCallback_274)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_447, OnFailureCallback_447)); return CHIP_NO_ERROR; } - void OnFailureResponse_274(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_447(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_274() { NextTest(); } + void OnSuccessResponse_447() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableEnum16MaxValue_275() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMinValid_448() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_275, OnFailureCallback_275)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_448, OnFailureCallback_448)); return CHIP_NO_ERROR; } - void OnFailureResponse_275(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_448(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_275(const chip::app::DataModel::Nullable & nullableEnum16) + void OnSuccessResponse_448(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) { - VerifyOrReturn(CheckValueNonNull("nullableEnum16", nullableEnum16)); - VerifyOrReturn(CheckValue("nullableEnum16.Value()", nullableEnum16.Value(), 65534U)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", nullableRangeRestrictedInt8s.Value(), -40)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableEnum16InvalidValue_276() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned8BitInteger_449() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableEnum16Argument; - nullableEnum16Argument.SetNonNull() = 65535U; + chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument.SetNonNull() = 50; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum16Argument, this, OnSuccessCallback_276, OnFailureCallback_276)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_449, OnFailureCallback_449)); return CHIP_NO_ERROR; } - void OnFailureResponse_276(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); - NextTest(); - } + void OnFailureResponse_449(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_276() { ThrowSuccessResponse(); } + void OnSuccessResponse_449() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableEnum16UnchangedValue_277() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMaxValid_450() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_277, OnFailureCallback_277)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_450, OnFailureCallback_450)); return CHIP_NO_ERROR; } - void OnFailureResponse_277(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_450(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_277(const chip::app::DataModel::Nullable & nullableEnum16) + void OnSuccessResponse_450(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) { - VerifyOrReturn(CheckValueNonNull("nullableEnum16", nullableEnum16)); - VerifyOrReturn(CheckValue("nullableEnum16.Value()", nullableEnum16.Value(), 65534U)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", nullableRangeRestrictedInt8s.Value(), 50)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableEnum16NullValue_278() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned8BitInteger_451() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableEnum16Argument; - nullableEnum16Argument.SetNull(); + chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument.SetNonNull() = 6; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableEnum16Argument, this, OnSuccessCallback_278, OnFailureCallback_278)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_451, OnFailureCallback_451)); return CHIP_NO_ERROR; } - void OnFailureResponse_278(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_451(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_278() { NextTest(); } + void OnSuccessResponse_451() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableEnum16NullValue_279() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtMidValid_452() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_279, OnFailureCallback_279)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_452, OnFailureCallback_452)); return CHIP_NO_ERROR; } - void OnFailureResponse_279(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_452(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_279(const chip::app::DataModel::Nullable & nullableEnum16) + void OnSuccessResponse_452(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) { - VerifyOrReturn(CheckValueNull("nullableEnum16", nullableEnum16)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt8s.Value()", nullableRangeRestrictedInt8s.Value(), 6)); NextTest(); } - CHIP_ERROR TestReadAttributeNullableOctetStringDefaultValue_280() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned8BitInteger_453() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_280, OnFailureCallback_280)); + chip::app::DataModel::Nullable nullableRangeRestrictedInt8sArgument; + nullableRangeRestrictedInt8sArgument.SetNull(); + + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt8sArgument, this, OnSuccessCallback_453, OnFailureCallback_453)); return CHIP_NO_ERROR; } - void OnFailureResponse_280(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_280(const chip::app::DataModel::Nullable & nullableOctetString) - { - VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); - VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), - chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); + void OnFailureResponse_453(EmberAfStatus status) { ThrowFailureResponse(); } - NextTest(); - } + void OnSuccessResponse_453() { NextTest(); } - CHIP_ERROR TestWriteAttributeNullableOctetString_281() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned8BitIntegerValueIsAtNull_454() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableOctetStringArgument; - nullableOctetStringArgument.SetNonNull() = - chip::ByteSpan(chip::Uint8::from_const_char("TestValuegarbage: not in length on purpose"), 9); - - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableOctetStringArgument, this, OnSuccessCallback_281, OnFailureCallback_281)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_454, OnFailureCallback_454)); return CHIP_NO_ERROR; } - void OnFailureResponse_281(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_454(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_281() { NextTest(); } + void OnSuccessResponse_454(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt8s) + { + VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt8s", nullableRangeRestrictedInt8s)); + + NextTest(); + } - CHIP_ERROR TestReadAttributeNullableOctetString_282() + CHIP_ERROR TestReadNullableRangeRestrictedSigned16BitInteger_455() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_282, OnFailureCallback_282)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_455, OnFailureCallback_455)); return CHIP_NO_ERROR; } - void OnFailureResponse_282(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_455(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_282(const chip::app::DataModel::Nullable & nullableOctetString) + void OnSuccessResponse_455(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) { - VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); - VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), - chip::ByteSpan(chip::Uint8::from_const_char("TestValue"), 9))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", nullableRangeRestrictedInt16s.Value(), -100)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableOctetString_283() + CHIP_ERROR TestWriteMinValueToANullableRangeRestrictedSigned16BitInteger_456() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableOctetStringArgument; - nullableOctetStringArgument.SetNull(); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument.SetNonNull() = -32767; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableOctetStringArgument, this, OnSuccessCallback_283, OnFailureCallback_283)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_456, OnFailureCallback_456)); return CHIP_NO_ERROR; } - void OnFailureResponse_283(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_456(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_283() { NextTest(); } + void OnSuccessResponse_456() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableOctetString_284() + CHIP_ERROR TestWriteJustBelowRangeValueToANullableRangeRestrictedSigned16BitInteger_457() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_284, OnFailureCallback_284)); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument.SetNonNull() = -151; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_457, OnFailureCallback_457)); return CHIP_NO_ERROR; } - void OnFailureResponse_284(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_284(const chip::app::DataModel::Nullable & nullableOctetString) + void OnFailureResponse_457(EmberAfStatus status) { - VerifyOrReturn(CheckValueNull("nullableOctetString", nullableOctetString)); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableOctetString_285() + void OnSuccessResponse_457() { ThrowSuccessResponse(); } + + CHIP_ERROR TestWriteJustAboveRangeValueToANullableRangeRestrictedSigned16BitInteger_458() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableOctetStringArgument; - nullableOctetStringArgument.SetNonNull() = - chip::ByteSpan(chip::Uint8::from_const_char("garbage: not in length on purpose"), 0); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument.SetNonNull() = 201; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableOctetStringArgument, this, OnSuccessCallback_285, OnFailureCallback_285)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_458, OnFailureCallback_458)); return CHIP_NO_ERROR; } - void OnFailureResponse_285(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_458(EmberAfStatus status) + { + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + } - void OnSuccessResponse_285() { NextTest(); } + void OnSuccessResponse_458() { ThrowSuccessResponse(); } - CHIP_ERROR TestReadAttributeNullableOctetString_286() + CHIP_ERROR TestWriteMaxValueToANullableRangeRestrictedSigned16BitInteger_459() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_286, OnFailureCallback_286)); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument.SetNonNull() = 32767; + + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_459, OnFailureCallback_459)); return CHIP_NO_ERROR; } - void OnFailureResponse_286(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_286(const chip::app::DataModel::Nullable & nullableOctetString) + void OnFailureResponse_459(EmberAfStatus status) { - VerifyOrReturn(CheckValueNonNull("nullableOctetString", nullableOctetString)); - VerifyOrReturn(CheckValueAsString("nullableOctetString.Value()", nullableOctetString.Value(), - chip::ByteSpan(chip::Uint8::from_const_char(""), 0))); - + VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); NextTest(); } - CHIP_ERROR TestReadAttributeNullableCharStringDefaultValue_287() + void OnSuccessResponse_459() { ThrowSuccessResponse(); } + + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueHasNotChanged_460() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_287, OnFailureCallback_287)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_460, OnFailureCallback_460)); return CHIP_NO_ERROR; } - void OnFailureResponse_287(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_460(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_287(const chip::app::DataModel::Nullable & nullableCharString) + void OnSuccessResponse_460(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) { - VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); - VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", nullableRangeRestrictedInt16s.Value(), -100)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableCharString_288() + CHIP_ERROR TestWriteMinValidValueToANullableRangeRestrictedSigned16BitInteger_461() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableCharStringArgument; - nullableCharStringArgument.SetNonNull() = chip::Span("☉T☉garbage: not in length on purpose", 7); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument.SetNonNull() = -150; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableCharStringArgument, this, OnSuccessCallback_288, OnFailureCallback_288)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_461, OnFailureCallback_461)); return CHIP_NO_ERROR; } - void OnFailureResponse_288(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_461(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_288() { NextTest(); } + void OnSuccessResponse_461() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableCharString_289() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMinValid_462() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_289, OnFailureCallback_289)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_462, OnFailureCallback_462)); return CHIP_NO_ERROR; } - void OnFailureResponse_289(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_462(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_289(const chip::app::DataModel::Nullable & nullableCharString) + void OnSuccessResponse_462(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) { - VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); - VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("☉T☉", 7))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", nullableRangeRestrictedInt16s.Value(), -150)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableCharStringValueTooLong_290() + CHIP_ERROR TestWriteMaxValidValueToANullableRangeRestrictedSigned16BitInteger_463() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableCharStringArgument; - nullableCharStringArgument.SetNull(); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument.SetNonNull() = 200; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableCharStringArgument, this, OnSuccessCallback_290, OnFailureCallback_290)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_463, OnFailureCallback_463)); return CHIP_NO_ERROR; } - void OnFailureResponse_290(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_463(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_290() { NextTest(); } + void OnSuccessResponse_463() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableCharString_291() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMaxValid_464() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_291, OnFailureCallback_291)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_464, OnFailureCallback_464)); return CHIP_NO_ERROR; } - void OnFailureResponse_291(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_464(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_291(const chip::app::DataModel::Nullable & nullableCharString) + void OnSuccessResponse_464(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) { - VerifyOrReturn(CheckValueNull("nullableCharString", nullableCharString)); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", nullableRangeRestrictedInt16s.Value(), 200)); NextTest(); } - CHIP_ERROR TestWriteAttributeNullableCharStringEmpty_292() + CHIP_ERROR TestWriteMiddleValidValueToANullableRangeRestrictedSigned16BitInteger_465() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableCharStringArgument; - nullableCharStringArgument.SetNonNull() = chip::Span("garbage: not in length on purpose", 0); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument.SetNonNull() = 7; - ReturnErrorOnFailure(cluster.WriteAttribute( - nullableCharStringArgument, this, OnSuccessCallback_292, OnFailureCallback_292)); + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_465, OnFailureCallback_465)); return CHIP_NO_ERROR; } - void OnFailureResponse_292(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_465(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_292() { NextTest(); } + void OnSuccessResponse_465() { NextTest(); } - CHIP_ERROR TestReadAttributeNullableCharString_293() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsAtMidValid_466() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_293, OnFailureCallback_293)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_466, OnFailureCallback_466)); return CHIP_NO_ERROR; } - void OnFailureResponse_293(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_466(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_293(const chip::app::DataModel::Nullable & nullableCharString) + void OnSuccessResponse_466(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) { - VerifyOrReturn(CheckValueNonNull("nullableCharString", nullableCharString)); - VerifyOrReturn(CheckValueAsString("nullableCharString.Value()", nullableCharString.Value(), chip::CharSpan("", 0))); + VerifyOrReturn(CheckValueNonNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); + VerifyOrReturn(CheckValue("nullableRangeRestrictedInt16s.Value()", nullableRangeRestrictedInt16s.Value(), 7)); NextTest(); } - CHIP_ERROR TestReadAttributeFromNonexistentEndpoint_294() + CHIP_ERROR TestWriteNullValueToANullableRangeRestrictedSigned16BitInteger_467() { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 200; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_294, OnFailureCallback_294)); + chip::app::DataModel::Nullable nullableRangeRestrictedInt16sArgument; + nullableRangeRestrictedInt16sArgument.SetNull(); + + ReturnErrorOnFailure( + cluster.WriteAttribute( + nullableRangeRestrictedInt16sArgument, this, OnSuccessCallback_467, OnFailureCallback_467)); return CHIP_NO_ERROR; } - void OnFailureResponse_294(EmberAfStatus status) - { - VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); - NextTest(); - } + void OnFailureResponse_467(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_294(const chip::app::DataModel::DecodableList & listInt8u) { ThrowSuccessResponse(); } + void OnSuccessResponse_467() { NextTest(); } - CHIP_ERROR TestReadAttributeFromNonexistentCluster_295() + CHIP_ERROR TestVerifyNullableRangeRestrictedSigned16BitIntegerValueIsNull_468() { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_295, OnFailureCallback_295)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_468, OnFailureCallback_468)); return CHIP_NO_ERROR; } - void OnFailureResponse_295(EmberAfStatus status) - { - VerifyOrReturn(CheckConstraintNotValue("status", status, 0)); - NextTest(); - } - - void OnSuccessResponse_295(const chip::app::DataModel::DecodableList & listInt8u) { ThrowSuccessResponse(); } + void OnFailureResponse_468(EmberAfStatus status) { ThrowFailureResponse(); } - CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_296() + void OnSuccessResponse_468(const chip::app::DataModel::Nullable & nullableRangeRestrictedInt16s) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type; + VerifyOrReturn(CheckValueNull("nullableRangeRestrictedInt16s", nullableRangeRestrictedInt16s)); - RequestType request; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_296(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_296(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_296(EmberAfStatus status) - { - VerifyOrReturn(CheckValue("status", status, EMBER_ZCL_STATUS_INVALID_VALUE)); NextTest(); } - - void OnSuccessResponse_296() { ThrowSuccessResponse(); } - - CHIP_ERROR TestSendACommandThatTakesAnOptionalParameterButDoNotSetIt_297() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::TestCluster::Commands::TestSimpleOptionalArgumentRequest::Type; - - RequestType request; - request.arg1.Emplace() = 1; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_297(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_297(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_297(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_297() { NextTest(); } }; class TestClusterComplexTypes : public TestCommand @@ -45344,8 +51561,7 @@ class TestConstraints : public TestCommand void OnSuccessResponse_2(uint32_t int32u) { - VerifyOrReturn(CheckConstraintMinValue("int32u", int32u, 5)); - + VerifyOrReturn(CheckConstraintMinValue("int32u", int32u, 5UL)); NextTest(); } @@ -45364,8 +51580,7 @@ class TestConstraints : public TestCommand void OnSuccessResponse_3(uint32_t int32u) { - VerifyOrReturn(CheckConstraintMaxValue("int32u", int32u, 5)); - + VerifyOrReturn(CheckConstraintMaxValue("int32u", int32u, 5UL)); NextTest(); } @@ -45441,7 +51656,6 @@ class TestConstraints : public TestCommand void OnSuccessResponse_7(chip::CharSpan charString) { VerifyOrReturn(CheckConstraintMinLength("charString", charString.size(), 5)); - NextTest(); } @@ -45461,7 +51675,6 @@ class TestConstraints : public TestCommand void OnSuccessResponse_8(chip::CharSpan charString) { VerifyOrReturn(CheckConstraintMaxLength("charString", charString.size(), 20)); - NextTest(); } @@ -45481,7 +51694,6 @@ class TestConstraints : public TestCommand void OnSuccessResponse_9(chip::CharSpan charString) { VerifyOrReturn(CheckConstraintStartsWith("charString", charString, "**")); - NextTest(); } @@ -45501,7 +51713,6 @@ class TestConstraints : public TestCommand void OnSuccessResponse_10(chip::CharSpan charString) { VerifyOrReturn(CheckConstraintEndsWith("charString", charString, "**")); - NextTest(); } @@ -49038,24 +55249,16 @@ class TestBasicInformation : public TestCommand err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read location\n"); - err = TestReadLocation_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write location\n"); + err = TestWriteLocation_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Write location\n"); - err = TestWriteLocation_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Restore initial location value\n"); + err = TestRestoreInitialLocationValue_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read back location\n"); - err = TestReadBackLocation_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Restore initial location value\n"); - err = TestRestoreInitialLocationValue_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read AttributeList value\n"); - err = TestReadAttributeListValue_5(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read AttributeList value\n"); + err = TestReadAttributeListValue_3(); break; } @@ -49068,17 +55271,14 @@ class TestBasicInformation : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 4; static void OnFailureCallback_1(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, chip::CharSpan location) - { - (static_cast(context))->OnSuccessResponse_1(location); - } + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } static void OnFailureCallback_2(void * context, EmberAfStatus status) { @@ -49092,26 +55292,9 @@ class TestBasicInformation : public TestCommand (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_3(void * context, chip::CharSpan location) - { - (static_cast(context))->OnSuccessResponse_3(location); - } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context) { (static_cast(context))->OnSuccessResponse_4(); } - - static void OnFailureCallback_5(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_5(status); - } - - static void OnSuccessCallback_5(void * context, const chip::app::DataModel::DecodableList & attributeList) + static void OnSuccessCallback_3(void * context, const chip::app::DataModel::DecodableList & attributeList) { - (static_cast(context))->OnSuccessResponse_5(attributeList); + (static_cast(context))->OnSuccessResponse_3(attributeList); } // @@ -49124,27 +55307,7 @@ class TestBasicInformation : public TestCommand return WaitForCommissionee(); } - CHIP_ERROR TestReadLocation_1() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_1, OnFailureCallback_1)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(chip::CharSpan location) - { - VerifyOrReturn(CheckValueAsString("location", location, chip::CharSpan("XX", 2))); - - NextTest(); - } - - CHIP_ERROR TestWriteLocation_2() + CHIP_ERROR TestWriteLocation_1() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; @@ -49154,35 +55317,15 @@ class TestBasicInformation : public TestCommand locationArgument = chip::Span("usgarbage: not in length on purpose", 2); ReturnErrorOnFailure(cluster.WriteAttribute( - locationArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2() { NextTest(); } - - CHIP_ERROR TestReadBackLocation_3() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_3, OnFailureCallback_3)); + locationArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); return CHIP_NO_ERROR; } - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3(chip::CharSpan location) - { - VerifyOrReturn(CheckValueAsString("location", location, chip::CharSpan("us", 2))); + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - NextTest(); - } + void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestRestoreInitialLocationValue_4() + CHIP_ERROR TestRestoreInitialLocationValue_2() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; @@ -49192,28 +55335,28 @@ class TestBasicInformation : public TestCommand locationArgument = chip::Span("garbage: not in length on purpose", 0); ReturnErrorOnFailure(cluster.WriteAttribute( - locationArgument, this, OnSuccessCallback_4, OnFailureCallback_4)); + locationArgument, this, OnSuccessCallback_2, OnFailureCallback_2)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_4() { NextTest(); } + void OnSuccessResponse_2() { NextTest(); } - CHIP_ERROR TestReadAttributeListValue_5() + CHIP_ERROR TestReadAttributeListValue_3() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; chip::Controller::BasicClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_5, OnFailureCallback_5)); + this, OnSuccessCallback_3, OnFailureCallback_3)); return CHIP_NO_ERROR; } - void OnFailureResponse_5(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(const chip::app::DataModel::DecodableList & attributeList) + void OnSuccessResponse_3(const chip::app::DataModel::DecodableList & attributeList) { auto iter = attributeList.begin(); VerifyOrReturn(CheckNextListItemDecodes("attributeList", iter, 0)); @@ -49409,84 +55552,52 @@ class TestGroupsCluster : public TestCommand err = TestGetGroupMembership1All_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Add Group 2 (new)\n"); - err = TestAddGroup2New_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : View Group 3 (not found)\n"); + err = TestViewGroup3NotFound_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : View Group 2 (new)\n"); - err = TestViewGroup2New_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : View Group 1 (existing)\n"); + err = TestViewGroup1Existing_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : View Group 3 (not found)\n"); - err = TestViewGroup3NotFound_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Remove Group 0 (invalid)\n"); + err = TestRemoveGroup0Invalid_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Add Group 3 (new)\n"); - err = TestAddGroup3New_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Remove Group 4 (not found)\n"); + err = TestRemoveGroup4NotFound_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : View Group 1 (existing)\n"); - err = TestViewGroup1Existing_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : View Group 1 (not removed)\n"); + err = TestViewGroup1NotRemoved_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : View Group 2 (existing)\n"); - err = TestViewGroup2Existing_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : View Group 2 (removed)\n"); + err = TestViewGroup2Removed_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Get Group Membership 2\n"); - err = TestGetGroupMembership2_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Get Group Membership 3\n"); + err = TestGetGroupMembership3_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : View Group 3 (new)\n"); - err = TestViewGroup3New_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Remove All\n"); + err = TestRemoveAll_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Remove Group 0 (invalid)\n"); - err = TestRemoveGroup0Invalid_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : View Group 1 (removed)\n"); + err = TestViewGroup1Removed_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Remove Group 4 (not found)\n"); - err = TestRemoveGroup4NotFound_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : View Group 2 (still removed)\n"); + err = TestViewGroup2StillRemoved_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Remove Group 2 (existing)\n"); - err = TestRemoveGroup2Existing_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : View Group 3 (removed)\n"); + err = TestViewGroup3Removed_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : View Group 1 (not removed)\n"); - err = TestViewGroup1NotRemoved_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : View Group 2 (removed)\n"); - err = TestViewGroup2Removed_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : View Group 3 (not removed)\n"); - err = TestViewGroup3NotRemoved_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Get Group Membership 3\n"); - err = TestGetGroupMembership3_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Remove All\n"); - err = TestRemoveAll_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : View Group 1 (removed)\n"); - err = TestViewGroup1Removed_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : View Group 2 (still removed)\n"); - err = TestViewGroup2StillRemoved_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : View Group 3 (removed)\n"); - err = TestViewGroup3Removed_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Get Group Membership 4\n"); - err = TestGetGroupMembership4_26(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Get Group Membership 4\n"); + err = TestGetGroupMembership4_18(); break; } @@ -49499,7 +55610,7 @@ class TestGroupsCluster : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 27; + const uint16_t mTestCount = 19; // // Tests methods @@ -49704,17 +55815,16 @@ class TestGroupsCluster : public TestCommand NextTest(); } - CHIP_ERROR TestAddGroup2New_7() + CHIP_ERROR TestViewGroup3NotFound_7() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::AddGroup::Type; + using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; RequestType request; - request.groupId = 4369U; - request.groupName = chip::Span("Group #2garbage: not in length on purpose", 8); + request.groupId = 32767U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_7(data.status, data.groupId); + (static_cast(context))->OnSuccessResponse_7(data.status, data.groupId, data.groupName); }; auto failure = [](void * context, EmberAfStatus status) { @@ -49727,22 +55837,22 @@ class TestGroupsCluster : public TestCommand void OnFailureResponse_7(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(uint8_t status, uint16_t groupId) + void OnSuccessResponse_7(uint8_t status, uint16_t groupId, chip::CharSpan groupName) { - VerifyOrReturn(CheckValue("status", status, 0)); + VerifyOrReturn(CheckValue("status", status, 139)); - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); + VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); NextTest(); } - CHIP_ERROR TestViewGroup2New_8() + CHIP_ERROR TestViewGroup1Existing_8() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; RequestType request; - request.groupId = 4369U; + request.groupId = 1U; auto success = [](void * context, const typename RequestType::ResponseType & data) { (static_cast(context))->OnSuccessResponse_8(data.status, data.groupId, data.groupName); @@ -49762,23 +55872,23 @@ class TestGroupsCluster : public TestCommand { VerifyOrReturn(CheckValue("status", status, 0)); - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); + VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #2", 8))); + VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #1", 8))); NextTest(); } - CHIP_ERROR TestViewGroup3NotFound_9() + CHIP_ERROR TestRemoveGroup0Invalid_9() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; + using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; RequestType request; - request.groupId = 32767U; + request.groupId = 0U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_9(data.status, data.groupId, data.groupName); + (static_cast(context))->OnSuccessResponse_9(data.status, data.groupId); }; auto failure = [](void * context, EmberAfStatus status) { @@ -49791,23 +55901,22 @@ class TestGroupsCluster : public TestCommand void OnFailureResponse_9(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_9(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + void OnSuccessResponse_9(uint8_t status, uint16_t groupId) { - VerifyOrReturn(CheckValue("status", status, 139)); + VerifyOrReturn(CheckValue("status", status, 135)); - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); + VerifyOrReturn(CheckValue("groupId", groupId, 0U)); NextTest(); } - CHIP_ERROR TestAddGroup3New_10() + CHIP_ERROR TestRemoveGroup4NotFound_10() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::AddGroup::Type; + using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; RequestType request; - request.groupId = 32767U; - request.groupName = chip::Span("Group #3garbage: not in length on purpose", 8); + request.groupId = 4U; auto success = [](void * context, const typename RequestType::ResponseType & data) { (static_cast(context))->OnSuccessResponse_10(data.status, data.groupId); @@ -49825,14 +55934,14 @@ class TestGroupsCluster : public TestCommand void OnSuccessResponse_10(uint8_t status, uint16_t groupId) { - VerifyOrReturn(CheckValue("status", status, 0)); + VerifyOrReturn(CheckValue("status", status, 139)); - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); + VerifyOrReturn(CheckValue("groupId", groupId, 4U)); NextTest(); } - CHIP_ERROR TestViewGroup1Existing_11() + CHIP_ERROR TestViewGroup1NotRemoved_11() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; @@ -49865,7 +55974,7 @@ class TestGroupsCluster : public TestCommand NextTest(); } - CHIP_ERROR TestViewGroup2Existing_12() + CHIP_ERROR TestViewGroup2Removed_12() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; @@ -49889,26 +55998,25 @@ class TestGroupsCluster : public TestCommand void OnSuccessResponse_12(uint8_t status, uint16_t groupId, chip::CharSpan groupName) { - VerifyOrReturn(CheckValue("status", status, 0)); + VerifyOrReturn(CheckValue("status", status, 139)); VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #2", 8))); - NextTest(); } - CHIP_ERROR TestGetGroupMembership2_13() + CHIP_ERROR TestGetGroupMembership3_13() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::GetGroupMembership::Type; RequestType request; - uint16_t groupListList[3]; - groupListList[0] = 2U; - groupListList[1] = 3U; - groupListList[2] = 32767U; + uint16_t groupListList[4]; + groupListList[0] = 1U; + groupListList[1] = 2U; + groupListList[2] = 4369U; + groupListList[3] = 3U; request.groupList = groupListList; auto success = [](void * context, const typename RequestType::ResponseType & data) { @@ -49931,22 +56039,21 @@ class TestGroupsCluster : public TestCommand auto iter = groupList.begin(); VerifyOrReturn(CheckNextListItemDecodes("groupList", iter, 0)); - VerifyOrReturn(CheckValue("groupList[0]", iter.GetValue(), 32767U)); + VerifyOrReturn(CheckValue("groupList[0]", iter.GetValue(), 1U)); VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 1)); NextTest(); } - CHIP_ERROR TestViewGroup3New_14() + CHIP_ERROR TestRemoveAll_14() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; + using RequestType = chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type; RequestType request; - request.groupId = 32767U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_14(data.status, data.groupId, data.groupName); + (static_cast(context))->OnSuccessResponse_14(); }; auto failure = [](void * context, EmberAfStatus status) { @@ -49959,27 +56066,18 @@ class TestGroupsCluster : public TestCommand void OnFailureResponse_14(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_14(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); - - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #3", 8))); - - NextTest(); - } + void OnSuccessResponse_14() { NextTest(); } - CHIP_ERROR TestRemoveGroup0Invalid_15() + CHIP_ERROR TestViewGroup1Removed_15() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; + using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; RequestType request; - request.groupId = 0U; + request.groupId = 1U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_15(data.status, data.groupId); + (static_cast(context))->OnSuccessResponse_15(data.status, data.groupId, data.groupName); }; auto failure = [](void * context, EmberAfStatus status) { @@ -49992,111 +56090,16 @@ class TestGroupsCluster : public TestCommand void OnFailureResponse_15(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_15(uint8_t status, uint16_t groupId) - { - VerifyOrReturn(CheckValue("status", status, 135)); - - VerifyOrReturn(CheckValue("groupId", groupId, 0U)); - - NextTest(); - } - - CHIP_ERROR TestRemoveGroup4NotFound_16() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; - - RequestType request; - request.groupId = 4U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_16(data.status, data.groupId); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_16(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_16(uint8_t status, uint16_t groupId) + void OnSuccessResponse_15(uint8_t status, uint16_t groupId, chip::CharSpan groupName) { VerifyOrReturn(CheckValue("status", status, 139)); - VerifyOrReturn(CheckValue("groupId", groupId, 4U)); - - NextTest(); - } - - CHIP_ERROR TestRemoveGroup2Existing_17() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveGroup::Type; - - RequestType request; - request.groupId = 4369U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_17(data.status, data.groupId); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_17(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_17(uint8_t status, uint16_t groupId) - { - VerifyOrReturn(CheckValue("status", status, 0)); - - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); - - NextTest(); - } - - CHIP_ERROR TestViewGroup1NotRemoved_18() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 1U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_18(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_18(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_18(uint8_t status, uint16_t groupId, chip::CharSpan groupName) - { - VerifyOrReturn(CheckValue("status", status, 0)); - VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #1", 8))); - NextTest(); } - CHIP_ERROR TestViewGroup2Removed_19() + CHIP_ERROR TestViewGroup2StillRemoved_16() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; @@ -50105,20 +56108,20 @@ class TestGroupsCluster : public TestCommand request.groupId = 4369U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_19(data.status, data.groupId, data.groupName); + (static_cast(context))->OnSuccessResponse_16(data.status, data.groupId, data.groupName); }; auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_19(status); + (static_cast(context))->OnFailureResponse_16(status); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_19(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_16(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_19(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + void OnSuccessResponse_16(uint8_t status, uint16_t groupId, chip::CharSpan groupName) { VerifyOrReturn(CheckValue("status", status, 139)); @@ -50127,7 +56130,7 @@ class TestGroupsCluster : public TestCommand NextTest(); } - CHIP_ERROR TestViewGroup3NotRemoved_20() + CHIP_ERROR TestViewGroup3Removed_17() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; @@ -50136,221 +56139,191 @@ class TestGroupsCluster : public TestCommand request.groupId = 32767U; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_20(data.status, data.groupId, data.groupName); + (static_cast(context))->OnSuccessResponse_17(data.status, data.groupId, data.groupName); }; auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_20(status); + (static_cast(context))->OnFailureResponse_17(status); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_20(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_17(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_20(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + void OnSuccessResponse_17(uint8_t status, uint16_t groupId, chip::CharSpan groupName) { - VerifyOrReturn(CheckValue("status", status, 0)); + VerifyOrReturn(CheckValue("status", status, 139)); VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); - VerifyOrReturn(CheckValueAsString("groupName", groupName, chip::CharSpan("Group #3", 8))); - NextTest(); } - CHIP_ERROR TestGetGroupMembership3_21() + CHIP_ERROR TestGetGroupMembership4_18() { const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; using RequestType = chip::app::Clusters::Groups::Commands::GetGroupMembership::Type; RequestType request; - uint16_t groupListList[4]; + uint16_t groupListList[5]; groupListList[0] = 1U; groupListList[1] = 2U; groupListList[2] = 4369U; groupListList[3] = 3U; + groupListList[4] = 32767U; request.groupList = groupListList; auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_21(data.capacity, data.groupList); + (static_cast(context))->OnSuccessResponse_18(data.capacity, data.groupList); }; auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_21(status); + (static_cast(context))->OnFailureResponse_18(status); }; ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); return CHIP_NO_ERROR; } - void OnFailureResponse_21(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_18(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_21(uint8_t capacity, const chip::app::DataModel::DecodableList & groupList) + void OnSuccessResponse_18(uint8_t capacity, const chip::app::DataModel::DecodableList & groupList) { VerifyOrReturn(CheckValue("capacity", capacity, 255)); auto iter = groupList.begin(); - VerifyOrReturn(CheckNextListItemDecodes("groupList", iter, 0)); - VerifyOrReturn(CheckValue("groupList[0]", iter.GetValue(), 1U)); - VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 1)); + VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 0)); NextTest(); } +}; - CHIP_ERROR TestRemoveAll_22() +class TestGroupKeyManagementCluster : public TestCommand +{ +public: + TestGroupKeyManagementCluster() : TestCommand("TestGroupKeyManagementCluster"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::RemoveAllGroups::Type; + CHIP_ERROR err = CHIP_NO_ERROR; - RequestType request; + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestGroupKeyManagementCluster\n"); + } - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_22(); - }; + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestGroupKeyManagementCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_22(status); - }; + Wait(); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read maxGroupsPerFabric\n"); + err = TestReadMaxGroupsPerFabric_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read maxGroupKeysPerFabric\n"); + err = TestReadMaxGroupKeysPerFabric_2(); + break; + } - void OnFailureResponse_22(EmberAfStatus status) { ThrowFailureResponse(); } + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - void OnSuccessResponse_22() { NextTest(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 3; - CHIP_ERROR TestViewGroup1Removed_23() + static void OnFailureCallback_1(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 1U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_23(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_23(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_1(status); } - void OnFailureResponse_23(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_23(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + static void OnSuccessCallback_1(void * context, uint16_t maxGroupsPerFabric) { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 1U)); - - NextTest(); + (static_cast(context))->OnSuccessResponse_1(maxGroupsPerFabric); } - CHIP_ERROR TestViewGroup2StillRemoved_24() + static void OnFailureCallback_2(void * context, EmberAfStatus status) { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 4369U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_24(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_24(status); - }; - - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); - return CHIP_NO_ERROR; + (static_cast(context))->OnFailureResponse_2(status); } - void OnFailureResponse_24(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_24(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + static void OnSuccessCallback_2(void * context, uint16_t maxGroupKeysPerFabric) { - VerifyOrReturn(CheckValue("status", status, 139)); + (static_cast(context))->OnSuccessResponse_2(maxGroupKeysPerFabric); + } - VerifyOrReturn(CheckValue("groupId", groupId, 4369U)); + // + // Tests methods + // - NextTest(); + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(); } - CHIP_ERROR TestViewGroup3Removed_25() + CHIP_ERROR TestReadMaxGroupsPerFabric_1() { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::ViewGroup::Type; - - RequestType request; - request.groupId = 32767U; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_25(data.status, data.groupId, data.groupName); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_25(status); - }; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; + chip::Controller::GroupKeyManagementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_1, OnFailureCallback_1)); return CHIP_NO_ERROR; } - void OnFailureResponse_25(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_1(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_25(uint8_t status, uint16_t groupId, chip::CharSpan groupName) + void OnSuccessResponse_1(uint16_t maxGroupsPerFabric) { - VerifyOrReturn(CheckValue("status", status, 139)); - - VerifyOrReturn(CheckValue("groupId", groupId, 32767U)); + VerifyOrReturn(CheckValue("maxGroupsPerFabric", maxGroupsPerFabric, 1U)); NextTest(); } - CHIP_ERROR TestGetGroupMembership4_26() + CHIP_ERROR TestReadMaxGroupKeysPerFabric_2() { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 1; - using RequestType = chip::app::Clusters::Groups::Commands::GetGroupMembership::Type; - - RequestType request; - - uint16_t groupListList[5]; - groupListList[0] = 1U; - groupListList[1] = 2U; - groupListList[2] = 4369U; - groupListList[3] = 3U; - groupListList[4] = 32767U; - request.groupList = groupListList; - - auto success = [](void * context, const typename RequestType::ResponseType & data) { - (static_cast(context))->OnSuccessResponse_26(data.capacity, data.groupList); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_26(status); - }; + const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; + chip::Controller::GroupKeyManagementClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); - ReturnErrorOnFailure(chip::Controller::InvokeCommand(mDevices[kIdentityAlpha], this, success, failure, endpoint, request)); + ReturnErrorOnFailure( + cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); return CHIP_NO_ERROR; } - void OnFailureResponse_26(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_26(uint8_t capacity, const chip::app::DataModel::DecodableList & groupList) + void OnSuccessResponse_2(uint16_t maxGroupKeysPerFabric) { - VerifyOrReturn(CheckValue("capacity", capacity, 255)); - - auto iter = groupList.begin(); - VerifyOrReturn(CheckNoMoreListItems("groupList", iter, 0)); + VerifyOrReturn(CheckValue("maxGroupKeysPerFabric", maxGroupKeysPerFabric, 1U)); NextTest(); } @@ -50473,7 +56446,6 @@ class TestOperationalCredentialsCluster : public TestCommand { VerifyOrReturn(CheckConstraintType("supportedFabrics", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("supportedFabrics", supportedFabrics, 4)); - NextTest(); } @@ -50495,7 +56467,6 @@ class TestOperationalCredentialsCluster : public TestCommand { VerifyOrReturn(CheckConstraintType("commissionedFabrics", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("commissionedFabrics", commissionedFabrics, 1)); - NextTest(); } @@ -50517,7 +56488,6 @@ class TestOperationalCredentialsCluster : public TestCommand { VerifyOrReturn(CheckConstraintType("currentFabricIndex", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("currentFabricIndex", currentFabricIndex, 1)); - NextTest(); } }; @@ -50901,16 +56871,8 @@ class TestGroupMessaging : public TestCommand err = TestGroupWriteAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read back Attribute\n"); - err = TestReadBackAttribute_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Restore initial location value\n"); - err = TestRestoreInitialLocationValue_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read back Attribute\n"); - err = TestReadBackAttribute_4(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Restore initial location value\n"); + err = TestRestoreInitialLocationValue_2(); break; } @@ -50923,7 +56885,7 @@ class TestGroupMessaging : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 3; static void OnDoneCallback_1(void * context) { (static_cast(context))->OnDoneResponse_1(); } @@ -50934,34 +56896,14 @@ class TestGroupMessaging : public TestCommand static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + static void OnDoneCallback_2(void * context) { (static_cast(context))->OnDoneResponse_2(); } + static void OnFailureCallback_2(void * context, EmberAfStatus status) { (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, chip::CharSpan location) - { - (static_cast(context))->OnSuccessResponse_2(location); - } - - static void OnDoneCallback_3(void * context) { (static_cast(context))->OnDoneResponse_3(); } - - static void OnFailureCallback_3(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_3(status); - } - - static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } - - static void OnFailureCallback_4(void * context, EmberAfStatus status) - { - (static_cast(context))->OnFailureResponse_4(status); - } - - static void OnSuccessCallback_4(void * context, chip::CharSpan location) - { - (static_cast(context))->OnSuccessResponse_4(location); - } + static void OnSuccessCallback_2(void * context) { (static_cast(context))->OnSuccessResponse_2(); } // // Tests methods @@ -50993,27 +56935,7 @@ class TestGroupMessaging : public TestCommand void OnDoneResponse_1() { NextTest(); } - CHIP_ERROR TestReadBackAttribute_2() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(chip::CharSpan location) - { - VerifyOrReturn(CheckValueAsString("location", location, chip::CharSpan("us", 2))); - - NextTest(); - } - - CHIP_ERROR TestRestoreInitialLocationValue_3() + CHIP_ERROR TestRestoreInitialLocationValue_2() { const chip::GroupId groupId = 1234; chip::Controller::BasicClusterTest cluster; @@ -51023,35 +56945,15 @@ class TestGroupMessaging : public TestCommand locationArgument = chip::Span("garbage: not in length on purpose", 0); ReturnErrorOnFailure(cluster.WriteAttribute( - locationArgument, this, OnSuccessCallback_3, OnFailureCallback_3, OnDoneCallback_3)); - return CHIP_NO_ERROR; - } - - void OnFailureResponse_3(EmberAfStatus status) { ThrowFailureResponse(); } - - void OnSuccessResponse_3() { NextTest(); } - - void OnDoneResponse_3() { NextTest(); } - - CHIP_ERROR TestReadBackAttribute_4() - { - const chip::EndpointId endpoint = mEndpointId.HasValue() ? mEndpointId.Value() : 0; - chip::Controller::BasicClusterTest cluster; - cluster.Associate(mDevices[kIdentityAlpha], endpoint); - - ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); + locationArgument, this, OnSuccessCallback_2, OnFailureCallback_2, OnDoneCallback_2)); return CHIP_NO_ERROR; } - void OnFailureResponse_4(EmberAfStatus status) { ThrowFailureResponse(); } + void OnFailureResponse_2(EmberAfStatus status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(chip::CharSpan location) - { - VerifyOrReturn(CheckValueAsString("location", location, chip::CharSpan("", 0))); + void OnSuccessResponse_2() { NextTest(); } - NextTest(); - } + void OnDoneResponse_2() { NextTest(); } }; class Test_TC_DIAGSW_1_1 : public TestCommand @@ -51173,7 +57075,6 @@ class Test_TC_DIAGSW_1_1 : public TestCommand void OnSuccessResponse_1(uint64_t currentHeapFree) { VerifyOrReturn(CheckConstraintType("currentHeapFree", "", "uint64")); - NextTest(); } @@ -51196,7 +57097,6 @@ class Test_TC_DIAGSW_1_1 : public TestCommand void OnSuccessResponse_2(uint64_t currentHeapUsed) { VerifyOrReturn(CheckConstraintType("currentHeapUsed", "", "uint64")); - NextTest(); } @@ -51220,7 +57120,6 @@ class Test_TC_DIAGSW_1_1 : public TestCommand void OnSuccessResponse_3(uint64_t currentHeapHighWatermark) { VerifyOrReturn(CheckConstraintType("currentHeapHighWatermark", "", "uint64")); - NextTest(); } }; @@ -51669,6 +57568,11 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -51737,8 +57641,9 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -51750,6 +57655,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp index 2df9174f0d2cd2..779834df8d925a 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp @@ -237,6 +237,27 @@ void AdministratorCommissioningClusterAttributeListListAttributeFilter(TLV::TLVR cb->mCall(cb->mContext, list); } +void ApplicationBasicClusterAllowedVendorListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + void ApplicationBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -304,7 +325,7 @@ void ApplicationLauncherClusterAttributeListListAttributeFilter(TLV::TLVReader * void AudioOutputClusterAudioOutputListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { - chip::app::DataModel::DecodableList list; + chip::app::DataModel::DecodableList list; CHIP_ERROR err = Decode(*tlvData, list); if (err != CHIP_NO_ERROR) { @@ -532,6 +553,48 @@ void BridgedDeviceBasicClusterAttributeListListAttributeFilter(TLV::TLVReader * cb->mCall(cb->mContext, list); } +void ChannelClusterChannelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ChannelClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + void ColorControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -553,10 +616,10 @@ void ColorControlClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvDat cb->mCall(cb->mContext, list); } -void ContentLauncherClusterAcceptsHeaderListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +void ContentLauncherClusterAcceptHeaderListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { - chip::app::DataModel::DecodableList list; + chip::app::DataModel::DecodableList list; CHIP_ERROR err = Decode(*tlvData, list); if (err != CHIP_NO_ERROR) { @@ -569,8 +632,8 @@ void ContentLauncherClusterAcceptsHeaderListListAttributeFilter(TLV::TLVReader * return; } - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, list); } @@ -1003,10 +1066,10 @@ void GeneralDiagnosticsClusterAttributeListListAttributeFilter(TLV::TLVReader * cb->mCall(cb->mContext, list); } -void GroupKeyManagementClusterGroupsListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +void GroupKeyManagementClusterGroupKeyMapListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { - chip::app::DataModel::DecodableList list; + chip::app::DataModel::DecodableList list; CHIP_ERROR err = Decode(*tlvData, list); if (err != CHIP_NO_ERROR) { @@ -1019,15 +1082,15 @@ void GroupKeyManagementClusterGroupsListAttributeFilter(TLV::TLVReader * tlvData return; } - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, list); } -void GroupKeyManagementClusterGroupKeysListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +void GroupKeyManagementClusterGroupTableListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { - chip::app::DataModel::DecodableList list; + chip::app::DataModel::DecodableList list; CHIP_ERROR err = Decode(*tlvData, list); if (err != CHIP_NO_ERROR) { @@ -1040,8 +1103,8 @@ void GroupKeyManagementClusterGroupKeysListAttributeFilter(TLV::TLVReader * tlvD return; } - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, list); } @@ -1196,7 +1259,7 @@ void LowPowerClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, C void MediaInputClusterMediaInputListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { - chip::app::DataModel::DecodableList list; + chip::app::DataModel::DecodableList list; CHIP_ERROR err = Decode(*tlvData, list); if (err != CHIP_NO_ERROR) { @@ -1341,6 +1404,29 @@ void OtaSoftwareUpdateProviderClusterAttributeListListAttributeFilter(TLV::TLVRe cb->mCall(cb->mContext, list); } +void OtaSoftwareUpdateRequestorClusterDefaultOtaProvidersListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList + list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + void OtaSoftwareUpdateRequestorClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) @@ -1726,54 +1812,11 @@ void SwitchClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Cal cb->mCall(cb->mContext, list); } -void TvChannelClusterChannelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - chip::app::DataModel::DecodableList list; - CHIP_ERROR err = Decode(*tlvData, list); - if (err != CHIP_NO_ERROR) - { - if (onFailureCallback != nullptr) - { - Callback::Callback * cb = - Callback::Callback::FromCancelable(onFailureCallback); - cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); - } - return; - } - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, list); -} - -void TvChannelClusterAttributeListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - chip::app::DataModel::DecodableList list; - CHIP_ERROR err = Decode(*tlvData, list); - if (err != CHIP_NO_ERROR) - { - if (onFailureCallback != nullptr) - { - Callback::Callback * cb = - Callback::Callback::FromCancelable(onFailureCallback); - cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); - } - return; - } - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, list); -} - void TargetNavigatorClusterTargetNavigatorListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { - chip::app::DataModel::DecodableList - list; + chip::app::DataModel::DecodableList list; CHIP_ERROR err = Decode(*tlvData, list); if (err != CHIP_NO_ERROR) { @@ -2239,81 +2282,52 @@ bool emberAfAccountLoginClusterGetSetupPINResponseCallback(EndpointId endpoint, return true; } -bool emberAfApplicationLauncherClusterHideAppResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, - chip::CharSpan data) +bool emberAfApplicationLauncherClusterLauncherResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + chip::CharSpan data) { - ChipLogProgress(Zcl, "HideAppResponse:"); + ChipLogProgress(Zcl, "LauncherResponse:"); ChipLogProgress(Zcl, " status: %" PRIu8 "", status); ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); - GET_CLUSTER_RESPONSE_CALLBACKS("ApplicationLauncherClusterHideAppResponseCallback"); + GET_CLUSTER_RESPONSE_CALLBACKS("ApplicationLauncherClusterLauncherResponseCallback"); - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, status, data); return true; } -bool emberAfApplicationLauncherClusterLaunchAppResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t status, chip::CharSpan data) +bool emberAfChannelClusterChangeChannelResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, + chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType channelMatch, uint8_t errorType) { - ChipLogProgress(Zcl, "LaunchAppResponse:"); - ChipLogProgress(Zcl, " status: %" PRIu8 "", status); - ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); + ChipLogProgress(Zcl, "ChangeChannelResponse:"); + ChipLogProgress(Zcl, " channelMatch: Not sure how to log struct ChannelInfo"); + ChipLogProgress(Zcl, " errorType: %" PRIu8 "", errorType); - GET_CLUSTER_RESPONSE_CALLBACKS("ApplicationLauncherClusterLaunchAppResponseCallback"); + GET_CLUSTER_RESPONSE_CALLBACKS("ChannelClusterChangeChannelResponseCallback"); - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, status, data); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, ChannelInfo(), errorType); return true; } -bool emberAfApplicationLauncherClusterStopAppResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, - chip::CharSpan data) +bool emberAfContentLauncherClusterLaunchResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, + chip::CharSpan data) { - ChipLogProgress(Zcl, "StopAppResponse:"); + ChipLogProgress(Zcl, "LaunchResponse:"); ChipLogProgress(Zcl, " status: %" PRIu8 "", status); ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); - GET_CLUSTER_RESPONSE_CALLBACKS("ApplicationLauncherClusterStopAppResponseCallback"); + GET_CLUSTER_RESPONSE_CALLBACKS("ContentLauncherClusterLaunchResponseCallback"); - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, status, data); return true; } -bool emberAfContentLauncherClusterLaunchContentResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t contentLaunchStatus, chip::CharSpan data) -{ - ChipLogProgress(Zcl, "LaunchContentResponse:"); - ChipLogProgress(Zcl, " contentLaunchStatus: %" PRIu8 "", contentLaunchStatus); - ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); - - GET_CLUSTER_RESPONSE_CALLBACKS("ContentLauncherClusterLaunchContentResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, contentLaunchStatus, data); - return true; -} - -bool emberAfContentLauncherClusterLaunchURLResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t contentLaunchStatus, chip::CharSpan data) -{ - ChipLogProgress(Zcl, "LaunchURLResponse:"); - ChipLogProgress(Zcl, " contentLaunchStatus: %" PRIu8 "", contentLaunchStatus); - ChipLogProgress(Zcl, " data: %.*s", static_cast(data.size()), data.data()); - - GET_CLUSTER_RESPONSE_CALLBACKS("ContentLauncherClusterLaunchURLResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, contentLaunchStatus, data); - return true; -} - bool emberAfDiagnosticLogsClusterRetrieveLogsResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, chip::ByteSpan content, uint32_t timeStamp, uint32_t timeSinceBoot) { @@ -2437,6 +2451,35 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigResponseCallback(Endpo return true; } +bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, /* TYPE WARNING: array array defaults to */ uint8_t * groupKeySetIDs) +{ + ChipLogProgress(Zcl, "KeySetReadAllIndicesResponse:"); + ChipLogProgress(Zcl, " groupKeySetIDs: %p", groupKeySetIDs); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupKeyManagementClusterKeySetReadAllIndicesResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, groupKeySetIDs); + return true; +} + +bool emberAfGroupKeyManagementClusterKeySetReadResponseCallback( + EndpointId endpoint, app::CommandSender * commandObj, + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType groupKeySet) +{ + ChipLogProgress(Zcl, "KeySetReadResponse:"); + ChipLogProgress(Zcl, " groupKeySet: Not sure how to log struct GroupKeySet"); + + GET_CLUSTER_RESPONSE_CALLBACKS("GroupKeyManagementClusterKeySetReadResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, GroupKeySet()); + return true; +} + bool emberAfGroupsClusterAddGroupResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, uint16_t groupId) { @@ -2524,157 +2567,16 @@ bool emberAfKeypadInputClusterSendKeyResponseCallback(EndpointId endpoint, app:: return true; } -bool emberAfMediaPlaybackClusterMediaFastForwardResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaFastForwardResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaFastForwardResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - -bool emberAfMediaPlaybackClusterMediaNextResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaNextResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaNextResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - -bool emberAfMediaPlaybackClusterMediaPauseResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaPauseResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaPauseResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - -bool emberAfMediaPlaybackClusterMediaPlayResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaPlayResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaPlayResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - -bool emberAfMediaPlaybackClusterMediaPreviousResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaPreviousResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaPreviousResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - -bool emberAfMediaPlaybackClusterMediaRewindResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) +bool emberAfMediaPlaybackClusterPlaybackResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status) { - ChipLogProgress(Zcl, "MediaRewindResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaRewindResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - -bool emberAfMediaPlaybackClusterMediaSeekResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaSeekResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSeekResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - -bool emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaSkipBackwardResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSkipBackwardResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - -bool emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaSkipForwardResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaSkipForwardResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - -bool emberAfMediaPlaybackClusterMediaStartOverResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaStartOverResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); - - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaStartOverResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); - return true; -} - -bool emberAfMediaPlaybackClusterMediaStopResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, - uint8_t mediaPlaybackStatus) -{ - ChipLogProgress(Zcl, "MediaStopResponse:"); - ChipLogProgress(Zcl, " mediaPlaybackStatus: %" PRIu8 "", mediaPlaybackStatus); + ChipLogProgress(Zcl, "PlaybackResponse:"); + ChipLogProgress(Zcl, " status: %" PRIu8 "", status); - GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterMediaStopResponseCallback"); + GET_CLUSTER_RESPONSE_CALLBACKS("MediaPlaybackClusterPlaybackResponseCallback"); - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, mediaPlaybackStatus); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, status); return true; } @@ -2934,22 +2836,6 @@ bool emberAfScenesClusterViewSceneResponseCallback(EndpointId endpoint, app::Com return true; } -bool emberAfTvChannelClusterChangeChannelResponseCallback( - EndpointId endpoint, app::CommandSender * commandObj, - chip::app::Clusters::TvChannel::Structs::TvChannelInfo::DecodableType channelMatch, uint8_t errorType) -{ - ChipLogProgress(Zcl, "ChangeChannelResponse:"); - ChipLogProgress(Zcl, " channelMatch: Not sure how to log struct TvChannelInfo"); - ChipLogProgress(Zcl, " errorType: %" PRIu8 "", errorType); - - GET_CLUSTER_RESPONSE_CALLBACKS("TvChannelClusterChangeChannelResponseCallback"); - - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); - cb->mCall(cb->mContext, TvChannelInfo(), errorType); - return true; -} - bool emberAfTargetNavigatorClusterNavigateTargetResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t status, chip::CharSpan data) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index 63c28f75060381..c4551161a6357c 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -36,12 +36,9 @@ // Cluster Specific Response Callbacks typedef void (*AccountLoginClusterGetSetupPINResponseCallback)(void * context, chip::CharSpan setupPIN); -typedef void (*ApplicationLauncherClusterHideAppResponseCallback)(void * context, uint8_t status, chip::CharSpan data); -typedef void (*ApplicationLauncherClusterLaunchAppResponseCallback)(void * context, uint8_t status, chip::CharSpan data); -typedef void (*ApplicationLauncherClusterStopAppResponseCallback)(void * context, uint8_t status, chip::CharSpan data); -typedef void (*ContentLauncherClusterLaunchContentResponseCallback)(void * context, uint8_t contentLaunchStatus, - chip::CharSpan data); -typedef void (*ContentLauncherClusterLaunchURLResponseCallback)(void * context, uint8_t contentLaunchStatus, chip::CharSpan data); +typedef void (*ApplicationLauncherClusterLauncherResponseCallback)(void * context, uint8_t status, chip::CharSpan data); +typedef void (*ChannelClusterChangeChannelResponseCallback)(void * context, ChannelInfo channelMatch, uint8_t errorType); +typedef void (*ContentLauncherClusterLaunchResponseCallback)(void * context, uint8_t status, chip::CharSpan data); typedef void (*DiagnosticLogsClusterRetrieveLogsResponseCallback)(void * context, uint8_t status, chip::ByteSpan content, uint32_t timeStamp, uint32_t timeSinceBoot); typedef void (*DoorLockClusterGetCredentialStatusResponseCallback)(void * context, bool credentialExists, uint16_t userIndex, @@ -59,6 +56,9 @@ typedef void (*GeneralCommissioningClusterCommissioningCompleteResponseCallback) chip::CharSpan debugText); typedef void (*GeneralCommissioningClusterSetRegulatoryConfigResponseCallback)(void * context, uint8_t errorCode, chip::CharSpan debugText); +typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallback)( + void * context, /* TYPE WARNING: array array defaults to */ uint8_t * groupKeySetIDs); +typedef void (*GroupKeyManagementClusterKeySetReadResponseCallback)(void * context, GroupKeySet groupKeySet); typedef void (*GroupsClusterAddGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId); typedef void (*GroupsClusterGetGroupMembershipResponseCallback)(void * context, uint8_t capacity, /* TYPE WARNING: array array defaults to */ uint8_t * groupList); @@ -66,17 +66,7 @@ typedef void (*GroupsClusterRemoveGroupResponseCallback)(void * context, uint8_t typedef void (*GroupsClusterViewGroupResponseCallback)(void * context, uint8_t status, uint16_t groupId, chip::CharSpan groupName); typedef void (*IdentifyClusterIdentifyQueryResponseCallback)(void * context, uint16_t timeout); typedef void (*KeypadInputClusterSendKeyResponseCallback)(void * context, uint8_t status); -typedef void (*MediaPlaybackClusterMediaFastForwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaNextResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaPauseResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaPlayResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaPreviousResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaRewindResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaSeekResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaSkipBackwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaSkipForwardResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaStartOverResponseCallback)(void * context, uint8_t mediaPlaybackStatus); -typedef void (*MediaPlaybackClusterMediaStopResponseCallback)(void * context, uint8_t mediaPlaybackStatus); +typedef void (*MediaPlaybackClusterPlaybackResponseCallback)(void * context, uint8_t status); typedef void (*NetworkCommissioningClusterConnectNetworkResponseCallback)(void * context, uint8_t NetworkingStatus, chip::CharSpan DebugText, int32_t ErrorValue); typedef void (*NetworkCommissioningClusterNetworkConfigResponseCallback)(void * context, uint8_t NetworkingStatus, @@ -107,7 +97,6 @@ typedef void (*ScenesClusterStoreSceneResponseCallback)(void * context, uint8_t typedef void (*ScenesClusterViewSceneResponseCallback)(void * context, uint8_t status, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, chip::CharSpan sceneName, /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets); -typedef void (*TvChannelClusterChangeChannelResponseCallback)(void * context, TvChannelInfo channelMatch, uint8_t errorType); typedef void (*TargetNavigatorClusterNavigateTargetResponseCallback)(void * context, uint8_t status, chip::CharSpan data); typedef void (*TestClusterClusterBooleanResponseCallback)(void * context, bool value); typedef void (*TestClusterClusterSimpleStructResponseCallback)(void * context, SimpleStruct arg1); @@ -152,6 +141,11 @@ void AdministratorCommissioningClusterAttributeListListAttributeFilter(chip::TLV chip::Callback::Cancelable * onFailureCallback); typedef void (*AdministratorCommissioningAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void ApplicationBasicClusterAllowedVendorListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ApplicationBasicAllowedVendorListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); void ApplicationBasicClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); @@ -172,7 +166,7 @@ void AudioOutputClusterAudioOutputListListAttributeFilter(chip::TLV::TLVReader * chip::Callback::Cancelable * onFailureCallback); typedef void (*AudioOutputAudioOutputListListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList & data); + const chip::app::DataModel::DecodableList & data); void AudioOutputClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); typedef void (*AudioOutputAttributeListListAttributeCallback)(void * context, @@ -222,16 +216,25 @@ void BridgedDeviceBasicClusterAttributeListListAttributeFilter(chip::TLV::TLVRea chip::Callback::Cancelable * onFailureCallback); typedef void (*BridgedDeviceBasicAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void ChannelClusterChannelListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ChannelChannelListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void ChannelClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ChannelAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); void ColorControlClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); typedef void (*ColorControlAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); -void ContentLauncherClusterAcceptsHeaderListListAttributeFilter(chip::TLV::TLVReader * data, - chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*ContentLauncherAcceptsHeaderListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); +void ContentLauncherClusterAcceptHeaderListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ContentLauncherAcceptHeaderListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); void ContentLauncherClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); @@ -330,17 +333,18 @@ void GeneralDiagnosticsClusterAttributeListListAttributeFilter(chip::TLV::TLVRea chip::Callback::Cancelable * onFailureCallback); typedef void (*GeneralDiagnosticsAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -void GroupKeyManagementClusterGroupsListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*GroupKeyManagementGroupsListAttributeCallback)( - void * context, - const chip::app::DataModel::DecodableList & data); -void GroupKeyManagementClusterGroupKeysListAttributeFilter(chip::TLV::TLVReader * data, - chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*GroupKeyManagementGroupKeysListAttributeCallback)( +void GroupKeyManagementClusterGroupKeyMapListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementGroupKeyMapListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void GroupKeyManagementClusterGroupTableListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*GroupKeyManagementGroupTableListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); void GroupKeyManagementClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); @@ -376,7 +380,7 @@ void MediaInputClusterMediaInputListListAttributeFilter(chip::TLV::TLVReader * d chip::Callback::Cancelable * onFailureCallback); typedef void (*MediaInputMediaInputListListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList & data); + const chip::app::DataModel::DecodableList & data); void MediaInputClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); typedef void (*MediaInputAttributeListListAttributeCallback)(void * context, @@ -407,6 +411,13 @@ void OtaSoftwareUpdateProviderClusterAttributeListListAttributeFilter(chip::TLV: chip::Callback::Cancelable * onFailureCallback); typedef void (*OtaSoftwareUpdateProviderAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +void OtaSoftwareUpdateRequestorClusterDefaultOtaProvidersListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OtaSoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::DecodableType> & data); void OtaSoftwareUpdateRequestorClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); @@ -497,22 +508,12 @@ void SwitchClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onFailureCallback); typedef void (*SwitchAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); -void TvChannelClusterChannelListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*TvChannelChannelListListAttributeCallback)( - void * context, - const chip::app::DataModel::DecodableList & data); -void TvChannelClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, - chip::Callback::Cancelable * onFailureCallback); -typedef void (*TvChannelAttributeListListAttributeCallback)(void * context, - const chip::app::DataModel::DecodableList & data); void TargetNavigatorClusterTargetNavigatorListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); typedef void (*TargetNavigatorTargetNavigatorListListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & data); + const chip::app::DataModel::DecodableList & data); void TargetNavigatorClusterAttributeListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp index 9fb89cf91df139..681b6afefaf038 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp @@ -35,11 +35,10 @@ namespace Controller { // TODO(#4503): Commands should take group id as an argument. // AccessControl Cluster Commands -// AccessControl Cluster Attributes // AccountLogin Cluster Commands -CHIP_ERROR AccountLoginCluster::GetSetupPIN(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan tempAccountIdentifier) +CHIP_ERROR AccountLoginCluster::GetSetupPINRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::CharSpan tempAccountIdentifier) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -51,7 +50,7 @@ CHIP_ERROR AccountLoginCluster::GetSetupPIN(Callback::Cancelable * onSuccessCall VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AccountLogin::Commands::GetSetupPIN::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AccountLogin::Commands::GetSetupPINRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -79,8 +78,8 @@ CHIP_ERROR AccountLoginCluster::GetSetupPIN(Callback::Cancelable * onSuccessCall return err; } -CHIP_ERROR AccountLoginCluster::Login(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan tempAccountIdentifier, chip::CharSpan setupPIN) +CHIP_ERROR AccountLoginCluster::LoginRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan tempAccountIdentifier, chip::CharSpan setupPIN) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -92,7 +91,7 @@ CHIP_ERROR AccountLoginCluster::Login(Callback::Cancelable * onSuccessCallback, VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AccountLogin::Commands::Login::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AccountLogin::Commands::LoginRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -122,7 +121,7 @@ CHIP_ERROR AccountLoginCluster::Login(Callback::Cancelable * onSuccessCallback, return err; } -CHIP_ERROR AccountLoginCluster::Logout(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR AccountLoginCluster::LogoutRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -134,7 +133,7 @@ CHIP_ERROR AccountLoginCluster::Logout(Callback::Cancelable * onSuccessCallback, VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AccountLogin::Commands::Logout::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AccountLogin::Commands::LogoutRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -160,24 +159,6 @@ CHIP_ERROR AccountLoginCluster::Logout(Callback::Cancelable * onSuccessCallback, return err; } -// AccountLogin Cluster Attributes -CHIP_ERROR AccountLoginCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR AccountLoginCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - // AdministratorCommissioning Cluster Commands CHIP_ERROR AdministratorCommissioningCluster::OpenBasicCommissioningWindow(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, @@ -317,27 +298,12 @@ CHIP_ERROR AdministratorCommissioningCluster::RevokeCommissioning(Callback::Canc return err; } -// AdministratorCommissioning Cluster Attributes -CHIP_ERROR AdministratorCommissioningCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR AdministratorCommissioningCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - // ApplicationBasic Cluster Commands -CHIP_ERROR ApplicationBasicCluster::ChangeStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t status) + +// ApplicationLauncher Cluster Commands +CHIP_ERROR ApplicationLauncherCluster::HideAppRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t catalogVendorId, + chip::CharSpan applicationId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -349,7 +315,7 @@ CHIP_ERROR ApplicationBasicCluster::ChangeStatus(Callback::Cancelable * onSucces VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ApplicationBasic::Commands::ChangeStatus::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ApplicationLauncher::Commands::HideAppRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -360,8 +326,10 @@ CHIP_ERROR ApplicationBasicCluster::ChangeStatus(Callback::Cancelable * onSucces SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // status: applicationBasicStatus - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), status)); + // catalogVendorId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), catalogVendorId)); + // applicationId: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), applicationId)); SuccessOrExit(err = sender->FinishCommand()); @@ -377,129 +345,9 @@ CHIP_ERROR ApplicationBasicCluster::ChangeStatus(Callback::Cancelable * onSucces return err; } -// ApplicationBasic Cluster Attributes -CHIP_ERROR ApplicationBasicCluster::SubscribeAttributeVendorName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ApplicationBasic::Attributes::VendorName::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ApplicationBasicCluster::ReportAttributeVendorName(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ApplicationBasic::Attributes::VendorName::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ApplicationBasicCluster::SubscribeAttributeVendorId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ApplicationBasic::Attributes::VendorId::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ApplicationBasicCluster::ReportAttributeVendorId(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ApplicationBasic::Attributes::VendorId::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ApplicationBasicCluster::SubscribeAttributeApplicationName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ApplicationBasic::Attributes::ApplicationName::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ApplicationBasicCluster::ReportAttributeApplicationName(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ApplicationBasic::Attributes::ApplicationName::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ApplicationBasicCluster::SubscribeAttributeProductId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ApplicationBasic::Attributes::ProductId::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ApplicationBasicCluster::ReportAttributeProductId(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ApplicationBasic::Attributes::ProductId::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ApplicationBasicCluster::SubscribeAttributeApplicationStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ApplicationBasic::Attributes::ApplicationStatus::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ApplicationBasicCluster::ReportAttributeApplicationStatus(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ApplicationBasic::Attributes::ApplicationStatus::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ApplicationBasicCluster::SubscribeAttributeApplicationVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ApplicationBasic::Attributes::ApplicationVersion::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ApplicationBasicCluster::ReportAttributeApplicationVersion(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ApplicationBasic::Attributes::ApplicationVersion::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ApplicationBasicCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ApplicationBasicCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// ApplicationLauncher Cluster Commands -CHIP_ERROR ApplicationLauncherCluster::HideApp(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t catalogVendorId, chip::CharSpan applicationId) +CHIP_ERROR ApplicationLauncherCluster::LaunchAppRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::CharSpan data, + uint16_t catalogVendorId, chip::CharSpan applicationId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -511,7 +359,8 @@ CHIP_ERROR ApplicationLauncherCluster::HideApp(Callback::Cancelable * onSuccessC VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ApplicationLauncher::Commands::HideApp::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + ApplicationLauncher::Commands::LaunchAppRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -522,6 +371,8 @@ CHIP_ERROR ApplicationLauncherCluster::HideApp(Callback::Cancelable * onSuccessC SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // data: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), data)); // catalogVendorId: int16u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), catalogVendorId)); // applicationId: charString @@ -541,8 +392,9 @@ CHIP_ERROR ApplicationLauncherCluster::HideApp(Callback::Cancelable * onSuccessC return err; } -CHIP_ERROR ApplicationLauncherCluster::LaunchApp(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan data, uint16_t catalogVendorId, chip::CharSpan applicationId) +CHIP_ERROR ApplicationLauncherCluster::StopAppRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t catalogVendorId, + chip::CharSpan applicationId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -554,7 +406,7 @@ CHIP_ERROR ApplicationLauncherCluster::LaunchApp(Callback::Cancelable * onSucces VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ApplicationLauncher::Commands::LaunchApp::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ApplicationLauncher::Commands::StopAppRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -565,8 +417,6 @@ CHIP_ERROR ApplicationLauncherCluster::LaunchApp(Callback::Cancelable * onSucces SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // data: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), data)); // catalogVendorId: int16u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), catalogVendorId)); // applicationId: charString @@ -586,8 +436,9 @@ CHIP_ERROR ApplicationLauncherCluster::LaunchApp(Callback::Cancelable * onSucces return err; } -CHIP_ERROR ApplicationLauncherCluster::StopApp(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t catalogVendorId, chip::CharSpan applicationId) +// AudioOutput Cluster Commands +CHIP_ERROR AudioOutputCluster::RenameOutputRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t index, chip::CharSpan name) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -599,7 +450,7 @@ CHIP_ERROR ApplicationLauncherCluster::StopApp(Callback::Cancelable * onSuccessC VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ApplicationLauncher::Commands::StopApp::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AudioOutput::Commands::RenameOutputRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -610,10 +461,10 @@ CHIP_ERROR ApplicationLauncherCluster::StopApp(Callback::Cancelable * onSuccessC SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // catalogVendorId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), catalogVendorId)); - // applicationId: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), applicationId)); + // index: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); + // name: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), name)); SuccessOrExit(err = sender->FinishCommand()); @@ -629,27 +480,8 @@ CHIP_ERROR ApplicationLauncherCluster::StopApp(Callback::Cancelable * onSuccessC return err; } -// ApplicationLauncher Cluster Attributes -CHIP_ERROR ApplicationLauncherCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ApplicationLauncherCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// AudioOutput Cluster Commands -CHIP_ERROR AudioOutputCluster::RenameOutput(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t index, chip::CharSpan name) +CHIP_ERROR AudioOutputCluster::SelectOutputRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t index) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -661,7 +493,7 @@ CHIP_ERROR AudioOutputCluster::RenameOutput(Callback::Cancelable * onSuccessCall VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AudioOutput::Commands::RenameOutput::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AudioOutput::Commands::SelectOutputRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -674,8 +506,6 @@ CHIP_ERROR AudioOutputCluster::RenameOutput(Callback::Cancelable * onSuccessCall VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); // index: int8u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); - // name: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), name)); SuccessOrExit(err = sender->FinishCommand()); @@ -691,8 +521,9 @@ CHIP_ERROR AudioOutputCluster::RenameOutput(Callback::Cancelable * onSuccessCall return err; } -CHIP_ERROR AudioOutputCluster::SelectOutput(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t index) +// BarrierControl Cluster Commands +CHIP_ERROR BarrierControlCluster::BarrierControlGoToPercent(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t percentOpen) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -704,7 +535,8 @@ CHIP_ERROR AudioOutputCluster::SelectOutput(Callback::Cancelable * onSuccessCall VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AudioOutput::Commands::SelectOutput::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + BarrierControl::Commands::BarrierControlGoToPercent::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -715,8 +547,8 @@ CHIP_ERROR AudioOutputCluster::SelectOutput(Callback::Cancelable * onSuccessCall SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // index: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); + // percentOpen: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), percentOpen)); SuccessOrExit(err = sender->FinishCommand()); @@ -732,44 +564,8 @@ CHIP_ERROR AudioOutputCluster::SelectOutput(Callback::Cancelable * onSuccessCall return err; } -// AudioOutput Cluster Attributes -CHIP_ERROR AudioOutputCluster::SubscribeAttributeCurrentAudioOutput(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = AudioOutput::Attributes::CurrentAudioOutput::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR AudioOutputCluster::ReportAttributeCurrentAudioOutput(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(AudioOutput::Attributes::CurrentAudioOutput::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR AudioOutputCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR AudioOutputCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// BarrierControl Cluster Commands -CHIP_ERROR BarrierControlCluster::BarrierControlGoToPercent(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t percentOpen) +CHIP_ERROR BarrierControlCluster::BarrierControlStop(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -781,8 +577,7 @@ CHIP_ERROR BarrierControlCluster::BarrierControlGoToPercent(Callback::Cancelable VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - BarrierControl::Commands::BarrierControlGoToPercent::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BarrierControl::Commands::BarrierControlStop::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -792,9 +587,7 @@ CHIP_ERROR BarrierControlCluster::BarrierControlGoToPercent(Callback::Cancelable SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // percentOpen: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), percentOpen)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -810,8 +603,8 @@ CHIP_ERROR BarrierControlCluster::BarrierControlGoToPercent(Callback::Cancelable return err; } -CHIP_ERROR BarrierControlCluster::BarrierControlStop(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +// Basic Cluster Commands +CHIP_ERROR BasicCluster::MfgSpecificPing(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -823,7 +616,7 @@ CHIP_ERROR BarrierControlCluster::BarrierControlStop(Callback::Cancelable * onSu VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BarrierControl::Commands::BarrierControlStop::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Basic::Commands::MfgSpecificPing::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -849,94 +642,59 @@ CHIP_ERROR BarrierControlCluster::BarrierControlStop(Callback::Cancelable * onSu return err; } -// BarrierControl Cluster Attributes -CHIP_ERROR BarrierControlCluster::SubscribeAttributeBarrierMovingState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BarrierControl::Attributes::BarrierMovingState::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} +// BinaryInputBasic Cluster Commands -CHIP_ERROR BarrierControlCluster::ReportAttributeBarrierMovingState(Callback::Cancelable * onReportCallback) +// Binding Cluster Commands +CHIP_ERROR BindingCluster::Bind(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::NodeId nodeId, chip::GroupId groupId, chip::EndpointId endpointId, chip::ClusterId clusterId) { - return RequestAttributeReporting(BarrierControl::Attributes::BarrierMovingState::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR BarrierControlCluster::SubscribeAttributeBarrierSafetyStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BarrierControl::Attributes::BarrierSafetyStatus::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR BarrierControlCluster::ReportAttributeBarrierSafetyStatus(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BarrierControl::Attributes::BarrierSafetyStatus::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR BarrierControlCluster::SubscribeAttributeBarrierCapabilities(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BarrierControl::Attributes::BarrierCapabilities::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Binding::Commands::Bind::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR BarrierControlCluster::ReportAttributeBarrierCapabilities(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BarrierControl::Attributes::BarrierCapabilities::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR BarrierControlCluster::SubscribeAttributeBarrierPosition(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BarrierControl::Attributes::BarrierPosition::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR BarrierControlCluster::ReportAttributeBarrierPosition(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BarrierControl::Attributes::BarrierPosition::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR BarrierControlCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // nodeId: nodeId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); + // groupId: groupId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // endpointId: endpointNo + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), endpointId)); + // clusterId: clusterId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), clusterId)); -CHIP_ERROR BarrierControlCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// Basic Cluster Commands -CHIP_ERROR BasicCluster::MfgSpecificPing(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR BindingCluster::Unbind(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::NodeId nodeId, chip::GroupId groupId, chip::EndpointId endpointId, + chip::ClusterId clusterId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -948,7 +706,7 @@ CHIP_ERROR BasicCluster::MfgSpecificPing(Callback::Cancelable * onSuccessCallbac VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Basic::Commands::MfgSpecificPing::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Binding::Commands::Unbind::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -958,7 +716,15 @@ CHIP_ERROR BasicCluster::MfgSpecificPing(Callback::Cancelable * onSuccessCallbac SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // nodeId: nodeId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); + // groupId: groupId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // endpointId: endpointNo + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), endpointId)); + // clusterId: clusterId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), clusterId)); SuccessOrExit(err = sender->FinishCommand()); @@ -974,403 +740,55 @@ CHIP_ERROR BasicCluster::MfgSpecificPing(Callback::Cancelable * onSuccessCallbac return err; } -// Basic Cluster Attributes -CHIP_ERROR BasicCluster::SubscribeAttributeInteractionModelVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::InteractionModelVersion::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} +// BooleanState Cluster Commands -CHIP_ERROR BasicCluster::ReportAttributeInteractionModelVersion(Callback::Cancelable * onReportCallback) +// BridgedActions Cluster Commands +CHIP_ERROR BridgedActionsCluster::DisableAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t actionID, uint32_t invokeID) { - return RequestAttributeReporting(Basic::Attributes::InteractionModelVersion::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR BasicCluster::SubscribeAttributeVendorName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::VendorName::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR BasicCluster::ReportAttributeVendorName(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::VendorName::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR BasicCluster::SubscribeAttributeVendorID(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::VendorID::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::DisableAction::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR BasicCluster::ReportAttributeVendorID(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::VendorID::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR BasicCluster::SubscribeAttributeProductName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::ProductName::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR BasicCluster::ReportAttributeProductName(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::ProductName::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR BasicCluster::SubscribeAttributeProductID(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::ProductID::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // actionID: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); + // invokeID: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); -CHIP_ERROR BasicCluster::ReportAttributeProductID(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::ProductID::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR BasicCluster::SubscribeAttributeNodeLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::NodeLabel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR BasicCluster::ReportAttributeNodeLabel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::NodeLabel::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR BasicCluster::SubscribeAttributeLocation(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::Location::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR BasicCluster::ReportAttributeLocation(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::Location::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::HardwareVersion::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeHardwareVersion(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::HardwareVersion::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::HardwareVersionString::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeHardwareVersionString(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::HardwareVersionString::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::SoftwareVersion::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeSoftwareVersion(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::SoftwareVersion::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::SoftwareVersionString::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeSoftwareVersionString(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::SoftwareVersionString::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::ManufacturingDate::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeManufacturingDate(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::ManufacturingDate::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributePartNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::PartNumber::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributePartNumber(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::PartNumber::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeProductURL(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::ProductURL::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeProductURL(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::ProductURL::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeProductLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::ProductLabel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeProductLabel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::ProductLabel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::SerialNumber::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeSerialNumber(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::SerialNumber::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeLocalConfigDisabled(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::LocalConfigDisabled::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeLocalConfigDisabled(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::LocalConfigDisabled::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeReachable(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Basic::Attributes::Reachable::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeReachable(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Basic::Attributes::Reachable::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BasicCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// BinaryInputBasic Cluster Commands -// BinaryInputBasic Cluster Attributes -CHIP_ERROR BinaryInputBasicCluster::SubscribeAttributeOutOfService(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BinaryInputBasic::Attributes::OutOfService::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BinaryInputBasicCluster::ReportAttributeOutOfService(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BinaryInputBasic::Attributes::OutOfService::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BinaryInputBasicCluster::SubscribeAttributePresentValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BinaryInputBasic::Attributes::PresentValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BinaryInputBasicCluster::ReportAttributePresentValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BinaryInputBasic::Attributes::PresentValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BinaryInputBasicCluster::SubscribeAttributeStatusFlags(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BinaryInputBasic::Attributes::StatusFlags::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BinaryInputBasicCluster::ReportAttributeStatusFlags(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BinaryInputBasic::Attributes::StatusFlags::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BinaryInputBasicCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BinaryInputBasicCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// Binding Cluster Commands -CHIP_ERROR BindingCluster::Bind(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::NodeId nodeId, chip::GroupId groupId, chip::EndpointId endpointId, chip::ClusterId clusterId) +CHIP_ERROR BridgedActionsCluster::DisableActionWithDuration(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t actionID, + uint32_t invokeID, uint32_t duration) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1382,7 +800,8 @@ CHIP_ERROR BindingCluster::Bind(Callback::Cancelable * onSuccessCallback, Callba VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Binding::Commands::Bind::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + BridgedActions::Commands::DisableActionWithDuration::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1393,14 +812,12 @@ CHIP_ERROR BindingCluster::Bind(Callback::Cancelable * onSuccessCallback, Callba SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // nodeId: nodeId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); - // groupId: groupId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - // endpointId: endpointNo - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), endpointId)); - // clusterId: clusterId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), clusterId)); + // actionID: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); + // invokeID: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); + // duration: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), duration)); SuccessOrExit(err = sender->FinishCommand()); @@ -1416,9 +833,8 @@ CHIP_ERROR BindingCluster::Bind(Callback::Cancelable * onSuccessCallback, Callba return err; } -CHIP_ERROR BindingCluster::Unbind(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::NodeId nodeId, chip::GroupId groupId, chip::EndpointId endpointId, - chip::ClusterId clusterId) +CHIP_ERROR BridgedActionsCluster::EnableAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t actionID, uint32_t invokeID) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1430,7 +846,7 @@ CHIP_ERROR BindingCluster::Unbind(Callback::Cancelable * onSuccessCallback, Call VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Binding::Commands::Unbind::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::EnableAction::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1441,14 +857,10 @@ CHIP_ERROR BindingCluster::Unbind(Callback::Cancelable * onSuccessCallback, Call SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // nodeId: nodeId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); - // groupId: groupId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - // endpointId: endpointNo - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), endpointId)); - // clusterId: clusterId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), clusterId)); + // actionID: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); + // invokeID: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); SuccessOrExit(err = sender->FinishCommand()); @@ -1464,63 +876,9 @@ CHIP_ERROR BindingCluster::Unbind(Callback::Cancelable * onSuccessCallback, Call return err; } -// Binding Cluster Attributes -CHIP_ERROR BindingCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BindingCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// BooleanState Cluster Commands -// BooleanState Cluster Attributes -CHIP_ERROR BooleanStateCluster::SubscribeAttributeStateValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BooleanState::Attributes::StateValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BooleanStateCluster::ReportAttributeStateValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BooleanState::Attributes::StateValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BooleanStateCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BooleanStateCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// BridgedActions Cluster Commands -CHIP_ERROR BridgedActionsCluster::DisableAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t actionID, uint32_t invokeID) +CHIP_ERROR BridgedActionsCluster::EnableActionWithDuration(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t actionID, + uint32_t invokeID, uint32_t duration) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1532,7 +890,8 @@ CHIP_ERROR BridgedActionsCluster::DisableAction(Callback::Cancelable * onSuccess VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::DisableAction::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + BridgedActions::Commands::EnableActionWithDuration::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1547,6 +906,8 @@ CHIP_ERROR BridgedActionsCluster::DisableAction(Callback::Cancelable * onSuccess SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); // invokeID: int32u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); + // duration: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), duration)); SuccessOrExit(err = sender->FinishCommand()); @@ -1562,9 +923,8 @@ CHIP_ERROR BridgedActionsCluster::DisableAction(Callback::Cancelable * onSuccess return err; } -CHIP_ERROR BridgedActionsCluster::DisableActionWithDuration(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t actionID, - uint32_t invokeID, uint32_t duration) +CHIP_ERROR BridgedActionsCluster::InstantAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t actionID, uint32_t invokeID) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1576,8 +936,7 @@ CHIP_ERROR BridgedActionsCluster::DisableActionWithDuration(Callback::Cancelable VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - BridgedActions::Commands::DisableActionWithDuration::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::InstantAction::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1592,8 +951,6 @@ CHIP_ERROR BridgedActionsCluster::DisableActionWithDuration(Callback::Cancelable SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); // invokeID: int32u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); - // duration: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), duration)); SuccessOrExit(err = sender->FinishCommand()); @@ -1609,8 +966,9 @@ CHIP_ERROR BridgedActionsCluster::DisableActionWithDuration(Callback::Cancelable return err; } -CHIP_ERROR BridgedActionsCluster::EnableAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t actionID, uint32_t invokeID) +CHIP_ERROR BridgedActionsCluster::InstantActionWithTransition(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t actionID, + uint32_t invokeID, uint16_t transitionTime) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1622,7 +980,8 @@ CHIP_ERROR BridgedActionsCluster::EnableAction(Callback::Cancelable * onSuccessC VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::EnableAction::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + BridgedActions::Commands::InstantActionWithTransition::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1637,6 +996,8 @@ CHIP_ERROR BridgedActionsCluster::EnableAction(Callback::Cancelable * onSuccessC SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); // invokeID: int32u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); SuccessOrExit(err = sender->FinishCommand()); @@ -1652,9 +1013,8 @@ CHIP_ERROR BridgedActionsCluster::EnableAction(Callback::Cancelable * onSuccessC return err; } -CHIP_ERROR BridgedActionsCluster::EnableActionWithDuration(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t actionID, - uint32_t invokeID, uint32_t duration) +CHIP_ERROR BridgedActionsCluster::PauseAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t actionID, uint32_t invokeID) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1666,8 +1026,7 @@ CHIP_ERROR BridgedActionsCluster::EnableActionWithDuration(Callback::Cancelable VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - BridgedActions::Commands::EnableActionWithDuration::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::PauseAction::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1682,8 +1041,6 @@ CHIP_ERROR BridgedActionsCluster::EnableActionWithDuration(Callback::Cancelable SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); // invokeID: int32u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); - // duration: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), duration)); SuccessOrExit(err = sender->FinishCommand()); @@ -1699,8 +1056,9 @@ CHIP_ERROR BridgedActionsCluster::EnableActionWithDuration(Callback::Cancelable return err; } -CHIP_ERROR BridgedActionsCluster::InstantAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t actionID, uint32_t invokeID) +CHIP_ERROR BridgedActionsCluster::PauseActionWithDuration(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t actionID, + uint32_t invokeID, uint32_t duration) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1712,7 +1070,8 @@ CHIP_ERROR BridgedActionsCluster::InstantAction(Callback::Cancelable * onSuccess VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::InstantAction::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + BridgedActions::Commands::PauseActionWithDuration::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1727,6 +1086,8 @@ CHIP_ERROR BridgedActionsCluster::InstantAction(Callback::Cancelable * onSuccess SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); // invokeID: int32u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); + // duration: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), duration)); SuccessOrExit(err = sender->FinishCommand()); @@ -1742,9 +1103,8 @@ CHIP_ERROR BridgedActionsCluster::InstantAction(Callback::Cancelable * onSuccess return err; } -CHIP_ERROR BridgedActionsCluster::InstantActionWithTransition(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t actionID, - uint32_t invokeID, uint16_t transitionTime) +CHIP_ERROR BridgedActionsCluster::ResumeAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t actionID, uint32_t invokeID) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1756,8 +1116,7 @@ CHIP_ERROR BridgedActionsCluster::InstantActionWithTransition(Callback::Cancelab VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - BridgedActions::Commands::InstantActionWithTransition::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::ResumeAction::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1772,8 +1131,6 @@ CHIP_ERROR BridgedActionsCluster::InstantActionWithTransition(Callback::Cancelab SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); // invokeID: int32u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); - // transitionTime: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); SuccessOrExit(err = sender->FinishCommand()); @@ -1789,7 +1146,7 @@ CHIP_ERROR BridgedActionsCluster::InstantActionWithTransition(Callback::Cancelab return err; } -CHIP_ERROR BridgedActionsCluster::PauseAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, +CHIP_ERROR BridgedActionsCluster::StartAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t actionID, uint32_t invokeID) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -1802,7 +1159,7 @@ CHIP_ERROR BridgedActionsCluster::PauseAction(Callback::Cancelable * onSuccessCa VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::PauseAction::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::StartAction::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1832,7 +1189,7 @@ CHIP_ERROR BridgedActionsCluster::PauseAction(Callback::Cancelable * onSuccessCa return err; } -CHIP_ERROR BridgedActionsCluster::PauseActionWithDuration(Callback::Cancelable * onSuccessCallback, +CHIP_ERROR BridgedActionsCluster::StartActionWithDuration(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t actionID, uint32_t invokeID, uint32_t duration) { @@ -1847,7 +1204,7 @@ CHIP_ERROR BridgedActionsCluster::PauseActionWithDuration(Callback::Cancelable * VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - BridgedActions::Commands::PauseActionWithDuration::Id, + BridgedActions::Commands::StartActionWithDuration::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1879,8 +1236,8 @@ CHIP_ERROR BridgedActionsCluster::PauseActionWithDuration(Callback::Cancelable * return err; } -CHIP_ERROR BridgedActionsCluster::ResumeAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t actionID, uint32_t invokeID) +CHIP_ERROR BridgedActionsCluster::StopAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t actionID, uint32_t invokeID) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1892,7 +1249,7 @@ CHIP_ERROR BridgedActionsCluster::ResumeAction(Callback::Cancelable * onSuccessC VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::ResumeAction::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::StopAction::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1922,8 +1279,12 @@ CHIP_ERROR BridgedActionsCluster::ResumeAction(Callback::Cancelable * onSuccessC return err; } -CHIP_ERROR BridgedActionsCluster::StartAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t actionID, uint32_t invokeID) +// BridgedDeviceBasic Cluster Commands + +// Channel Cluster Commands +CHIP_ERROR ChannelCluster::ChangeChannelByNumberRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t majorNumber, + uint16_t minorNumber) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1935,7 +1296,8 @@ CHIP_ERROR BridgedActionsCluster::StartAction(Callback::Cancelable * onSuccessCa VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::StartAction::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + Channel::Commands::ChangeChannelByNumberRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1946,10 +1308,10 @@ CHIP_ERROR BridgedActionsCluster::StartAction(Callback::Cancelable * onSuccessCa SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // actionID: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); - // invokeID: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); + // majorNumber: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), majorNumber)); + // minorNumber: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), minorNumber)); SuccessOrExit(err = sender->FinishCommand()); @@ -1965,9 +1327,8 @@ CHIP_ERROR BridgedActionsCluster::StartAction(Callback::Cancelable * onSuccessCa return err; } -CHIP_ERROR BridgedActionsCluster::StartActionWithDuration(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t actionID, - uint32_t invokeID, uint32_t duration) +CHIP_ERROR ChannelCluster::ChangeChannelRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan match) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -1979,8 +1340,7 @@ CHIP_ERROR BridgedActionsCluster::StartActionWithDuration(Callback::Cancelable * VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - BridgedActions::Commands::StartActionWithDuration::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Channel::Commands::ChangeChannelRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -1991,12 +1351,8 @@ CHIP_ERROR BridgedActionsCluster::StartActionWithDuration(Callback::Cancelable * SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // actionID: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); - // invokeID: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); - // duration: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), duration)); + // match: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), match)); SuccessOrExit(err = sender->FinishCommand()); @@ -2012,8 +1368,8 @@ CHIP_ERROR BridgedActionsCluster::StartActionWithDuration(Callback::Cancelable * return err; } -CHIP_ERROR BridgedActionsCluster::StopAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t actionID, uint32_t invokeID) +CHIP_ERROR ChannelCluster::SkipChannelRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t count) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -2025,7 +1381,7 @@ CHIP_ERROR BridgedActionsCluster::StopAction(Callback::Cancelable * onSuccessCal VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, BridgedActions::Commands::StopAction::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Channel::Commands::SkipChannelRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -2036,10 +1392,8 @@ CHIP_ERROR BridgedActionsCluster::StopAction(Callback::Cancelable * onSuccessCal SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // actionID: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), actionID)); - // invokeID: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), invokeID)); + // count: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), count)); SuccessOrExit(err = sender->FinishCommand()); @@ -2055,60 +1409,6 @@ CHIP_ERROR BridgedActionsCluster::StopAction(Callback::Cancelable * onSuccessCal return err; } -// BridgedActions Cluster Attributes -CHIP_ERROR BridgedActionsCluster::SubscribeAttributeSetupUrl(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = BridgedActions::Attributes::SetupUrl::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedActionsCluster::ReportAttributeSetupUrl(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(BridgedActions::Attributes::SetupUrl::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR BridgedActionsCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedActionsCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// BridgedDeviceBasic Cluster Commands -// BridgedDeviceBasic Cluster Attributes -CHIP_ERROR BridgedDeviceBasicCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - // ColorControl Cluster Commands CHIP_ERROR ColorControlCluster::ColorLoopSet(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t updateFlags, uint8_t action, uint8_t direction, uint16_t time, @@ -3053,911 +2353,234 @@ CHIP_ERROR ColorControlCluster::StopMoveStep(Callback::Cancelable * onSuccessCal return err; } -// ColorControl Cluster Attributes -CHIP_ERROR ColorControlCluster::SubscribeAttributeCurrentHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +// ContentLauncher Cluster Commands +CHIP_ERROR ContentLauncherCluster::LaunchContentRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, bool autoPlay, + chip::CharSpan data) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::CurrentHue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ColorControlCluster::ReportAttributeCurrentHue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::CurrentHue::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ColorControlCluster::SubscribeAttributeCurrentSaturation(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::CurrentSaturation::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ColorControlCluster::ReportAttributeCurrentSaturation(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::CurrentSaturation::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + ContentLauncher::Commands::LaunchContentRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ColorControlCluster::SubscribeAttributeRemainingTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::RemainingTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ColorControlCluster::ReportAttributeRemainingTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::RemainingTime::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ColorControlCluster::SubscribeAttributeCurrentX(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::CurrentX::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ColorControlCluster::ReportAttributeCurrentX(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::CurrentX::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // autoPlay: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), autoPlay)); + // data: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), data)); -CHIP_ERROR ColorControlCluster::SubscribeAttributeCurrentY(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::CurrentY::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ColorControlCluster::ReportAttributeCurrentY(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::CurrentY::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ColorControlCluster::SubscribeAttributeDriftCompensation(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::DriftCompensation::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ColorControlCluster::ReportAttributeDriftCompensation(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::DriftCompensation::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ColorControlCluster::SubscribeAttributeCompensationText(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +CHIP_ERROR ContentLauncherCluster::LaunchURLRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::CharSpan contentURL, + chip::CharSpan displayString, chip::CharSpan providerName) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::CompensationText::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ColorControlCluster::ReportAttributeCompensationText(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::CompensationText::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorTemperature(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorTemperature::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ColorControlCluster::ReportAttributeColorTemperature(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorTemperature::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ContentLauncher::Commands::LaunchURLRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ColorControlCluster::ReportAttributeColorMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorMode::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorControlOptions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorControlOptions::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ColorControlCluster::ReportAttributeColorControlOptions(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorControlOptions::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // contentURL: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), contentURL)); + // displayString: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), displayString)); + // providerName: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), providerName)); -CHIP_ERROR ColorControlCluster::SubscribeAttributeNumberOfPrimaries(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::NumberOfPrimaries::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ColorControlCluster::ReportAttributeNumberOfPrimaries(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::NumberOfPrimaries::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary1X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary1X::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ColorControlCluster::ReportAttributePrimary1X(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary1X::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary1Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary1Y::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} +// Descriptor Cluster Commands -CHIP_ERROR ColorControlCluster::ReportAttributePrimary1Y(Callback::Cancelable * onReportCallback) +// DiagnosticLogs Cluster Commands +CHIP_ERROR DiagnosticLogsCluster::RetrieveLogsRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t intent, + uint8_t requestedProtocol, chip::ByteSpan transferFileDesignator) { - return RequestAttributeReporting(ColorControl::Attributes::Primary1Y::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary1Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary1Intensity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ColorControlCluster::ReportAttributePrimary1Intensity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary1Intensity::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary2X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary2X::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DiagnosticLogs::Commands::RetrieveLogsRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ColorControlCluster::ReportAttributePrimary2X(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary2X::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary2Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary2Y::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ColorControlCluster::ReportAttributePrimary2Y(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary2Y::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary2Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary2Intensity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // intent: logsIntent + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), intent)); + // requestedProtocol: logsTransferProtocol + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), requestedProtocol)); + // transferFileDesignator: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transferFileDesignator)); -CHIP_ERROR ColorControlCluster::ReportAttributePrimary2Intensity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary2Intensity::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary3X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary3X::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ColorControlCluster::ReportAttributePrimary3X(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary3X::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary3Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary3Y::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ColorControlCluster::ReportAttributePrimary3Y(Callback::Cancelable * onReportCallback) +// DoorLock Cluster Commands +CHIP_ERROR DoorLockCluster::ClearCredential(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t credentialType, uint16_t credentialIndex) { - return RequestAttributeReporting(ColorControl::Attributes::Primary3Y::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary3Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary3Intensity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ColorControlCluster::ReportAttributePrimary3Intensity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary3Intensity::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary4X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary4X::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::ClearCredential::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ColorControlCluster::ReportAttributePrimary4X(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary4X::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary4Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary4Y::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ColorControlCluster::ReportAttributePrimary4Y(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary4Y::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary4Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary4Intensity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // credentialType: dlCredentialType + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialType)); + // credentialIndex: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialIndex)); -CHIP_ERROR ColorControlCluster::ReportAttributePrimary4Intensity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary4Intensity::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary5X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary5X::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ColorControlCluster::ReportAttributePrimary5X(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary5X::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary5Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary5Y::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ColorControlCluster::ReportAttributePrimary5Y(Callback::Cancelable * onReportCallback) +CHIP_ERROR DoorLockCluster::ClearUser(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t userIndex) { - return RequestAttributeReporting(ColorControl::Attributes::Primary5Y::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary5Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary5Intensity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ColorControlCluster::ReportAttributePrimary5Intensity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary5Intensity::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary6X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary6X::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributePrimary6X(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary6X::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary6Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary6Y::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributePrimary6Y(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary6Y::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributePrimary6Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::Primary6Intensity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributePrimary6Intensity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::Primary6Intensity::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeWhitePointX(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::WhitePointX::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeWhitePointX(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::WhitePointX::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeWhitePointY(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::WhitePointY::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeWhitePointY(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::WhitePointY::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorPointRX(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorPointRX::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorPointRX(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorPointRX::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorPointRY(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorPointRY::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorPointRY(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorPointRY::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorPointRIntensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorPointRIntensity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorPointRIntensity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorPointRIntensity::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorPointGX(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorPointGX::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorPointGX(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorPointGX::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorPointGY(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorPointGY::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorPointGY(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorPointGY::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorPointGIntensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorPointGIntensity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorPointGIntensity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorPointGIntensity::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorPointBX(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorPointBX::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorPointBX(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorPointBX::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorPointBY(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorPointBY::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorPointBY(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorPointBY::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorPointBIntensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorPointBIntensity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorPointBIntensity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorPointBIntensity::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeEnhancedCurrentHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::EnhancedCurrentHue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeEnhancedCurrentHue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::EnhancedCurrentHue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeEnhancedColorMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::EnhancedColorMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeEnhancedColorMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::EnhancedColorMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorLoopActive(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorLoopActive::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorLoopActive(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorLoopActive::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorLoopDirection(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorLoopDirection::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorLoopDirection(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorLoopDirection::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorLoopTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorLoopTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorLoopTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorLoopTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorLoopStartEnhancedHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorLoopStartEnhancedHue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorLoopStartEnhancedHue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorLoopStartEnhancedHue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorLoopStoredEnhancedHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorLoopStoredEnhancedHue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorCapabilities(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorCapabilities::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlCluster::ReportAttributeColorCapabilities(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorCapabilities::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorTempPhysicalMin(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorTempPhysicalMin::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ColorControlCluster::ReportAttributeColorTempPhysicalMin(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorTempPhysicalMin::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::ClearUser::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ColorControlCluster::SubscribeAttributeColorTempPhysicalMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::ColorTempPhysicalMax::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ColorControlCluster::ReportAttributeColorTempPhysicalMax(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::ColorTempPhysicalMax::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ColorControlCluster::SubscribeAttributeCoupleColorTempToLevelMinMireds(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ColorControlCluster::ReportAttributeCoupleColorTempToLevelMinMireds(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // userIndex: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userIndex)); -CHIP_ERROR ColorControlCluster::SubscribeAttributeStartUpColorTemperatureMireds(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ColorControl::Attributes::StartUpColorTemperatureMireds::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ColorControlCluster::ReportAttributeStartUpColorTemperatureMireds(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ColorControl::Attributes::StartUpColorTemperatureMireds::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ColorControlCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ColorControlCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// ContentLauncher Cluster Commands -CHIP_ERROR ContentLauncherCluster::LaunchContent(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - bool autoPlay, chip::CharSpan data, uint8_t type, chip::CharSpan value) +CHIP_ERROR DoorLockCluster::GetCredentialStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t credentialType, uint16_t credentialIndex) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -3969,7 +2592,7 @@ CHIP_ERROR ContentLauncherCluster::LaunchContent(Callback::Cancelable * onSucces VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ContentLauncher::Commands::LaunchContent::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::GetCredentialStatus::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -3980,14 +2603,10 @@ CHIP_ERROR ContentLauncherCluster::LaunchContent(Callback::Cancelable * onSucces SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // autoPlay: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), autoPlay)); - // data: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), data)); - // type: contentLaunchParameterEnum - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), type)); - // value: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), value)); + // credentialType: dlCredentialType + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialType)); + // credentialIndex: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialIndex)); SuccessOrExit(err = sender->FinishCommand()); @@ -4003,8 +2622,8 @@ CHIP_ERROR ContentLauncherCluster::LaunchContent(Callback::Cancelable * onSucces return err; } -CHIP_ERROR ContentLauncherCluster::LaunchURL(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan contentURL, chip::CharSpan displayString, chip::CharSpan providerName) +CHIP_ERROR DoorLockCluster::GetUser(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t userIndex) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -4016,7 +2635,7 @@ CHIP_ERROR ContentLauncherCluster::LaunchURL(Callback::Cancelable * onSuccessCal VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ContentLauncher::Commands::LaunchURL::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::GetUser::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4027,12 +2646,8 @@ CHIP_ERROR ContentLauncherCluster::LaunchURL(Callback::Cancelable * onSuccessCal SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // contentURL: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), contentURL)); - // displayString: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), displayString)); - // providerName: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), providerName)); + // userIndex: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userIndex)); SuccessOrExit(err = sender->FinishCommand()); @@ -4048,64 +2663,8 @@ CHIP_ERROR ContentLauncherCluster::LaunchURL(Callback::Cancelable * onSuccessCal return err; } -// ContentLauncher Cluster Attributes -CHIP_ERROR ContentLauncherCluster::SubscribeAttributeSupportedStreamingProtocols(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ContentLauncher::Attributes::SupportedStreamingProtocols::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ContentLauncherCluster::ReportAttributeSupportedStreamingProtocols(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ContentLauncher::Attributes::SupportedStreamingProtocols::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ContentLauncherCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ContentLauncherCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// Descriptor Cluster Commands -// Descriptor Cluster Attributes -CHIP_ERROR DescriptorCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR DescriptorCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// DiagnosticLogs Cluster Commands -CHIP_ERROR DiagnosticLogsCluster::RetrieveLogsRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t intent, - uint8_t requestedProtocol, chip::ByteSpan transferFileDesignator) +CHIP_ERROR DoorLockCluster::LockDoor(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan pinCode) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -4117,7 +2676,7 @@ CHIP_ERROR DiagnosticLogsCluster::RetrieveLogsRequest(Callback::Cancelable * onS VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DiagnosticLogs::Commands::RetrieveLogsRequest::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::LockDoor::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4128,12 +2687,8 @@ CHIP_ERROR DiagnosticLogsCluster::RetrieveLogsRequest(Callback::Cancelable * onS SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // intent: logsIntent - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), intent)); - // requestedProtocol: logsTransferProtocol - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), requestedProtocol)); - // transferFileDesignator: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transferFileDesignator)); + // pinCode: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), pinCode)); SuccessOrExit(err = sender->FinishCommand()); @@ -4149,11 +2704,9 @@ CHIP_ERROR DiagnosticLogsCluster::RetrieveLogsRequest(Callback::Cancelable * onS return err; } -// DiagnosticLogs Cluster Attributes - -// DoorLock Cluster Commands -CHIP_ERROR DoorLockCluster::ClearCredential(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t credentialType, uint16_t credentialIndex) +CHIP_ERROR DoorLockCluster::SetCredential(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t operationType, uint8_t credentialType, uint16_t credentialIndex, + chip::ByteSpan credentialData, uint16_t userIndex, uint8_t userStatus) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -4165,7 +2718,7 @@ CHIP_ERROR DoorLockCluster::ClearCredential(Callback::Cancelable * onSuccessCall VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::ClearCredential::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::SetCredential::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4176,10 +2729,18 @@ CHIP_ERROR DoorLockCluster::ClearCredential(Callback::Cancelable * onSuccessCall SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // operationType: dlDataOperationType + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), operationType)); // credentialType: dlCredentialType SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialType)); // credentialIndex: int16u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialIndex)); + // credentialData: longOctetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialData)); + // userIndex: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userIndex)); + // userStatus: dlUserStatus + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userStatus)); SuccessOrExit(err = sender->FinishCommand()); @@ -4195,9 +2756,10 @@ CHIP_ERROR DoorLockCluster::ClearCredential(Callback::Cancelable * onSuccessCall return err; } -CHIP_ERROR DoorLockCluster::ClearUser(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t userIndex) -{ +CHIP_ERROR DoorLockCluster::SetUser(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t operationType, uint16_t userIndex, chip::CharSpan userName, uint32_t userUniqueId, + uint8_t userStatus, uint8_t userType, uint8_t credentialRule) +{ CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; uint8_t argSeqNumber = 0; @@ -4208,7 +2770,7 @@ CHIP_ERROR DoorLockCluster::ClearUser(Callback::Cancelable * onSuccessCallback, VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::ClearUser::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::SetUser::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4219,8 +2781,20 @@ CHIP_ERROR DoorLockCluster::ClearUser(Callback::Cancelable * onSuccessCallback, SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // operationType: dlDataOperationType + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), operationType)); // userIndex: int16u SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userIndex)); + // userName: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), userName)); + // userUniqueId: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userUniqueId)); + // userStatus: dlUserStatus + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userStatus)); + // userType: dlUserType + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userType)); + // credentialRule: dlCredentialRule + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialRule)); SuccessOrExit(err = sender->FinishCommand()); @@ -4236,8 +2810,8 @@ CHIP_ERROR DoorLockCluster::ClearUser(Callback::Cancelable * onSuccessCallback, return err; } -CHIP_ERROR DoorLockCluster::GetCredentialStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t credentialType, uint16_t credentialIndex) +CHIP_ERROR DoorLockCluster::UnlockDoor(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan pinCode) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -4249,7 +2823,7 @@ CHIP_ERROR DoorLockCluster::GetCredentialStatus(Callback::Cancelable * onSuccess VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::GetCredentialStatus::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::UnlockDoor::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4260,10 +2834,8 @@ CHIP_ERROR DoorLockCluster::GetCredentialStatus(Callback::Cancelable * onSuccess SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // credentialType: dlCredentialType - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialType)); - // credentialIndex: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialIndex)); + // pinCode: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), pinCode)); SuccessOrExit(err = sender->FinishCommand()); @@ -4279,8 +2851,11 @@ CHIP_ERROR DoorLockCluster::GetCredentialStatus(Callback::Cancelable * onSuccess return err; } -CHIP_ERROR DoorLockCluster::GetUser(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t userIndex) +// ElectricalMeasurement Cluster Commands + +// EthernetNetworkDiagnostics Cluster Commands +CHIP_ERROR EthernetNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -4292,7 +2867,8 @@ CHIP_ERROR DoorLockCluster::GetUser(Callback::Cancelable * onSuccessCallback, Ca VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::GetUser::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + EthernetNetworkDiagnostics::Commands::ResetCounts::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4302,9 +2878,7 @@ CHIP_ERROR DoorLockCluster::GetUser(Callback::Cancelable * onSuccessCallback, Ca SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // userIndex: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userIndex)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -4320,8 +2894,14 @@ CHIP_ERROR DoorLockCluster::GetUser(Callback::Cancelable * onSuccessCallback, Ca return err; } -CHIP_ERROR DoorLockCluster::LockDoor(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan pinCode) +// FixedLabel Cluster Commands + +// FlowMeasurement Cluster Commands + +// GeneralCommissioning Cluster Commands +CHIP_ERROR GeneralCommissioningCluster::ArmFailSafe(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t expiryLengthSeconds, + uint64_t breadcrumb, uint32_t timeoutMs) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -4333,7 +2913,7 @@ CHIP_ERROR DoorLockCluster::LockDoor(Callback::Cancelable * onSuccessCallback, C VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::LockDoor::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, GeneralCommissioning::Commands::ArmFailSafe::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4344,8 +2924,12 @@ CHIP_ERROR DoorLockCluster::LockDoor(Callback::Cancelable * onSuccessCallback, C SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // pinCode: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), pinCode)); + // expiryLengthSeconds: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), expiryLengthSeconds)); + // breadcrumb: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); + // timeoutMs: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), timeoutMs)); SuccessOrExit(err = sender->FinishCommand()); @@ -4361,9 +2945,8 @@ CHIP_ERROR DoorLockCluster::LockDoor(Callback::Cancelable * onSuccessCallback, C return err; } -CHIP_ERROR DoorLockCluster::SetCredential(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t operationType, uint8_t credentialType, uint16_t credentialIndex, - chip::ByteSpan credentialData, uint16_t userIndex, uint8_t userStatus) +CHIP_ERROR GeneralCommissioningCluster::CommissioningComplete(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -4375,7 +2958,8 @@ CHIP_ERROR DoorLockCluster::SetCredential(Callback::Cancelable * onSuccessCallba VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::SetCredential::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + GeneralCommissioning::Commands::CommissioningComplete::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4385,19 +2969,7 @@ CHIP_ERROR DoorLockCluster::SetCredential(Callback::Cancelable * onSuccessCallba SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // operationType: dlDataOperationType - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), operationType)); - // credentialType: dlCredentialType - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialType)); - // credentialIndex: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialIndex)); - // credentialData: longOctetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialData)); - // userIndex: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userIndex)); - // userStatus: dlUserStatus - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userStatus)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -4413,9 +2985,9 @@ CHIP_ERROR DoorLockCluster::SetCredential(Callback::Cancelable * onSuccessCallba return err; } -CHIP_ERROR DoorLockCluster::SetUser(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t operationType, uint16_t userIndex, chip::CharSpan userName, uint32_t userUniqueId, - uint8_t userStatus, uint8_t userType, uint8_t credentialRule) +CHIP_ERROR GeneralCommissioningCluster::SetRegulatoryConfig(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t location, + chip::CharSpan countryCode, uint64_t breadcrumb, uint32_t timeoutMs) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -4427,7 +2999,8 @@ CHIP_ERROR DoorLockCluster::SetUser(Callback::Cancelable * onSuccessCallback, Ca VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::SetUser::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + GeneralCommissioning::Commands::SetRegulatoryConfig::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4438,20 +3011,14 @@ CHIP_ERROR DoorLockCluster::SetUser(Callback::Cancelable * onSuccessCallback, Ca SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // operationType: dlDataOperationType - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), operationType)); - // userIndex: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userIndex)); - // userName: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), userName)); - // userUniqueId: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userUniqueId)); - // userStatus: dlUserStatus - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userStatus)); - // userType: dlUserType - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), userType)); - // credentialRule: dlCredentialRule - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentialRule)); + // location: regulatoryLocationType + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), location)); + // countryCode: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), countryCode)); + // breadcrumb: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); + // timeoutMs: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), timeoutMs)); SuccessOrExit(err = sender->FinishCommand()); @@ -4467,8 +3034,11 @@ CHIP_ERROR DoorLockCluster::SetUser(Callback::Cancelable * onSuccessCallback, Ca return err; } -CHIP_ERROR DoorLockCluster::UnlockDoor(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan pinCode) +// GeneralDiagnostics Cluster Commands + +// GroupKeyManagement Cluster Commands +CHIP_ERROR GroupKeyManagementCluster::KeySetRead(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupKeySetID) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -4480,7 +3050,7 @@ CHIP_ERROR DoorLockCluster::UnlockDoor(Callback::Cancelable * onSuccessCallback, VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, DoorLock::Commands::UnlockDoor::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, GroupKeyManagement::Commands::KeySetRead::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4491,8 +3061,8 @@ CHIP_ERROR DoorLockCluster::UnlockDoor(Callback::Cancelable * onSuccessCallback, SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // pinCode: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), pinCode)); + // groupKeySetID: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupKeySetID)); SuccessOrExit(err = sender->FinishCommand()); @@ -4508,420 +3078,193 @@ CHIP_ERROR DoorLockCluster::UnlockDoor(Callback::Cancelable * onSuccessCallback, return err; } -// DoorLock Cluster Attributes -CHIP_ERROR DoorLockCluster::SubscribeAttributeLockState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +CHIP_ERROR GroupKeyManagementCluster::KeySetReadAllIndices(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t groupKeySetIDs) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::LockState::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR DoorLockCluster::ReportAttributeLockState(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::LockState::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR DoorLockCluster::SubscribeAttributeLockType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::LockType::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR DoorLockCluster::ReportAttributeLockType(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::LockType::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + GroupKeyManagement::Commands::KeySetReadAllIndices::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR DoorLockCluster::SubscribeAttributeActuatorEnabled(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::ActuatorEnabled::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR DoorLockCluster::ReportAttributeActuatorEnabled(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::ActuatorEnabled::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR DoorLockCluster::SubscribeAttributeDoorState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::DoorState::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR DoorLockCluster::ReportAttributeDoorState(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::DoorState::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupKeySetIDs: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupKeySetIDs)); -CHIP_ERROR DoorLockCluster::SubscribeAttributeLanguage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::Language::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR DoorLockCluster::ReportAttributeLanguage(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::Language::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR DoorLockCluster::SubscribeAttributeAutoRelockTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::AutoRelockTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR DoorLockCluster::ReportAttributeAutoRelockTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::AutoRelockTime::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR DoorLockCluster::SubscribeAttributeSoundVolume(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +CHIP_ERROR GroupKeyManagementCluster::KeySetRemove(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t groupKeySetID) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::SoundVolume::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR DoorLockCluster::ReportAttributeSoundVolume(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::SoundVolume::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR DoorLockCluster::SubscribeAttributeOperatingMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::OperatingMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR DoorLockCluster::ReportAttributeOperatingMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::OperatingMode::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, GroupKeyManagement::Commands::KeySetRemove::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR DoorLockCluster::SubscribeAttributeEnableOneTouchLocking(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::EnableOneTouchLocking::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR DoorLockCluster::ReportAttributeEnableOneTouchLocking(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::EnableOneTouchLocking::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR DoorLockCluster::SubscribeAttributeEnablePrivacyModeButton(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::EnablePrivacyModeButton::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR DoorLockCluster::ReportAttributeEnablePrivacyModeButton(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::EnablePrivacyModeButton::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupKeySetID: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupKeySetID)); -CHIP_ERROR DoorLockCluster::SubscribeAttributeWrongCodeEntryLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = DoorLock::Attributes::WrongCodeEntryLimit::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR DoorLockCluster::ReportAttributeWrongCodeEntryLimit(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(DoorLock::Attributes::WrongCodeEntryLimit::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR DoorLockCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR DoorLockCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// ElectricalMeasurement Cluster Commands -// ElectricalMeasurement Cluster Attributes -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeMeasurementType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) +CHIP_ERROR GroupKeyManagementCluster::KeySetWrite(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t groupKeySetID, + uint8_t securityPolicy, chip::ByteSpan epochKey0, uint64_t epochStartTime0, + chip::ByteSpan epochKey1, uint64_t epochStartTime1, chip::ByteSpan epochKey2, + uint64_t epochStartTime2) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::MeasurementType::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeMeasurementType(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::MeasurementType::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeTotalActivePower(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::TotalActivePower::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeTotalActivePower(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::TotalActivePower::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, GroupKeyManagement::Commands::KeySetWrite::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeRmsVoltage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::RmsVoltage::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeRmsVoltage(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::RmsVoltage::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeRmsVoltageMin(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::RmsVoltageMin::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeRmsVoltageMin(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::RmsVoltageMin::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupKeySetID: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupKeySetID)); + // securityPolicy: groupKeySecurityPolicy + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), securityPolicy)); + // epochKey0: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochKey0)); + // epochStartTime0: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochStartTime0)); + // epochKey1: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochKey1)); + // epochStartTime1: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochStartTime1)); + // epochKey2: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochKey2)); + // epochStartTime2: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), epochStartTime2)); -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeRmsVoltageMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::RmsVoltageMax::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeRmsVoltageMax(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::RmsVoltageMax::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeRmsCurrent(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::RmsCurrent::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeRmsCurrent(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::RmsCurrent::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeRmsCurrentMin(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) +// Groups Cluster Commands +CHIP_ERROR GroupsCluster::AddGroup(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId, chip::CharSpan groupName) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::RmsCurrentMin::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeRmsCurrentMin(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::RmsCurrentMin::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeRmsCurrentMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::RmsCurrentMax::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeRmsCurrentMax(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::RmsCurrentMax::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::AddGroup::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeActivePower(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::ActivePower::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeActivePower(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::ActivePower::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeActivePowerMin(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::ActivePowerMin::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeActivePowerMin(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::ActivePowerMin::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // groupName: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), groupName)); -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeActivePowerMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ElectricalMeasurement::Attributes::ActivePowerMax::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeActivePowerMax(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ElectricalMeasurement::Attributes::ActivePowerMax::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ElectricalMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ElectricalMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// EthernetNetworkDiagnostics Cluster Commands -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR GroupsCluster::AddGroupIfIdentifying(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId, chip::CharSpan groupName) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -4933,8 +3276,7 @@ CHIP_ERROR EthernetNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - EthernetNetworkDiagnostics::Commands::ResetCounts::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::AddGroupIfIdentifying::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -4944,7 +3286,11 @@ CHIP_ERROR EthernetNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // groupName: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), groupName)); SuccessOrExit(err = sender->FinishCommand()); @@ -4960,287 +3306,87 @@ CHIP_ERROR EthernetNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * return err; } -// EthernetNetworkDiagnostics Cluster Attributes -CHIP_ERROR EthernetNetworkDiagnosticsCluster::SubscribeAttributePHYRate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = EthernetNetworkDiagnostics::Attributes::PHYRate::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ReportAttributePHYRate(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(EthernetNetworkDiagnostics::Attributes::PHYRate::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR EthernetNetworkDiagnosticsCluster::SubscribeAttributeFullDuplex(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = EthernetNetworkDiagnostics::Attributes::FullDuplex::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ReportAttributeFullDuplex(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(EthernetNetworkDiagnostics::Attributes::FullDuplex::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR EthernetNetworkDiagnosticsCluster::SubscribeAttributePacketRxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = EthernetNetworkDiagnostics::Attributes::PacketRxCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ReportAttributePacketRxCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(EthernetNetworkDiagnostics::Attributes::PacketRxCount::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR EthernetNetworkDiagnosticsCluster::SubscribeAttributePacketTxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = EthernetNetworkDiagnostics::Attributes::PacketTxCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ReportAttributePacketTxCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(EthernetNetworkDiagnostics::Attributes::PacketTxCount::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR EthernetNetworkDiagnosticsCluster::SubscribeAttributeTxErrCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) +CHIP_ERROR GroupsCluster::GetGroupMembership(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupList) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = EthernetNetworkDiagnostics::Attributes::TxErrCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ReportAttributeTxErrCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(EthernetNetworkDiagnostics::Attributes::TxErrCount::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR EthernetNetworkDiagnosticsCluster::SubscribeAttributeCollisionCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = EthernetNetworkDiagnostics::Attributes::CollisionCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ReportAttributeCollisionCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(EthernetNetworkDiagnostics::Attributes::CollisionCount::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::GetGroupMembership::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR EthernetNetworkDiagnosticsCluster::SubscribeAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = EthernetNetworkDiagnostics::Attributes::OverrunCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ReportAttributeOverrunCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(EthernetNetworkDiagnostics::Attributes::OverrunCount::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR EthernetNetworkDiagnosticsCluster::SubscribeAttributeCarrierDetect(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = EthernetNetworkDiagnostics::Attributes::CarrierDetect::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ReportAttributeCarrierDetect(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(EthernetNetworkDiagnostics::Attributes::CarrierDetect::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupList: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupList)); -CHIP_ERROR EthernetNetworkDiagnosticsCluster::SubscribeAttributeTimeSinceReset(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = EthernetNetworkDiagnostics::Attributes::TimeSinceReset::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ReportAttributeTimeSinceReset(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(EthernetNetworkDiagnostics::Attributes::TimeSinceReset::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR EthernetNetworkDiagnosticsCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR EthernetNetworkDiagnosticsCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// FixedLabel Cluster Commands -// FixedLabel Cluster Attributes -CHIP_ERROR FixedLabelCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +CHIP_ERROR GroupsCluster::RemoveAllGroups(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR FixedLabelCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -// FlowMeasurement Cluster Commands -// FlowMeasurement Cluster Attributes -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = FlowMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR FlowMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(FlowMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::RemoveAllGroups::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = FlowMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR FlowMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(FlowMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = FlowMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR FlowMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(FlowMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} + // Command takes no arguments. -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = FlowMeasurement::Attributes::Tolerance::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR FlowMeasurementCluster::ReportAttributeTolerance(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(FlowMeasurement::Attributes::Tolerance::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR FlowMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// GeneralCommissioning Cluster Commands -CHIP_ERROR GeneralCommissioningCluster::ArmFailSafe(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t expiryLengthSeconds, - uint64_t breadcrumb, uint32_t timeoutMs) +CHIP_ERROR GroupsCluster::RemoveGroup(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5252,7 +3398,7 @@ CHIP_ERROR GeneralCommissioningCluster::ArmFailSafe(Callback::Cancelable * onSuc VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, GeneralCommissioning::Commands::ArmFailSafe::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::RemoveGroup::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5263,12 +3409,8 @@ CHIP_ERROR GeneralCommissioningCluster::ArmFailSafe(Callback::Cancelable * onSuc SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // expiryLengthSeconds: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), expiryLengthSeconds)); - // breadcrumb: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); - // timeoutMs: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), timeoutMs)); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); SuccessOrExit(err = sender->FinishCommand()); @@ -5284,8 +3426,8 @@ CHIP_ERROR GeneralCommissioningCluster::ArmFailSafe(Callback::Cancelable * onSuc return err; } -CHIP_ERROR GeneralCommissioningCluster::CommissioningComplete(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR GroupsCluster::ViewGroup(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5297,8 +3439,7 @@ CHIP_ERROR GeneralCommissioningCluster::CommissioningComplete(Callback::Cancelab VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - GeneralCommissioning::Commands::CommissioningComplete::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::ViewGroup::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5308,7 +3449,9 @@ CHIP_ERROR GeneralCommissioningCluster::CommissioningComplete(Callback::Cancelab SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); SuccessOrExit(err = sender->FinishCommand()); @@ -5324,9 +3467,9 @@ CHIP_ERROR GeneralCommissioningCluster::CommissioningComplete(Callback::Cancelab return err; } -CHIP_ERROR GeneralCommissioningCluster::SetRegulatoryConfig(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t location, - chip::CharSpan countryCode, uint64_t breadcrumb, uint32_t timeoutMs) +// Identify Cluster Commands +CHIP_ERROR IdentifyCluster::Identify(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t identifyTime) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5338,8 +3481,7 @@ CHIP_ERROR GeneralCommissioningCluster::SetRegulatoryConfig(Callback::Cancelable VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - GeneralCommissioning::Commands::SetRegulatoryConfig::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Identify::Commands::Identify::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5350,14 +3492,8 @@ CHIP_ERROR GeneralCommissioningCluster::SetRegulatoryConfig(Callback::Cancelable SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // location: regulatoryLocationType - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), location)); - // countryCode: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), countryCode)); - // breadcrumb: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); - // timeoutMs: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), timeoutMs)); + // identifyTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), identifyTime)); SuccessOrExit(err = sender->FinishCommand()); @@ -5373,150 +3509,46 @@ CHIP_ERROR GeneralCommissioningCluster::SetRegulatoryConfig(Callback::Cancelable return err; } -// GeneralCommissioning Cluster Attributes -CHIP_ERROR GeneralCommissioningCluster::SubscribeAttributeBreadcrumb(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +CHIP_ERROR IdentifyCluster::IdentifyQuery(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = GeneralCommissioning::Attributes::Breadcrumb::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR GeneralCommissioningCluster::ReportAttributeBreadcrumb(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(GeneralCommissioning::Attributes::Breadcrumb::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR GeneralCommissioningCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR GeneralCommissioningCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// GeneralDiagnostics Cluster Commands -// GeneralDiagnostics Cluster Attributes -CHIP_ERROR GeneralDiagnosticsCluster::SubscribeAttributeRebootCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = GeneralDiagnostics::Attributes::RebootCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR GeneralDiagnosticsCluster::ReportAttributeRebootCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(GeneralDiagnostics::Attributes::RebootCount::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR GeneralDiagnosticsCluster::SubscribeAttributeUpTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = GeneralDiagnostics::Attributes::UpTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR GeneralDiagnosticsCluster::ReportAttributeUpTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(GeneralDiagnostics::Attributes::UpTime::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Identify::Commands::IdentifyQuery::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR GeneralDiagnosticsCluster::SubscribeAttributeTotalOperationalHours(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = GeneralDiagnostics::Attributes::TotalOperationalHours::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR GeneralDiagnosticsCluster::ReportAttributeTotalOperationalHours(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(GeneralDiagnostics::Attributes::TotalOperationalHours::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR GeneralDiagnosticsCluster::SubscribeAttributeBootReasons(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = GeneralDiagnostics::Attributes::BootReasons::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR GeneralDiagnosticsCluster::ReportAttributeBootReasons(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(GeneralDiagnostics::Attributes::BootReasons::Id, onReportCallback, - BasicAttributeFilter); -} + // Command takes no arguments. -CHIP_ERROR GeneralDiagnosticsCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR GeneralDiagnosticsCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -// GroupKeyManagement Cluster Commands -// GroupKeyManagement Cluster Attributes -CHIP_ERROR GroupKeyManagementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR GroupKeyManagementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// Groups Cluster Commands -CHIP_ERROR GroupsCluster::AddGroup(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId, chip::CharSpan groupName) +CHIP_ERROR IdentifyCluster::TriggerEffect(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t effectIdentifier, uint8_t effectVariant) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5528,7 +3560,7 @@ CHIP_ERROR GroupsCluster::AddGroup(Callback::Cancelable * onSuccessCallback, Cal VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::AddGroup::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Identify::Commands::TriggerEffect::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5539,10 +3571,10 @@ CHIP_ERROR GroupsCluster::AddGroup(Callback::Cancelable * onSuccessCallback, Cal SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - // groupName: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), groupName)); + // effectIdentifier: identifyEffectIdentifier + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), effectIdentifier)); + // effectVariant: identifyEffectVariant + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), effectVariant)); SuccessOrExit(err = sender->FinishCommand()); @@ -5558,8 +3590,11 @@ CHIP_ERROR GroupsCluster::AddGroup(Callback::Cancelable * onSuccessCallback, Cal return err; } -CHIP_ERROR GroupsCluster::AddGroupIfIdentifying(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId, chip::CharSpan groupName) +// IlluminanceMeasurement Cluster Commands + +// KeypadInput Cluster Commands +CHIP_ERROR KeypadInputCluster::SendKeyRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t keyCode) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5571,7 +3606,7 @@ CHIP_ERROR GroupsCluster::AddGroupIfIdentifying(Callback::Cancelable * onSuccess VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::AddGroupIfIdentifying::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, KeypadInput::Commands::SendKeyRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5582,10 +3617,8 @@ CHIP_ERROR GroupsCluster::AddGroupIfIdentifying(Callback::Cancelable * onSuccess SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - // groupName: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), groupName)); + // keyCode: cecKeyCode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), keyCode)); SuccessOrExit(err = sender->FinishCommand()); @@ -5601,8 +3634,9 @@ CHIP_ERROR GroupsCluster::AddGroupIfIdentifying(Callback::Cancelable * onSuccess return err; } -CHIP_ERROR GroupsCluster::GetGroupMembership(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupList) +// LevelControl Cluster Commands +CHIP_ERROR LevelControlCluster::Move(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t moveMode, uint8_t rate, uint8_t optionMask, uint8_t optionOverride) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5614,7 +3648,7 @@ CHIP_ERROR GroupsCluster::GetGroupMembership(Callback::Cancelable * onSuccessCal VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::GetGroupMembership::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::Move::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5625,8 +3659,14 @@ CHIP_ERROR GroupsCluster::GetGroupMembership(Callback::Cancelable * onSuccessCal SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupList: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupList)); + // moveMode: moveMode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), moveMode)); + // rate: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rate)); + // optionMask: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); + // optionOverride: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); SuccessOrExit(err = sender->FinishCommand()); @@ -5642,7 +3682,8 @@ CHIP_ERROR GroupsCluster::GetGroupMembership(Callback::Cancelable * onSuccessCal return err; } -CHIP_ERROR GroupsCluster::RemoveAllGroups(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR LevelControlCluster::MoveToLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t level, uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5654,7 +3695,7 @@ CHIP_ERROR GroupsCluster::RemoveAllGroups(Callback::Cancelable * onSuccessCallba VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::RemoveAllGroups::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::MoveToLevel::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5664,7 +3705,15 @@ CHIP_ERROR GroupsCluster::RemoveAllGroups(Callback::Cancelable * onSuccessCallba SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // level: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), level)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); + // optionMask: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); + // optionOverride: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); SuccessOrExit(err = sender->FinishCommand()); @@ -5680,8 +3729,9 @@ CHIP_ERROR GroupsCluster::RemoveAllGroups(Callback::Cancelable * onSuccessCallba return err; } -CHIP_ERROR GroupsCluster::RemoveGroup(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId) +CHIP_ERROR LevelControlCluster::MoveToLevelWithOnOff(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t level, + uint16_t transitionTime) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5693,7 +3743,7 @@ CHIP_ERROR GroupsCluster::RemoveGroup(Callback::Cancelable * onSuccessCallback, VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::RemoveGroup::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::MoveToLevelWithOnOff::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5704,8 +3754,10 @@ CHIP_ERROR GroupsCluster::RemoveGroup(Callback::Cancelable * onSuccessCallback, SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // level: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), level)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); SuccessOrExit(err = sender->FinishCommand()); @@ -5721,8 +3773,8 @@ CHIP_ERROR GroupsCluster::RemoveGroup(Callback::Cancelable * onSuccessCallback, return err; } -CHIP_ERROR GroupsCluster::ViewGroup(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId) +CHIP_ERROR LevelControlCluster::MoveWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t moveMode, uint8_t rate) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5734,7 +3786,7 @@ CHIP_ERROR GroupsCluster::ViewGroup(Callback::Cancelable * onSuccessCallback, Ca VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Groups::Commands::ViewGroup::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::MoveWithOnOff::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5745,8 +3797,10 @@ CHIP_ERROR GroupsCluster::ViewGroup(Callback::Cancelable * onSuccessCallback, Ca SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // moveMode: moveMode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), moveMode)); + // rate: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rate)); SuccessOrExit(err = sender->FinishCommand()); @@ -5762,44 +3816,9 @@ CHIP_ERROR GroupsCluster::ViewGroup(Callback::Cancelable * onSuccessCallback, Ca return err; } -// Groups Cluster Attributes -CHIP_ERROR GroupsCluster::SubscribeAttributeNameSupport(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Groups::Attributes::NameSupport::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR GroupsCluster::ReportAttributeNameSupport(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Groups::Attributes::NameSupport::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR GroupsCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR GroupsCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// Identify Cluster Commands -CHIP_ERROR IdentifyCluster::Identify(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t identifyTime) +CHIP_ERROR LevelControlCluster::Step(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime, uint8_t optionMask, + uint8_t optionOverride) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5811,7 +3830,7 @@ CHIP_ERROR IdentifyCluster::Identify(Callback::Cancelable * onSuccessCallback, C VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Identify::Commands::Identify::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::Step::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5822,8 +3841,16 @@ CHIP_ERROR IdentifyCluster::Identify(Callback::Cancelable * onSuccessCallback, C SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // identifyTime: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), identifyTime)); + // stepMode: stepMode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepMode)); + // stepSize: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepSize)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); + // optionMask: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); + // optionOverride: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); SuccessOrExit(err = sender->FinishCommand()); @@ -5839,7 +3866,8 @@ CHIP_ERROR IdentifyCluster::Identify(Callback::Cancelable * onSuccessCallback, C return err; } -CHIP_ERROR IdentifyCluster::IdentifyQuery(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR LevelControlCluster::StepWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5851,7 +3879,7 @@ CHIP_ERROR IdentifyCluster::IdentifyQuery(Callback::Cancelable * onSuccessCallba VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Identify::Commands::IdentifyQuery::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::StepWithOnOff::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5861,7 +3889,13 @@ CHIP_ERROR IdentifyCluster::IdentifyQuery(Callback::Cancelable * onSuccessCallba SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // stepMode: stepMode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepMode)); + // stepSize: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepSize)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); SuccessOrExit(err = sender->FinishCommand()); @@ -5877,8 +3911,8 @@ CHIP_ERROR IdentifyCluster::IdentifyQuery(Callback::Cancelable * onSuccessCallba return err; } -CHIP_ERROR IdentifyCluster::TriggerEffect(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t effectIdentifier, uint8_t effectVariant) +CHIP_ERROR LevelControlCluster::Stop(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t optionMask, uint8_t optionOverride) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -5890,7 +3924,7 @@ CHIP_ERROR IdentifyCluster::TriggerEffect(Callback::Cancelable * onSuccessCallba VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Identify::Commands::TriggerEffect::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::Stop::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -5901,10 +3935,10 @@ CHIP_ERROR IdentifyCluster::TriggerEffect(Callback::Cancelable * onSuccessCallba SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // effectIdentifier: identifyEffectIdentifier - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), effectIdentifier)); - // effectVariant: identifyEffectVariant - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), effectVariant)); + // optionMask: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); + // optionOverride: bitmap8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); SuccessOrExit(err = sender->FinishCommand()); @@ -5920,165 +3954,7 @@ CHIP_ERROR IdentifyCluster::TriggerEffect(Callback::Cancelable * onSuccessCallba return err; } -// Identify Cluster Attributes -CHIP_ERROR IdentifyCluster::SubscribeAttributeIdentifyTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Identify::Attributes::IdentifyTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IdentifyCluster::ReportAttributeIdentifyTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Identify::Attributes::IdentifyTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR IdentifyCluster::SubscribeAttributeIdentifyType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Identify::Attributes::IdentifyType::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IdentifyCluster::ReportAttributeIdentifyType(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Identify::Attributes::IdentifyType::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR IdentifyCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IdentifyCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// IlluminanceMeasurement Cluster Commands -// IlluminanceMeasurement Cluster Attributes -CHIP_ERROR IlluminanceMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = IlluminanceMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IlluminanceMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(IlluminanceMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR IlluminanceMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = IlluminanceMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IlluminanceMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(IlluminanceMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR IlluminanceMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IlluminanceMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR IlluminanceMeasurementCluster::SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = IlluminanceMeasurement::Attributes::Tolerance::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IlluminanceMeasurementCluster::ReportAttributeTolerance(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(IlluminanceMeasurement::Attributes::Tolerance::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR IlluminanceMeasurementCluster::SubscribeAttributeLightSensorType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = IlluminanceMeasurement::Attributes::LightSensorType::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IlluminanceMeasurementCluster::ReportAttributeLightSensorType(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(IlluminanceMeasurement::Attributes::LightSensorType::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR IlluminanceMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IlluminanceMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// KeypadInput Cluster Commands -CHIP_ERROR KeypadInputCluster::SendKey(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t keyCode) +CHIP_ERROR LevelControlCluster::StopWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6090,7 +3966,7 @@ CHIP_ERROR KeypadInputCluster::SendKey(Callback::Cancelable * onSuccessCallback, VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, KeypadInput::Commands::SendKey::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::StopWithOnOff::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6100,9 +3976,7 @@ CHIP_ERROR KeypadInputCluster::SendKey(Callback::Cancelable * onSuccessCallback, SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // keyCode: keypadInputCecKeyCode - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), keyCode)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -6118,27 +3992,8 @@ CHIP_ERROR KeypadInputCluster::SendKey(Callback::Cancelable * onSuccessCallback, return err; } -// KeypadInput Cluster Attributes -CHIP_ERROR KeypadInputCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR KeypadInputCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// LevelControl Cluster Commands -CHIP_ERROR LevelControlCluster::Move(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t moveMode, uint8_t rate, uint8_t optionMask, uint8_t optionOverride) +// LowPower Cluster Commands +CHIP_ERROR LowPowerCluster::Sleep(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6150,7 +4005,7 @@ CHIP_ERROR LevelControlCluster::Move(Callback::Cancelable * onSuccessCallback, C VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::Move::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LowPower::Commands::Sleep::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6160,15 +4015,7 @@ CHIP_ERROR LevelControlCluster::Move(Callback::Cancelable * onSuccessCallback, C SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // moveMode: moveMode - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), moveMode)); - // rate: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rate)); - // optionMask: bitmap8 - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); - // optionOverride: bitmap8 - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -6184,8 +4031,9 @@ CHIP_ERROR LevelControlCluster::Move(Callback::Cancelable * onSuccessCallback, C return err; } -CHIP_ERROR LevelControlCluster::MoveToLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t level, uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride) +// MediaInput Cluster Commands +CHIP_ERROR MediaInputCluster::HideInputStatusRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6197,7 +4045,7 @@ CHIP_ERROR LevelControlCluster::MoveToLevel(Callback::Cancelable * onSuccessCall VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::MoveToLevel::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::HideInputStatusRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6207,15 +4055,7 @@ CHIP_ERROR LevelControlCluster::MoveToLevel(Callback::Cancelable * onSuccessCall SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // level: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), level)); - // transitionTime: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); - // optionMask: bitmap8 - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); - // optionOverride: bitmap8 - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -6231,9 +4071,8 @@ CHIP_ERROR LevelControlCluster::MoveToLevel(Callback::Cancelable * onSuccessCall return err; } -CHIP_ERROR LevelControlCluster::MoveToLevelWithOnOff(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t level, - uint16_t transitionTime) +CHIP_ERROR MediaInputCluster::RenameInputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t index, chip::CharSpan name) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6245,7 +4084,7 @@ CHIP_ERROR LevelControlCluster::MoveToLevelWithOnOff(Callback::Cancelable * onSu VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::MoveToLevelWithOnOff::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::RenameInputRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6256,10 +4095,10 @@ CHIP_ERROR LevelControlCluster::MoveToLevelWithOnOff(Callback::Cancelable * onSu SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // level: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), level)); - // transitionTime: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); + // index: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); + // name: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), name)); SuccessOrExit(err = sender->FinishCommand()); @@ -6275,8 +4114,8 @@ CHIP_ERROR LevelControlCluster::MoveToLevelWithOnOff(Callback::Cancelable * onSu return err; } -CHIP_ERROR LevelControlCluster::MoveWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t moveMode, uint8_t rate) +CHIP_ERROR MediaInputCluster::SelectInputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t index) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6288,7 +4127,7 @@ CHIP_ERROR LevelControlCluster::MoveWithOnOff(Callback::Cancelable * onSuccessCa VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::MoveWithOnOff::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::SelectInputRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6299,10 +4138,8 @@ CHIP_ERROR LevelControlCluster::MoveWithOnOff(Callback::Cancelable * onSuccessCa SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // moveMode: moveMode - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), moveMode)); - // rate: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rate)); + // index: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); SuccessOrExit(err = sender->FinishCommand()); @@ -6318,9 +4155,8 @@ CHIP_ERROR LevelControlCluster::MoveWithOnOff(Callback::Cancelable * onSuccessCa return err; } -CHIP_ERROR LevelControlCluster::Step(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime, uint8_t optionMask, - uint8_t optionOverride) +CHIP_ERROR MediaInputCluster::ShowInputStatusRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6332,7 +4168,7 @@ CHIP_ERROR LevelControlCluster::Step(Callback::Cancelable * onSuccessCallback, C VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::Step::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::ShowInputStatusRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6342,17 +4178,7 @@ CHIP_ERROR LevelControlCluster::Step(Callback::Cancelable * onSuccessCallback, C SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // stepMode: stepMode - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepMode)); - // stepSize: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepSize)); - // transitionTime: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); - // optionMask: bitmap8 - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); - // optionOverride: bitmap8 - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -6368,8 +4194,9 @@ CHIP_ERROR LevelControlCluster::Step(Callback::Cancelable * onSuccessCallback, C return err; } -CHIP_ERROR LevelControlCluster::StepWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime) +// MediaPlayback Cluster Commands +CHIP_ERROR MediaPlaybackCluster::FastForwardRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6381,7 +4208,7 @@ CHIP_ERROR LevelControlCluster::StepWithOnOff(Callback::Cancelable * onSuccessCa VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::StepWithOnOff::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::FastForwardRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6391,13 +4218,7 @@ CHIP_ERROR LevelControlCluster::StepWithOnOff(Callback::Cancelable * onSuccessCa SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // stepMode: stepMode - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepMode)); - // stepSize: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), stepSize)); - // transitionTime: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -6413,8 +4234,7 @@ CHIP_ERROR LevelControlCluster::StepWithOnOff(Callback::Cancelable * onSuccessCa return err; } -CHIP_ERROR LevelControlCluster::Stop(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t optionMask, uint8_t optionOverride) +CHIP_ERROR MediaPlaybackCluster::NextRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6426,7 +4246,7 @@ CHIP_ERROR LevelControlCluster::Stop(Callback::Cancelable * onSuccessCallback, C VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::Stop::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::NextRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6436,11 +4256,7 @@ CHIP_ERROR LevelControlCluster::Stop(Callback::Cancelable * onSuccessCallback, C SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // optionMask: bitmap8 - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionMask)); - // optionOverride: bitmap8 - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), optionOverride)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -6456,7 +4272,7 @@ CHIP_ERROR LevelControlCluster::Stop(Callback::Cancelable * onSuccessCallback, C return err; } -CHIP_ERROR LevelControlCluster::StopWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR MediaPlaybackCluster::PauseRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6468,7 +4284,7 @@ CHIP_ERROR LevelControlCluster::StopWithOnOff(Callback::Cancelable * onSuccessCa VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LevelControl::Commands::StopWithOnOff::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::PauseRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6494,264 +4310,7 @@ CHIP_ERROR LevelControlCluster::StopWithOnOff(Callback::Cancelable * onSuccessCa return err; } -// LevelControl Cluster Attributes -CHIP_ERROR LevelControlCluster::SubscribeAttributeCurrentLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::CurrentLevel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeCurrentLevel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::CurrentLevel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeRemainingTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::RemainingTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeRemainingTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::RemainingTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeMinLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::MinLevel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeMinLevel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::MinLevel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeMaxLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::MaxLevel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeMaxLevel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::MaxLevel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeCurrentFrequency(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::CurrentFrequency::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeCurrentFrequency(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::CurrentFrequency::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeMinFrequency(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::MinFrequency::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeMinFrequency(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::MinFrequency::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeMaxFrequency(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::MaxFrequency::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeMaxFrequency(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::MaxFrequency::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeOptions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::Options::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeOptions(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::Options::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeOnOffTransitionTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::OnOffTransitionTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeOnOffTransitionTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::OnOffTransitionTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeOnLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::OnLevel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeOnLevel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::OnLevel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeOnTransitionTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::OnTransitionTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeOnTransitionTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::OnTransitionTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeOffTransitionTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::OffTransitionTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeOffTransitionTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::OffTransitionTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeDefaultMoveRate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::DefaultMoveRate::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeDefaultMoveRate(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::DefaultMoveRate::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeStartUpCurrentLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::StartUpCurrentLevel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeStartUpCurrentLevel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::StartUpCurrentLevel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// LowPower Cluster Commands -CHIP_ERROR LowPowerCluster::Sleep(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR MediaPlaybackCluster::PlayRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6763,7 +4322,7 @@ CHIP_ERROR LowPowerCluster::Sleep(Callback::Cancelable * onSuccessCallback, Call VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, LowPower::Commands::Sleep::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::PlayRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6789,26 +4348,7 @@ CHIP_ERROR LowPowerCluster::Sleep(Callback::Cancelable * onSuccessCallback, Call return err; } -// LowPower Cluster Attributes -CHIP_ERROR LowPowerCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LowPowerCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// MediaInput Cluster Commands -CHIP_ERROR MediaInputCluster::HideInputStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR MediaPlaybackCluster::PreviousRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6820,7 +4360,7 @@ CHIP_ERROR MediaInputCluster::HideInputStatus(Callback::Cancelable * onSuccessCa VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::HideInputStatus::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::PreviousRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6846,8 +4386,7 @@ CHIP_ERROR MediaInputCluster::HideInputStatus(Callback::Cancelable * onSuccessCa return err; } -CHIP_ERROR MediaInputCluster::RenameInput(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t index, chip::CharSpan name) +CHIP_ERROR MediaPlaybackCluster::RewindRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6859,7 +4398,7 @@ CHIP_ERROR MediaInputCluster::RenameInput(Callback::Cancelable * onSuccessCallba VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::RenameInput::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::RewindRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6869,11 +4408,7 @@ CHIP_ERROR MediaInputCluster::RenameInput(Callback::Cancelable * onSuccessCallba SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // index: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); - // name: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), name)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -6889,8 +4424,8 @@ CHIP_ERROR MediaInputCluster::RenameInput(Callback::Cancelable * onSuccessCallba return err; } -CHIP_ERROR MediaInputCluster::SelectInput(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t index) +CHIP_ERROR MediaPlaybackCluster::SeekRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t position) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6902,7 +4437,7 @@ CHIP_ERROR MediaInputCluster::SelectInput(Callback::Cancelable * onSuccessCallba VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::SelectInput::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::SeekRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6913,8 +4448,8 @@ CHIP_ERROR MediaInputCluster::SelectInput(Callback::Cancelable * onSuccessCallba SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // index: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); + // position: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), position)); SuccessOrExit(err = sender->FinishCommand()); @@ -6930,7 +4465,8 @@ CHIP_ERROR MediaInputCluster::SelectInput(Callback::Cancelable * onSuccessCallba return err; } -CHIP_ERROR MediaInputCluster::ShowInputStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR MediaPlaybackCluster::SkipBackwardRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -6942,7 +4478,7 @@ CHIP_ERROR MediaInputCluster::ShowInputStatus(Callback::Cancelable * onSuccessCa VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::ShowInputStatus::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::SkipBackwardRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -6952,7 +4488,9 @@ CHIP_ERROR MediaInputCluster::ShowInputStatus(Callback::Cancelable * onSuccessCa SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // deltaPositionMilliseconds: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), deltaPositionMilliseconds)); SuccessOrExit(err = sender->FinishCommand()); @@ -6968,44 +4506,8 @@ CHIP_ERROR MediaInputCluster::ShowInputStatus(Callback::Cancelable * onSuccessCa return err; } -// MediaInput Cluster Attributes -CHIP_ERROR MediaInputCluster::SubscribeAttributeCurrentMediaInput(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = MediaInput::Attributes::CurrentMediaInput::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR MediaInputCluster::ReportAttributeCurrentMediaInput(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(MediaInput::Attributes::CurrentMediaInput::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR MediaInputCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR MediaInputCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// MediaPlayback Cluster Commands -CHIP_ERROR MediaPlaybackCluster::MediaFastForward(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR MediaPlaybackCluster::SkipForwardRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7017,7 +4519,7 @@ CHIP_ERROR MediaPlaybackCluster::MediaFastForward(Callback::Cancelable * onSucce VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaFastForward::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::SkipForwardRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7027,7 +4529,9 @@ CHIP_ERROR MediaPlaybackCluster::MediaFastForward(Callback::Cancelable * onSucce SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // deltaPositionMilliseconds: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), deltaPositionMilliseconds)); SuccessOrExit(err = sender->FinishCommand()); @@ -7043,7 +4547,8 @@ CHIP_ERROR MediaPlaybackCluster::MediaFastForward(Callback::Cancelable * onSucce return err; } -CHIP_ERROR MediaPlaybackCluster::MediaNext(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR MediaPlaybackCluster::StartOverRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7055,7 +4560,7 @@ CHIP_ERROR MediaPlaybackCluster::MediaNext(Callback::Cancelable * onSuccessCallb VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaNext::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::StartOverRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7081,7 +4586,7 @@ CHIP_ERROR MediaPlaybackCluster::MediaNext(Callback::Cancelable * onSuccessCallb return err; } -CHIP_ERROR MediaPlaybackCluster::MediaPause(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR MediaPlaybackCluster::StopRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7093,7 +4598,7 @@ CHIP_ERROR MediaPlaybackCluster::MediaPause(Callback::Cancelable * onSuccessCall VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaPause::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::StopRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7119,7 +4624,9 @@ CHIP_ERROR MediaPlaybackCluster::MediaPause(Callback::Cancelable * onSuccessCall return err; } -CHIP_ERROR MediaPlaybackCluster::MediaPlay(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +// ModeSelect Cluster Commands +CHIP_ERROR ModeSelectCluster::ChangeToMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t newMode) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7131,7 +4638,7 @@ CHIP_ERROR MediaPlaybackCluster::MediaPlay(Callback::Cancelable * onSuccessCallb VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaPlay::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ModeSelect::Commands::ChangeToMode::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7141,7 +4648,9 @@ CHIP_ERROR MediaPlaybackCluster::MediaPlay(Callback::Cancelable * onSuccessCallb SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // newMode: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), newMode)); SuccessOrExit(err = sender->FinishCommand()); @@ -7157,7 +4666,10 @@ CHIP_ERROR MediaPlaybackCluster::MediaPlay(Callback::Cancelable * onSuccessCallb return err; } -CHIP_ERROR MediaPlaybackCluster::MediaPrevious(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +// NetworkCommissioning Cluster Commands +CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateThreadNetwork(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan operationalDataset, uint64_t breadcrumb) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7169,7 +4681,8 @@ CHIP_ERROR MediaPlaybackCluster::MediaPrevious(Callback::Cancelable * onSuccessC VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaPrevious::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7179,7 +4692,11 @@ CHIP_ERROR MediaPlaybackCluster::MediaPrevious(Callback::Cancelable * onSuccessC SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // operationalDataset: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), operationalDataset)); + // breadcrumb: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); SuccessOrExit(err = sender->FinishCommand()); @@ -7195,7 +4712,9 @@ CHIP_ERROR MediaPlaybackCluster::MediaPrevious(Callback::Cancelable * onSuccessC return err; } -CHIP_ERROR MediaPlaybackCluster::MediaRewind(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateWiFiNetwork(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan ssid, + chip::ByteSpan credentials, uint64_t breadcrumb) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7207,8 +4726,9 @@ CHIP_ERROR MediaPlaybackCluster::MediaRewind(Callback::Cancelable * onSuccessCal VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaRewind::Id, - (app::CommandPathFlags::kEndpointIdValid) }; + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Id, + (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); @@ -7217,7 +4737,13 @@ CHIP_ERROR MediaPlaybackCluster::MediaRewind(Callback::Cancelable * onSuccessCal SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // ssid: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ssid)); + // credentials: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentials)); + // breadcrumb: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); SuccessOrExit(err = sender->FinishCommand()); @@ -7233,8 +4759,9 @@ CHIP_ERROR MediaPlaybackCluster::MediaRewind(Callback::Cancelable * onSuccessCal return err; } -CHIP_ERROR MediaPlaybackCluster::MediaSeek(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint64_t position) +CHIP_ERROR NetworkCommissioningCluster::ConnectNetwork(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan networkID, + uint64_t breadcrumb) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7246,7 +4773,8 @@ CHIP_ERROR MediaPlaybackCluster::MediaSeek(Callback::Cancelable * onSuccessCallb VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaSeek::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + NetworkCommissioning::Commands::ConnectNetwork::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7257,8 +4785,10 @@ CHIP_ERROR MediaPlaybackCluster::MediaSeek(Callback::Cancelable * onSuccessCallb SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // position: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), position)); + // networkID: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), networkID)); + // breadcrumb: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); SuccessOrExit(err = sender->FinishCommand()); @@ -7274,8 +4804,9 @@ CHIP_ERROR MediaPlaybackCluster::MediaSeek(Callback::Cancelable * onSuccessCallb return err; } -CHIP_ERROR MediaPlaybackCluster::MediaSkipBackward(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds) +CHIP_ERROR NetworkCommissioningCluster::RemoveNetwork(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan networkID, + uint64_t breadcrumb) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7287,7 +4818,7 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipBackward(Callback::Cancelable * onSucc VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaSkipBackward::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, NetworkCommissioning::Commands::RemoveNetwork::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7298,8 +4829,10 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipBackward(Callback::Cancelable * onSucc SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // deltaPositionMilliseconds: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), deltaPositionMilliseconds)); + // networkID: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), networkID)); + // breadcrumb: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); SuccessOrExit(err = sender->FinishCommand()); @@ -7315,8 +4848,9 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipBackward(Callback::Cancelable * onSucc return err; } -CHIP_ERROR MediaPlaybackCluster::MediaSkipForward(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds) +CHIP_ERROR NetworkCommissioningCluster::ReorderNetwork(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan networkID, + uint8_t networkIndex, uint64_t breadcrumb) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7328,7 +4862,8 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipForward(Callback::Cancelable * onSucce VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaSkipForward::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + NetworkCommissioning::Commands::ReorderNetwork::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7339,8 +4874,12 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipForward(Callback::Cancelable * onSucce SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // deltaPositionMilliseconds: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), deltaPositionMilliseconds)); + // networkID: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), networkID)); + // networkIndex: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), networkIndex)); + // breadcrumb: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); SuccessOrExit(err = sender->FinishCommand()); @@ -7356,7 +4895,9 @@ CHIP_ERROR MediaPlaybackCluster::MediaSkipForward(Callback::Cancelable * onSucce return err; } -CHIP_ERROR MediaPlaybackCluster::MediaStartOver(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR NetworkCommissioningCluster::ScanNetworks(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan ssid, + uint64_t breadcrumb) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7368,7 +4909,7 @@ CHIP_ERROR MediaPlaybackCluster::MediaStartOver(Callback::Cancelable * onSuccess VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaStartOver::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, NetworkCommissioning::Commands::ScanNetworks::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7378,7 +4919,11 @@ CHIP_ERROR MediaPlaybackCluster::MediaStartOver(Callback::Cancelable * onSuccess SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // ssid: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ssid)); + // breadcrumb: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); SuccessOrExit(err = sender->FinishCommand()); @@ -7394,7 +4939,10 @@ CHIP_ERROR MediaPlaybackCluster::MediaStartOver(Callback::Cancelable * onSuccess return err; } -CHIP_ERROR MediaPlaybackCluster::MediaStop(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +// OtaSoftwareUpdateProvider Cluster Commands +CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan updateToken, uint32_t newVersion) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7406,7 +4954,8 @@ CHIP_ERROR MediaPlaybackCluster::MediaStop(Callback::Cancelable * onSuccessCallb VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::MediaStop::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7416,7 +4965,11 @@ CHIP_ERROR MediaPlaybackCluster::MediaStop(Callback::Cancelable * onSuccessCallb SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // updateToken: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); + // newVersion: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), newVersion)); SuccessOrExit(err = sender->FinishCommand()); @@ -7432,112 +4985,9 @@ CHIP_ERROR MediaPlaybackCluster::MediaStop(Callback::Cancelable * onSuccessCallb return err; } -// MediaPlayback Cluster Attributes -CHIP_ERROR MediaPlaybackCluster::SubscribeAttributePlaybackState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = MediaPlayback::Attributes::PlaybackState::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR MediaPlaybackCluster::ReportAttributePlaybackState(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(MediaPlayback::Attributes::PlaybackState::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR MediaPlaybackCluster::SubscribeAttributeStartTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = MediaPlayback::Attributes::StartTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR MediaPlaybackCluster::ReportAttributeStartTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(MediaPlayback::Attributes::StartTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR MediaPlaybackCluster::SubscribeAttributeDuration(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = MediaPlayback::Attributes::Duration::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR MediaPlaybackCluster::ReportAttributeDuration(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(MediaPlayback::Attributes::Duration::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR MediaPlaybackCluster::SubscribeAttributeSeekRangeEnd(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = MediaPlayback::Attributes::SeekRangeEnd::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR MediaPlaybackCluster::ReportAttributeSeekRangeEnd(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(MediaPlayback::Attributes::SeekRangeEnd::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR MediaPlaybackCluster::SubscribeAttributeSeekRangeStart(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = MediaPlayback::Attributes::SeekRangeStart::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR MediaPlaybackCluster::ReportAttributeSeekRangeStart(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(MediaPlayback::Attributes::SeekRangeStart::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR MediaPlaybackCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR MediaPlaybackCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// ModeSelect Cluster Commands -CHIP_ERROR ModeSelectCluster::ChangeToMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t newMode) +CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan updateToken, uint32_t softwareVersion) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7549,7 +4999,8 @@ CHIP_ERROR ModeSelectCluster::ChangeToMode(Callback::Cancelable * onSuccessCallb VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ModeSelect::Commands::ChangeToMode::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7560,8 +5011,10 @@ CHIP_ERROR ModeSelectCluster::ChangeToMode(Callback::Cancelable * onSuccessCallb SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // newMode: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), newMode)); + // updateToken: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); + // softwareVersion: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); SuccessOrExit(err = sender->FinishCommand()); @@ -7577,96 +5030,11 @@ CHIP_ERROR ModeSelectCluster::ChangeToMode(Callback::Cancelable * onSuccessCallb return err; } -// ModeSelect Cluster Attributes -CHIP_ERROR ModeSelectCluster::SubscribeAttributeCurrentMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ModeSelect::Attributes::CurrentMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ModeSelectCluster::ReportAttributeCurrentMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ModeSelect::Attributes::CurrentMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ModeSelectCluster::SubscribeAttributeOnMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ModeSelect::Attributes::OnMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ModeSelectCluster::ReportAttributeOnMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ModeSelect::Attributes::OnMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ModeSelectCluster::SubscribeAttributeStartUpMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ModeSelect::Attributes::StartUpMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ModeSelectCluster::ReportAttributeStartUpMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ModeSelect::Attributes::StartUpMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ModeSelectCluster::SubscribeAttributeDescription(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ModeSelect::Attributes::Description::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ModeSelectCluster::ReportAttributeDescription(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ModeSelect::Attributes::Description::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ModeSelectCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ModeSelectCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// NetworkCommissioning Cluster Commands -CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateThreadNetwork(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan operationalDataset, uint64_t breadcrumb) +CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::VendorId vendorId, + uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, + uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, + chip::ByteSpan metadataForProvider) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7679,7 +5047,7 @@ CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateThreadNetwork(Callback::Cance VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - NetworkCommissioning::Commands::AddOrUpdateThreadNetwork::Id, + OtaSoftwareUpdateProvider::Commands::QueryImage::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7690,10 +5058,22 @@ CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateThreadNetwork(Callback::Cance SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // operationalDataset: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), operationalDataset)); - // breadcrumb: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); + // vendorId: vendorId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); + // productId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), productId)); + // softwareVersion: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); + // protocolsSupported: OTADownloadProtocol + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), protocolsSupported)); + // hardwareVersion: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), hardwareVersion)); + // location: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), location)); + // requestorCanConsent: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), requestorCanConsent)); + // metadataForProvider: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForProvider)); SuccessOrExit(err = sender->FinishCommand()); @@ -7709,9 +5089,12 @@ CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateThreadNetwork(Callback::Cance return err; } -CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateWiFiNetwork(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan ssid, - chip::ByteSpan credentials, uint64_t breadcrumb) +// OtaSoftwareUpdateRequestor Cluster Commands +CHIP_ERROR OtaSoftwareUpdateRequestorCluster::AnnounceOtaProvider(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::NodeId providerNodeId, chip::VendorId vendorId, + uint8_t announcementReason, chip::ByteSpan metadataForNode, + chip::EndpointId endpoint) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7724,7 +5107,7 @@ CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateWiFiNetwork(Callback::Cancela VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - NetworkCommissioning::Commands::AddOrUpdateWiFiNetwork::Id, + OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7735,12 +5118,16 @@ CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateWiFiNetwork(Callback::Cancela SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // ssid: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ssid)); - // credentials: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), credentials)); - // breadcrumb: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); + // providerNodeId: nodeId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), providerNodeId)); + // vendorId: vendorId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); + // announcementReason: OTAAnnouncementReason + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), announcementReason)); + // metadataForNode: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForNode)); + // endpoint: endpointNo + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), endpoint)); SuccessOrExit(err = sender->FinishCommand()); @@ -7756,9 +5143,10 @@ CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateWiFiNetwork(Callback::Cancela return err; } -CHIP_ERROR NetworkCommissioningCluster::ConnectNetwork(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan networkID, - uint64_t breadcrumb) +// OccupancySensing Cluster Commands + +// OnOff Cluster Commands +CHIP_ERROR OnOffCluster::Off(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7770,8 +5158,7 @@ CHIP_ERROR NetworkCommissioningCluster::ConnectNetwork(Callback::Cancelable * on VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - NetworkCommissioning::Commands::ConnectNetwork::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::Off::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7781,11 +5168,7 @@ CHIP_ERROR NetworkCommissioningCluster::ConnectNetwork(Callback::Cancelable * on SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // networkID: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), networkID)); - // breadcrumb: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -7801,9 +5184,8 @@ CHIP_ERROR NetworkCommissioningCluster::ConnectNetwork(Callback::Cancelable * on return err; } -CHIP_ERROR NetworkCommissioningCluster::RemoveNetwork(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan networkID, - uint64_t breadcrumb) +CHIP_ERROR OnOffCluster::OffWithEffect(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t effectId, uint8_t effectVariant) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7815,7 +5197,7 @@ CHIP_ERROR NetworkCommissioningCluster::RemoveNetwork(Callback::Cancelable * onS VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, NetworkCommissioning::Commands::RemoveNetwork::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::OffWithEffect::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7826,10 +5208,10 @@ CHIP_ERROR NetworkCommissioningCluster::RemoveNetwork(Callback::Cancelable * onS SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // networkID: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), networkID)); - // breadcrumb: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); + // effectId: onOffEffectIdentifier + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), effectId)); + // effectVariant: onOffDelayedAllOffEffectVariant + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), effectVariant)); SuccessOrExit(err = sender->FinishCommand()); @@ -7845,9 +5227,7 @@ CHIP_ERROR NetworkCommissioningCluster::RemoveNetwork(Callback::Cancelable * onS return err; } -CHIP_ERROR NetworkCommissioningCluster::ReorderNetwork(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan networkID, - uint8_t networkIndex, uint64_t breadcrumb) +CHIP_ERROR OnOffCluster::On(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7859,8 +5239,7 @@ CHIP_ERROR NetworkCommissioningCluster::ReorderNetwork(Callback::Cancelable * on VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - NetworkCommissioning::Commands::ReorderNetwork::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::On::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7870,13 +5249,7 @@ CHIP_ERROR NetworkCommissioningCluster::ReorderNetwork(Callback::Cancelable * on SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // networkID: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), networkID)); - // networkIndex: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), networkIndex)); - // breadcrumb: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -7892,9 +5265,7 @@ CHIP_ERROR NetworkCommissioningCluster::ReorderNetwork(Callback::Cancelable * on return err; } -CHIP_ERROR NetworkCommissioningCluster::ScanNetworks(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan ssid, - uint64_t breadcrumb) +CHIP_ERROR OnOffCluster::OnWithRecallGlobalScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7906,7 +5277,7 @@ CHIP_ERROR NetworkCommissioningCluster::ScanNetworks(Callback::Cancelable * onSu VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, NetworkCommissioning::Commands::ScanNetworks::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::OnWithRecallGlobalScene::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7916,11 +5287,7 @@ CHIP_ERROR NetworkCommissioningCluster::ScanNetworks(Callback::Cancelable * onSu SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // ssid: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ssid)); - // breadcrumb: int64u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), breadcrumb)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -7936,45 +5303,8 @@ CHIP_ERROR NetworkCommissioningCluster::ScanNetworks(Callback::Cancelable * onSu return err; } -// NetworkCommissioning Cluster Attributes -CHIP_ERROR NetworkCommissioningCluster::SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::FeatureMap::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR NetworkCommissioningCluster::ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::FeatureMap::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR NetworkCommissioningCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR NetworkCommissioningCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// OtaSoftwareUpdateProvider Cluster Commands -CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan updateToken, uint32_t newVersion) +CHIP_ERROR OnOffCluster::OnWithTimedOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t onOffControl, uint16_t onTime, uint16_t offWaitTime) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -7986,8 +5316,7 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest(Callback::Cancel VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::OnWithTimedOff::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -7998,10 +5327,12 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest(Callback::Cancel SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // updateToken: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); - // newVersion: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), newVersion)); + // onOffControl: onOffControl + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), onOffControl)); + // onTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), onTime)); + // offWaitTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), offWaitTime)); SuccessOrExit(err = sender->FinishCommand()); @@ -8017,9 +5348,7 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::ApplyUpdateRequest(Callback::Cancel return err; } -CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan updateToken, uint32_t softwareVersion) +CHIP_ERROR OnOffCluster::Toggle(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8031,8 +5360,7 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied(Callback::Cance VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::Toggle::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8042,11 +5370,7 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied(Callback::Cance SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // updateToken: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), updateToken)); - // softwareVersion: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -8062,11 +5386,12 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::NotifyUpdateApplied(Callback::Cance return err; } -CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::VendorId vendorId, - uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, - uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, - chip::ByteSpan metadataForProvider) +// OnOffSwitchConfiguration Cluster Commands + +// OperationalCredentials Cluster Commands +CHIP_ERROR OperationalCredentialsCluster::AddNOC(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan NOCValue, chip::ByteSpan ICACValue, chip::ByteSpan IPKValue, + chip::NodeId caseAdminNode, uint16_t adminVendorId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8078,8 +5403,7 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage(Callback::Cancelable * o VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OtaSoftwareUpdateProvider::Commands::QueryImage::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OperationalCredentials::Commands::AddNOC::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8090,22 +5414,16 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage(Callback::Cancelable * o SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // vendorId: vendorId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); - // productId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), productId)); - // softwareVersion: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), softwareVersion)); - // protocolsSupported: OTADownloadProtocol - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), protocolsSupported)); - // hardwareVersion: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), hardwareVersion)); - // location: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), location)); - // requestorCanConsent: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), requestorCanConsent)); - // metadataForProvider: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForProvider)); + // NOCValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), NOCValue)); + // ICACValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ICACValue)); + // IPKValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), IPKValue)); + // caseAdminNode: nodeId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), caseAdminNode)); + // adminVendorId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), adminVendorId)); SuccessOrExit(err = sender->FinishCommand()); @@ -8121,29 +5439,9 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage(Callback::Cancelable * o return err; } -// OtaSoftwareUpdateProvider Cluster Attributes -CHIP_ERROR OtaSoftwareUpdateProviderCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OtaSoftwareUpdateProviderCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// OtaSoftwareUpdateRequestor Cluster Commands -CHIP_ERROR OtaSoftwareUpdateRequestorCluster::AnnounceOtaProvider(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::NodeId providerLocation, chip::VendorId vendorId, - uint8_t announcementReason, chip::ByteSpan metadataForNode) +CHIP_ERROR OperationalCredentialsCluster::AddTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan rootCertificate) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8156,7 +5454,7 @@ CHIP_ERROR OtaSoftwareUpdateRequestorCluster::AnnounceOtaProvider(Callback::Canc VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::Id, + OperationalCredentials::Commands::AddTrustedRootCertificate::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8167,14 +5465,8 @@ CHIP_ERROR OtaSoftwareUpdateRequestorCluster::AnnounceOtaProvider(Callback::Canc SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // providerLocation: nodeId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), providerLocation)); - // vendorId: vendorId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); - // announcementReason: OTAAnnouncementReason - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), announcementReason)); - // metadataForNode: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), metadataForNode)); + // rootCertificate: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rootCertificate)); SuccessOrExit(err = sender->FinishCommand()); @@ -8190,130 +5482,51 @@ CHIP_ERROR OtaSoftwareUpdateRequestorCluster::AnnounceOtaProvider(Callback::Canc return err; } -// OtaSoftwareUpdateRequestor Cluster Attributes -CHIP_ERROR OtaSoftwareUpdateRequestorCluster::SubscribeAttributeDefaultOtaProvider(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OtaSoftwareUpdateRequestorCluster::ReportAttributeDefaultOtaProvider(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OtaSoftwareUpdateRequestorCluster::SubscribeAttributeUpdatePossible(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) +CHIP_ERROR OperationalCredentialsCluster::AttestationRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan attestationNonce) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR OtaSoftwareUpdateRequestorCluster::ReportAttributeUpdatePossible(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR OtaSoftwareUpdateRequestorCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR OtaSoftwareUpdateRequestorCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::AttestationRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -// OccupancySensing Cluster Commands -// OccupancySensing Cluster Attributes -CHIP_ERROR OccupancySensingCluster::SubscribeAttributeOccupancy(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OccupancySensing::Attributes::Occupancy::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR OccupancySensingCluster::ReportAttributeOccupancy(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OccupancySensing::Attributes::Occupancy::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR OccupancySensingCluster::SubscribeAttributeOccupancySensorType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OccupancySensing::Attributes::OccupancySensorType::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR OccupancySensingCluster::ReportAttributeOccupancySensorType(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OccupancySensing::Attributes::OccupancySensorType::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // attestationNonce: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), attestationNonce)); -CHIP_ERROR OccupancySensingCluster::SubscribeAttributeOccupancySensorTypeBitmap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OccupancySensing::Attributes::OccupancySensorTypeBitmap::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR OccupancySensingCluster::ReportAttributeOccupancySensorTypeBitmap(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OccupancySensing::Attributes::OccupancySensorTypeBitmap::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR OccupancySensingCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR OccupancySensingCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// OnOff Cluster Commands -CHIP_ERROR OnOffCluster::Off(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR OperationalCredentialsCluster::CertificateChainRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t certificateType) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8325,7 +5538,8 @@ CHIP_ERROR OnOffCluster::Off(Callback::Cancelable * onSuccessCallback, Callback: VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::Off::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::CertificateChainRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8335,7 +5549,9 @@ CHIP_ERROR OnOffCluster::Off(Callback::Cancelable * onSuccessCallback, Callback: SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // certificateType: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), certificateType)); SuccessOrExit(err = sender->FinishCommand()); @@ -8351,8 +5567,8 @@ CHIP_ERROR OnOffCluster::Off(Callback::Cancelable * onSuccessCallback, Callback: return err; } -CHIP_ERROR OnOffCluster::OffWithEffect(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t effectId, uint8_t effectVariant) +CHIP_ERROR OperationalCredentialsCluster::OpCSRRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan CSRNonce) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8364,7 +5580,8 @@ CHIP_ERROR OnOffCluster::OffWithEffect(Callback::Cancelable * onSuccessCallback, VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::OffWithEffect::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::OpCSRRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8375,10 +5592,8 @@ CHIP_ERROR OnOffCluster::OffWithEffect(Callback::Cancelable * onSuccessCallback, SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // effectId: onOffEffectIdentifier - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), effectId)); - // effectVariant: onOffDelayedAllOffEffectVariant - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), effectVariant)); + // CSRNonce: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), CSRNonce)); SuccessOrExit(err = sender->FinishCommand()); @@ -8394,7 +5609,8 @@ CHIP_ERROR OnOffCluster::OffWithEffect(Callback::Cancelable * onSuccessCallback, return err; } -CHIP_ERROR OnOffCluster::On(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t fabricIndex) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8406,7 +5622,8 @@ CHIP_ERROR OnOffCluster::On(Callback::Cancelable * onSuccessCallback, Callback:: VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::On::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::RemoveFabric::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8416,7 +5633,9 @@ CHIP_ERROR OnOffCluster::On(Callback::Cancelable * onSuccessCallback, Callback:: SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // fabricIndex: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), fabricIndex)); SuccessOrExit(err = sender->FinishCommand()); @@ -8432,7 +5651,9 @@ CHIP_ERROR OnOffCluster::On(Callback::Cancelable * onSuccessCallback, Callback:: return err; } -CHIP_ERROR OnOffCluster::OnWithRecallGlobalScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR OperationalCredentialsCluster::RemoveTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan trustedRootIdentifier) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8444,7 +5665,8 @@ CHIP_ERROR OnOffCluster::OnWithRecallGlobalScene(Callback::Cancelable * onSucces VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::OnWithRecallGlobalScene::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::RemoveTrustedRootCertificate::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8454,7 +5676,9 @@ CHIP_ERROR OnOffCluster::OnWithRecallGlobalScene(Callback::Cancelable * onSucces SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // trustedRootIdentifier: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), trustedRootIdentifier)); SuccessOrExit(err = sender->FinishCommand()); @@ -8470,8 +5694,8 @@ CHIP_ERROR OnOffCluster::OnWithRecallGlobalScene(Callback::Cancelable * onSucces return err; } -CHIP_ERROR OnOffCluster::OnWithTimedOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t onOffControl, uint16_t onTime, uint16_t offWaitTime) +CHIP_ERROR OperationalCredentialsCluster::UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::CharSpan label) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8483,7 +5707,8 @@ CHIP_ERROR OnOffCluster::OnWithTimedOff(Callback::Cancelable * onSuccessCallback VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::OnWithTimedOff::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::UpdateFabricLabel::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8494,12 +5719,8 @@ CHIP_ERROR OnOffCluster::OnWithTimedOff(Callback::Cancelable * onSuccessCallback SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // onOffControl: onOffControl - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), onOffControl)); - // onTime: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), onTime)); - // offWaitTime: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), offWaitTime)); + // label: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), label)); SuccessOrExit(err = sender->FinishCommand()); @@ -8515,7 +5736,9 @@ CHIP_ERROR OnOffCluster::OnWithTimedOff(Callback::Cancelable * onSuccessCallback return err; } -CHIP_ERROR OnOffCluster::Toggle(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR OperationalCredentialsCluster::UpdateNOC(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan NOCValue, + chip::ByteSpan ICACValue) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8527,7 +5750,7 @@ CHIP_ERROR OnOffCluster::Toggle(Callback::Cancelable * onSuccessCallback, Callba VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OnOff::Commands::Toggle::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OperationalCredentials::Commands::UpdateNOC::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8537,7 +5760,11 @@ CHIP_ERROR OnOffCluster::Toggle(Callback::Cancelable * onSuccessCallback, Callba SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // NOCValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), NOCValue)); + // ICACValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ICACValue)); SuccessOrExit(err = sender->FinishCommand()); @@ -8553,182 +5780,73 @@ CHIP_ERROR OnOffCluster::Toggle(Callback::Cancelable * onSuccessCallback, Callba return err; } -// OnOff Cluster Attributes -CHIP_ERROR OnOffCluster::SubscribeAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::OnOff::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeOnOff(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::OnOff::Id, onReportCallback, - BasicAttributeFilter); -} +// PowerSource Cluster Commands -CHIP_ERROR OnOffCluster::SubscribeAttributeGlobalSceneControl(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::GlobalSceneControl::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} +// PowerSourceConfiguration Cluster Commands -CHIP_ERROR OnOffCluster::ReportAttributeGlobalSceneControl(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::GlobalSceneControl::Id, onReportCallback, - BasicAttributeFilter); -} +// PressureMeasurement Cluster Commands -CHIP_ERROR OnOffCluster::SubscribeAttributeOnTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::OnTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} +// PumpConfigurationAndControl Cluster Commands -CHIP_ERROR OnOffCluster::ReportAttributeOnTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::OnTime::Id, onReportCallback, - BasicAttributeFilter); -} +// RelativeHumidityMeasurement Cluster Commands -CHIP_ERROR OnOffCluster::SubscribeAttributeOffWaitTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::OffWaitTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeOffWaitTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::OffWaitTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OnOffCluster::SubscribeAttributeStartUpOnOff(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +// Scenes Cluster Commands +CHIP_ERROR ScenesCluster::AddScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, chip::CharSpan sceneName, + chip::ClusterId clusterId, uint8_t length, uint8_t value) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::StartUpOnOff::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR OnOffCluster::ReportAttributeStartUpOnOff(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::StartUpOnOff::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR OnOffCluster::SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::FeatureMap::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR OnOffCluster::ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::FeatureMap::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::AddScene::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR OnOffCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR OnOffCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -// OnOffSwitchConfiguration Cluster Commands -// OnOffSwitchConfiguration Cluster Attributes -CHIP_ERROR OnOffSwitchConfigurationCluster::SubscribeAttributeSwitchType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOffSwitchConfiguration::Attributes::SwitchType::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR OnOffSwitchConfigurationCluster::ReportAttributeSwitchType(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOffSwitchConfiguration::Attributes::SwitchType::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // sceneId: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), sceneId)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); + // sceneName: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), sceneName)); + // clusterId: clusterId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), clusterId)); + // length: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), length)); + // value: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), value)); -CHIP_ERROR OnOffSwitchConfigurationCluster::SubscribeAttributeSwitchActions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOffSwitchConfiguration::Attributes::SwitchActions::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR OnOffSwitchConfigurationCluster::ReportAttributeSwitchActions(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOffSwitchConfiguration::Attributes::SwitchActions::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR OnOffSwitchConfigurationCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR OnOffSwitchConfigurationCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// OperationalCredentials Cluster Commands -CHIP_ERROR OperationalCredentialsCluster::AddNOC(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::ByteSpan NOCValue, chip::ByteSpan ICACValue, chip::ByteSpan IPKValue, - chip::NodeId caseAdminNode, uint16_t adminVendorId) +CHIP_ERROR ScenesCluster::GetSceneMembership(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8740,7 +5858,7 @@ CHIP_ERROR OperationalCredentialsCluster::AddNOC(Callback::Cancelable * onSucces VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OperationalCredentials::Commands::AddNOC::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::GetSceneMembership::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8751,16 +5869,8 @@ CHIP_ERROR OperationalCredentialsCluster::AddNOC(Callback::Cancelable * onSucces SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // NOCValue: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), NOCValue)); - // ICACValue: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ICACValue)); - // IPKValue: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), IPKValue)); - // caseAdminNode: nodeId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), caseAdminNode)); - // adminVendorId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), adminVendorId)); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); SuccessOrExit(err = sender->FinishCommand()); @@ -8776,9 +5886,8 @@ CHIP_ERROR OperationalCredentialsCluster::AddNOC(Callback::Cancelable * onSucces return err; } -CHIP_ERROR OperationalCredentialsCluster::AddTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan rootCertificate) +CHIP_ERROR ScenesCluster::RecallScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId, uint8_t sceneId, uint16_t transitionTime) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8790,8 +5899,7 @@ CHIP_ERROR OperationalCredentialsCluster::AddTrustedRootCertificate(Callback::Ca VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OperationalCredentials::Commands::AddTrustedRootCertificate::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::RecallScene::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8802,8 +5910,12 @@ CHIP_ERROR OperationalCredentialsCluster::AddTrustedRootCertificate(Callback::Ca SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // rootCertificate: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rootCertificate)); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // sceneId: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), sceneId)); + // transitionTime: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); SuccessOrExit(err = sender->FinishCommand()); @@ -8819,9 +5931,8 @@ CHIP_ERROR OperationalCredentialsCluster::AddTrustedRootCertificate(Callback::Ca return err; } -CHIP_ERROR OperationalCredentialsCluster::AttestationRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan attestationNonce) +CHIP_ERROR ScenesCluster::RemoveAllScenes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8833,8 +5944,7 @@ CHIP_ERROR OperationalCredentialsCluster::AttestationRequest(Callback::Cancelabl VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OperationalCredentials::Commands::AttestationRequest::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::RemoveAllScenes::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8845,8 +5955,8 @@ CHIP_ERROR OperationalCredentialsCluster::AttestationRequest(Callback::Cancelabl SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // attestationNonce: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), attestationNonce)); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); SuccessOrExit(err = sender->FinishCommand()); @@ -8862,8 +5972,8 @@ CHIP_ERROR OperationalCredentialsCluster::AttestationRequest(Callback::Cancelabl return err; } -CHIP_ERROR OperationalCredentialsCluster::CertificateChainRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t certificateType) +CHIP_ERROR ScenesCluster::RemoveScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId, uint8_t sceneId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8875,8 +5985,7 @@ CHIP_ERROR OperationalCredentialsCluster::CertificateChainRequest(Callback::Canc VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OperationalCredentials::Commands::CertificateChainRequest::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::RemoveScene::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8887,8 +5996,10 @@ CHIP_ERROR OperationalCredentialsCluster::CertificateChainRequest(Callback::Canc SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // certificateType: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), certificateType)); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // sceneId: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), sceneId)); SuccessOrExit(err = sender->FinishCommand()); @@ -8904,8 +6015,8 @@ CHIP_ERROR OperationalCredentialsCluster::CertificateChainRequest(Callback::Canc return err; } -CHIP_ERROR OperationalCredentialsCluster::OpCSRRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan CSRNonce) +CHIP_ERROR ScenesCluster::StoreScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId, uint8_t sceneId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8917,8 +6028,7 @@ CHIP_ERROR OperationalCredentialsCluster::OpCSRRequest(Callback::Cancelable * on VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OperationalCredentials::Commands::OpCSRRequest::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::StoreScene::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8929,8 +6039,10 @@ CHIP_ERROR OperationalCredentialsCluster::OpCSRRequest(Callback::Cancelable * on SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // CSRNonce: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), CSRNonce)); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // sceneId: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), sceneId)); SuccessOrExit(err = sender->FinishCommand()); @@ -8946,8 +6058,8 @@ CHIP_ERROR OperationalCredentialsCluster::OpCSRRequest(Callback::Cancelable * on return err; } -CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t fabricIndex) +CHIP_ERROR ScenesCluster::ViewScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupId, uint8_t sceneId) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -8959,8 +6071,7 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * on VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OperationalCredentials::Commands::RemoveFabric::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::ViewScene::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -8971,8 +6082,10 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * on SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // fabricIndex: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), fabricIndex)); + // groupId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); + // sceneId: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), sceneId)); SuccessOrExit(err = sender->FinishCommand()); @@ -8988,9 +6101,9 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * on return err; } -CHIP_ERROR OperationalCredentialsCluster::RemoveTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan trustedRootIdentifier) +// SoftwareDiagnostics Cluster Commands +CHIP_ERROR SoftwareDiagnosticsCluster::ResetWatermarks(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -9003,7 +6116,7 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveTrustedRootCertificate(Callback: VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OperationalCredentials::Commands::RemoveTrustedRootCertificate::Id, + SoftwareDiagnostics::Commands::ResetWatermarks::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -9013,9 +6126,7 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveTrustedRootCertificate(Callback: SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // trustedRootIdentifier: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), trustedRootIdentifier)); + // Command takes no arguments. SuccessOrExit(err = sender->FinishCommand()); @@ -9031,8 +6142,12 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveTrustedRootCertificate(Callback: return err; } -CHIP_ERROR OperationalCredentialsCluster::UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan label) +// Switch Cluster Commands + +// TargetNavigator Cluster Commands +CHIP_ERROR TargetNavigatorCluster::NavigateTargetRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t target, + chip::CharSpan data) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -9045,7 +6160,7 @@ CHIP_ERROR OperationalCredentialsCluster::UpdateFabricLabel(Callback::Cancelable VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - OperationalCredentials::Commands::UpdateFabricLabel::Id, + TargetNavigator::Commands::NavigateTargetRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -9056,8 +6171,10 @@ CHIP_ERROR OperationalCredentialsCluster::UpdateFabricLabel(Callback::Cancelable SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // label: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), label)); + // target: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), target)); + // data: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), data)); SuccessOrExit(err = sender->FinishCommand()); @@ -9073,9 +6190,12 @@ CHIP_ERROR OperationalCredentialsCluster::UpdateFabricLabel(Callback::Cancelable return err; } -CHIP_ERROR OperationalCredentialsCluster::UpdateNOC(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan NOCValue, - chip::ByteSpan ICACValue) +// TemperatureMeasurement Cluster Commands + +// TestCluster Cluster Commands +CHIP_ERROR TestClusterCluster::SimpleStructEchoRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t a, bool b, uint8_t c, + chip::ByteSpan d, chip::CharSpan e, uint8_t f, float g, double h) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -9087,7 +6207,8 @@ CHIP_ERROR OperationalCredentialsCluster::UpdateNOC(Callback::Cancelable * onSuc VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OperationalCredentials::Commands::UpdateNOC::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TestCluster::Commands::SimpleStructEchoRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -9098,10 +6219,22 @@ CHIP_ERROR OperationalCredentialsCluster::UpdateNOC(Callback::Cancelable * onSuc SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // NOCValue: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), NOCValue)); - // ICACValue: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ICACValue)); + // a: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); + // b: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); + // c: simpleEnum + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), c)); + // d: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), d)); + // e: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), e)); + // f: simpleBitmap + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), f)); + // g: single + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), g)); + // h: double + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), h)); SuccessOrExit(err = sender->FinishCommand()); @@ -9117,3731 +6250,132 @@ CHIP_ERROR OperationalCredentialsCluster::UpdateNOC(Callback::Cancelable * onSuc return err; } -// OperationalCredentials Cluster Attributes -CHIP_ERROR OperationalCredentialsCluster::SubscribeAttributeSupportedFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) +CHIP_ERROR TestClusterCluster::Test(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OperationalCredentials::Attributes::SupportedFabrics::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR OperationalCredentialsCluster::ReportAttributeSupportedFabrics(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OperationalCredentials::Attributes::SupportedFabrics::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR OperationalCredentialsCluster::SubscribeAttributeCommissionedFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OperationalCredentials::Attributes::CommissionedFabrics::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR OperationalCredentialsCluster::ReportAttributeCommissionedFabrics(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OperationalCredentials::Attributes::CommissionedFabrics::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::Test::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR OperationalCredentialsCluster::SubscribeAttributeCurrentFabricIndex(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OperationalCredentials::Attributes::CurrentFabricIndex::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR OperationalCredentialsCluster::ReportAttributeCurrentFabricIndex(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OperationalCredentials::Attributes::CurrentFabricIndex::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR OperationalCredentialsCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR OperationalCredentialsCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} + // Command takes no arguments. -// PowerSource Cluster Commands -// PowerSource Cluster Attributes -CHIP_ERROR PowerSourceCluster::SubscribeAttributeStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PowerSource::Attributes::Status::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR PowerSourceCluster::ReportAttributeStatus(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PowerSource::Attributes::Status::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR PowerSourceCluster::SubscribeAttributeOrder(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PowerSource::Attributes::Order::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR PowerSourceCluster::ReportAttributeOrder(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PowerSource::Attributes::Order::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PowerSourceCluster::SubscribeAttributeDescription(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PowerSource::Attributes::Description::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PowerSourceCluster::ReportAttributeDescription(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PowerSource::Attributes::Description::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PowerSourceCluster::SubscribeAttributeBatteryVoltage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PowerSource::Attributes::BatteryVoltage::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PowerSourceCluster::ReportAttributeBatteryVoltage(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PowerSource::Attributes::BatteryVoltage::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PowerSourceCluster::SubscribeAttributeBatteryPercentRemaining(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PowerSource::Attributes::BatteryPercentRemaining::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PowerSourceCluster::ReportAttributeBatteryPercentRemaining(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PowerSource::Attributes::BatteryPercentRemaining::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PowerSourceCluster::SubscribeAttributeBatteryTimeRemaining(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PowerSource::Attributes::BatteryTimeRemaining::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PowerSourceCluster::ReportAttributeBatteryTimeRemaining(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PowerSource::Attributes::BatteryTimeRemaining::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PowerSourceCluster::SubscribeAttributeBatteryChargeLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PowerSource::Attributes::BatteryChargeLevel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PowerSourceCluster::ReportAttributeBatteryChargeLevel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PowerSource::Attributes::BatteryChargeLevel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PowerSourceCluster::SubscribeAttributeBatteryChargeState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PowerSource::Attributes::BatteryChargeState::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PowerSourceCluster::ReportAttributeBatteryChargeState(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PowerSource::Attributes::BatteryChargeState::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PowerSourceCluster::SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::FeatureMap::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PowerSourceCluster::ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::FeatureMap::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PowerSourceCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PowerSourceCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// PowerSourceConfiguration Cluster Commands -// PowerSourceConfiguration Cluster Attributes - -// PressureMeasurement Cluster Commands -// PressureMeasurement Cluster Attributes -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PressureMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PressureMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PressureMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PressureMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PressureMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PressureMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// PumpConfigurationAndControl Cluster Commands -// PumpConfigurationAndControl Cluster Attributes -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxPressure::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxPressure(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxPressure::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxSpeed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxSpeed::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxSpeed(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxSpeed::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxFlow(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxFlow::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxFlow(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxFlow::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMinConstPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MinConstPressure::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMinConstPressure(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MinConstPressure::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxConstPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxConstPressure::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxConstPressure(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxConstPressure::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMinCompPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MinCompPressure::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMinCompPressure(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MinCompPressure::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxCompPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxCompPressure::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxCompPressure(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxCompPressure::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMinConstSpeed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MinConstSpeed::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMinConstSpeed(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MinConstSpeed::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxConstSpeed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxConstSpeed::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxConstSpeed(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxConstSpeed::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMinConstFlow(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MinConstFlow::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMinConstFlow(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MinConstFlow::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxConstFlow(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxConstFlow::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxConstFlow(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxConstFlow::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMinConstTemp(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MinConstTemp::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMinConstTemp(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MinConstTemp::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxConstTemp(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxConstTemp::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxConstTemp(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxConstTemp::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributePumpStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::PumpStatus::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributePumpStatus(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::PumpStatus::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeEffectiveOperationMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeEffectiveOperationMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeEffectiveControlMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeEffectiveControlMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeCapacity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::Capacity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeCapacity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::Capacity::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeSpeed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::Speed::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeSpeed(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::Speed::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeLifetimeRunningHours(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeLifetimeRunningHours(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributePower(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::Power::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributePower(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::Power::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeLifetimeEnergyConsumed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeLifetimeEnergyConsumed(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeOperationMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::OperationMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeOperationMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::OperationMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeControlMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::ControlMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeControlMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::ControlMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeAlarmMask(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::AlarmMask::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeAlarmMask(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::AlarmMask::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::FeatureMap::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::FeatureMap::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// RelativeHumidityMeasurement Cluster Commands -// RelativeHumidityMeasurement Cluster Attributes -CHIP_ERROR RelativeHumidityMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = RelativeHumidityMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR RelativeHumidityMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(RelativeHumidityMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR RelativeHumidityMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR RelativeHumidityMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR RelativeHumidityMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR RelativeHumidityMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR RelativeHumidityMeasurementCluster::SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = RelativeHumidityMeasurement::Attributes::Tolerance::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR RelativeHumidityMeasurementCluster::ReportAttributeTolerance(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(RelativeHumidityMeasurement::Attributes::Tolerance::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR RelativeHumidityMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR RelativeHumidityMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// Scenes Cluster Commands -CHIP_ERROR ScenesCluster::AddScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, chip::CharSpan sceneName, - chip::ClusterId clusterId, uint8_t length, uint8_t value) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::AddScene::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - // sceneId: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), sceneId)); - // transitionTime: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); - // sceneName: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), sceneName)); - // clusterId: clusterId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), clusterId)); - // length: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), length)); - // value: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), value)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR ScenesCluster::GetSceneMembership(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::GetSceneMembership::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR ScenesCluster::RecallScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId, uint8_t sceneId, uint16_t transitionTime) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::RecallScene::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - // sceneId: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), sceneId)); - // transitionTime: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), transitionTime)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR ScenesCluster::RemoveAllScenes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::RemoveAllScenes::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR ScenesCluster::RemoveScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId, uint8_t sceneId) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::RemoveScene::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - // sceneId: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), sceneId)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR ScenesCluster::StoreScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId, uint8_t sceneId) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::StoreScene::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - // sceneId: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), sceneId)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR ScenesCluster::ViewScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t groupId, uint8_t sceneId) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Scenes::Commands::ViewScene::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // groupId: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), groupId)); - // sceneId: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), sceneId)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -// Scenes Cluster Attributes -CHIP_ERROR ScenesCluster::SubscribeAttributeSceneCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Scenes::Attributes::SceneCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ScenesCluster::ReportAttributeSceneCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Scenes::Attributes::SceneCount::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ScenesCluster::SubscribeAttributeCurrentScene(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Scenes::Attributes::CurrentScene::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ScenesCluster::ReportAttributeCurrentScene(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Scenes::Attributes::CurrentScene::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ScenesCluster::SubscribeAttributeCurrentGroup(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Scenes::Attributes::CurrentGroup::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ScenesCluster::ReportAttributeCurrentGroup(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Scenes::Attributes::CurrentGroup::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ScenesCluster::SubscribeAttributeSceneValid(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Scenes::Attributes::SceneValid::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ScenesCluster::ReportAttributeSceneValid(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Scenes::Attributes::SceneValid::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ScenesCluster::SubscribeAttributeNameSupport(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Scenes::Attributes::NameSupport::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ScenesCluster::ReportAttributeNameSupport(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Scenes::Attributes::NameSupport::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ScenesCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ScenesCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// SoftwareDiagnostics Cluster Commands -CHIP_ERROR SoftwareDiagnosticsCluster::ResetWatermarks(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - SoftwareDiagnostics::Commands::ResetWatermarks::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - // Command takes no arguments. - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -// SoftwareDiagnostics Cluster Attributes -CHIP_ERROR SoftwareDiagnosticsCluster::SubscribeAttributeCurrentHeapFree(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = SoftwareDiagnostics::Attributes::CurrentHeapFree::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SoftwareDiagnosticsCluster::ReportAttributeCurrentHeapFree(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(SoftwareDiagnostics::Attributes::CurrentHeapFree::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR SoftwareDiagnosticsCluster::SubscribeAttributeCurrentHeapUsed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = SoftwareDiagnostics::Attributes::CurrentHeapUsed::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SoftwareDiagnosticsCluster::ReportAttributeCurrentHeapUsed(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(SoftwareDiagnostics::Attributes::CurrentHeapUsed::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR SoftwareDiagnosticsCluster::SubscribeAttributeCurrentHeapHighWatermark(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SoftwareDiagnosticsCluster::ReportAttributeCurrentHeapHighWatermark(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR SoftwareDiagnosticsCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SoftwareDiagnosticsCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// Switch Cluster Commands -// Switch Cluster Attributes -CHIP_ERROR SwitchCluster::SubscribeAttributeNumberOfPositions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Switch::Attributes::NumberOfPositions::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SwitchCluster::ReportAttributeNumberOfPositions(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Switch::Attributes::NumberOfPositions::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR SwitchCluster::SubscribeAttributeCurrentPosition(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Switch::Attributes::CurrentPosition::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SwitchCluster::ReportAttributeCurrentPosition(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Switch::Attributes::CurrentPosition::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR SwitchCluster::SubscribeAttributeMultiPressMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Switch::Attributes::MultiPressMax::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SwitchCluster::ReportAttributeMultiPressMax(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Switch::Attributes::MultiPressMax::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR SwitchCluster::SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::FeatureMap::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SwitchCluster::ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::FeatureMap::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR SwitchCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SwitchCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// TvChannel Cluster Commands -CHIP_ERROR TvChannelCluster::ChangeChannel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan match) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TvChannel::Commands::ChangeChannel::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // match: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), match)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TvChannelCluster::ChangeChannelByNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t majorNumber, - uint16_t minorNumber) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TvChannel::Commands::ChangeChannelByNumber::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // majorNumber: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), majorNumber)); - // minorNumber: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), minorNumber)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TvChannelCluster::SkipChannel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t count) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TvChannel::Commands::SkipChannel::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // count: int16u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), count)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -// TvChannel Cluster Attributes -CHIP_ERROR TvChannelCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TvChannelCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// TargetNavigator Cluster Commands -CHIP_ERROR TargetNavigatorCluster::NavigateTarget(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t target, chip::CharSpan data) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TargetNavigator::Commands::NavigateTarget::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // target: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), target)); - // data: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), data)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -// TargetNavigator Cluster Attributes -CHIP_ERROR TargetNavigatorCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TargetNavigatorCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// TemperatureMeasurement Cluster Commands -// TemperatureMeasurement Cluster Attributes -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TemperatureMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TemperatureMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TemperatureMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TemperatureMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TemperatureMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TemperatureMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TemperatureMeasurement::Attributes::Tolerance::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeTolerance(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TemperatureMeasurement::Attributes::Tolerance::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - -// TestCluster Cluster Commands -CHIP_ERROR TestClusterCluster::SimpleStructEchoRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t a, bool b, uint8_t c, - chip::ByteSpan d, chip::CharSpan e, uint8_t f, float g, double h) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - TestCluster::Commands::SimpleStructEchoRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // a: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); - // b: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); - // c: simpleEnum - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), c)); - // d: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), d)); - // e: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), e)); - // f: simpleBitmap - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), f)); - // g: single - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), g)); - // h: double - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), h)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::Test(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::Test::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - // Command takes no arguments. - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestAddArguments(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t arg1, uint8_t arg2) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TestAddArguments::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // arg1: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); - // arg2: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg2)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestEnumsRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::VendorId arg1, uint8_t arg2) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TestEnumsRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // arg1: vendorId - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); - // arg2: simpleEnum - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg2)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestListInt8UArgumentRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t arg1) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - TestCluster::Commands::TestListInt8UArgumentRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // arg1: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestListInt8UReverseRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t arg1) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - TestCluster::Commands::TestListInt8UReverseRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // arg1: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestListNestedStructListArgumentRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t a, bool b, - uint32_t e, chip::ByteSpan f, uint8_t g) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - TestCluster::Commands::TestListNestedStructListArgumentRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // a: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); - // b: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); - // e: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), e)); - // f: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), f)); - // g: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), g)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestListStructArgumentRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t a, bool b, uint8_t c, - chip::ByteSpan d, chip::CharSpan e, uint8_t f, float g, double h) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - TestCluster::Commands::TestListStructArgumentRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // a: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); - // b: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); - // c: simpleEnum - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), c)); - // d: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), d)); - // e: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), e)); - // f: simpleBitmap - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), f)); - // g: single - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), g)); - // h: double - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), h)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestNestedStructArgumentRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t a, bool b) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - TestCluster::Commands::TestNestedStructArgumentRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // a: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); - // b: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestNestedStructListArgumentRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t a, bool b, - uint32_t e, chip::ByteSpan f, uint8_t g) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - TestCluster::Commands::TestNestedStructListArgumentRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // a: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); - // b: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); - // e: int32u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), e)); - // f: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), f)); - // g: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), g)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestNotHandled(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TestNotHandled::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - // Command takes no arguments. - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestNullableOptionalRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t arg1) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - TestCluster::Commands::TestNullableOptionalRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // arg1: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestSimpleOptionalArgumentRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, bool arg1) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - TestCluster::Commands::TestSimpleOptionalArgumentRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // arg1: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestSpecific(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TestSpecific::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - // Command takes no arguments. - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestStructArgumentRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t a, bool b, uint8_t c, - chip::ByteSpan d, chip::CharSpan e, uint8_t f, float g, double h) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - TestCluster::Commands::TestStructArgumentRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // a: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); - // b: boolean - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); - // c: simpleEnum - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), c)); - // d: octetString - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), d)); - // e: charString - SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), e)); - // f: simpleBitmap - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), f)); - // g: single - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), g)); - // h: double - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), h)); - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TestUnknownCommand(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TestUnknownCommand::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - // Command takes no arguments. - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -CHIP_ERROR TestClusterCluster::TimedInvokeRequest(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVWriter * writer = nullptr; - uint8_t argSeqNumber = 0; - - // Used when encoding non-empty command. Suppress error message when encoding empty commands. - (void) writer; - (void) argSeqNumber; - - VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TimedInvokeRequest::Id, - (app::CommandPathFlags::kEndpointIdValid) }; - - CommandSenderHandle sender( - Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); - - VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); - - SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - - // Command takes no arguments. - - SuccessOrExit(err = sender->FinishCommand()); - - // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. - mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); - - SuccessOrExit(err = mDevice->SendCommands(sender.get())); - - // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object - // now. - sender.release(); -exit: - return err; -} - -// TestCluster Cluster Attributes -CHIP_ERROR TestClusterCluster::SubscribeAttributeBoolean(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Boolean::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeBoolean(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Boolean::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeBitmap8(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Bitmap8::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeBitmap8(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Bitmap8::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeBitmap16(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Bitmap16::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeBitmap16(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Bitmap16::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeBitmap32(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Bitmap32::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeBitmap32(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Bitmap32::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeBitmap64(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Bitmap64::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeBitmap64(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Bitmap64::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt8u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int8u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt8u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int8u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt16u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int16u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt16u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int16u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt24u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int24u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt24u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int24u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt32u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int32u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt32u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int32u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt40u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int40u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt40u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int40u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt48u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int48u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt48u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int48u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt56u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int56u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt56u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int56u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt64u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int64u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt64u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int64u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt8s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int8s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt8s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int8s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt16s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int16s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt16s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int16s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt24s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int24s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt24s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int24s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt32s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int32s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt32s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int32s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt40s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int40s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt40s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int40s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt48s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int48s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt48s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int48s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt56s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int56s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt56s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int56s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeInt64s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Int64s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeInt64s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Int64s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeEnum8(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Enum8::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeEnum8(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Enum8::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeEnum16(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Enum16::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeEnum16(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Enum16::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeFloatSingle(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::FloatSingle::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeFloatSingle(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::FloatSingle::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeFloatDouble(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::FloatDouble::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeFloatDouble(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::FloatDouble::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeOctetString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::OctetString::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeOctetString(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::OctetString::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeLongOctetString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::LongOctetString::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeLongOctetString(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::LongOctetString::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeCharString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::CharString::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeCharString(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::CharString::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeLongCharString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::LongCharString::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeLongCharString(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::LongCharString::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeEpochUs(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::EpochUs::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeEpochUs(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::EpochUs::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeEpochS(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::EpochS::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeEpochS(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::EpochS::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeVendorId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::VendorId::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeVendorId(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::VendorId::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeEnumAttr(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::EnumAttr::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeEnumAttr(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::EnumAttr::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeRangeRestrictedInt8u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::RangeRestrictedInt8u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeRangeRestrictedInt8u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::RangeRestrictedInt8u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeRangeRestrictedInt8s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::RangeRestrictedInt8s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeRangeRestrictedInt8s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::RangeRestrictedInt8s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeRangeRestrictedInt16u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::RangeRestrictedInt16u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeRangeRestrictedInt16u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::RangeRestrictedInt16u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeRangeRestrictedInt16s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::RangeRestrictedInt16s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeRangeRestrictedInt16s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::RangeRestrictedInt16s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeUnsupported(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::Unsupported::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeUnsupported(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::Unsupported::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableBoolean(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableBoolean::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableBoolean(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableBoolean::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableBitmap8(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableBitmap8::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableBitmap8(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableBitmap8::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableBitmap16(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableBitmap16::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableBitmap16(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableBitmap16::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableBitmap32(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableBitmap32::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableBitmap32(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableBitmap32::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableBitmap64(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableBitmap64::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableBitmap64(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableBitmap64::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt8u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt8u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt8u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt8u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt16u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt16u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt16u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt16u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt24u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt24u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt24u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt24u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt32u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt32u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt32u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt32u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt40u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt40u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt40u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt40u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt48u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt48u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt48u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt48u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt56u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt56u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt56u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt56u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt64u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt64u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt64u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt64u::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt8s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt8s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt8s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt8s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt16s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt16s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt16s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt16s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt24s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt24s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt24s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt24s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt32s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt32s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt32s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt32s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt40s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt40s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt40s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt40s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt48s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt48s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt48s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt48s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt56s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt56s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt56s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt56s::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableInt64s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableInt64s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterCluster::ReportAttributeNullableInt64s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableInt64s::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableEnum8(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +CHIP_ERROR TestClusterCluster::TestAddArguments(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t arg1, uint8_t arg2) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableEnum8::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR TestClusterCluster::ReportAttributeNullableEnum8(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableEnum8::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableEnum16(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableEnum16::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR TestClusterCluster::ReportAttributeNullableEnum16(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableEnum16::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TestAddArguments::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableFloatSingle(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableFloatSingle::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR TestClusterCluster::ReportAttributeNullableFloatSingle(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableFloatSingle::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableFloatDouble(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableFloatDouble::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR TestClusterCluster::ReportAttributeNullableFloatDouble(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableFloatDouble::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // arg1: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); + // arg2: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg2)); -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableOctetString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableOctetString::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR TestClusterCluster::ReportAttributeNullableOctetString(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableOctetString::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableCharString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableCharString::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR TestClusterCluster::ReportAttributeNullableCharString(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableCharString::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableEnumAttr(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +CHIP_ERROR TestClusterCluster::TestEnumsRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::VendorId arg1, uint8_t arg2) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableEnumAttr::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR TestClusterCluster::ReportAttributeNullableEnumAttr(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableEnumAttr::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableRangeRestrictedInt8u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableRangeRestrictedInt8u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR TestClusterCluster::ReportAttributeNullableRangeRestrictedInt8u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableRangeRestrictedInt8u::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TestEnumsRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableRangeRestrictedInt8s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableRangeRestrictedInt8s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR TestClusterCluster::ReportAttributeNullableRangeRestrictedInt8s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableRangeRestrictedInt8s::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableRangeRestrictedInt16u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableRangeRestrictedInt16u::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR TestClusterCluster::ReportAttributeNullableRangeRestrictedInt16u(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableRangeRestrictedInt16u::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // arg1: vendorId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); + // arg2: simpleEnum + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg2)); -CHIP_ERROR TestClusterCluster::SubscribeAttributeNullableRangeRestrictedInt16s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TestCluster::Attributes::NullableRangeRestrictedInt16s::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR TestClusterCluster::ReportAttributeNullableRangeRestrictedInt16s(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TestCluster::Attributes::NullableRangeRestrictedInt16s::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR TestClusterCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR TestClusterCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// Thermostat Cluster Commands -CHIP_ERROR ThermostatCluster::ClearWeeklySchedule(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR TestClusterCluster::TestListInt8UArgumentRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t arg1) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -12853,7 +6387,8 @@ CHIP_ERROR ThermostatCluster::ClearWeeklySchedule(Callback::Cancelable * onSucce VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Thermostat::Commands::ClearWeeklySchedule::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TestCluster::Commands::TestListInt8UArgumentRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -12863,7 +6398,9 @@ CHIP_ERROR ThermostatCluster::ClearWeeklySchedule(Callback::Cancelable * onSucce SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // arg1: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); SuccessOrExit(err = sender->FinishCommand()); @@ -12879,7 +6416,8 @@ CHIP_ERROR ThermostatCluster::ClearWeeklySchedule(Callback::Cancelable * onSucce return err; } -CHIP_ERROR ThermostatCluster::GetRelayStatusLog(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +CHIP_ERROR TestClusterCluster::TestListInt8UReverseRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t arg1) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -12891,7 +6429,8 @@ CHIP_ERROR ThermostatCluster::GetRelayStatusLog(Callback::Cancelable * onSuccess VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Thermostat::Commands::GetRelayStatusLog::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TestCluster::Commands::TestListInt8UReverseRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -12901,7 +6440,9 @@ CHIP_ERROR ThermostatCluster::GetRelayStatusLog(Callback::Cancelable * onSuccess SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // arg1: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); SuccessOrExit(err = sender->FinishCommand()); @@ -12917,8 +6458,9 @@ CHIP_ERROR ThermostatCluster::GetRelayStatusLog(Callback::Cancelable * onSuccess return err; } -CHIP_ERROR ThermostatCluster::GetWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t daysToReturn, uint8_t modeToReturn) +CHIP_ERROR TestClusterCluster::TestListNestedStructListArgumentRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t a, bool b, + uint32_t e, chip::ByteSpan f, uint8_t g) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -12930,7 +6472,8 @@ CHIP_ERROR ThermostatCluster::GetWeeklySchedule(Callback::Cancelable * onSuccess VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Thermostat::Commands::GetWeeklySchedule::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TestCluster::Commands::TestListNestedStructListArgumentRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -12941,10 +6484,16 @@ CHIP_ERROR ThermostatCluster::GetWeeklySchedule(Callback::Cancelable * onSuccess SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // daysToReturn: dayOfWeek - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), daysToReturn)); - // modeToReturn: modeForSequence - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), modeToReturn)); + // a: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); + // b: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); + // e: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), e)); + // f: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), f)); + // g: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), g)); SuccessOrExit(err = sender->FinishCommand()); @@ -12960,9 +6509,9 @@ CHIP_ERROR ThermostatCluster::GetWeeklySchedule(Callback::Cancelable * onSuccess return err; } -CHIP_ERROR ThermostatCluster::SetWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t numberOfTransitionsForSequence, uint8_t dayOfWeekForSequence, - uint8_t modeForSequence, uint8_t payload) +CHIP_ERROR TestClusterCluster::TestListStructArgumentRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t a, bool b, uint8_t c, + chip::ByteSpan d, chip::CharSpan e, uint8_t f, float g, double h) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -12974,7 +6523,8 @@ CHIP_ERROR ThermostatCluster::SetWeeklySchedule(Callback::Cancelable * onSuccess VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Thermostat::Commands::SetWeeklySchedule::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TestCluster::Commands::TestListStructArgumentRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -12985,14 +6535,22 @@ CHIP_ERROR ThermostatCluster::SetWeeklySchedule(Callback::Cancelable * onSuccess SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // numberOfTransitionsForSequence: enum8 - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), numberOfTransitionsForSequence)); - // dayOfWeekForSequence: dayOfWeek - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), dayOfWeekForSequence)); - // modeForSequence: modeForSequence - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), modeForSequence)); - // payload: int8u - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), payload)); + // a: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); + // b: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); + // c: simpleEnum + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), c)); + // d: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), d)); + // e: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), e)); + // f: simpleBitmap + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), f)); + // g: single + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), g)); + // h: double + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), h)); SuccessOrExit(err = sender->FinishCommand()); @@ -13008,8 +6566,8 @@ CHIP_ERROR ThermostatCluster::SetWeeklySchedule(Callback::Cancelable * onSuccess return err; } -CHIP_ERROR ThermostatCluster::SetpointRaiseLower(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t mode, int8_t amount) +CHIP_ERROR TestClusterCluster::TestNestedStructArgumentRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t a, bool b) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -13021,7 +6579,8 @@ CHIP_ERROR ThermostatCluster::SetpointRaiseLower(Callback::Cancelable * onSucces VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Thermostat::Commands::SetpointRaiseLower::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TestCluster::Commands::TestNestedStructArgumentRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -13032,10 +6591,10 @@ CHIP_ERROR ThermostatCluster::SetpointRaiseLower(Callback::Cancelable * onSucces SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // mode: setpointAdjustMode - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), mode)); - // amount: int8s - SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), amount)); + // a: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); + // b: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); SuccessOrExit(err = sender->FinishCommand()); @@ -13051,404 +6610,97 @@ CHIP_ERROR ThermostatCluster::SetpointRaiseLower(Callback::Cancelable * onSucces return err; } -// Thermostat Cluster Attributes -CHIP_ERROR ThermostatCluster::SubscribeAttributeLocalTemperature(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::LocalTemperature::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeLocalTemperature(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::LocalTemperature::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeAbsMinHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::AbsMinHeatSetpointLimit::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeAbsMinHeatSetpointLimit(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::AbsMinHeatSetpointLimit::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeAbsMaxHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeAbsMaxHeatSetpointLimit(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeAbsMinCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::AbsMinCoolSetpointLimit::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeAbsMinCoolSetpointLimit(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::AbsMinCoolSetpointLimit::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeAbsMaxCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeAbsMaxCoolSetpointLimit(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeOccupiedCoolingSetpoint(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::OccupiedCoolingSetpoint::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeOccupiedCoolingSetpoint(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::OccupiedCoolingSetpoint::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeOccupiedHeatingSetpoint(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::OccupiedHeatingSetpoint::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeOccupiedHeatingSetpoint(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::OccupiedHeatingSetpoint::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeMinHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::MinHeatSetpointLimit::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeMinHeatSetpointLimit(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::MinHeatSetpointLimit::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeMaxHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::MaxHeatSetpointLimit::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeMaxHeatSetpointLimit(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::MaxHeatSetpointLimit::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeMinCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::MinCoolSetpointLimit::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeMinCoolSetpointLimit(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::MinCoolSetpointLimit::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeMaxCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::MaxCoolSetpointLimit::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatCluster::ReportAttributeMaxCoolSetpointLimit(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::MaxCoolSetpointLimit::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThermostatCluster::SubscribeAttributeMinSetpointDeadBand(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +CHIP_ERROR TestClusterCluster::TestNestedStructListArgumentRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t a, bool b, + uint32_t e, chip::ByteSpan f, uint8_t g) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::MinSetpointDeadBand::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThermostatCluster::ReportAttributeMinSetpointDeadBand(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::MinSetpointDeadBand::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThermostatCluster::SubscribeAttributeControlSequenceOfOperation(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::ControlSequenceOfOperation::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThermostatCluster::ReportAttributeControlSequenceOfOperation(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::ControlSequenceOfOperation::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TestCluster::Commands::TestNestedStructListArgumentRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ThermostatCluster::SubscribeAttributeSystemMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::SystemMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ThermostatCluster::ReportAttributeSystemMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::SystemMode::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThermostatCluster::SubscribeAttributeStartOfWeek(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::StartOfWeek::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ThermostatCluster::ReportAttributeStartOfWeek(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::StartOfWeek::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // a: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); + // b: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); + // e: int32u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), e)); + // f: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), f)); + // g: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), g)); -CHIP_ERROR ThermostatCluster::SubscribeAttributeNumberOfWeeklyTransitions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::NumberOfWeeklyTransitions::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ThermostatCluster::ReportAttributeNumberOfWeeklyTransitions(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::NumberOfWeeklyTransitions::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ThermostatCluster::SubscribeAttributeNumberOfDailyTransitions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Thermostat::Attributes::NumberOfDailyTransitions::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ThermostatCluster::ReportAttributeNumberOfDailyTransitions(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Thermostat::Attributes::NumberOfDailyTransitions::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ThermostatCluster::SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) +CHIP_ERROR TestClusterCluster::TestNotHandled(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::FeatureMap::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThermostatCluster::ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::FeatureMap::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThermostatCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThermostatCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TestNotHandled::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -// ThermostatUserInterfaceConfiguration Cluster Commands -// ThermostatUserInterfaceConfiguration Cluster Attributes -CHIP_ERROR ThermostatUserInterfaceConfigurationCluster::SubscribeAttributeTemperatureDisplayMode( - Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR -ThermostatUserInterfaceConfigurationCluster::ReportAttributeTemperatureDisplayMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThermostatUserInterfaceConfigurationCluster::SubscribeAttributeKeypadLockout(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ThermostatUserInterfaceConfigurationCluster::ReportAttributeKeypadLockout(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id, onReportCallback, - BasicAttributeFilter); -} + // Command takes no arguments. -CHIP_ERROR ThermostatUserInterfaceConfigurationCluster::SubscribeAttributeScheduleProgrammingVisibility( - Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR -ThermostatUserInterfaceConfigurationCluster::ReportAttributeScheduleProgrammingVisibility(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id, - onReportCallback, BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ThermostatUserInterfaceConfigurationCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ThermostatUserInterfaceConfigurationCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// ThreadNetworkDiagnostics Cluster Commands -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR TestClusterCluster::TestNullableOptionalRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t arg1) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -13461,7 +6713,7 @@ CHIP_ERROR ThreadNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * o VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, - ThreadNetworkDiagnostics::Commands::ResetCounts::Id, + TestCluster::Commands::TestNullableOptionalRequest::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -13471,7 +6723,9 @@ CHIP_ERROR ThreadNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * o SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // arg1: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); SuccessOrExit(err = sender->FinishCommand()); @@ -13487,1052 +6741,392 @@ CHIP_ERROR ThreadNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * o return err; } -// ThreadNetworkDiagnostics Cluster Attributes -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeChannel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::Channel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeChannel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::Channel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRoutingRole(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RoutingRole::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRoutingRole(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RoutingRole::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeNetworkName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::NetworkName::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeNetworkName(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::NetworkName::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributePanId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::PanId::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributePanId(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::PanId::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeExtendedPanId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::ExtendedPanId::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeExtendedPanId(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::ExtendedPanId::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeMeshLocalPrefix(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeMeshLocalPrefix(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::OverrunCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeOverrunCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::OverrunCount::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributePartitionId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::PartitionId::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributePartitionId(Callback::Cancelable * onReportCallback) +CHIP_ERROR TestClusterCluster::TestSimpleOptionalArgumentRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, bool arg1) { - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::PartitionId::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeWeighting(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::Weighting::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeWeighting(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::Weighting::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeDataVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::DataVersion::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TestCluster::Commands::TestSimpleOptionalArgumentRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeDataVersion(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::DataVersion::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeStableDataVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::StableDataVersion::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeStableDataVersion(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::StableDataVersion::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeLeaderRouterId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::LeaderRouterId::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // arg1: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeLeaderRouterId(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::LeaderRouterId::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeDetachedRoleCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeDetachedRoleCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeChildRoleCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::ChildRoleCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeChildRoleCount(Callback::Cancelable * onReportCallback) +CHIP_ERROR TestClusterCluster::TestSpecific(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::ChildRoleCount::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRouterRoleCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RouterRoleCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRouterRoleCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RouterRoleCount::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeLeaderRoleCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TestSpecific::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeLeaderRoleCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeAttachAttemptCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeAttachAttemptCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributePartitionIdChangeCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Command takes no arguments. -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributePartitionIdChangeCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeBetterPartitionAttachAttemptCount( - Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR -ThreadNetworkDiagnosticsCluster::ReportAttributeBetterPartitionAttachAttemptCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeParentChangeCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::ParentChangeCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeParentChangeCount(Callback::Cancelable * onReportCallback) +CHIP_ERROR TestClusterCluster::TestStructArgumentRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t a, bool b, uint8_t c, + chip::ByteSpan d, chip::CharSpan e, uint8_t f, float g, double h) { - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::ParentChangeCount::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxTotalCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxTotalCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxUnicastCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxUnicastCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TestCluster::Commands::TestStructArgumentRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxUnicastCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxUnicastCount::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxBroadcastCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxBroadcastCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxAckRequestedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // a: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), a)); + // b: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), b)); + // c: simpleEnum + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), c)); + // d: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), d)); + // e: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), e)); + // f: simpleBitmap + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), f)); + // g: single + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), g)); + // h: double + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), h)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxAckRequestedCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxAckedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxAckedCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxAckedCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxAckedCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxNoAckRequestedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxNoAckRequestedCount(Callback::Cancelable * onReportCallback) +CHIP_ERROR TestClusterCluster::TestUnknownCommand(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxDataCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxDataCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxDataCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxDataCount::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxDataPollCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxDataPollCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TestUnknownCommand::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxDataPollCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxDataPollCount::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxBeaconCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxBeaconCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxBeaconCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxBeaconCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxBeaconRequestCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Command takes no arguments. -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxBeaconRequestCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxOtherCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxOtherCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxOtherCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxOtherCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxRetryCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxRetryCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxRetryCount(Callback::Cancelable * onReportCallback) +CHIP_ERROR TestClusterCluster::TimedInvokeRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxRetryCount::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxDirectMaxRetryExpiryCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxDirectMaxRetryExpiryCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxIndirectMaxRetryExpiryCount( - Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, TestCluster::Commands::TimedInvokeRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxIndirectMaxRetryExpiryCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxErrCcaCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxErrCcaCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxErrAbortCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Command takes no arguments. -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxErrAbortCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeTxErrBusyChannelCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeTxErrBusyChannelCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxTotalCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxTotalCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxTotalCount(Callback::Cancelable * onReportCallback) +// Thermostat Cluster Commands +CHIP_ERROR ThermostatCluster::ClearWeeklySchedule(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxTotalCount::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxUnicastCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxUnicastCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxUnicastCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxUnicastCount::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxBroadcastCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Thermostat::Commands::ClearWeeklySchedule::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxBroadcastCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxDataCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxDataCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxDataCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxDataCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxDataPollCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxDataPollCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Command takes no arguments. -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxDataPollCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxDataPollCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxBeaconCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxBeaconCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxBeaconCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxBeaconCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxBeaconRequestCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxBeaconRequestCount(Callback::Cancelable * onReportCallback) +CHIP_ERROR ThermostatCluster::GetRelayStatusLog(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxOtherCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxOtherCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxOtherCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxOtherCount::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxAddressFilteredCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Thermostat::Commands::GetRelayStatusLog::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxAddressFilteredCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxDestAddrFilteredCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxDestAddrFilteredCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxDuplicatedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Command takes no arguments. -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxDuplicatedCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxErrNoFrameCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxErrNoFrameCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxErrUnknownNeighborCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxErrUnknownNeighborCount(Callback::Cancelable * onReportCallback) +CHIP_ERROR ThermostatCluster::GetWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t daysToReturn, uint8_t modeToReturn) { - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxErrInvalidSrcAddrCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxErrInvalidSrcAddrCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxErrSecCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxErrSecCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Thermostat::Commands::GetWeeklySchedule::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxErrSecCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxErrSecCount::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxErrFcsCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxErrFcsCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeRxErrOtherCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // daysToReturn: dayOfWeek + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), daysToReturn)); + // modeToReturn: modeForSequence + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), modeToReturn)); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeRxErrOtherCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeActiveTimestamp(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeActiveTimestamp(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributePendingTimestamp(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::PendingTimestamp::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributePendingTimestamp(Callback::Cancelable * onReportCallback) +CHIP_ERROR ThermostatCluster::SetWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t numberOfTransitionsForSequence, uint8_t dayOfWeekForSequence, + uint8_t modeForSequence, uint8_t payload) { - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::PendingTimestamp::Id, onReportCallback, - BasicAttributeFilter); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeDelay(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::Delay::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeDelay(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::Delay::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeChannelMask(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = ThreadNetworkDiagnostics::Attributes::ChannelMask::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Thermostat::Commands::SetWeeklySchedule::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeChannelMask(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(ThreadNetworkDiagnostics::Attributes::ChannelMask::Id, onReportCallback, - BasicAttributeFilter); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR ThreadNetworkDiagnosticsCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -// UserLabel Cluster Commands -// UserLabel Cluster Attributes + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // numberOfTransitionsForSequence: enum8 + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), numberOfTransitionsForSequence)); + // dayOfWeekForSequence: dayOfWeek + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), dayOfWeekForSequence)); + // modeForSequence: modeForSequence + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), modeForSequence)); + // payload: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), payload)); -// WakeOnLan Cluster Commands -// WakeOnLan Cluster Attributes -CHIP_ERROR WakeOnLanCluster::SubscribeAttributeWakeOnLanMacAddress(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WakeOnLan::Attributes::WakeOnLanMacAddress::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR WakeOnLanCluster::ReportAttributeWakeOnLanMacAddress(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WakeOnLan::Attributes::WakeOnLanMacAddress::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR WakeOnLanCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR WakeOnLanCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -// WiFiNetworkDiagnostics Cluster Commands -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR ThermostatCluster::SetpointRaiseLower(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t mode, int8_t amount) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -14544,7 +7138,7 @@ CHIP_ERROR WiFiNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * onS VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, WiFiNetworkDiagnostics::Commands::ResetCounts::Id, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Thermostat::Commands::SetpointRaiseLower::Id, (app::CommandPathFlags::kEndpointIdValid) }; CommandSenderHandle sender( @@ -14554,7 +7148,11 @@ CHIP_ERROR WiFiNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * onS SuccessOrExit(err = sender->PrepareCommand(cmdParams)); - // Command takes no arguments. + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // mode: setpointAdjustMode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), mode)); + // amount: int8s + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), amount)); SuccessOrExit(err = sender->FinishCommand()); @@ -14570,243 +7168,91 @@ CHIP_ERROR WiFiNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * onS return err; } -// WiFiNetworkDiagnostics Cluster Attributes -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributeBssid(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::Bssid::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributeBssid(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::Bssid::Id, onReportCallback, - BasicAttributeFilter); -} +// ThermostatUserInterfaceConfiguration Cluster Commands -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributeSecurityType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) +// ThreadNetworkDiagnostics Cluster Commands +CHIP_ERROR ThreadNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::SecurityType::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributeSecurityType(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::SecurityType::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributeWiFiVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::WiFiVersion::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributeWiFiVersion(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::WiFiVersion::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + ThreadNetworkDiagnostics::Commands::ResetCounts::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributeChannelNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::ChannelNumber::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributeChannelNumber(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::ChannelNumber::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributeRssi(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::Rssi::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributeRssi(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::Rssi::Id, onReportCallback, - BasicAttributeFilter); -} + // Command takes no arguments. -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributeBeaconLostCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::BeaconLostCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributeBeaconLostCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::BeaconLostCount::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributeBeaconRxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::BeaconRxCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributeBeaconRxCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::BeaconRxCount::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributePacketMulticastRxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} +// UserLabel Cluster Commands -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributePacketMulticastRxCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::Id, onReportCallback, - BasicAttributeFilter); -} +// WakeOnLan Cluster Commands -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributePacketMulticastTxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) +// WiFiNetworkDiagnostics Cluster Commands +CHIP_ERROR WiFiNetworkDiagnosticsCluster::ResetCounts(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) { - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributePacketMulticastTxCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::Id, onReportCallback, - BasicAttributeFilter); -} + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributePacketUnicastRxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributePacketUnicastRxCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::Id, onReportCallback, - BasicAttributeFilter); -} + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, WiFiNetworkDiagnostics::Commands::ResetCounts::Id, + (app::CommandPathFlags::kEndpointIdValid) }; -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributePacketUnicastTxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributePacketUnicastTxCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::Id, onReportCallback, - BasicAttributeFilter); -} + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributeCurrentMaxRate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributeCurrentMaxRate(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::Id, onReportCallback, - BasicAttributeFilter); -} + // Command takes no arguments. -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WiFiNetworkDiagnostics::Attributes::OverrunCount::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = sender->FinishCommand()); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributeOverrunCount(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WiFiNetworkDiagnostics::Attributes::OverrunCount::Id, onReportCallback, - BasicAttributeFilter); -} + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} + SuccessOrExit(err = mDevice->SendCommands(sender.get())); -CHIP_ERROR WiFiNetworkDiagnosticsCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; } // WindowCovering Cluster Commands @@ -14849,8 +7295,8 @@ CHIP_ERROR WindowCoveringCluster::DownOrClose(Callback::Cancelable * onSuccessCa } CHIP_ERROR WindowCoveringCluster::GoToLiftPercentage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t liftPercentageValue, - uint16_t liftPercent100thsValue) + Callback::Cancelable * onFailureCallback, chip::Percent liftPercentageValue, + chip::Percent100ths liftPercent100thsValue) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -14873,9 +7319,9 @@ CHIP_ERROR WindowCoveringCluster::GoToLiftPercentage(Callback::Cancelable * onSu SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // liftPercentageValue: int8u + // liftPercentageValue: percent SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), liftPercentageValue)); - // liftPercent100thsValue: int16u + // liftPercent100thsValue: percent100ths SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), liftPercent100thsValue)); SuccessOrExit(err = sender->FinishCommand()); @@ -14934,8 +7380,8 @@ CHIP_ERROR WindowCoveringCluster::GoToLiftValue(Callback::Cancelable * onSuccess } CHIP_ERROR WindowCoveringCluster::GoToTiltPercentage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t tiltPercentageValue, - uint16_t tiltPercent100thsValue) + Callback::Cancelable * onFailureCallback, chip::Percent tiltPercentageValue, + chip::Percent100ths tiltPercent100thsValue) { CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVWriter * writer = nullptr; @@ -14958,9 +7404,9 @@ CHIP_ERROR WindowCoveringCluster::GoToTiltPercentage(Callback::Cancelable * onSu SuccessOrExit(err = sender->PrepareCommand(cmdParams)); VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); - // tiltPercentageValue: int8u + // tiltPercentageValue: percent SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), tiltPercentageValue)); - // tiltPercent100thsValue: int16u + // tiltPercent100thsValue: percent100ths SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), tiltPercent100thsValue)); SuccessOrExit(err = sender->FinishCommand()); @@ -15094,346 +7540,5 @@ CHIP_ERROR WindowCoveringCluster::UpOrOpen(Callback::Cancelable * onSuccessCallb return err; } -// WindowCovering Cluster Attributes -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::Type::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeType(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::Type::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeCurrentPositionLift(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::CurrentPositionLift::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeCurrentPositionLift(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::CurrentPositionLift::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeCurrentPositionTilt(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::CurrentPositionTilt::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeCurrentPositionTilt(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::CurrentPositionTilt::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeConfigStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::ConfigStatus::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeConfigStatus(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::ConfigStatus::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeCurrentPositionLiftPercentage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::CurrentPositionLiftPercentage::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeCurrentPositionLiftPercentage(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::CurrentPositionLiftPercentage::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeCurrentPositionTiltPercentage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::CurrentPositionTiltPercentage::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeCurrentPositionTiltPercentage(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::CurrentPositionTiltPercentage::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeOperationalStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::OperationalStatus::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeOperationalStatus(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::OperationalStatus::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeTargetPositionLiftPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeTargetPositionLiftPercent100ths(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeTargetPositionTiltPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeTargetPositionTiltPercent100ths(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeEndProductType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::EndProductType::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeEndProductType(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::EndProductType::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeCurrentPositionLiftPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeCurrentPositionLiftPercent100ths(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeCurrentPositionTiltPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeCurrentPositionTiltPercent100ths(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeInstalledOpenLimitLift(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::InstalledOpenLimitLift::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeInstalledOpenLimitLift(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::InstalledOpenLimitLift::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeInstalledClosedLimitLift(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::InstalledClosedLimitLift::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeInstalledClosedLimitLift(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::InstalledClosedLimitLift::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeInstalledOpenLimitTilt(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::InstalledOpenLimitTilt::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeInstalledOpenLimitTilt(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::InstalledOpenLimitTilt::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeInstalledClosedLimitTilt(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::InstalledClosedLimitTilt::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeInstalledClosedLimitTilt(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::InstalledClosedLimitTilt::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::Mode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::Mode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeSafetyStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = WindowCovering::Attributes::SafetyStatus::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeSafetyStatus(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(WindowCovering::Attributes::SafetyStatus::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::FeatureMap::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::FeatureMap::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR WindowCoveringCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - } // namespace Controller } // namespace chip diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index a0a56519efc3b0..3e6c0b7081c175 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -35,8 +35,6 @@ class DLL_EXPORT AccessControlCluster : public ClusterBase public: AccessControlCluster() : ClusterBase(app::Clusters::AccessControl::Id) {} ~AccessControlCluster() {} - - // Cluster Attributes }; class DLL_EXPORT AccountLoginCluster : public ClusterBase @@ -46,18 +44,11 @@ class DLL_EXPORT AccountLoginCluster : public ClusterBase ~AccountLoginCluster() {} // Cluster Commands - CHIP_ERROR GetSetupPIN(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan tempAccountIdentifier); - CHIP_ERROR Login(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan tempAccountIdentifier, chip::CharSpan setupPIN); - CHIP_ERROR Logout(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: + CHIP_ERROR GetSetupPINRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan tempAccountIdentifier); + CHIP_ERROR LoginRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan tempAccountIdentifier, chip::CharSpan setupPIN); + CHIP_ERROR LogoutRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); }; class DLL_EXPORT AdministratorCommissioningCluster : public ClusterBase @@ -73,13 +64,6 @@ class DLL_EXPORT AdministratorCommissioningCluster : public ClusterBase uint16_t commissioningTimeout, chip::ByteSpan PAKEVerifier, uint16_t discriminator, uint32_t iterations, chip::ByteSpan salt, uint16_t passcodeID); CHIP_ERROR RevokeCommissioning(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT ApplicationBasicCluster : public ClusterBase @@ -87,36 +71,6 @@ class DLL_EXPORT ApplicationBasicCluster : public ClusterBase public: ApplicationBasicCluster() : ClusterBase(app::Clusters::ApplicationBasic::Id) {} ~ApplicationBasicCluster() {} - - // Cluster Commands - CHIP_ERROR ChangeStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t status); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeVendorName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeVendorName(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeVendorId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeVendorId(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeApplicationName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeApplicationName(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeProductId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeProductId(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeApplicationStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeApplicationStatus(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeApplicationVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeApplicationVersion(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT ApplicationLauncherCluster : public ClusterBase @@ -126,19 +80,12 @@ class DLL_EXPORT ApplicationLauncherCluster : public ClusterBase ~ApplicationLauncherCluster() {} // Cluster Commands - CHIP_ERROR HideApp(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t catalogVendorId, - chip::CharSpan applicationId); - CHIP_ERROR LaunchApp(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::CharSpan data, - uint16_t catalogVendorId, chip::CharSpan applicationId); - CHIP_ERROR StopApp(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t catalogVendorId, - chip::CharSpan applicationId); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: + CHIP_ERROR HideAppRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t catalogVendorId, chip::CharSpan applicationId); + CHIP_ERROR LaunchAppRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan data, uint16_t catalogVendorId, chip::CharSpan applicationId); + CHIP_ERROR StopAppRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t catalogVendorId, chip::CharSpan applicationId); }; class DLL_EXPORT AudioOutputCluster : public ClusterBase @@ -148,20 +95,10 @@ class DLL_EXPORT AudioOutputCluster : public ClusterBase ~AudioOutputCluster() {} // Cluster Commands - CHIP_ERROR RenameOutput(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t index, - chip::CharSpan name); - CHIP_ERROR SelectOutput(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t index); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeCurrentAudioOutput(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentAudioOutput(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: + CHIP_ERROR RenameOutputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t index, chip::CharSpan name); + CHIP_ERROR SelectOutputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t index); }; class DLL_EXPORT BarrierControlCluster : public ClusterBase @@ -174,28 +111,6 @@ class DLL_EXPORT BarrierControlCluster : public ClusterBase CHIP_ERROR BarrierControlGoToPercent(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t percentOpen); CHIP_ERROR BarrierControlStop(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeBarrierMovingState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeBarrierMovingState(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBarrierSafetyStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeBarrierSafetyStatus(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBarrierCapabilities(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeBarrierCapabilities(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBarrierPosition(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBarrierPosition(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT BasicCluster : public ClusterBase @@ -206,72 +121,6 @@ class DLL_EXPORT BasicCluster : public ClusterBase // Cluster Commands CHIP_ERROR MfgSpecificPing(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeInteractionModelVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeInteractionModelVersion(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeVendorName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeVendorName(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeVendorID(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeVendorID(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeProductName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeProductName(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeProductID(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeProductID(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNodeLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNodeLabel(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLocation(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeLocation(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeHardwareVersion(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeHardwareVersionString(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSoftwareVersion(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeSoftwareVersionString(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeManufacturingDate(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePartNumber(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePartNumber(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeProductURL(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeProductURL(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeProductLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeProductLabel(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSerialNumber(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLocalConfigDisabled(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeLocalConfigDisabled(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeReachable(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeReachable(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT BinaryInputBasicCluster : public ClusterBase @@ -279,20 +128,6 @@ class DLL_EXPORT BinaryInputBasicCluster : public ClusterBase public: BinaryInputBasicCluster() : ClusterBase(app::Clusters::BinaryInputBasic::Id) {} ~BinaryInputBasicCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeOutOfService(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOutOfService(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePresentValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePresentValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeStatusFlags(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeStatusFlags(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT BindingCluster : public ClusterBase @@ -306,13 +141,6 @@ class DLL_EXPORT BindingCluster : public ClusterBase chip::GroupId groupId, chip::EndpointId endpointId, chip::ClusterId clusterId); CHIP_ERROR Unbind(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::NodeId nodeId, chip::GroupId groupId, chip::EndpointId endpointId, chip::ClusterId clusterId); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT BooleanStateCluster : public ClusterBase @@ -320,14 +148,6 @@ class DLL_EXPORT BooleanStateCluster : public ClusterBase public: BooleanStateCluster() : ClusterBase(app::Clusters::BooleanState::Id) {} ~BooleanStateCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeStateValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeStateValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT BridgedActionsCluster : public ClusterBase @@ -361,16 +181,6 @@ class DLL_EXPORT BridgedActionsCluster : public ClusterBase uint16_t actionID, uint32_t invokeID, uint32_t duration); CHIP_ERROR StopAction(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t actionID, uint32_t invokeID); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeSetupUrl(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSetupUrl(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT BridgedDeviceBasicCluster : public ClusterBase @@ -378,11 +188,21 @@ class DLL_EXPORT BridgedDeviceBasicCluster : public ClusterBase public: BridgedDeviceBasicCluster() : ClusterBase(app::Clusters::BridgedDeviceBasic::Id) {} ~BridgedDeviceBasicCluster() {} +}; - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); +class DLL_EXPORT ChannelCluster : public ClusterBase +{ +public: + ChannelCluster() : ClusterBase(app::Clusters::Channel::Id) {} + ~ChannelCluster() {} + + // Cluster Commands + CHIP_ERROR ChangeChannelByNumberRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t majorNumber, uint16_t minorNumber); + CHIP_ERROR ChangeChannelRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan match); + CHIP_ERROR SkipChannelRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t count); }; class DLL_EXPORT ColorControlCluster : public ClusterBase @@ -437,194 +257,6 @@ class DLL_EXPORT ColorControlCluster : public ClusterBase uint8_t stepSize, uint8_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride); CHIP_ERROR StopMoveStep(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t optionsMask, uint8_t optionsOverride); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeCurrentHue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentHue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentSaturation(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentSaturation(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRemainingTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRemainingTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentX(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentX(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentY(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentY(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeDriftCompensation(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeDriftCompensation(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCompensationText(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCompensationText(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorTemperature(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorTemperature(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorControlOptions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorControlOptions(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNumberOfPrimaries(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNumberOfPrimaries(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary1X(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary1X(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary1Y(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary1Y(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary1Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary1Intensity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary2X(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary2X(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary2Y(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary2Y(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary2Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary2Intensity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary3X(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary3X(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary3Y(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary3Y(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary3Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary3Intensity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary4X(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary4X(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary4Y(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary4Y(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary4Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary4Intensity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary5X(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary5X(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary5Y(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary5Y(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary5Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary5Intensity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary6X(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary6X(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary6Y(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary6Y(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePrimary6Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePrimary6Intensity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeWhitePointX(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeWhitePointX(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeWhitePointY(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeWhitePointY(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorPointRX(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorPointRX(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorPointRY(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorPointRY(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorPointRIntensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorPointRIntensity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorPointGX(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorPointGX(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorPointGY(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorPointGY(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorPointGIntensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorPointGIntensity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorPointBX(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorPointBX(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorPointBY(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorPointBY(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorPointBIntensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorPointBIntensity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEnhancedCurrentHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeEnhancedCurrentHue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEnhancedColorMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeEnhancedColorMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorLoopActive(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorLoopActive(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorLoopDirection(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorLoopDirection(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorLoopTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorLoopTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorLoopStartEnhancedHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorLoopStartEnhancedHue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorLoopStoredEnhancedHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorLoopStoredEnhancedHue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorCapabilities(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorCapabilities(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorTempPhysicalMin(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorTempPhysicalMin(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeColorTempPhysicalMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeColorTempPhysicalMax(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCoupleColorTempToLevelMinMireds(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCoupleColorTempToLevelMinMireds(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeStartUpColorTemperatureMireds(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeStartUpColorTemperatureMireds(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT ContentLauncherCluster : public ClusterBase @@ -634,21 +266,10 @@ class DLL_EXPORT ContentLauncherCluster : public ClusterBase ~ContentLauncherCluster() {} // Cluster Commands - CHIP_ERROR LaunchContent(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, bool autoPlay, - chip::CharSpan data, uint8_t type, chip::CharSpan value); - CHIP_ERROR LaunchURL(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan contentURL, chip::CharSpan displayString, chip::CharSpan providerName); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeSupportedStreamingProtocols(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeSupportedStreamingProtocols(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: + CHIP_ERROR LaunchContentRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + bool autoPlay, chip::CharSpan data); + CHIP_ERROR LaunchURLRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan contentURL, chip::CharSpan displayString, chip::CharSpan providerName); }; class DLL_EXPORT DescriptorCluster : public ClusterBase @@ -656,11 +277,6 @@ class DLL_EXPORT DescriptorCluster : public ClusterBase public: DescriptorCluster() : ClusterBase(app::Clusters::Descriptor::Id) {} ~DescriptorCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT DiagnosticLogsCluster : public ClusterBase @@ -672,10 +288,6 @@ class DLL_EXPORT DiagnosticLogsCluster : public ClusterBase // Cluster Commands CHIP_ERROR RetrieveLogsRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t intent, uint8_t requestedProtocol, chip::ByteSpan transferFileDesignator); - - // Cluster Attributes - -private: }; class DLL_EXPORT DoorLockCluster : public ClusterBase @@ -700,49 +312,6 @@ class DLL_EXPORT DoorLockCluster : public ClusterBase uint8_t credentialRule); CHIP_ERROR UnlockDoor(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan pinCode); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeLockState(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeLockState(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLockType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeLockType(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeActuatorEnabled(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeActuatorEnabled(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeDoorState(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeDoorState(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLanguage(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeLanguage(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeAutoRelockTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeAutoRelockTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSoundVolume(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSoundVolume(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOperatingMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOperatingMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEnableOneTouchLocking(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeEnableOneTouchLocking(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEnablePrivacyModeButton(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeEnablePrivacyModeButton(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeWrongCodeEntryLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeWrongCodeEntryLimit(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT ElectricalMeasurementCluster : public ClusterBase @@ -750,45 +319,6 @@ class DLL_EXPORT ElectricalMeasurementCluster : public ClusterBase public: ElectricalMeasurementCluster() : ClusterBase(app::Clusters::ElectricalMeasurement::Id) {} ~ElectricalMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasurementType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasurementType(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTotalActivePower(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTotalActivePower(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRmsVoltage(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRmsVoltage(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRmsVoltageMin(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRmsVoltageMin(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRmsVoltageMax(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRmsVoltageMax(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRmsCurrent(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRmsCurrent(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRmsCurrentMin(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRmsCurrentMin(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRmsCurrentMax(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRmsCurrentMax(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeActivePower(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeActivePower(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeActivePowerMin(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeActivePowerMin(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeActivePowerMax(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeActivePowerMax(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT EthernetNetworkDiagnosticsCluster : public ClusterBase @@ -799,40 +329,6 @@ class DLL_EXPORT EthernetNetworkDiagnosticsCluster : public ClusterBase // Cluster Commands CHIP_ERROR ResetCounts(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributePHYRate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePHYRate(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeFullDuplex(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFullDuplex(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePacketRxCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePacketRxCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePacketTxCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePacketTxCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxErrCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxErrCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCollisionCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCollisionCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOverrunCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCarrierDetect(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCarrierDetect(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTimeSinceReset(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTimeSinceReset(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT FixedLabelCluster : public ClusterBase @@ -840,11 +336,6 @@ class DLL_EXPORT FixedLabelCluster : public ClusterBase public: FixedLabelCluster() : ClusterBase(app::Clusters::FixedLabel::Id) {} ~FixedLabelCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT FlowMeasurementCluster : public ClusterBase @@ -852,25 +343,6 @@ class DLL_EXPORT FlowMeasurementCluster : public ClusterBase public: FlowMeasurementCluster() : ClusterBase(app::Clusters::FlowMeasurement::Id) {} ~FlowMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTolerance(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT GeneralCommissioningCluster : public ClusterBase @@ -885,16 +357,6 @@ class DLL_EXPORT GeneralCommissioningCluster : public ClusterBase CHIP_ERROR CommissioningComplete(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR SetRegulatoryConfig(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t location, chip::CharSpan countryCode, uint64_t breadcrumb, uint32_t timeoutMs); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeBreadcrumb(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBreadcrumb(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT GeneralDiagnosticsCluster : public ClusterBase @@ -902,24 +364,6 @@ class DLL_EXPORT GeneralDiagnosticsCluster : public ClusterBase public: GeneralDiagnosticsCluster() : ClusterBase(app::Clusters::GeneralDiagnostics::Id) {} ~GeneralDiagnosticsCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeRebootCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRebootCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeUpTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeUpTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTotalOperationalHours(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTotalOperationalHours(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBootReasons(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBootReasons(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT GroupKeyManagementCluster : public ClusterBase @@ -928,10 +372,16 @@ class DLL_EXPORT GroupKeyManagementCluster : public ClusterBase GroupKeyManagementCluster() : ClusterBase(app::Clusters::GroupKeyManagement::Id) {} ~GroupKeyManagementCluster() {} - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); + // Cluster Commands + CHIP_ERROR KeySetRead(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupKeySetID); + CHIP_ERROR KeySetReadAllIndices(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupKeySetIDs); + CHIP_ERROR KeySetRemove(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupKeySetID); + CHIP_ERROR KeySetWrite(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t groupKeySetID, uint8_t securityPolicy, chip::ByteSpan epochKey0, uint64_t epochStartTime0, + chip::ByteSpan epochKey1, uint64_t epochStartTime1, chip::ByteSpan epochKey2, uint64_t epochStartTime2); }; class DLL_EXPORT GroupsCluster : public ClusterBase @@ -950,16 +400,6 @@ class DLL_EXPORT GroupsCluster : public ClusterBase CHIP_ERROR RemoveAllGroups(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR RemoveGroup(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t groupId); CHIP_ERROR ViewGroup(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t groupId); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeNameSupport(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNameSupport(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT IdentifyCluster : public ClusterBase @@ -973,19 +413,6 @@ class DLL_EXPORT IdentifyCluster : public ClusterBase CHIP_ERROR IdentifyQuery(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR TriggerEffect(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t effectIdentifier, uint8_t effectVariant); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeIdentifyTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeIdentifyTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeIdentifyType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeIdentifyType(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT IlluminanceMeasurementCluster : public ClusterBase @@ -993,28 +420,6 @@ class DLL_EXPORT IlluminanceMeasurementCluster : public ClusterBase public: IlluminanceMeasurementCluster() : ClusterBase(app::Clusters::IlluminanceMeasurement::Id) {} ~IlluminanceMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTolerance(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLightSensorType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeLightSensorType(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT KeypadInputCluster : public ClusterBase @@ -1024,14 +429,7 @@ class DLL_EXPORT KeypadInputCluster : public ClusterBase ~KeypadInputCluster() {} // Cluster Commands - CHIP_ERROR SendKey(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t keyCode); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: + CHIP_ERROR SendKeyRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t keyCode); }; class DLL_EXPORT LevelControlCluster : public ClusterBase @@ -1056,60 +454,6 @@ class DLL_EXPORT LevelControlCluster : public ClusterBase CHIP_ERROR Stop(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t optionMask, uint8_t optionOverride); CHIP_ERROR StopWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeCurrentLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentLevel(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRemainingTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRemainingTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinLevel(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxLevel(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentFrequency(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentFrequency(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinFrequency(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinFrequency(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxFrequency(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxFrequency(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOptions(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOptions(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOnOffTransitionTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeOnOffTransitionTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOnLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOnLevel(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOnTransitionTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeOnTransitionTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOffTransitionTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeOffTransitionTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeDefaultMoveRate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeDefaultMoveRate(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeStartUpCurrentLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeStartUpCurrentLevel(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT LowPowerCluster : public ClusterBase @@ -1120,13 +464,6 @@ class DLL_EXPORT LowPowerCluster : public ClusterBase // Cluster Commands CHIP_ERROR Sleep(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT MediaInputCluster : public ClusterBase @@ -1136,22 +473,12 @@ class DLL_EXPORT MediaInputCluster : public ClusterBase ~MediaInputCluster() {} // Cluster Commands - CHIP_ERROR HideInputStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR RenameInput(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t index, - chip::CharSpan name); - CHIP_ERROR SelectInput(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t index); - CHIP_ERROR ShowInputStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeCurrentMediaInput(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentMediaInput(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: + CHIP_ERROR HideInputStatusRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR RenameInputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t index, + chip::CharSpan name); + CHIP_ERROR SelectInputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t index); + CHIP_ERROR ShowInputStatusRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); }; class DLL_EXPORT MediaPlaybackCluster : public ClusterBase @@ -1161,41 +488,19 @@ class DLL_EXPORT MediaPlaybackCluster : public ClusterBase ~MediaPlaybackCluster() {} // Cluster Commands - CHIP_ERROR MediaFastForward(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR MediaNext(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR MediaPause(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR MediaPlay(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR MediaPrevious(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR MediaRewind(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR MediaSeek(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint64_t position); - CHIP_ERROR MediaSkipBackward(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint64_t deltaPositionMilliseconds); - CHIP_ERROR MediaSkipForward(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint64_t deltaPositionMilliseconds); - CHIP_ERROR MediaStartOver(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - CHIP_ERROR MediaStop(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributePlaybackState(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePlaybackState(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeStartTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeStartTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeDuration(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeDuration(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSeekRangeEnd(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSeekRangeEnd(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSeekRangeStart(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSeekRangeStart(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: + CHIP_ERROR FastForwardRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR NextRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR PauseRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR PlayRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR PreviousRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR RewindRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR SeekRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint64_t position); + CHIP_ERROR SkipBackwardRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t deltaPositionMilliseconds); + CHIP_ERROR SkipForwardRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t deltaPositionMilliseconds); + CHIP_ERROR StartOverRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR StopRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); }; class DLL_EXPORT ModeSelectCluster : public ClusterBase @@ -1206,25 +511,6 @@ class DLL_EXPORT ModeSelectCluster : public ClusterBase // Cluster Commands CHIP_ERROR ChangeToMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t newMode); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeCurrentMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOnMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOnMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeStartUpMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeStartUpMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeDescription(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeDescription(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT NetworkCommissioningCluster : public ClusterBase @@ -1246,16 +532,6 @@ class DLL_EXPORT NetworkCommissioningCluster : public ClusterBase chip::ByteSpan networkID, uint8_t networkIndex, uint64_t breadcrumb); CHIP_ERROR ScanNetworks(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan ssid, uint64_t breadcrumb); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase @@ -1273,13 +549,6 @@ class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase chip::VendorId vendorId, uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, chip::ByteSpan metadataForProvider); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT OtaSoftwareUpdateRequestorCluster : public ClusterBase @@ -1290,22 +559,8 @@ class DLL_EXPORT OtaSoftwareUpdateRequestorCluster : public ClusterBase // Cluster Commands CHIP_ERROR AnnounceOtaProvider(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::NodeId providerLocation, chip::VendorId vendorId, uint8_t announcementReason, - chip::ByteSpan metadataForNode); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeDefaultOtaProvider(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeDefaultOtaProvider(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeUpdatePossible(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeUpdatePossible(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: + chip::NodeId providerNodeId, chip::VendorId vendorId, uint8_t announcementReason, + chip::ByteSpan metadataForNode, chip::EndpointId endpoint); }; class DLL_EXPORT OccupancySensingCluster : public ClusterBase @@ -1313,22 +568,6 @@ class DLL_EXPORT OccupancySensingCluster : public ClusterBase public: OccupancySensingCluster() : ClusterBase(app::Clusters::OccupancySensing::Id) {} ~OccupancySensingCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeOccupancy(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOccupancy(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOccupancySensorType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeOccupancySensorType(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOccupancySensorTypeBitmap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeOccupancySensorTypeBitmap(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT OnOffCluster : public ClusterBase @@ -1346,32 +585,6 @@ class DLL_EXPORT OnOffCluster : public ClusterBase CHIP_ERROR OnWithTimedOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t onOffControl, uint16_t onTime, uint16_t offWaitTime); CHIP_ERROR Toggle(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOnOff(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeGlobalSceneControl(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeGlobalSceneControl(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOnTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOnTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOffWaitTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOffWaitTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeStartUpOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeStartUpOnOff(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT OnOffSwitchConfigurationCluster : public ClusterBase @@ -1379,17 +592,6 @@ class DLL_EXPORT OnOffSwitchConfigurationCluster : public ClusterBase public: OnOffSwitchConfigurationCluster() : ClusterBase(app::Clusters::OnOffSwitchConfiguration::Id) {} ~OnOffSwitchConfigurationCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeSwitchType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSwitchType(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSwitchActions(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSwitchActions(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase @@ -1417,25 +619,6 @@ class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase chip::CharSpan label); CHIP_ERROR UpdateNOC(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan NOCValue, chip::ByteSpan ICACValue); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeSupportedFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeSupportedFabrics(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCommissionedFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCommissionedFabrics(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentFabricIndex(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentFabricIndex(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT PowerSourceCluster : public ClusterBase @@ -1443,42 +626,6 @@ class DLL_EXPORT PowerSourceCluster : public ClusterBase public: PowerSourceCluster() : ClusterBase(app::Clusters::PowerSource::Id) {} ~PowerSourceCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeStatus(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOrder(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOrder(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeDescription(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeDescription(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBatteryVoltage(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBatteryVoltage(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBatteryPercentRemaining(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeBatteryPercentRemaining(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBatteryTimeRemaining(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeBatteryTimeRemaining(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBatteryChargeLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeBatteryChargeLevel(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBatteryChargeState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeBatteryChargeState(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT PowerSourceConfigurationCluster : public ClusterBase @@ -1486,8 +633,6 @@ class DLL_EXPORT PowerSourceConfigurationCluster : public ClusterBase public: PowerSourceConfigurationCluster() : ClusterBase(app::Clusters::PowerSourceConfiguration::Id) {} ~PowerSourceConfigurationCluster() {} - - // Cluster Attributes }; class DLL_EXPORT PressureMeasurementCluster : public ClusterBase @@ -1495,22 +640,6 @@ class DLL_EXPORT PressureMeasurementCluster : public ClusterBase public: PressureMeasurementCluster() : ClusterBase(app::Clusters::PressureMeasurement::Id) {} ~PressureMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT PumpConfigurationAndControlCluster : public ClusterBase @@ -1518,92 +647,6 @@ class DLL_EXPORT PumpConfigurationAndControlCluster : public ClusterBase public: PumpConfigurationAndControlCluster() : ClusterBase(app::Clusters::PumpConfigurationAndControl::Id) {} ~PumpConfigurationAndControlCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMaxPressure(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxPressure(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxSpeed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxSpeed(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxFlow(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxFlow(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinConstPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinConstPressure(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxConstPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxConstPressure(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinCompPressure(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinCompPressure(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxCompPressure(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxCompPressure(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinConstSpeed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinConstSpeed(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxConstSpeed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxConstSpeed(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinConstFlow(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinConstFlow(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxConstFlow(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxConstFlow(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinConstTemp(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinConstTemp(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxConstTemp(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxConstTemp(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePumpStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePumpStatus(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEffectiveOperationMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeEffectiveOperationMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEffectiveControlMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeEffectiveControlMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCapacity(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCapacity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSpeed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSpeed(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLifetimeRunningHours(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeLifetimeRunningHours(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePower(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePower(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLifetimeEnergyConsumed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeLifetimeEnergyConsumed(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOperationMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOperationMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeControlMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeControlMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeAlarmMask(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeAlarmMask(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT RelativeHumidityMeasurementCluster : public ClusterBase @@ -1611,25 +654,6 @@ class DLL_EXPORT RelativeHumidityMeasurementCluster : public ClusterBase public: RelativeHumidityMeasurementCluster() : ClusterBase(app::Clusters::RelativeHumidityMeasurement::Id) {} ~RelativeHumidityMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTolerance(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT ScenesCluster : public ClusterBase @@ -1654,28 +678,6 @@ class DLL_EXPORT ScenesCluster : public ClusterBase uint8_t sceneId); CHIP_ERROR ViewScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t groupId, uint8_t sceneId); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeSceneCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSceneCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentScene(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentGroup(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentGroup(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSceneValid(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSceneValid(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNameSupport(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNameSupport(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT SoftwareDiagnosticsCluster : public ClusterBase @@ -1686,23 +688,6 @@ class DLL_EXPORT SoftwareDiagnosticsCluster : public ClusterBase // Cluster Commands CHIP_ERROR ResetWatermarks(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeCurrentHeapFree(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentHeapFree(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentHeapUsed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentHeapUsed(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentHeapHighWatermark(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentHeapHighWatermark(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT SwitchCluster : public ClusterBase @@ -1710,45 +695,6 @@ class DLL_EXPORT SwitchCluster : public ClusterBase public: SwitchCluster() : ClusterBase(app::Clusters::Switch::Id) {} ~SwitchCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeNumberOfPositions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNumberOfPositions(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentPosition(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentPosition(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMultiPressMax(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMultiPressMax(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); -}; - -class DLL_EXPORT TvChannelCluster : public ClusterBase -{ -public: - TvChannelCluster() : ClusterBase(app::Clusters::TvChannel::Id) {} - ~TvChannelCluster() {} - - // Cluster Commands - CHIP_ERROR ChangeChannel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - chip::CharSpan match); - CHIP_ERROR ChangeChannelByNumber(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t majorNumber, uint16_t minorNumber); - CHIP_ERROR SkipChannel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t count); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT TargetNavigatorCluster : public ClusterBase @@ -1758,15 +704,8 @@ class DLL_EXPORT TargetNavigatorCluster : public ClusterBase ~TargetNavigatorCluster() {} // Cluster Commands - CHIP_ERROR NavigateTarget(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t target, - chip::CharSpan data); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: + CHIP_ERROR NavigateTargetRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t target, chip::CharSpan data); }; class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase @@ -1774,25 +713,6 @@ class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase public: TemperatureMeasurementCluster() : ClusterBase(app::Clusters::TemperatureMeasurement::Id) {} ~TemperatureMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTolerance(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT TestClusterCluster : public ClusterBase @@ -1836,239 +756,6 @@ class DLL_EXPORT TestClusterCluster : public ClusterBase double h); CHIP_ERROR TestUnknownCommand(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR TimedInvokeRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBoolean(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBitmap8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBitmap8(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBitmap16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBitmap16(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBitmap32(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBitmap32(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBitmap64(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBitmap64(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt8u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt16u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt16u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt24u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt24u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt32u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt32u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt40u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt40u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt48u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt48u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt56u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt56u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt64u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt64u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt8s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt8s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt16s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt16s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt24s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt24s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt32s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt32s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt40s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt40s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt48s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt48s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt56s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt56s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInt64s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeInt64s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEnum8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeEnum8(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEnum16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeEnum16(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeFloatSingle(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFloatSingle(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeFloatDouble(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFloatDouble(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOctetString(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLongOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeLongOctetString(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCharString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCharString(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLongCharString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeLongCharString(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEpochUs(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeEpochUs(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEpochS(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeEpochS(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeVendorId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeVendorId(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEnumAttr(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeEnumAttr(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRangeRestrictedInt8u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRangeRestrictedInt8u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRangeRestrictedInt8s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRangeRestrictedInt8s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRangeRestrictedInt16u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRangeRestrictedInt16u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRangeRestrictedInt16s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRangeRestrictedInt16s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeUnsupported(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeUnsupported(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableBoolean(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableBitmap8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableBitmap8(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableBitmap16(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableBitmap16(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableBitmap32(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableBitmap32(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableBitmap64(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableBitmap64(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt8u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt16u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt16u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt24u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt24u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt32u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt32u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt40u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt40u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt48u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt48u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt56u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt56u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt64u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt64u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt8s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt8s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt16s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt16s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt24s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt24s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt32s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt32s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt40s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt40s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt48s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt48s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt56s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt56s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableInt64s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableInt64s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableEnum8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableEnum8(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableEnum16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableEnum16(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableFloatSingle(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableFloatSingle(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableFloatDouble(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableFloatDouble(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableOctetString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableOctetString(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableCharString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableCharString(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableEnumAttr(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableEnumAttr(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableRangeRestrictedInt8u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableRangeRestrictedInt8u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableRangeRestrictedInt8s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableRangeRestrictedInt8s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableRangeRestrictedInt16u(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableRangeRestrictedInt16u(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNullableRangeRestrictedInt16s(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNullableRangeRestrictedInt16s(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT ThermostatCluster : public ClusterBase @@ -2087,82 +774,6 @@ class DLL_EXPORT ThermostatCluster : public ClusterBase uint8_t payload); CHIP_ERROR SetpointRaiseLower(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t mode, int8_t amount); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeLocalTemperature(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeLocalTemperature(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeAbsMinHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeAbsMinHeatSetpointLimit(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeAbsMaxHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeAbsMaxHeatSetpointLimit(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeAbsMinCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeAbsMinCoolSetpointLimit(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeAbsMaxCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeAbsMaxCoolSetpointLimit(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOccupiedCoolingSetpoint(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeOccupiedCoolingSetpoint(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOccupiedHeatingSetpoint(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeOccupiedHeatingSetpoint(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinHeatSetpointLimit(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxHeatSetpointLimit(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinCoolSetpointLimit(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxCoolSetpointLimit(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinSetpointDeadBand(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinSetpointDeadBand(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeControlSequenceOfOperation(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeControlSequenceOfOperation(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSystemMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSystemMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeStartOfWeek(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeStartOfWeek(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNumberOfWeeklyTransitions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNumberOfWeeklyTransitions(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNumberOfDailyTransitions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeNumberOfDailyTransitions(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT ThermostatUserInterfaceConfigurationCluster : public ClusterBase @@ -2170,22 +781,6 @@ class DLL_EXPORT ThermostatUserInterfaceConfigurationCluster : public ClusterBas public: ThermostatUserInterfaceConfigurationCluster() : ClusterBase(app::Clusters::ThermostatUserInterfaceConfiguration::Id) {} ~ThermostatUserInterfaceConfigurationCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeTemperatureDisplayMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTemperatureDisplayMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeKeypadLockout(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeKeypadLockout(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeScheduleProgrammingVisibility(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeScheduleProgrammingVisibility(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT ThreadNetworkDiagnosticsCluster : public ClusterBase @@ -2196,209 +791,6 @@ class DLL_EXPORT ThreadNetworkDiagnosticsCluster : public ClusterBase // Cluster Commands CHIP_ERROR ResetCounts(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeChannel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeChannel(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRoutingRole(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRoutingRole(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeNetworkName(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeNetworkName(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePanId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePanId(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeExtendedPanId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeExtendedPanId(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMeshLocalPrefix(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeshLocalPrefix(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOverrunCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePartitionId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributePartitionId(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeWeighting(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeWeighting(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeDataVersion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeDataVersion(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeStableDataVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeStableDataVersion(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLeaderRouterId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeLeaderRouterId(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeDetachedRoleCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeDetachedRoleCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeChildRoleCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeChildRoleCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRouterRoleCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRouterRoleCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeLeaderRoleCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeLeaderRoleCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeAttachAttemptCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeAttachAttemptCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePartitionIdChangeCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePartitionIdChangeCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBetterPartitionAttachAttemptCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeBetterPartitionAttachAttemptCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeParentChangeCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeParentChangeCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxTotalCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxTotalCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxUnicastCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxUnicastCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxBroadcastCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxBroadcastCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxAckRequestedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxAckRequestedCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxAckedCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxAckedCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxNoAckRequestedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxNoAckRequestedCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxDataCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxDataCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxDataPollCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxDataPollCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxBeaconCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxBeaconCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxBeaconRequestCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxBeaconRequestCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxOtherCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxOtherCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxRetryCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxRetryCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxDirectMaxRetryExpiryCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxDirectMaxRetryExpiryCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxIndirectMaxRetryExpiryCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxIndirectMaxRetryExpiryCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxErrCcaCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxErrCcaCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxErrAbortCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxErrAbortCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTxErrBusyChannelCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTxErrBusyChannelCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxTotalCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxTotalCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxUnicastCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxUnicastCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxBroadcastCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxBroadcastCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxDataCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxDataCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxDataPollCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxDataPollCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxBeaconCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxBeaconCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxBeaconRequestCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxBeaconRequestCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxOtherCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxOtherCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxAddressFilteredCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxAddressFilteredCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxDestAddrFilteredCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxDestAddrFilteredCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxDuplicatedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxDuplicatedCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxErrNoFrameCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxErrNoFrameCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxErrUnknownNeighborCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxErrUnknownNeighborCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxErrInvalidSrcAddrCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxErrInvalidSrcAddrCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxErrSecCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxErrSecCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxErrFcsCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxErrFcsCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRxErrOtherCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRxErrOtherCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeActiveTimestamp(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeActiveTimestamp(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePendingTimestamp(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePendingTimestamp(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeDelay(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeDelay(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeChannelMask(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeChannelMask(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT UserLabelCluster : public ClusterBase @@ -2406,8 +798,6 @@ class DLL_EXPORT UserLabelCluster : public ClusterBase public: UserLabelCluster() : ClusterBase(app::Clusters::UserLabel::Id) {} ~UserLabelCluster() {} - - // Cluster Attributes }; class DLL_EXPORT WakeOnLanCluster : public ClusterBase @@ -2415,15 +805,6 @@ class DLL_EXPORT WakeOnLanCluster : public ClusterBase public: WakeOnLanCluster() : ClusterBase(app::Clusters::WakeOnLan::Id) {} ~WakeOnLanCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeWakeOnLanMacAddress(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeWakeOnLanMacAddress(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT WiFiNetworkDiagnosticsCluster : public ClusterBase @@ -2434,56 +815,6 @@ class DLL_EXPORT WiFiNetworkDiagnosticsCluster : public ClusterBase // Cluster Commands CHIP_ERROR ResetCounts(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeBssid(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBssid(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSecurityType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSecurityType(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeWiFiVersion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeWiFiVersion(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeChannelNumber(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeChannelNumber(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeRssi(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeRssi(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBeaconLostCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBeaconLostCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeBeaconRxCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBeaconRxCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePacketMulticastRxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePacketMulticastRxCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePacketMulticastTxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePacketMulticastTxCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePacketUnicastRxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePacketUnicastRxCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributePacketUnicastTxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributePacketUnicastTxCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentMaxRate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentMaxRate(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOverrunCount(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT WindowCoveringCluster : public ClusterBase @@ -2495,92 +826,15 @@ class DLL_EXPORT WindowCoveringCluster : public ClusterBase // Cluster Commands CHIP_ERROR DownOrClose(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR GoToLiftPercentage(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t liftPercentageValue, uint16_t liftPercent100thsValue); + chip::Percent liftPercentageValue, chip::Percent100ths liftPercent100thsValue); CHIP_ERROR GoToLiftValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t liftValue); CHIP_ERROR GoToTiltPercentage(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint8_t tiltPercentageValue, uint16_t tiltPercent100thsValue); + chip::Percent tiltPercentageValue, chip::Percent100ths tiltPercent100thsValue); CHIP_ERROR GoToTiltValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t tiltValue); CHIP_ERROR StopMotion(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR UpOrOpen(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeType(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentPositionLift(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentPositionLift(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentPositionTilt(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentPositionTilt(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeConfigStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeConfigStatus(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentPositionLiftPercentage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentPositionLiftPercentage(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentPositionTiltPercentage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentPositionTiltPercentage(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOperationalStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeOperationalStatus(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTargetPositionLiftPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTargetPositionLiftPercent100ths(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeTargetPositionTiltPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeTargetPositionTiltPercent100ths(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEndProductType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeEndProductType(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentPositionLiftPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentPositionLiftPercent100ths(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentPositionTiltPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentPositionTiltPercent100ths(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInstalledOpenLimitLift(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeInstalledOpenLimitLift(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInstalledClosedLimitLift(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeInstalledClosedLimitLift(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInstalledOpenLimitTilt(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeInstalledOpenLimitTilt(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeInstalledClosedLimitTilt(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeInstalledClosedLimitTilt(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeSafetyStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeSafetyStatus(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; } // namespace Controller diff --git a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp index 728e686b0b7924..5c79540bad0ac2 100644 --- a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp @@ -155,7 +155,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa { switch (aCommandPath.mCommandId) { - case Commands::HideAppResponse::Id: { + case Commands::LauncherResponse::Id: { expectArgumentCount = 2; uint8_t status; chip::CharSpan data; @@ -214,77 +214,52 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { wasHandled = - emberAfApplicationLauncherClusterHideAppResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, data); + emberAfApplicationLauncherClusterLauncherResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, data); } break; } - case Commands::LaunchAppResponse::Id: { - expectArgumentCount = 2; - uint8_t status; - chip::CharSpan data; - bool argExists[2]; + default: { + return; + } + } + } - memset(argExists, 0, sizeof argExists); + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) + { + ChipLogProgress(Zcl, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); + } +} - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(data); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } +} // namespace ApplicationLauncher - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } +namespace Channel { - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfApplicationLauncherClusterLaunchAppResponseCallback(aCommandPath.mEndpointId, apCommandObj, - status, data); - } - break; - } - case Commands::StopAppResponse::Id: { +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::ChangeChannelResponse::Id: { expectArgumentCount = 2; - uint8_t status; - chip::CharSpan data; + chip::app::Clusters::Channel::Structs::ChannelInfo::DecodableType channelMatch; + uint8_t errorType; bool argExists[2]; memset(argExists, 0, sizeof argExists); @@ -315,10 +290,11 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(status); + // Not supported, just error out. + TLVUnpackError = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT; break; case 1: - TLVUnpackError = aDataTlv.Get(data); + TLVUnpackError = aDataTlv.Get(errorType); break; default: // Unsupported tag, ignore it. @@ -339,8 +315,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfApplicationLauncherClusterStopAppResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, data); + wasHandled = emberAfChannelClusterChangeChannelResponseCallback(aCommandPath.mEndpointId, apCommandObj, + channelMatch, errorType); } break; } @@ -363,7 +339,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa } } -} // namespace ApplicationLauncher +} // namespace Channel namespace ContentLauncher { @@ -382,72 +358,9 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa { switch (aCommandPath.mCommandId) { - case Commands::LaunchContentResponse::Id: { - expectArgumentCount = 2; - uint8_t contentLaunchStatus; - chip::CharSpan data; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(contentLaunchStatus); - break; - case 1: - TLVUnpackError = aDataTlv.Get(data); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfContentLauncherClusterLaunchContentResponseCallback(aCommandPath.mEndpointId, apCommandObj, - contentLaunchStatus, data); - } - break; - } - case Commands::LaunchURLResponse::Id: { + case Commands::LaunchResponse::Id: { expectArgumentCount = 2; - uint8_t contentLaunchStatus; + uint8_t status; chip::CharSpan data; bool argExists[2]; @@ -479,7 +392,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(contentLaunchStatus); + TLVUnpackError = aDataTlv.Get(status); break; case 1: TLVUnpackError = aDataTlv.Get(data); @@ -503,8 +416,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfContentLauncherClusterLaunchURLResponseCallback(aCommandPath.mEndpointId, apCommandObj, - contentLaunchStatus, data); + wasHandled = + emberAfContentLauncherClusterLaunchResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, data); } break; } @@ -1134,7 +1047,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa } // namespace GeneralCommissioning -namespace Groups { +namespace GroupKeyManagement { void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { @@ -1151,11 +1064,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa { switch (aCommandPath.mCommandId) { - case Commands::AddGroupResponse::Id: { - expectArgumentCount = 2; - uint8_t status; - uint16_t groupId; - bool argExists[2]; + case Commands::KeySetReadAllIndicesResponse::Id: { + expectArgumentCount = 1; + /* TYPE WARNING: array array defaults to */ uint8_t * groupKeySetIDs; + bool argExists[1]; memset(argExists, 0, sizeof argExists); @@ -1168,7 +1080,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa continue; } currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) + if (currentDecodeTagId < 1) { if (argExists[currentDecodeTagId]) { @@ -1185,10 +1097,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - case 1: - TLVUnpackError = aDataTlv.Get(groupId); + // Just for compatibility, we will add array type support in IM later. + TLVUnpackError = aDataTlv.GetDataPtr(const_cast(groupKeySetIDs)); break; default: // Unsupported tag, ignore it. @@ -1207,17 +1117,17 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa TLVError = CHIP_NO_ERROR; } - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfGroupsClusterAddGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId); + wasHandled = emberAfGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback(aCommandPath.mEndpointId, + apCommandObj, groupKeySetIDs); } break; } - case Commands::GetGroupMembershipResponse::Id: { - expectArgumentCount = 2; - uint8_t capacity; - /* TYPE WARNING: array array defaults to */ uint8_t * groupList; - bool argExists[2]; + case Commands::KeySetReadResponse::Id: { + expectArgumentCount = 1; + chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySet::DecodableType groupKeySet; + bool argExists[1]; memset(argExists, 0, sizeof argExists); @@ -1230,7 +1140,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa continue; } currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) + if (currentDecodeTagId < 1) { if (argExists[currentDecodeTagId]) { @@ -1247,11 +1157,8 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(capacity); - break; - case 1: - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(groupList)); + // Not supported, just error out. + TLVUnpackError = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT; break; default: // Unsupported tag, ignore it. @@ -1270,14 +1177,52 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa TLVError = CHIP_NO_ERROR; } - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfGroupsClusterGetGroupMembershipResponseCallback(aCommandPath.mEndpointId, apCommandObj, - capacity, groupList); + wasHandled = + emberAfGroupKeyManagementClusterKeySetReadResponseCallback(aCommandPath.mEndpointId, apCommandObj, groupKeySet); } break; } - case Commands::RemoveGroupResponse::Id: { + default: { + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) + { + ChipLogProgress(Zcl, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); + } +} + +} // namespace GroupKeyManagement + +namespace Groups { + +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::AddGroupResponse::Id: { expectArgumentCount = 2; uint8_t status; uint16_t groupId; @@ -1335,17 +1280,15 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = - emberAfGroupsClusterRemoveGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId); + wasHandled = emberAfGroupsClusterAddGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId); } break; } - case Commands::ViewGroupResponse::Id: { - expectArgumentCount = 3; - uint8_t status; - uint16_t groupId; - chip::CharSpan groupName; - bool argExists[3]; + case Commands::GetGroupMembershipResponse::Id: { + expectArgumentCount = 2; + uint8_t capacity; + /* TYPE WARNING: array array defaults to */ uint8_t * groupList; + bool argExists[2]; memset(argExists, 0, sizeof argExists); @@ -1358,7 +1301,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa continue; } currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 3) + if (currentDecodeTagId < 2) { if (argExists[currentDecodeTagId]) { @@ -1375,110 +1318,11 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(status); + TLVUnpackError = aDataTlv.Get(capacity); break; case 1: - TLVUnpackError = aDataTlv.Get(groupId); - break; - case 2: - TLVUnpackError = aDataTlv.Get(groupName); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) - { - wasHandled = emberAfGroupsClusterViewGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId, - groupName); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace Groups - -namespace Identify { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::IdentifyQueryResponse::Id: { - expectArgumentCount = 1; - uint16_t timeout; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(timeout); + // Just for compatibility, we will add array type support in IM later. + TLVUnpackError = aDataTlv.GetDataPtr(const_cast(groupList)); break; default: // Unsupported tag, ignore it. @@ -1497,504 +1341,18 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa TLVError = CHIP_NO_ERROR; } - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfIdentifyClusterIdentifyQueryResponseCallback(aCommandPath.mEndpointId, apCommandObj, timeout); + wasHandled = emberAfGroupsClusterGetGroupMembershipResponseCallback(aCommandPath.mEndpointId, apCommandObj, + capacity, groupList); } break; } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace Identify - -namespace KeypadInput { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::SendKeyResponse::Id: { - expectArgumentCount = 1; + case Commands::RemoveGroupResponse::Id: { + expectArgumentCount = 2; uint8_t status; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(status); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfKeypadInputClusterSendKeyResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace KeypadInput - -namespace MediaPlayback { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::MediaFastForwardResponse::Id: { - expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfMediaPlaybackClusterMediaFastForwardResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); - } - break; - } - case Commands::MediaNextResponse::Id: { - expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfMediaPlaybackClusterMediaNextResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); - } - break; - } - case Commands::MediaPauseResponse::Id: { - expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfMediaPlaybackClusterMediaPauseResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); - } - break; - } - case Commands::MediaPlayResponse::Id: { - expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfMediaPlaybackClusterMediaPlayResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); - } - break; - } - case Commands::MediaPreviousResponse::Id: { - expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfMediaPlaybackClusterMediaPreviousResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); - } - break; - } - case Commands::MediaRewindResponse::Id: { - expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; - bool argExists[1]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - wasHandled = emberAfMediaPlaybackClusterMediaRewindResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); - } - break; - } - case Commands::MediaSeekResponse::Id: { - expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; - bool argExists[1]; + uint16_t groupId; + bool argExists[2]; memset(argExists, 0, sizeof argExists); @@ -2007,7 +1365,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa continue; } currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) + if (currentDecodeTagId < 2) { if (argExists[currentDecodeTagId]) { @@ -2024,7 +1382,10 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); + TLVUnpackError = aDataTlv.Get(status); + break; + case 1: + TLVUnpackError = aDataTlv.Get(groupId); break; default: // Unsupported tag, ignore it. @@ -2043,17 +1404,19 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa TLVError = CHIP_NO_ERROR; } - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaSeekResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); + wasHandled = + emberAfGroupsClusterRemoveGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId); } break; } - case Commands::MediaSkipBackwardResponse::Id: { - expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; - bool argExists[1]; + case Commands::ViewGroupResponse::Id: { + expectArgumentCount = 3; + uint8_t status; + uint16_t groupId; + chip::CharSpan groupName; + bool argExists[3]; memset(argExists, 0, sizeof argExists); @@ -2066,7 +1429,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa continue; } currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 1) + if (currentDecodeTagId < 3) { if (argExists[currentDecodeTagId]) { @@ -2083,7 +1446,13 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); + TLVUnpackError = aDataTlv.Get(status); + break; + case 1: + TLVUnpackError = aDataTlv.Get(groupId); + break; + case 2: + TLVUnpackError = aDataTlv.Get(groupName); break; default: // Unsupported tag, ignore it. @@ -2102,16 +1471,54 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa TLVError = CHIP_NO_ERROR; } - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaSkipBackwardResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); + wasHandled = emberAfGroupsClusterViewGroupResponseCallback(aCommandPath.mEndpointId, apCommandObj, status, groupId, + groupName); } break; } - case Commands::MediaSkipForwardResponse::Id: { + default: { + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) + { + ChipLogProgress(Zcl, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); + } +} + +} // namespace Groups + +namespace Identify { + +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::IdentifyQueryResponse::Id: { expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; + uint16_t timeout; bool argExists[1]; memset(argExists, 0, sizeof argExists); @@ -2142,7 +1549,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); + TLVUnpackError = aDataTlv.Get(timeout); break; default: // Unsupported tag, ignore it. @@ -2163,14 +1570,51 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaSkipForwardResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); + wasHandled = emberAfIdentifyClusterIdentifyQueryResponseCallback(aCommandPath.mEndpointId, apCommandObj, timeout); } break; } - case Commands::MediaStartOverResponse::Id: { + default: { + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) + { + ChipLogProgress(Zcl, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); + } +} + +} // namespace Identify + +namespace KeypadInput { + +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::SendKeyResponse::Id: { expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; + uint8_t status; bool argExists[1]; memset(argExists, 0, sizeof argExists); @@ -2201,7 +1645,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); + TLVUnpackError = aDataTlv.Get(status); break; default: // Unsupported tag, ignore it. @@ -2222,14 +1666,51 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaStartOverResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); + wasHandled = emberAfKeypadInputClusterSendKeyResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } - case Commands::MediaStopResponse::Id: { + default: { + return; + } + } + } + + if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) + { + ChipLogProgress(Zcl, + "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT + ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, + validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); + // A command with no arguments would never write currentDecodeTagId. If + // progress logging is also disabled, it would look unused. Silence that + // warning. + UNUSED_VAR(currentDecodeTagId); + } +} + +} // namespace KeypadInput + +namespace MediaPlayback { + +void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + // The following variables are used for all commands to save code size. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint32_t validArgumentCount = 0; + uint32_t expectArgumentCount = 0; + uint32_t currentDecodeTagId = 0; + bool wasHandled = false; + { + switch (aCommandPath.mCommandId) + { + case Commands::PlaybackResponse::Id: { expectArgumentCount = 1; - uint8_t mediaPlaybackStatus; + uint8_t status; bool argExists[1]; memset(argExists, 0, sizeof argExists); @@ -2260,7 +1741,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa switch (currentDecodeTagId) { case 0: - TLVUnpackError = aDataTlv.Get(mediaPlaybackStatus); + TLVUnpackError = aDataTlv.Get(status); break; default: // Unsupported tag, ignore it. @@ -2281,8 +1762,7 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { - wasHandled = emberAfMediaPlaybackClusterMediaStopResponseCallback(aCommandPath.mEndpointId, apCommandObj, - mediaPlaybackStatus); + wasHandled = emberAfMediaPlaybackClusterPlaybackResponseCallback(aCommandPath.mEndpointId, apCommandObj, status); } break; } @@ -3485,108 +2965,6 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa } // namespace Scenes -namespace TvChannel { - -void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t validArgumentCount = 0; - uint32_t expectArgumentCount = 0; - uint32_t currentDecodeTagId = 0; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ChangeChannelResponse::Id: { - expectArgumentCount = 2; - chip::app::Clusters::TvChannel::Structs::TvChannelInfo::DecodableType channelMatch; - uint8_t errorType; - bool argExists[2]; - - memset(argExists, 0, sizeof argExists); - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < 2) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { - case 0: - // Not supported, just error out. - TLVUnpackError = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT; - break; - case 1: - TLVUnpackError = aDataTlv.Get(errorType); - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - wasHandled = emberAfTvChannelClusterChangeChannelResponseCallback(aCommandPath.mEndpointId, apCommandObj, - channelMatch, errorType); - } - break; - } - default: { - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || CHIP_NO_ERROR != TLVUnpackError || expectArgumentCount != validArgumentCount || !wasHandled) - { - ChipLogProgress(Zcl, - "Failed to dispatch command, %" PRIu32 "/%" PRIu32 " arguments parsed, TLVError=%" CHIP_ERROR_FORMAT - ", UnpackError=%" CHIP_ERROR_FORMAT " (last decoded tag = %" PRIu32, - validArgumentCount, expectArgumentCount, TLVError.Format(), TLVUnpackError.Format(), currentDecodeTagId); - // A command with no arguments would never write currentDecodeTagId. If - // progress logging is also disabled, it would look unused. Silence that - // warning. - UNUSED_VAR(currentDecodeTagId); - } -} - -} // namespace TvChannel - namespace TargetNavigator { void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -4377,6 +3755,9 @@ void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPa case Clusters::ApplicationLauncher::Id: Clusters::ApplicationLauncher::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; + case Clusters::Channel::Id: + Clusters::Channel::DispatchClientCommand(apCommandObj, aCommandPath, aReader); + break; case Clusters::ContentLauncher::Id: Clusters::ContentLauncher::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; @@ -4389,6 +3770,9 @@ void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPa case Clusters::GeneralCommissioning::Id: Clusters::GeneralCommissioning::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; + case Clusters::GroupKeyManagement::Id: + Clusters::GroupKeyManagement::DispatchClientCommand(apCommandObj, aCommandPath, aReader); + break; case Clusters::Groups::Id: Clusters::Groups::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; @@ -4413,9 +3797,6 @@ void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPa case Clusters::Scenes::Id: Clusters::Scenes::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::TvChannel::Id: - Clusters::TvChannel::DispatchClientCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::TargetNavigator::Id: Clusters::TargetNavigator::DispatchClientCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h index 2f85009baab323..58ad4eee403386 100644 --- a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h @@ -35,6 +35,7 @@ MatterBooleanStatePluginClientInitCallback(); \ MatterBridgedActionsPluginClientInitCallback(); \ MatterBridgedDeviceBasicPluginClientInitCallback(); \ + MatterChannelPluginClientInitCallback(); \ MatterColorControlPluginClientInitCallback(); \ MatterContentLauncherPluginClientInitCallback(); \ MatterDescriptorPluginClientInitCallback(); \ @@ -71,7 +72,6 @@ MatterScenesPluginClientInitCallback(); \ MatterSoftwareDiagnosticsPluginClientInitCallback(); \ MatterSwitchPluginClientInitCallback(); \ - MatterTvChannelPluginClientInitCallback(); \ MatterTargetNavigatorPluginClientInitCallback(); \ MatterTemperatureMeasurementPluginClientInitCallback(); \ MatterTestClusterPluginClientInitCallback(); \ diff --git a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp index cce54b227edfd6..105f048289f12a 100644 --- a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp +++ b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp @@ -68,6 +68,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID: emberAfBridgedDeviceBasicClusterInitCallback(endpoint); break; + case ZCL_CHANNEL_CLUSTER_ID: + emberAfChannelClusterInitCallback(endpoint); + break; case ZCL_COLOR_CONTROL_CLUSTER_ID: emberAfColorControlClusterInitCallback(endpoint); break; @@ -176,9 +179,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_SWITCH_CLUSTER_ID: emberAfSwitchClusterInitCallback(endpoint); break; - case ZCL_TV_CHANNEL_CLUSTER_ID: - emberAfTvChannelClusterInitCallback(endpoint); - break; case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: emberAfTargetNavigatorClusterInitCallback(endpoint); break; @@ -280,6 +280,11 @@ void __attribute__((weak)) emberAfBridgedDeviceBasicClusterInitCallback(Endpoint // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfChannelClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfColorControlClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -460,11 +465,6 @@ void __attribute__((weak)) emberAfSwitchClusterInitCallback(EndpointId endpoint) // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfTvChannelClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfTargetNavigatorClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h index ca02d5ae2a8fb7..b595a44c43dc83 100644 --- a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h @@ -271,7 +271,7 @@ /* Endpoint: 1, Cluster: Wake on LAN (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: TV Channel (client) */ \ + /* Endpoint: 1, Cluster: Channel (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (client) */ \ @@ -450,7 +450,7 @@ }, /* Endpoint: 1, Cluster: Wake on LAN (client) */ \ { \ 0x0504, ZAP_ATTRIBUTE_INDEX(51), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ - }, /* Endpoint: 1, Cluster: TV Channel (client) */ \ + }, /* Endpoint: 1, Cluster: Channel (client) */ \ { \ 0x0505, ZAP_ATTRIBUTE_INDEX(52), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (client) */ \ diff --git a/zzz_generated/controller-clusters/zap-generated/gen_config.h b/zzz_generated/controller-clusters/zap-generated/gen_config.h index 0a03eeaa82080d..1a538867128128 100644 --- a/zzz_generated/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/controller-clusters/zap-generated/gen_config.h @@ -42,6 +42,7 @@ #define EMBER_AF_BOOLEAN_STATE_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_BRIDGED_ACTIONS_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_BRIDGED_DEVICE_BASIC_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_CHANNEL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_COLOR_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_CONTENT_LAUNCH_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_DESCRIPTOR_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -78,7 +79,6 @@ #define EMBER_AF_SCENES_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_SWITCH_CLUSTER_CLIENT_ENDPOINT_COUNT (1) -#define EMBER_AF_TV_CHANNEL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TEST_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -144,6 +144,10 @@ #define ZCL_USING_BRIDGED_DEVICE_BASIC_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_BRIDGED_DEVICE_BASIC_CLIENT +// Use this macro to check if the client side of the Channel cluster is included +#define ZCL_USING_CHANNEL_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_CHANNEL_CLIENT + // Use this macro to check if the client side of the Color Control cluster is included #define ZCL_USING_COLOR_CONTROL_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_COLOR_CONTROL_CLIENT @@ -288,10 +292,6 @@ #define ZCL_USING_SWITCH_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_SWITCH_CLIENT -// Use this macro to check if the client side of the TV Channel cluster is included -#define ZCL_USING_TV_CHANNEL_CLUSTER_CLIENT -#define EMBER_AF_PLUGIN_TV_CHANNEL_CLIENT - // Use this macro to check if the client side of the Target Navigator cluster is included #define ZCL_USING_TARGET_NAVIGATOR_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_TARGET_NAVIGATOR_CLIENT diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp deleted file mode 100644 index 4afc378c3cedd1..00000000000000 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp +++ /dev/null @@ -1,3772 +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. - */ - -// THIS FILE IS GENERATED BY ZAP - -#include - -#include -#include - -#include -#include -#include - -using namespace chip::app::Clusters; -using namespace chip::System; -using namespace chip::Encoding::LittleEndian; - -namespace chip { -namespace Controller { - -CHIP_ERROR AccessControlClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, AccessControl::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR AccountLoginClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, AccountLogin::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR AdministratorCommissioningClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, AdministratorCommissioning::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeVendorName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ApplicationBasic::Attributes::VendorName::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeVendorId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ApplicationBasic::Attributes::VendorId::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeApplicationName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ApplicationBasic::Attributes::ApplicationName::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeProductId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ApplicationBasic::Attributes::ProductId::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeApplicationStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ApplicationBasic::Attributes::ApplicationStatus::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeApplicationVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ApplicationBasic::Attributes::ApplicationVersion::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ApplicationBasicClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ApplicationBasic::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ApplicationLauncherClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ApplicationLauncher::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR AudioOutputClusterTest::WriteAttributeCurrentAudioOutput(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, AudioOutput::Attributes::CurrentAudioOutput::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR AudioOutputClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, AudioOutput::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BarrierControlClusterTest::WriteAttributeBarrierMovingState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BarrierControl::Attributes::BarrierMovingState::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BarrierControlClusterTest::WriteAttributeBarrierSafetyStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BarrierControl::Attributes::BarrierSafetyStatus::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BarrierControlClusterTest::WriteAttributeBarrierCapabilities(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BarrierControl::Attributes::BarrierCapabilities::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BarrierControlClusterTest::WriteAttributeBarrierPosition(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BarrierControl::Attributes::BarrierPosition::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BarrierControlClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BarrierControl::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BasicClusterTest::WriteAttributeInteractionModelVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::InteractionModelVersion::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeVendorName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::VendorName::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeVendorID(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::VendorID::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeProductName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::ProductName::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeProductID(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::ProductID::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeHardwareVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::HardwareVersion::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeHardwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::HardwareVersionString::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeSoftwareVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::SoftwareVersion::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeSoftwareVersionString(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::SoftwareVersionString::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeManufacturingDate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::ManufacturingDate::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributePartNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::PartNumber::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeProductURL(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::ProductURL::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeProductLabel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::ProductLabel::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeSerialNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::SerialNumber::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeReachable(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, bool value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::Reachable::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeUniqueID(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::UniqueID::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BasicClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Basic::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BinaryInputBasicClusterTest::WriteAttributeStatusFlags(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BinaryInputBasic::Attributes::StatusFlags::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BinaryInputBasicClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BinaryInputBasic::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BindingClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Binding::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BooleanStateClusterTest::WriteAttributeStateValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, bool value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BooleanState::Attributes::StateValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BooleanStateClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BooleanState::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedActionsClusterTest::WriteAttributeSetupUrl(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedActions::Attributes::SetupUrl::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR BridgedActionsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedActions::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR BridgedDeviceBasicClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, BridgedDeviceBasic::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ColorControlClusterTest::WriteAttributeCurrentHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::CurrentHue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeCurrentSaturation(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::CurrentSaturation::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeRemainingTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::RemainingTime::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeCurrentX(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::CurrentX::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeCurrentY(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::CurrentY::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeDriftCompensation(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::DriftCompensation::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeCompensationText(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::CompensationText::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeColorTemperature(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ColorTemperature::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeColorMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ColorMode::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeNumberOfPrimaries(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::NumberOfPrimaries::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary1X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary1X::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary1Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary1Y::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary1Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary1Intensity::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary2X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary2X::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary2Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary2Y::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary2Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary2Intensity::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary3X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary3X::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary3Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary3Y::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary3Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary3Intensity::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary4X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary4X::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary4Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary4Y::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary4Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary4Intensity::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary5X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary5X::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary5Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary5Y::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary5Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary5Intensity::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary6X(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary6X::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary6Y(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary6Y::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributePrimary6Intensity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::Primary6Intensity::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeEnhancedCurrentHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::EnhancedCurrentHue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeEnhancedColorMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::EnhancedColorMode::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeColorLoopActive(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ColorLoopActive::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeColorLoopDirection(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ColorLoopDirection::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeColorLoopTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ColorLoopTime::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeColorLoopStartEnhancedHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ColorLoopStartEnhancedHue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeColorLoopStoredEnhancedHue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeColorCapabilities(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ColorCapabilities::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeColorTempPhysicalMin(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ColorTempPhysicalMin::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeColorTempPhysicalMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ColorTempPhysicalMax::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeCoupleColorTempToLevelMinMireds(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ColorControlClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ColorControl::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ContentLauncherClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ContentLauncher::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR DescriptorClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Descriptor::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR DoorLockClusterTest::WriteAttributeLockState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, DoorLock::Attributes::LockState::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR DoorLockClusterTest::WriteAttributeLockType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, DoorLock::Attributes::LockType::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR DoorLockClusterTest::WriteAttributeActuatorEnabled(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, bool value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, DoorLock::Attributes::ActuatorEnabled::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR DoorLockClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, DoorLock::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeMeasurementType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::MeasurementType::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeTotalActivePower(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::TotalActivePower::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsVoltage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::RmsVoltage::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsVoltageMin(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::RmsVoltageMin::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsVoltageMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::RmsVoltageMax::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsCurrent(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::RmsCurrent::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsCurrentMin(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::RmsCurrentMin::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeRmsCurrentMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::RmsCurrentMax::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeActivePower(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::ActivePower::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeActivePowerMin(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::ActivePowerMin::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeActivePowerMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::ActivePowerMax::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ElectricalMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ElectricalMeasurement::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributePHYRate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::PHYRate::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeFullDuplex(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, bool value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::FullDuplex::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributePacketRxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::PacketRxCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributePacketTxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::PacketTxCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeTxErrCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::TxErrCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeCollisionCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::CollisionCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::OverrunCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeCarrierDetect(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, bool value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::CarrierDetect::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeTimeSinceReset(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::TimeSinceReset::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR EthernetNetworkDiagnosticsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, EthernetNetworkDiagnostics::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR FixedLabelClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, FixedLabel::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, FlowMeasurement::Attributes::MeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, FlowMeasurement::Attributes::MinMeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, FlowMeasurement::Attributes::MaxMeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, FlowMeasurement::Attributes::Tolerance::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, FlowMeasurement::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR GeneralCommissioningClusterTest::WriteAttributeRegulatoryConfig(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, GeneralCommissioning::Attributes::RegulatoryConfig::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR GeneralCommissioningClusterTest::WriteAttributeLocationCapability(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, GeneralCommissioning::Attributes::LocationCapability::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR GeneralCommissioningClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, GeneralCommissioning::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR GeneralDiagnosticsClusterTest::WriteAttributeRebootCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, GeneralDiagnostics::Attributes::RebootCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR GeneralDiagnosticsClusterTest::WriteAttributeUpTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, GeneralDiagnostics::Attributes::UpTime::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR GeneralDiagnosticsClusterTest::WriteAttributeTotalOperationalHours(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, GeneralDiagnostics::Attributes::TotalOperationalHours::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR GeneralDiagnosticsClusterTest::WriteAttributeBootReasons(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, GeneralDiagnostics::Attributes::BootReasons::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR GeneralDiagnosticsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, GeneralDiagnostics::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR GroupKeyManagementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, GroupKeyManagement::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR GroupsClusterTest::WriteAttributeNameSupport(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Groups::Attributes::NameSupport::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR GroupsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Groups::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IdentifyClusterTest::WriteAttributeIdentifyType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Identify::Attributes::IdentifyType::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR IdentifyClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Identify::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::MeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::MinMeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::Tolerance::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeLightSensorType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::LightSensorType::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR IlluminanceMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, IlluminanceMeasurement::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR KeypadInputClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, KeypadInput::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlClusterTest::WriteAttributeCurrentLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, LevelControl::Attributes::CurrentLevel::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR LevelControlClusterTest::WriteAttributeRemainingTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, LevelControl::Attributes::RemainingTime::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR LevelControlClusterTest::WriteAttributeMinLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, LevelControl::Attributes::MinLevel::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR LevelControlClusterTest::WriteAttributeMaxLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, LevelControl::Attributes::MaxLevel::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR LevelControlClusterTest::WriteAttributeCurrentFrequency(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, LevelControl::Attributes::CurrentFrequency::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR LevelControlClusterTest::WriteAttributeMinFrequency(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, LevelControl::Attributes::MinFrequency::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR LevelControlClusterTest::WriteAttributeMaxFrequency(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, LevelControl::Attributes::MaxFrequency::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR LevelControlClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, LevelControl::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LowPowerClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, LowPower::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR MediaInputClusterTest::WriteAttributeCurrentMediaInput(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, MediaInput::Attributes::CurrentMediaInput::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR MediaInputClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, MediaInput::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR MediaPlaybackClusterTest::WriteAttributePlaybackState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, MediaPlayback::Attributes::PlaybackState::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR MediaPlaybackClusterTest::WriteAttributeStartTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, MediaPlayback::Attributes::StartTime::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR MediaPlaybackClusterTest::WriteAttributeDuration(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, MediaPlayback::Attributes::Duration::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR MediaPlaybackClusterTest::WriteAttributePlaybackSpeed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, float value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, MediaPlayback::Attributes::PlaybackSpeed::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR MediaPlaybackClusterTest::WriteAttributeSeekRangeEnd(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, MediaPlayback::Attributes::SeekRangeEnd::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR MediaPlaybackClusterTest::WriteAttributeSeekRangeStart(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, MediaPlayback::Attributes::SeekRangeStart::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR MediaPlaybackClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, MediaPlayback::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ModeSelectClusterTest::WriteAttributeCurrentMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ModeSelect::Attributes::CurrentMode::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ModeSelectClusterTest::WriteAttributeStartUpMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ModeSelect::Attributes::StartUpMode::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ModeSelectClusterTest::WriteAttributeDescription(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ModeSelect::Attributes::Description::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ModeSelectClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ModeSelect::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR NetworkCommissioningClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, NetworkCommissioning::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR NetworkCommissioningClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, NetworkCommissioning::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OtaSoftwareUpdateProviderClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OtaSoftwareUpdateProvider::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OtaSoftwareUpdateRequestorClusterTest::WriteAttributeUpdatePossible(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, bool value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OtaSoftwareUpdateRequestorClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OccupancySensingClusterTest::WriteAttributeOccupancy(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OccupancySensing::Attributes::Occupancy::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OccupancySensingClusterTest::WriteAttributeOccupancySensorType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OccupancySensing::Attributes::OccupancySensorType::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OccupancySensingClusterTest::WriteAttributeOccupancySensorTypeBitmap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OccupancySensing::Attributes::OccupancySensorTypeBitmap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OccupancySensingClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OccupancySensing::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffClusterTest::WriteAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - bool value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OnOff::Attributes::OnOff::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OnOffClusterTest::WriteAttributeGlobalSceneControl(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, bool value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OnOff::Attributes::GlobalSceneControl::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OnOffClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OnOff::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OnOffClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OnOff::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffSwitchConfigurationClusterTest::WriteAttributeSwitchType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OnOffSwitchConfiguration::Attributes::SwitchType::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OnOffSwitchConfigurationClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OnOffSwitchConfiguration::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OperationalCredentialsClusterTest::WriteAttributeSupportedFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OperationalCredentials::Attributes::SupportedFabrics::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OperationalCredentialsClusterTest::WriteAttributeCommissionedFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OperationalCredentials::Attributes::CommissionedFabrics::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OperationalCredentialsClusterTest::WriteAttributeCurrentFabricIndex(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::FabricIndex value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OperationalCredentials::Attributes::CurrentFabricIndex::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR OperationalCredentialsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, OperationalCredentials::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PowerSourceClusterTest::WriteAttributeStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSource::Attributes::Status::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PowerSourceClusterTest::WriteAttributeOrder(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSource::Attributes::Order::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PowerSourceClusterTest::WriteAttributeDescription(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSource::Attributes::Description::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PowerSourceClusterTest::WriteAttributeBatteryVoltage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSource::Attributes::BatteryVoltage::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PowerSourceClusterTest::WriteAttributeBatteryPercentRemaining(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSource::Attributes::BatteryPercentRemaining::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PowerSourceClusterTest::WriteAttributeBatteryTimeRemaining(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSource::Attributes::BatteryTimeRemaining::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PowerSourceClusterTest::WriteAttributeBatteryChargeLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSource::Attributes::BatteryChargeLevel::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PowerSourceClusterTest::WriteAttributeBatteryChargeState(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSource::Attributes::BatteryChargeState::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PowerSourceClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSource::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PowerSourceClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSource::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PowerSourceConfigurationClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PowerSourceConfiguration::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PressureMeasurement::Attributes::MeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PressureMeasurementClusterTest::WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PressureMeasurement::Attributes::MinMeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PressureMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PressureMeasurement::Attributes::MaxMeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PressureMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PressureMeasurement::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MaxPressure::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxSpeed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MaxSpeed::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxFlow(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MaxFlow::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMinConstPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MinConstPressure::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxConstPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MaxConstPressure::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMinCompPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MinCompPressure::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxCompPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MaxCompPressure::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMinConstSpeed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MinConstSpeed::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxConstSpeed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MaxConstSpeed::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMinConstFlow(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MinConstFlow::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxConstFlow(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MaxConstFlow::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMinConstTemp(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MinConstTemp::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeMaxConstTemp(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::MaxConstTemp::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributePumpStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::PumpStatus::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeEffectiveOperationMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeEffectiveControlMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeCapacity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::Capacity::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeSpeed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::Speed::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributePower(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::Power::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeAlarmMask(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::AlarmMask::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR PumpConfigurationAndControlClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, PumpConfigurationAndControl::Attributes::ClusterRevision::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, RelativeHumidityMeasurement::Attributes::MeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, RelativeHumidityMeasurement::Attributes::Tolerance::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, RelativeHumidityMeasurement::Attributes::ClusterRevision::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ScenesClusterTest::WriteAttributeSceneCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Scenes::Attributes::SceneCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ScenesClusterTest::WriteAttributeCurrentScene(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Scenes::Attributes::CurrentScene::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ScenesClusterTest::WriteAttributeCurrentGroup(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Scenes::Attributes::CurrentGroup::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ScenesClusterTest::WriteAttributeSceneValid(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, bool value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Scenes::Attributes::SceneValid::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ScenesClusterTest::WriteAttributeNameSupport(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Scenes::Attributes::NameSupport::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ScenesClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Scenes::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SoftwareDiagnosticsClusterTest::WriteAttributeCurrentHeapFree(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, SoftwareDiagnostics::Attributes::CurrentHeapFree::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR SoftwareDiagnosticsClusterTest::WriteAttributeCurrentHeapUsed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, SoftwareDiagnostics::Attributes::CurrentHeapUsed::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR SoftwareDiagnosticsClusterTest::WriteAttributeCurrentHeapHighWatermark(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR SoftwareDiagnosticsClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, SoftwareDiagnostics::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR SoftwareDiagnosticsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, SoftwareDiagnostics::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR SwitchClusterTest::WriteAttributeNumberOfPositions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Switch::Attributes::NumberOfPositions::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR SwitchClusterTest::WriteAttributeCurrentPosition(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Switch::Attributes::CurrentPosition::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR SwitchClusterTest::WriteAttributeMultiPressMax(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Switch::Attributes::MultiPressMax::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR SwitchClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Switch::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR SwitchClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Switch::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TvChannelClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, TvChannel::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TargetNavigatorClusterTest::WriteAttributeCurrentNavigatorTarget(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, TargetNavigator::Attributes::CurrentNavigatorTarget::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR TargetNavigatorClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, TargetNavigator::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, TemperatureMeasurement::Attributes::MeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, TemperatureMeasurement::Attributes::MinMeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, TemperatureMeasurement::Attributes::MaxMeasuredValue::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, TemperatureMeasurement::Attributes::Tolerance::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, TemperatureMeasurement::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TestClusterClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, TestCluster::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatClusterTest::WriteAttributeLocalTemperature(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::LocalTemperature::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThermostatClusterTest::WriteAttributeAbsMinHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::AbsMinHeatSetpointLimit::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThermostatClusterTest::WriteAttributeAbsMaxHeatSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThermostatClusterTest::WriteAttributeAbsMinCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::AbsMinCoolSetpointLimit::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThermostatClusterTest::WriteAttributeAbsMaxCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThermostatClusterTest::WriteAttributeStartOfWeek(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::StartOfWeek::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThermostatClusterTest::WriteAttributeNumberOfWeeklyTransitions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::NumberOfWeeklyTransitions::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThermostatClusterTest::WriteAttributeNumberOfDailyTransitions(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::NumberOfDailyTransitions::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThermostatClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThermostatClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThermostatUserInterfaceConfigurationClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, - ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeChannel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::Channel::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRoutingRole(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RoutingRole::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeNetworkName(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::NetworkName::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributePanId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::PanId::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeExtendedPanId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::ExtendedPanId::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeMeshLocalPrefix(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::OverrunCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributePartitionId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::PartitionId::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeWeighting(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::Weighting::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeDataVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::DataVersion::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeStableDataVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::StableDataVersion::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeLeaderRouterId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::LeaderRouterId::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeDetachedRoleCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeChildRoleCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::ChildRoleCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRouterRoleCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RouterRoleCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeLeaderRoleCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeAttachAttemptCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributePartitionIdChangeCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeBetterPartitionAttachAttemptCount( - Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, - ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeParentChangeCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::ParentChangeCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxTotalCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxTotalCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxUnicastCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxUnicastCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxBroadcastCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxAckRequestedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxAckedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxAckedCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxNoAckRequestedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxDataCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxDataCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxDataPollCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxDataPollCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxBeaconCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxBeaconCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxBeaconRequestCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxOtherCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxOtherCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxRetryCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxRetryCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxDirectMaxRetryExpiryCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, - ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxIndirectMaxRetryExpiryCount( - Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, - ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxErrCcaCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxErrAbortCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeTxErrBusyChannelCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxTotalCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxTotalCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxUnicastCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxUnicastCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxBroadcastCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxDataCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxDataCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxDataPollCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxDataPollCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxBeaconCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxBeaconCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxBeaconRequestCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxOtherCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxOtherCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxAddressFilteredCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxDestAddrFilteredCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxDuplicatedCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrNoFrameCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrUnknownNeighborCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrInvalidSrcAddrCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrSecCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxErrSecCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrFcsCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeRxErrOtherCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeActiveTimestamp(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributePendingTimestamp(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::PendingTimestamp::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeDelay(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::Delay::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeChannelMask(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - chip::ByteSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::ChannelMask::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR ThreadNetworkDiagnosticsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, ThreadNetworkDiagnostics::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WakeOnLanClusterTest::WriteAttributeWakeOnLanMacAddress(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::CharSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WakeOnLan::Attributes::WakeOnLanMacAddress::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WakeOnLanClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WakeOnLan::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeBssid(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::ByteSpan value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::Bssid::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeSecurityType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::SecurityType::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeWiFiVersion(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::WiFiVersion::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeChannelNumber(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::ChannelNumber::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeRssi(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, int8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::Rssi::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeBeaconLostCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::BeaconLostCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeBeaconRxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::BeaconRxCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributePacketMulticastRxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributePacketMulticastTxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributePacketUnicastRxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributePacketUnicastTxCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeCurrentMaxRate(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeOverrunCount(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint64_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::OverrunCount::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WiFiNetworkDiagnosticsClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WiFiNetworkDiagnostics::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::Type::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionLift(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::CurrentPositionLift::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionTilt(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::CurrentPositionTilt::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeConfigStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::ConfigStatus::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionLiftPercentage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::CurrentPositionLiftPercentage::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionTiltPercentage(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::CurrentPositionTiltPercentage::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeOperationalStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::OperationalStatus::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeTargetPositionLiftPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeTargetPositionTiltPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeEndProductType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint8_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::EndProductType::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionLiftPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeCurrentPositionTiltPercent100ths(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id), - value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeInstalledOpenLimitLift(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::InstalledOpenLimitLift::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeInstalledClosedLimitLift(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::InstalledClosedLimitLift::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeInstalledOpenLimitTilt(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::InstalledOpenLimitTilt::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeInstalledClosedLimitTilt(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::InstalledClosedLimitTilt::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeSafetyStatus(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::SafetyStatus::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint32_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::FeatureMap::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} -CHIP_ERROR WindowCoveringClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t value) -{ - app::WriteClientHandle handle; - ReturnErrorOnFailure( - app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); - ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( - chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::ClusterRevision::Id), value)); - return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); -} - -} // namespace Controller -} // namespace chip diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h index 7ef1a5c5c1e4c7..8733079a01b4f4 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h @@ -115,6 +115,13 @@ class DLL_EXPORT BridgedDeviceBasicClusterTest : public BridgedDeviceBasicCluste ~BridgedDeviceBasicClusterTest() {} }; +class DLL_EXPORT ChannelClusterTest : public ChannelCluster +{ +public: + ChannelClusterTest() : ChannelCluster() {} + ~ChannelClusterTest() {} +}; + class DLL_EXPORT ColorControlClusterTest : public ColorControlCluster { public: @@ -367,13 +374,6 @@ class DLL_EXPORT SwitchClusterTest : public SwitchCluster ~SwitchClusterTest() {} }; -class DLL_EXPORT TvChannelClusterTest : public TvChannelCluster -{ -public: - TvChannelClusterTest() : TvChannelCluster() {} - ~TvChannelClusterTest() {} -}; - class DLL_EXPORT TargetNavigatorClusterTest : public TargetNavigatorCluster { public: diff --git a/zzz_generated/lighting-app/zap-generated/CHIPClusters.cpp b/zzz_generated/lighting-app/zap-generated/CHIPClusters.cpp index ba1cdf93cacdfe..e4f1af2542fbd8 100644 --- a/zzz_generated/lighting-app/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/lighting-app/zap-generated/CHIPClusters.cpp @@ -184,127 +184,7 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage(Callback::Cancelable * o return err; } -// OtaSoftwareUpdateProvider Cluster Attributes - // OnOff Cluster Commands -// OnOff Cluster Attributes -CHIP_ERROR OnOffCluster::SubscribeAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::OnOff::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeOnOff(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::OnOff::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OnOffCluster::SubscribeAttributeGlobalSceneControl(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::GlobalSceneControl::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeGlobalSceneControl(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::GlobalSceneControl::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OnOffCluster::SubscribeAttributeOnTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::OnTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeOnTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::OnTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OnOffCluster::SubscribeAttributeOffWaitTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::OffWaitTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeOffWaitTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::OffWaitTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OnOffCluster::SubscribeAttributeStartUpOnOff(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::StartUpOnOff::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeStartUpOnOff(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::StartUpOnOff::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OnOffCluster::SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::FeatureMap::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::FeatureMap::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OnOffCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} } // namespace Controller } // namespace chip diff --git a/zzz_generated/lighting-app/zap-generated/CHIPClusters.h b/zzz_generated/lighting-app/zap-generated/CHIPClusters.h index 08c9d3509a9f43..b676e14c0d9747 100644 --- a/zzz_generated/lighting-app/zap-generated/CHIPClusters.h +++ b/zzz_generated/lighting-app/zap-generated/CHIPClusters.h @@ -45,10 +45,6 @@ class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase chip::VendorId vendorId, uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, chip::ByteSpan metadataForProvider); - - // Cluster Attributes - -private: }; class DLL_EXPORT OnOffCluster : public ClusterBase @@ -56,30 +52,6 @@ class DLL_EXPORT OnOffCluster : public ClusterBase public: OnOffCluster() : ClusterBase(app::Clusters::OnOff::Id) {} ~OnOffCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOnOff(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeGlobalSceneControl(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeGlobalSceneControl(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOnTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOnTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOffWaitTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOffWaitTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeStartUpOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeStartUpOnOff(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeFeatureMap(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; } // namespace Controller diff --git a/zzz_generated/lighting-app/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/lighting-app/zap-generated/PluginApplicationCallbacks.h index 7a742884d6430e..ac93a15a8550c2 100644 --- a/zzz_generated/lighting-app/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/lighting-app/zap-generated/PluginApplicationCallbacks.h @@ -41,6 +41,7 @@ MatterOnOffSwitchConfigurationPluginServerInitCallback(); \ MatterOperationalCredentialsPluginServerInitCallback(); \ MatterSoftwareDiagnosticsPluginServerInitCallback(); \ + MatterSwitchPluginServerInitCallback(); \ MatterThreadNetworkDiagnosticsPluginServerInitCallback(); \ MatterUserLabelPluginServerInitCallback(); \ MatterWiFiNetworkDiagnosticsPluginServerInitCallback(); diff --git a/zzz_generated/lighting-app/zap-generated/callback-stub.cpp b/zzz_generated/lighting-app/zap-generated/callback-stub.cpp index 68b30d16f6b810..ff219206cbe828 100644 --- a/zzz_generated/lighting-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/lighting-app/zap-generated/callback-stub.cpp @@ -83,6 +83,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: emberAfSoftwareDiagnosticsClusterInitCallback(endpoint); break; + case ZCL_SWITCH_CLUSTER_ID: + emberAfSwitchClusterInitCallback(endpoint); + break; case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID: emberAfThreadNetworkDiagnosticsClusterInitCallback(endpoint); break; @@ -188,6 +191,11 @@ void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(Endpoin // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfSwitchClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfThreadNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/lighting-app/zap-generated/endpoint_config.h b/zzz_generated/lighting-app/zap-generated/endpoint_config.h index d908e4422a0922..5707fd2edb4e5d 100644 --- a/zzz_generated/lighting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lighting-app/zap-generated/endpoint_config.h @@ -773,8 +773,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -888,7 +889,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 23 +#define GENERATED_CLUSTER_COUNT 24 #define GENERATED_CLUSTERS \ { \ { 0x001D, ZAP_ATTRIBUTE_INDEX(0), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ @@ -925,6 +926,9 @@ { \ 0x0037, ZAP_ATTRIBUTE_INDEX(136), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ + { \ + 0x003B, ZAP_ATTRIBUTE_INDEX(147), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 0, Cluster: Switch (server) */ \ { \ 0x003C, ZAP_ATTRIBUTE_INDEX(147), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -983,7 +987,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 15, 1436 }, { ZAP_CLUSTER_INDEX(15), 6, 82 }, { ZAP_CLUSTER_INDEX(21), 2, 6 }, \ + { ZAP_CLUSTER_INDEX(0), 16, 1436 }, { ZAP_CLUSTER_INDEX(16), 6, 82 }, { ZAP_CLUSTER_INDEX(22), 2, 6 }, \ } // Largest attribute size is needed for various buffers diff --git a/zzz_generated/lighting-app/zap-generated/gen_config.h b/zzz_generated/lighting-app/zap-generated/gen_config.h index 1b3c5edabc2bc0..1ce9f36f46e1aa 100644 --- a/zzz_generated/lighting-app/zap-generated/gen_config.h +++ b/zzz_generated/lighting-app/zap-generated/gen_config.h @@ -48,6 +48,7 @@ #define EMBER_AF_ON_OFF_SWITCH_CONFIG_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_SWITCH_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_USER_LABEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -155,6 +156,11 @@ #define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER #define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS +// Use this macro to check if the server side of the Switch cluster is included +#define ZCL_USING_SWITCH_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_SWITCH_SERVER +#define EMBER_AF_PLUGIN_SWITCH + // Use this macro to check if the server side of the Thread Network Diagnostics cluster is included #define ZCL_USING_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_THREAD_NETWORK_DIAGNOSTICS_SERVER diff --git a/zzz_generated/lock-app/zap-generated/endpoint_config.h b/zzz_generated/lock-app/zap-generated/endpoint_config.h index e0338277c6249b..4f7b1ce0159ba9 100644 --- a/zzz_generated/lock-app/zap-generated/endpoint_config.h +++ b/zzz_generated/lock-app/zap-generated/endpoint_config.h @@ -800,8 +800,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \ diff --git a/zzz_generated/log-source-app/zap-generated/CHIPClusters.cpp b/zzz_generated/log-source-app/zap-generated/CHIPClusters.cpp index 3175e85910ea91..a230c51a3c6f07 100644 --- a/zzz_generated/log-source-app/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/log-source-app/zap-generated/CHIPClusters.cpp @@ -35,7 +35,6 @@ namespace Controller { // TODO(#4503): Commands should take group id as an argument. // DiagnosticLogs Cluster Commands -// DiagnosticLogs Cluster Attributes } // namespace Controller } // namespace chip diff --git a/zzz_generated/log-source-app/zap-generated/CHIPClusters.h b/zzz_generated/log-source-app/zap-generated/CHIPClusters.h index 7b704c88b2dc36..e7e8d21f076fa6 100644 --- a/zzz_generated/log-source-app/zap-generated/CHIPClusters.h +++ b/zzz_generated/log-source-app/zap-generated/CHIPClusters.h @@ -35,8 +35,6 @@ class DLL_EXPORT DiagnosticLogsCluster : public ClusterBase public: DiagnosticLogsCluster() : ClusterBase(app::Clusters::DiagnosticLogs::Id) {} ~DiagnosticLogsCluster() {} - - // Cluster Attributes }; } // namespace Controller diff --git a/zzz_generated/log-source-app/zap-generated/attribute-size.cpp b/zzz_generated/log-source-app/zap-generated/attribute-size.cpp deleted file mode 100644 index 11bb303cbdd145..00000000000000 --- a/zzz_generated/log-source-app/zap-generated/attribute-size.cpp +++ /dev/null @@ -1,232 +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. - */ - -// THIS FILE IS GENERATED BY ZAP - -#include -#include -#include -#include -#include -#include -#include - -using namespace chip; -using namespace chip::app::List; - -// The first 2 bytes specify the number of entries. A value of 0xFFFF means the list in invalid -// and data is undefined. -constexpr uint16_t kSizeLengthInBytes = 2u; - -void copyListMember(uint8_t * dest, uint8_t * src, bool write, uint16_t * offset, uint16_t length) -{ - if (write) - { - memmove(dest + *offset, src, length); - } - else - { - memmove(dest, src + *offset, length); - } - - *offset = static_cast(*offset + length); -} - -uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, bool write, uint8_t * dest, uint8_t * src, - int32_t index) -{ - if (index == -1) - { - memmove(dest, src, am->size); - return am->size; - } - - if (index == 0) - { - if (write) - { - // src is a pointer to native-endian uint16_t, dest is pointer to buffer that should hold little-endian value - emberAfCopyInt16u(dest, 0, *reinterpret_cast(src)); - } - else - { - // src is pointer to buffer holding little-endian value, dest is a pointer to native-endian uint16_t - *reinterpret_cast(dest) = emberAfGetInt16u(src, 0, kSizeLengthInBytes); - } - return kSizeLengthInBytes; - } - - if (!CanCastTo(index)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Should be between 1 and 65534", index); - return 0; - } - - uint16_t entryLength = 0; - switch (clusterId) - { - case 0x0030: // General Commissioning Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0001: // BasicCommissioningInfoList - { - entryLength = 4; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _BasicCommissioningInfoType - _BasicCommissioningInfoType * entry = reinterpret_cast<_BasicCommissioningInfoType *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->FailSafeExpiryLengthMs, - write ? (uint8_t *) &entry->FailSafeExpiryLengthMs : src, write, &entryOffset, - sizeof(entry->FailSafeExpiryLengthMs)); // INT32U - break; - } - } - break; - } - case 0x003E: // Operational Credentials Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0001: // fabrics list - { - entryLength = 120; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _FabricDescriptor - _FabricDescriptor * entry = reinterpret_cast<_FabricDescriptor *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->FabricIndex, write ? (uint8_t *) &entry->FabricIndex : src, write, - &entryOffset, sizeof(entry->FabricIndex)); // INT8U - ByteSpan * RootPublicKeySpan = &entry->RootPublicKey; // OCTET_STRING - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 67, RootPublicKeySpan) - : ReadByteSpan(src + entryOffset, 67, RootPublicKeySpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 67); - copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write, - &entryOffset, sizeof(entry->VendorId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, - &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID - copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING - ByteSpan * LabelSpan = &LabelSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - case 0x0004: // TrustedRootCertificates - { - entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast(index - 1)); - if (entryOffset == 0) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - - ByteSpan * trustedRootCertificatesSpan = reinterpret_cast(write ? src : dest); // OCTET_STRING - uint16_t trustedRootCertificatesRemainingSpace = static_cast(am->size - entryOffset); - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, trustedRootCertificatesRemainingSpace, trustedRootCertificatesSpan) - : ReadByteSpan(src + entryOffset, trustedRootCertificatesRemainingSpace, trustedRootCertificatesSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - - if (!CanCastTo(trustedRootCertificatesSpan->size())) - { - ChipLogError(Zcl, "Span size %zu is too large", trustedRootCertificatesSpan->size()); - return 0; - } - entryLength = static_cast(trustedRootCertificatesSpan->size()); - break; - } - } - break; - } - } - - return entryLength; -} - -// A list is a collection of entries of the same data type. The data type may be any defined data type. -uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attributeId, const uint8_t * buffer) -{ - // The first 2 bytes specify the number of entries. A value of 0xFFFF means the list in invalid - // and data is undefined. - uint16_t entryCount = emberAfGetInt16u(buffer, 0, kSizeLengthInBytes); - if (entryCount == 0xFFFF) - { - return 0; - } - - uint16_t entryLength = 0; - switch (clusterId) - { - case 0x0030: // General Commissioning Cluster - switch (attributeId) - { - case 0x0001: // BasicCommissioningInfoList - // Struct _BasicCommissioningInfoType - entryLength = 4; - break; - } - break; - case 0x003E: // Operational Credentials Cluster - switch (attributeId) - { - case 0x0001: // fabrics list - // Struct _FabricDescriptor - entryLength = 120; - break; - case 0x0004: // TrustedRootCertificates - // chip::ByteSpan - return GetByteSpanOffsetFromIndex(buffer, 402, entryCount); - break; - } - break; - } - - uint32_t totalSize = kSizeLengthInBytes + (entryCount * entryLength); - if (!CanCastTo(totalSize)) - { - ChipLogError(Zcl, "Cluster " ChipLogFormatMEI ": Size of attribute " ChipLogFormatMEI " is too large.", - ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId)); - return 0; - } - - return static_cast(totalSize); -} diff --git a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h index 7fd4bfc6f4baa8..9d1654a9823ee0 100644 --- a/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-provider-app/zap-generated/endpoint_config.h @@ -175,8 +175,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ } // This is an array of EmberAfCluster structures. diff --git a/zzz_generated/ota-requestor-app/zap-generated/CHIPClusters.cpp b/zzz_generated/ota-requestor-app/zap-generated/CHIPClusters.cpp index 9cc87d3624e9df..610435b71adc00 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/ota-requestor-app/zap-generated/CHIPClusters.cpp @@ -184,23 +184,5 @@ CHIP_ERROR OtaSoftwareUpdateProviderCluster::QueryImage(Callback::Cancelable * o return err; } -// OtaSoftwareUpdateProvider Cluster Attributes -CHIP_ERROR OtaSoftwareUpdateProviderCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OtaSoftwareUpdateProviderCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - } // namespace Controller } // namespace chip diff --git a/zzz_generated/ota-requestor-app/zap-generated/CHIPClusters.h b/zzz_generated/ota-requestor-app/zap-generated/CHIPClusters.h index 213ff93d0e6c54..908506defd13e0 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/CHIPClusters.h +++ b/zzz_generated/ota-requestor-app/zap-generated/CHIPClusters.h @@ -45,13 +45,6 @@ class DLL_EXPORT OtaSoftwareUpdateProviderCluster : public ClusterBase chip::VendorId vendorId, uint16_t productId, uint32_t softwareVersion, uint8_t protocolsSupported, uint16_t hardwareVersion, chip::CharSpan location, bool requestorCanConsent, chip::ByteSpan metadataForProvider); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; } // namespace Controller diff --git a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h index 7ad4ffc22348e3..deacb6930d7e7a 100644 --- a/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h +++ b/zzz_generated/ota-requestor-app/zap-generated/endpoint_config.h @@ -143,7 +143,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 42 +#define GENERATED_ATTRIBUTE_COUNT 44 #define GENERATED_ATTRIBUTES \ { \ \ @@ -167,9 +167,12 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ - { 0x0001, ZAP_TYPE(OCTET_STRING), 17, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* default ota provider */ \ - { 0x0002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* update possible */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_SIMPLE_DEFAULT(0) }, /* DefaultOtaProviders */ \ + { 0x0001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(1) }, /* UpdatePossible */ \ + { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* UpdateState */ \ + { 0x0003, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* UpdateStateProgress */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: General Commissioning (server) */ \ { 0x0000, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4) }, /* Breadcrumb */ \ @@ -206,8 +209,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ } // This is an array of EmberAfCluster structures. @@ -233,22 +237,22 @@ 0x0029, ZAP_ATTRIBUTE_INDEX(12), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 0, Cluster: OTA Software Update Provider (client) */ \ { \ - 0x002A, ZAP_ATTRIBUTE_INDEX(13), 3, 20, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002A, ZAP_ATTRIBUTE_INDEX(13), 5, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(16), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0030, ZAP_ATTRIBUTE_INDEX(18), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(22), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0031, ZAP_ATTRIBUTE_INDEX(24), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(32), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(34), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(38), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(40), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x0041, ZAP_ATTRIBUTE_INDEX(40), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0041, ZAP_ATTRIBUTE_INDEX(42), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ } @@ -257,7 +261,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 8, 606 }, \ + { ZAP_CLUSTER_INDEX(0), 8, 591 }, \ } // Largest attribute size is needed for various buffers @@ -267,7 +271,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (246) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (606) +#define ATTRIBUTE_MAX_SIZE (591) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (1) diff --git a/zzz_generated/pump-app/zap-generated/CHIPClusters.cpp b/zzz_generated/pump-app/zap-generated/CHIPClusters.cpp index a389adc1243490..d9be8496dcf259 100644 --- a/zzz_generated/pump-app/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/pump-app/zap-generated/CHIPClusters.cpp @@ -35,214 +35,10 @@ namespace Controller { // TODO(#4503): Commands should take group id as an argument. // FlowMeasurement Cluster Commands -// FlowMeasurement Cluster Attributes -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = FlowMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR FlowMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(FlowMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = FlowMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR FlowMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(FlowMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = FlowMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR FlowMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(FlowMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR FlowMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} // PressureMeasurement Cluster Commands -// PressureMeasurement Cluster Attributes -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PressureMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PressureMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PressureMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PressureMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PressureMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PressureMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} // TemperatureMeasurement Cluster Commands -// TemperatureMeasurement Cluster Attributes -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TemperatureMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TemperatureMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TemperatureMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TemperatureMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TemperatureMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TemperatureMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} } // namespace Controller } // namespace chip diff --git a/zzz_generated/pump-app/zap-generated/CHIPClusters.h b/zzz_generated/pump-app/zap-generated/CHIPClusters.h index 6cef2576cb11e0..2395f712efe45c 100644 --- a/zzz_generated/pump-app/zap-generated/CHIPClusters.h +++ b/zzz_generated/pump-app/zap-generated/CHIPClusters.h @@ -35,22 +35,6 @@ class DLL_EXPORT FlowMeasurementCluster : public ClusterBase public: FlowMeasurementCluster() : ClusterBase(app::Clusters::FlowMeasurement::Id) {} ~FlowMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT PressureMeasurementCluster : public ClusterBase @@ -58,22 +42,6 @@ class DLL_EXPORT PressureMeasurementCluster : public ClusterBase public: PressureMeasurementCluster() : ClusterBase(app::Clusters::PressureMeasurement::Id) {} ~PressureMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase @@ -81,22 +49,6 @@ class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase public: TemperatureMeasurementCluster() : ClusterBase(app::Clusters::TemperatureMeasurement::Id) {} ~TemperatureMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; } // namespace Controller diff --git a/zzz_generated/pump-app/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/pump-app/zap-generated/PluginApplicationCallbacks.h index 80bf851f3bef57..3de849fbc19dfb 100644 --- a/zzz_generated/pump-app/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/pump-app/zap-generated/PluginApplicationCallbacks.h @@ -26,7 +26,6 @@ MatterBasicPluginServerInitCallback(); \ MatterDescriptorPluginServerInitCallback(); \ MatterDiagnosticLogsPluginServerInitCallback(); \ - MatterEthernetNetworkDiagnosticsPluginServerInitCallback(); \ MatterFixedLabelPluginServerInitCallback(); \ MatterFlowMeasurementPluginClientInitCallback(); \ MatterFlowMeasurementPluginServerInitCallback(); \ @@ -43,5 +42,4 @@ MatterTemperatureMeasurementPluginClientInitCallback(); \ MatterTemperatureMeasurementPluginServerInitCallback(); \ MatterThreadNetworkDiagnosticsPluginServerInitCallback(); \ - MatterUserLabelPluginServerInitCallback(); \ - MatterWiFiNetworkDiagnosticsPluginServerInitCallback(); + MatterUserLabelPluginServerInitCallback(); diff --git a/zzz_generated/pump-app/zap-generated/callback-stub.cpp b/zzz_generated/pump-app/zap-generated/callback-stub.cpp index bf672f6f48cf56..c9eb42086f4c57 100644 --- a/zzz_generated/pump-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/pump-app/zap-generated/callback-stub.cpp @@ -41,9 +41,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_DIAGNOSTIC_LOGS_CLUSTER_ID: emberAfDiagnosticLogsClusterInitCallback(endpoint); break; - case ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID: - emberAfEthernetNetworkDiagnosticsClusterInitCallback(endpoint); - break; case ZCL_FIXED_LABEL_CLUSTER_ID: emberAfFixedLabelClusterInitCallback(endpoint); break; @@ -86,9 +83,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_USER_LABEL_CLUSTER_ID: emberAfUserLabelClusterInitCallback(endpoint); break; - case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID: - emberAfWiFiNetworkDiagnosticsClusterInitCallback(endpoint); - break; default: // Unrecognized cluster ID break; @@ -115,11 +109,6 @@ void __attribute__((weak)) emberAfDiagnosticLogsClusterInitCallback(EndpointId e // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfEthernetNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfFixedLabelClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -190,11 +179,6 @@ void __attribute__((weak)) emberAfUserLabelClusterInitCallback(EndpointId endpoi // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfWiFiNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} // // Non-Cluster Related Callbacks diff --git a/zzz_generated/pump-app/zap-generated/endpoint_config.h b/zzz_generated/pump-app/zap-generated/endpoint_config.h index ce516cc750f198..d05bde926d079c 100644 --- a/zzz_generated/pump-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-app/zap-generated/endpoint_config.h @@ -220,70 +220,18 @@ /* 515 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0F, \ \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), big-endian */ \ - \ - /* 519 - BeaconLostCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 523 - BeaconRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 527 - PacketMulticastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 531 - PacketMulticastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 535 - PacketUnicastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 539 - PacketUnicastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 543 - CurrentMaxRate, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 551 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 559 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x03, \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), big-endian */ \ - \ - /* 563 - PacketRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 571 - PacketTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 579 - TxErrCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 587 - CollisionCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 595 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 603 - TimeSinceReset, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 611 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x03, \ - \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 615 - LifetimeRunningHours, */ \ + /* 519 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 618 - Power, */ \ + /* 522 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 621 - LifetimeEnergyConsumed, */ \ + /* 525 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 625 - FeatureMap, */ \ + /* 529 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -484,76 +432,24 @@ /* 515 - FeatureMap, */ \ 0x0F, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server), little-endian */ \ - \ - /* 519 - BeaconLostCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 523 - BeaconRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 527 - PacketMulticastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 531 - PacketMulticastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 535 - PacketUnicastRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 539 - PacketUnicastTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* 543 - CurrentMaxRate, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 551 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 559 - FeatureMap, */ \ - 0x03, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server), little-endian */ \ - \ - /* 563 - PacketRxCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 571 - PacketTxCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 579 - TxErrCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 587 - CollisionCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 595 - OverrunCount, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 603 - TimeSinceReset, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 611 - FeatureMap, */ \ - 0x03, 0x00, 0x00, 0x00, \ - \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 615 - LifetimeRunningHours, */ \ + /* 519 - LifetimeRunningHours, */ \ 0x00, 0x00, 0x00, \ \ - /* 618 - Power, */ \ + /* 522 - Power, */ \ 0x00, 0x00, 0x00, \ \ - /* 621 - LifetimeEnergyConsumed, */ \ + /* 525 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 625 - FeatureMap, */ \ + /* 529 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (76) +#define GENERATED_DEFAULTS_COUNT (60) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -587,7 +483,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 203 +#define GENERATED_ATTRIBUTE_COUNT 177 #define GENERATED_ATTRIBUTES \ { \ \ @@ -720,36 +616,6 @@ { 0x003E, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_EMPTY_DEFAULT() }, /* ActiveNetworkFaultsList */ \ { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(515) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(OCTET_STRING), 7, 0, ZAP_EMPTY_DEFAULT() }, /* bssid */ \ - { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SecurityType */ \ - { 0x0002, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* WiFiVersion */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* ChannelNumber */ \ - { 0x0004, ZAP_TYPE(INT8S), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Rssi */ \ - { 0x0005, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(519) }, /* BeaconLostCount */ \ - { 0x0006, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(523) }, /* BeaconRxCount */ \ - { 0x0007, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(527) }, /* PacketMulticastRxCount */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(531) }, /* PacketMulticastTxCount */ \ - { 0x0009, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(535) }, /* PacketUnicastRxCount */ \ - { 0x000A, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(539) }, /* PacketUnicastTxCount */ \ - { 0x000B, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(543) }, /* CurrentMaxRate */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(551) }, /* OverrunCount */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(559) }, /* FeatureMap */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ - \ - /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* PHYRate */ \ - { 0x0001, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* FullDuplex */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(563) }, /* PacketRxCount */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(571) }, /* PacketTxCount */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(579) }, /* TxErrCount */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(587) }, /* CollisionCount */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(595) }, /* OverrunCount */ \ - { 0x0007, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* CarrierDetect */ \ - { 0x0008, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(603) }, /* TimeSinceReset */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(611) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ @@ -774,8 +640,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OnOff */ \ @@ -812,16 +679,16 @@ { 0x0013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ { 0x0015, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(615) }, /* LifetimeRunningHours */ \ - { 0x0016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(618) }, /* Power */ \ + ZAP_LONG_DEFAULTS_INDEX(519) }, /* LifetimeRunningHours */ \ + { 0x0016, ZAP_TYPE(INT24U), 3, 0, ZAP_LONG_DEFAULTS_INDEX(522) }, /* Power */ \ { 0x0017, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE), \ - ZAP_LONG_DEFAULTS_INDEX(621) }, /* LifetimeEnergyConsumed */ \ + ZAP_LONG_DEFAULTS_INDEX(525) }, /* LifetimeEnergyConsumed */ \ { 0x0020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(0) }, /* OperationMode */ \ { 0x0021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_MIN_MAX_DEFAULTS_INDEX(1) }, /* ControlMode */ \ { 0x0022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(625) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(529) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ @@ -872,7 +739,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 24 +#define GENERATED_CLUSTER_COUNT 22 #define GENERATED_CLUSTERS \ { \ { 0x001D, ZAP_ATTRIBUTE_INDEX(0), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ @@ -901,63 +768,57 @@ 0x0035, ZAP_ATTRIBUTE_INDEX(48), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(113), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(128), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ - { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(139), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(113), 4, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(143), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(117), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(149), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(123), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { \ - 0x0041, ZAP_ATTRIBUTE_INDEX(151), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0041, ZAP_ATTRIBUTE_INDEX(125), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: User Label (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(153), \ + ZAP_ATTRIBUTE_INDEX(127), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(155), \ + ZAP_ATTRIBUTE_INDEX(129), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(157), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(131), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ 0x0200, \ - ZAP_ATTRIBUTE_INDEX(162), \ + ZAP_ATTRIBUTE_INDEX(136), \ 26, \ 54, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(188), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(162), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(189), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(163), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(193), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(167), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(194), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(168), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(198), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(172), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(199), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(173), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ } @@ -966,7 +827,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 14, 995 }, { ZAP_CLUSTER_INDEX(14), 10, 90 }, \ + { ZAP_CLUSTER_INDEX(0), 12, 880 }, { ZAP_CLUSTER_INDEX(12), 10, 90 }, \ } // Largest attribute size is needed for various buffers @@ -976,7 +837,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (246) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1085) +#define ATTRIBUTE_MAX_SIZE (970) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/pump-app/zap-generated/gen_config.h b/zzz_generated/pump-app/zap-generated/gen_config.h index 8a9ff77ec94c90..e88eb960407f5d 100644 --- a/zzz_generated/pump-app/zap-generated/gen_config.h +++ b/zzz_generated/pump-app/zap-generated/gen_config.h @@ -33,7 +33,6 @@ #define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_DIAGNOSTIC_LOGS_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_FIXED_LABEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_FLOW_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_FLOW_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -51,7 +50,6 @@ #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_USER_LABEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) /**** Cluster Plugins ****/ @@ -75,11 +73,6 @@ #define EMBER_AF_PLUGIN_DIAGNOSTIC_LOGS_SERVER #define EMBER_AF_PLUGIN_DIAGNOSTIC_LOGS -// Use this macro to check if the server side of the Ethernet Network Diagnostics cluster is included -#define ZCL_USING_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_ETHERNET_NETWORK_DIAGNOSTICS_SERVER -#define EMBER_AF_PLUGIN_ETHERNET_NETWORK_DIAGNOSTICS - // Use this macro to check if the server side of the Fixed Label cluster is included #define ZCL_USING_FIXED_LABEL_CLUSTER_SERVER #define EMBER_AF_PLUGIN_FIXED_LABEL_SERVER @@ -165,8 +158,3 @@ #define ZCL_USING_USER_LABEL_CLUSTER_SERVER #define EMBER_AF_PLUGIN_USER_LABEL_SERVER #define EMBER_AF_PLUGIN_USER_LABEL - -// Use this macro to check if the server side of the WiFi Network Diagnostics cluster is included -#define ZCL_USING_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_WI_FI_NETWORK_DIAGNOSTICS_SERVER -#define EMBER_AF_PLUGIN_WI_FI_NETWORK_DIAGNOSTICS diff --git a/zzz_generated/pump-controller-app/zap-generated/CHIPClusters.cpp b/zzz_generated/pump-controller-app/zap-generated/CHIPClusters.cpp index 8d145aae4d82bf..5d5bc2ded1b7e5 100644 --- a/zzz_generated/pump-controller-app/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/pump-controller-app/zap-generated/CHIPClusters.cpp @@ -35,74 +35,6 @@ namespace Controller { // TODO(#4503): Commands should take group id as an argument. // FlowMeasurement Cluster Commands -// FlowMeasurement Cluster Attributes -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = FlowMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR FlowMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(FlowMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = FlowMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR FlowMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(FlowMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = FlowMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR FlowMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(FlowMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR FlowMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR FlowMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} // LevelControl Cluster Commands CHIP_ERROR LevelControlCluster::Move(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, @@ -462,41 +394,6 @@ CHIP_ERROR LevelControlCluster::StopWithOnOff(Callback::Cancelable * onSuccessCa return err; } -// LevelControl Cluster Attributes -CHIP_ERROR LevelControlCluster::SubscribeAttributeCurrentLevel(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = LevelControl::Attributes::CurrentLevel::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeCurrentLevel(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(LevelControl::Attributes::CurrentLevel::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR LevelControlCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR LevelControlCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - // OnOff Cluster Commands CHIP_ERROR OnOffCluster::Off(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -612,317 +509,11 @@ CHIP_ERROR OnOffCluster::Toggle(Callback::Cancelable * onSuccessCallback, Callba return err; } -// OnOff Cluster Attributes -CHIP_ERROR OnOffCluster::SubscribeAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OnOff::Attributes::OnOff::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeOnOff(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OnOff::Attributes::OnOff::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OnOffCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OnOffCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - // PressureMeasurement Cluster Commands -// PressureMeasurement Cluster Attributes -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PressureMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PressureMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PressureMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PressureMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PressureMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PressureMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PressureMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PressureMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} // PumpConfigurationAndControl Cluster Commands -// PumpConfigurationAndControl Cluster Attributes -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxPressure(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxPressure::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxPressure(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxPressure::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxSpeed(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxSpeed::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxSpeed(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxSpeed::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeMaxFlow(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::MaxFlow::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeMaxFlow(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::MaxFlow::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeEffectiveOperationMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeEffectiveOperationMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeEffectiveControlMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeEffectiveControlMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeCapacity(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::Capacity::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeCapacity(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::Capacity::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeOperationMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = PumpConfigurationAndControl::Attributes::OperationMode::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeOperationMode(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(PumpConfigurationAndControl::Attributes::OperationMode::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR PumpConfigurationAndControlCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} // TemperatureMeasurement Cluster Commands -// TemperatureMeasurement Cluster Attributes -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TemperatureMeasurement::Attributes::MeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TemperatureMeasurement::Attributes::MeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TemperatureMeasurement::Attributes::MinMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TemperatureMeasurement::Attributes::MinMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = TemperatureMeasurement::Attributes::MaxMeasuredValue::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(TemperatureMeasurement::Attributes::MaxMeasuredValue::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} } // namespace Controller } // namespace chip diff --git a/zzz_generated/pump-controller-app/zap-generated/CHIPClusters.h b/zzz_generated/pump-controller-app/zap-generated/CHIPClusters.h index 1cc5a7e2028c2f..61aace6b8b9f3f 100644 --- a/zzz_generated/pump-controller-app/zap-generated/CHIPClusters.h +++ b/zzz_generated/pump-controller-app/zap-generated/CHIPClusters.h @@ -35,22 +35,6 @@ class DLL_EXPORT FlowMeasurementCluster : public ClusterBase public: FlowMeasurementCluster() : ClusterBase(app::Clusters::FlowMeasurement::Id) {} ~FlowMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT LevelControlCluster : public ClusterBase @@ -75,16 +59,6 @@ class DLL_EXPORT LevelControlCluster : public ClusterBase CHIP_ERROR Stop(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t optionMask, uint8_t optionOverride); CHIP_ERROR StopWithOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeCurrentLevel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentLevel(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT OnOffCluster : public ClusterBase @@ -97,16 +71,6 @@ class DLL_EXPORT OnOffCluster : public ClusterBase CHIP_ERROR Off(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR On(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR Toggle(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeOnOff(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOnOff(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT PressureMeasurementCluster : public ClusterBase @@ -114,22 +78,6 @@ class DLL_EXPORT PressureMeasurementCluster : public ClusterBase public: PressureMeasurementCluster() : ClusterBase(app::Clusters::PressureMeasurement::Id) {} ~PressureMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT PumpConfigurationAndControlCluster : public ClusterBase @@ -137,34 +85,6 @@ class DLL_EXPORT PumpConfigurationAndControlCluster : public ClusterBase public: PumpConfigurationAndControlCluster() : ClusterBase(app::Clusters::PumpConfigurationAndControl::Id) {} ~PumpConfigurationAndControlCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMaxPressure(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxPressure(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxSpeed(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxSpeed(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxFlow(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxFlow(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEffectiveOperationMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeEffectiveOperationMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeEffectiveControlMode(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeEffectiveControlMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCapacity(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeCapacity(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeOperationMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeOperationMode(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase @@ -172,22 +92,6 @@ class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase public: TemperatureMeasurementCluster() : ClusterBase(app::Clusters::TemperatureMeasurement::Id) {} ~TemperatureMeasurementCluster() {} - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMinMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeMaxMeasuredValue(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); }; } // namespace Controller diff --git a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h index 825bde5e51efc5..eb8da2b45a1879 100644 --- a/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-controller-app/zap-generated/endpoint_config.h @@ -743,8 +743,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: On/Off (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ diff --git a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h index 1c080af22baf5e..45392c7e48f7be 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h +++ b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h @@ -394,8 +394,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ diff --git a/zzz_generated/thermostat/zap-generated/CHIPClusters.cpp b/zzz_generated/thermostat/zap-generated/CHIPClusters.cpp index a77c77a4105bff..3570368f8f26b7 100644 --- a/zzz_generated/thermostat/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/thermostat/zap-generated/CHIPClusters.cpp @@ -114,57 +114,5 @@ CHIP_ERROR IdentifyCluster::IdentifyQuery(Callback::Cancelable * onSuccessCallba return err; } -// Identify Cluster Attributes -CHIP_ERROR IdentifyCluster::SubscribeAttributeIdentifyTime(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Identify::Attributes::IdentifyTime::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IdentifyCluster::ReportAttributeIdentifyTime(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Identify::Attributes::IdentifyTime::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR IdentifyCluster::SubscribeAttributeIdentifyType(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Identify::Attributes::IdentifyType::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IdentifyCluster::ReportAttributeIdentifyType(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Identify::Attributes::IdentifyType::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR IdentifyCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR IdentifyCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - } // namespace Controller } // namespace chip diff --git a/zzz_generated/thermostat/zap-generated/CHIPClusters.h b/zzz_generated/thermostat/zap-generated/CHIPClusters.h index 0cb414ecfb0550..2e5cbd30f56076 100644 --- a/zzz_generated/thermostat/zap-generated/CHIPClusters.h +++ b/zzz_generated/thermostat/zap-generated/CHIPClusters.h @@ -39,19 +39,6 @@ class DLL_EXPORT IdentifyCluster : public ClusterBase // Cluster Commands CHIP_ERROR Identify(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t identifyTime); CHIP_ERROR IdentifyQuery(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeIdentifyTime(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeIdentifyTime(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeIdentifyType(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeIdentifyType(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; } // namespace Controller diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index 31e99d2499ab4a..d1719853c2409a 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -277,7 +277,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 632 - groups, */ \ + /* 632 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -293,7 +293,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 886 - group keys, */ \ + /* 886 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -574,7 +574,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 632 - groups, */ \ + /* 632 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -590,7 +590,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 886 - group keys, */ \ + /* 886 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -869,8 +869,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(886) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* groupKeyMap */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(886) }, /* groupTable */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ @@ -878,8 +878,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Identify (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ diff --git a/zzz_generated/tv-app/zap-generated/CHIPClusters.cpp b/zzz_generated/tv-app/zap-generated/CHIPClusters.cpp index fcdf6ed9063385..ae3e8dcaafcfec 100644 --- a/zzz_generated/tv-app/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/tv-app/zap-generated/CHIPClusters.cpp @@ -170,41 +170,6 @@ CHIP_ERROR GeneralCommissioningCluster::SetRegulatoryConfig(Callback::Cancelable return err; } -// GeneralCommissioning Cluster Attributes -CHIP_ERROR GeneralCommissioningCluster::SubscribeAttributeBreadcrumb(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = GeneralCommissioning::Attributes::Breadcrumb::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR GeneralCommissioningCluster::ReportAttributeBreadcrumb(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(GeneralCommissioning::Attributes::Breadcrumb::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR GeneralCommissioningCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR GeneralCommissioningCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - // NetworkCommissioning Cluster Commands CHIP_ERROR NetworkCommissioningCluster::AddOrUpdateThreadNetwork(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, @@ -478,24 +443,6 @@ CHIP_ERROR NetworkCommissioningCluster::ScanNetworks(Callback::Cancelable * onSu return err; } -// NetworkCommissioning Cluster Attributes -CHIP_ERROR NetworkCommissioningCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR NetworkCommissioningCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - // OperationalCredentials Cluster Commands CHIP_ERROR OperationalCredentialsCluster::AddNOC(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan NOCValue, chip::ByteSpan ICACValue, chip::ByteSpan IPKValue, @@ -801,74 +748,5 @@ CHIP_ERROR OperationalCredentialsCluster::UpdateFabricLabel(Callback::Cancelable return err; } -// OperationalCredentials Cluster Attributes -CHIP_ERROR OperationalCredentialsCluster::SubscribeAttributeSupportedFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OperationalCredentials::Attributes::SupportedFabrics::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OperationalCredentialsCluster::ReportAttributeSupportedFabrics(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OperationalCredentials::Attributes::SupportedFabrics::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OperationalCredentialsCluster::SubscribeAttributeCommissionedFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OperationalCredentials::Attributes::CommissionedFabrics::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OperationalCredentialsCluster::ReportAttributeCommissionedFabrics(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OperationalCredentials::Attributes::CommissionedFabrics::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OperationalCredentialsCluster::SubscribeAttributeCurrentFabricIndex(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = OperationalCredentials::Attributes::CurrentFabricIndex::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OperationalCredentialsCluster::ReportAttributeCurrentFabricIndex(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(OperationalCredentials::Attributes::CurrentFabricIndex::Id, onReportCallback, - BasicAttributeFilter); -} - -CHIP_ERROR OperationalCredentialsCluster::SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval) -{ - chip::app::AttributePathParams attributePath; - attributePath.mEndpointId = mEndpoint; - attributePath.mClusterId = mClusterId; - attributePath.mAttributeId = Globals::Attributes::ClusterRevision::Id; - return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); -} - -CHIP_ERROR OperationalCredentialsCluster::ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback) -{ - return RequestAttributeReporting(Globals::Attributes::ClusterRevision::Id, onReportCallback, - BasicAttributeFilter); -} - } // namespace Controller } // namespace chip diff --git a/zzz_generated/tv-app/zap-generated/CHIPClusters.h b/zzz_generated/tv-app/zap-generated/CHIPClusters.h index 8f2d0c2d2a5326..2b64cd00524e46 100644 --- a/zzz_generated/tv-app/zap-generated/CHIPClusters.h +++ b/zzz_generated/tv-app/zap-generated/CHIPClusters.h @@ -42,16 +42,6 @@ class DLL_EXPORT GeneralCommissioningCluster : public ClusterBase CHIP_ERROR CommissioningComplete(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR SetRegulatoryConfig(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t location, chip::CharSpan countryCode, uint64_t breadcrumb, uint32_t timeoutMs); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeBreadcrumb(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeBreadcrumb(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT NetworkCommissioningCluster : public ClusterBase @@ -73,13 +63,6 @@ class DLL_EXPORT NetworkCommissioningCluster : public ClusterBase chip::ByteSpan networkID, uint8_t networkIndex, uint64_t breadcrumb); CHIP_ERROR ScanNetworks(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan ssid, uint64_t breadcrumb); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase @@ -103,25 +86,6 @@ class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase uint8_t fabricIndex); CHIP_ERROR UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::CharSpan label); - - // Cluster Attributes - CHIP_ERROR SubscribeAttributeSupportedFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeSupportedFabrics(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCommissionedFabrics(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCommissionedFabrics(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeCurrentFabricIndex(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, uint16_t minInterval, - uint16_t maxInterval); - CHIP_ERROR ReportAttributeCurrentFabricIndex(Callback::Cancelable * onReportCallback); - CHIP_ERROR SubscribeAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, - uint16_t minInterval, uint16_t maxInterval); - CHIP_ERROR ReportAttributeClusterRevision(Callback::Cancelable * onReportCallback); - -private: }; } // namespace Controller diff --git a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp index 586b0a43914a6f..35ff681fbd77eb 100644 --- a/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/tv-app/zap-generated/IMClusterCommandHandler.cpp @@ -54,30 +54,40 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { switch (aCommandPath.mCommandId) { - case Commands::GetSetupPIN::Id: { - Commands::GetSetupPIN::DecodableType commandData; + case Commands::GetSetupPINRequest::Id: { + if (!apCommandObj->IsTimedInvoke()) + { + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::NeedsTimedInteraction); + return; + } + Commands::GetSetupPINRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfAccountLoginClusterGetSetupPINCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfAccountLoginClusterGetSetupPINRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::Login::Id: { - Commands::Login::DecodableType commandData; + case Commands::LoginRequest::Id: { + Commands::LoginRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfAccountLoginClusterLoginCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfAccountLoginClusterLoginRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::Logout::Id: { - Commands::Logout::DecodableType commandData; + case Commands::LogoutRequest::Id: { + if (!apCommandObj->IsTimedInvoke()) + { + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::NeedsTimedInteraction); + return; + } + Commands::LogoutRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfAccountLoginClusterLogoutCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfAccountLoginClusterLogoutRequestCallback(apCommandObj, aCommandPath, commandData); } break; } @@ -162,7 +172,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace AdministratorCommissioning -namespace ApplicationBasic { +namespace ApplicationLauncher { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { @@ -175,12 +185,30 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { switch (aCommandPath.mCommandId) { - case Commands::ChangeStatus::Id: { - Commands::ChangeStatus::DecodableType commandData; + case Commands::HideAppRequest::Id: { + Commands::HideAppRequest::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfApplicationLauncherClusterHideAppRequestCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::LaunchAppRequest::Id: { + Commands::LaunchAppRequest::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfApplicationLauncherClusterLaunchAppRequestCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::StopAppRequest::Id: { + Commands::StopAppRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfApplicationBasicClusterChangeStatusCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfApplicationLauncherClusterStopAppRequestCallback(apCommandObj, aCommandPath, commandData); } break; } @@ -201,9 +229,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } } -} // namespace ApplicationBasic +} // namespace ApplicationLauncher -namespace ApplicationLauncher { +namespace AudioOutput { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { @@ -216,30 +244,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { switch (aCommandPath.mCommandId) { - case Commands::HideApp::Id: { - Commands::HideApp::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfApplicationLauncherClusterHideAppCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::LaunchApp::Id: { - Commands::LaunchApp::DecodableType commandData; + case Commands::RenameOutputRequest::Id: { + Commands::RenameOutputRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfApplicationLauncherClusterLaunchAppCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfAudioOutputClusterRenameOutputRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::StopApp::Id: { - Commands::StopApp::DecodableType commandData; + case Commands::SelectOutputRequest::Id: { + Commands::SelectOutputRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfApplicationLauncherClusterStopAppCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfAudioOutputClusterSelectOutputRequestCallback(apCommandObj, aCommandPath, commandData); } break; } @@ -260,9 +279,20 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } } -} // namespace ApplicationLauncher +} // namespace AudioOutput -namespace AudioOutput { +namespace Basic { + +void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) +{ + apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); + ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, + ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); +} + +} // namespace Basic + +namespace Binding { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { @@ -275,21 +305,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { switch (aCommandPath.mCommandId) { - case Commands::RenameOutput::Id: { - Commands::RenameOutput::DecodableType commandData; + case Commands::Bind::Id: { + Commands::Bind::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfAudioOutputClusterRenameOutputCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::SelectOutput::Id: { - Commands::SelectOutput::DecodableType commandData; + case Commands::Unbind::Id: { + Commands::Unbind::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfAudioOutputClusterSelectOutputCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, commandData); } break; } @@ -310,20 +340,9 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } } -} // namespace AudioOutput - -namespace Basic { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); -} +} // namespace Binding -} // namespace Basic - -namespace Binding { +namespace Channel { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) { @@ -336,21 +355,30 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { switch (aCommandPath.mCommandId) { - case Commands::Bind::Id: { - Commands::Bind::DecodableType commandData; + case Commands::ChangeChannelByNumberRequest::Id: { + Commands::ChangeChannelByNumberRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfBindingClusterBindCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfChannelClusterChangeChannelByNumberRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::Unbind::Id: { - Commands::Unbind::DecodableType commandData; + case Commands::ChangeChannelRequest::Id: { + Commands::ChangeChannelRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfBindingClusterUnbindCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfChannelClusterChangeChannelRequestCallback(apCommandObj, aCommandPath, commandData); + } + break; + } + case Commands::SkipChannelRequest::Id: { + Commands::SkipChannelRequest::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfChannelClusterSkipChannelRequestCallback(apCommandObj, aCommandPath, commandData); } break; } @@ -371,7 +399,7 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } } -} // namespace Binding +} // namespace Channel namespace ContentLauncher { @@ -386,21 +414,21 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { switch (aCommandPath.mCommandId) { - case Commands::LaunchContent::Id: { - Commands::LaunchContent::DecodableType commandData; + case Commands::LaunchContentRequest::Id: { + Commands::LaunchContentRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfContentLauncherClusterLaunchContentCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfContentLauncherClusterLaunchContentRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::LaunchURL::Id: { - Commands::LaunchURL::DecodableType commandData; + case Commands::LaunchURLRequest::Id: { + Commands::LaunchURLRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfContentLauncherClusterLaunchURLCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfContentLauncherClusterLaunchURLRequestCallback(apCommandObj, aCommandPath, commandData); } break; } @@ -764,12 +792,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { switch (aCommandPath.mCommandId) { - case Commands::SendKey::Id: { - Commands::SendKey::DecodableType commandData; + case Commands::SendKeyRequest::Id: { + Commands::SendKeyRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfKeypadInputClusterSendKeyCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfKeypadInputClusterSendKeyRequestCallback(apCommandObj, aCommandPath, commandData); } break; } @@ -950,39 +978,39 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { switch (aCommandPath.mCommandId) { - case Commands::HideInputStatus::Id: { - Commands::HideInputStatus::DecodableType commandData; + case Commands::HideInputStatusRequest::Id: { + Commands::HideInputStatusRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaInputClusterHideInputStatusCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaInputClusterHideInputStatusRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::RenameInput::Id: { - Commands::RenameInput::DecodableType commandData; + case Commands::RenameInputRequest::Id: { + Commands::RenameInputRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaInputClusterRenameInputCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaInputClusterRenameInputRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::SelectInput::Id: { - Commands::SelectInput::DecodableType commandData; + case Commands::SelectInputRequest::Id: { + Commands::SelectInputRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaInputClusterSelectInputCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaInputClusterSelectInputRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::ShowInputStatus::Id: { - Commands::ShowInputStatus::DecodableType commandData; + case Commands::ShowInputStatusRequest::Id: { + Commands::ShowInputStatusRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaInputClusterShowInputStatusCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaInputClusterShowInputStatusRequestCallback(apCommandObj, aCommandPath, commandData); } break; } @@ -1018,102 +1046,102 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { switch (aCommandPath.mCommandId) { - case Commands::MediaFastForward::Id: { - Commands::MediaFastForward::DecodableType commandData; + case Commands::FastForwardRequest::Id: { + Commands::FastForwardRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaFastForwardCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterFastForwardRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::MediaNext::Id: { - Commands::MediaNext::DecodableType commandData; + case Commands::NextRequest::Id: { + Commands::NextRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaNextCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterNextRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::MediaPause::Id: { - Commands::MediaPause::DecodableType commandData; + case Commands::PauseRequest::Id: { + Commands::PauseRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaPauseCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterPauseRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::MediaPlay::Id: { - Commands::MediaPlay::DecodableType commandData; + case Commands::PlayRequest::Id: { + Commands::PlayRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaPlayCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterPlayRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::MediaPrevious::Id: { - Commands::MediaPrevious::DecodableType commandData; + case Commands::PreviousRequest::Id: { + Commands::PreviousRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaPreviousCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterPreviousRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::MediaRewind::Id: { - Commands::MediaRewind::DecodableType commandData; + case Commands::RewindRequest::Id: { + Commands::RewindRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaRewindCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterRewindRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::MediaSeek::Id: { - Commands::MediaSeek::DecodableType commandData; + case Commands::SeekRequest::Id: { + Commands::SeekRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaSeekCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterSeekRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::MediaSkipBackward::Id: { - Commands::MediaSkipBackward::DecodableType commandData; + case Commands::SkipBackwardRequest::Id: { + Commands::SkipBackwardRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaSkipBackwardCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterSkipBackwardRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::MediaSkipForward::Id: { - Commands::MediaSkipForward::DecodableType commandData; + case Commands::SkipForwardRequest::Id: { + Commands::SkipForwardRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaSkipForwardCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterSkipForwardRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::MediaStartOver::Id: { - Commands::MediaStartOver::DecodableType commandData; + case Commands::StartOverRequest::Id: { + Commands::StartOverRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaStartOverCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterStartOverRequestCallback(apCommandObj, aCommandPath, commandData); } break; } - case Commands::MediaStop::Id: { - Commands::MediaStop::DecodableType commandData; + case Commands::StopRequest::Id: { + Commands::StopRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfMediaPlaybackClusterMediaStopCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfMediaPlaybackClusterStopRequestCallback(apCommandObj, aCommandPath, commandData); } break; } @@ -1992,65 +2020,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace OperationalCredentials -namespace TvChannel { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - // The following variables are used for all commands to save code size. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::ChangeChannel::Id: { - Commands::ChangeChannel::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfTvChannelClusterChangeChannelCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::ChangeChannelByNumber::Id: { - Commands::ChangeChannelByNumber::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfTvChannelClusterChangeChannelByNumberCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::SkipChannel::Id: { - Commands::SkipChannel::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfTvChannelClusterSkipChannelCallback(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 TvChannel - namespace TargetNavigator { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -2064,12 +2033,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { switch (aCommandPath.mCommandId) { - case Commands::NavigateTarget::Id: { - Commands::NavigateTarget::DecodableType commandData; + case Commands::NavigateTargetRequest::Id: { + Commands::NavigateTargetRequest::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); if (TLVError == CHIP_NO_ERROR) { - wasHandled = emberAfTargetNavigatorClusterNavigateTargetCallback(apCommandObj, aCommandPath, commandData); + wasHandled = emberAfTargetNavigatorClusterNavigateTargetRequestCallback(apCommandObj, aCommandPath, commandData); } break; } @@ -2106,9 +2075,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::AdministratorCommissioning::Id: Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::ApplicationBasic::Id: - Clusters::ApplicationBasic::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::ApplicationLauncher::Id: Clusters::ApplicationLauncher::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; @@ -2121,6 +2087,9 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::Binding::Id: Clusters::Binding::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; + case Clusters::Channel::Id: + Clusters::Channel::DispatchServerCommand(apCommandObj, aCommandPath, aReader); + break; case Clusters::ContentLauncher::Id: Clusters::ContentLauncher::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; @@ -2157,9 +2126,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::OperationalCredentials::Id: Clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::TvChannel::Id: - Clusters::TvChannel::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::TargetNavigator::Id: Clusters::TargetNavigator::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/zzz_generated/tv-app/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/tv-app/zap-generated/PluginApplicationCallbacks.h index 3a08594996df75..dd0d51a216419f 100644 --- a/zzz_generated/tv-app/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/tv-app/zap-generated/PluginApplicationCallbacks.h @@ -29,6 +29,7 @@ MatterAudioOutputPluginServerInitCallback(); \ MatterBasicPluginServerInitCallback(); \ MatterBindingPluginServerInitCallback(); \ + MatterChannelPluginServerInitCallback(); \ MatterContentLauncherPluginServerInitCallback(); \ MatterDescriptorPluginServerInitCallback(); \ MatterDiagnosticLogsPluginServerInitCallback(); \ @@ -51,7 +52,6 @@ MatterOperationalCredentialsPluginServerInitCallback(); \ MatterRelativeHumidityMeasurementPluginServerInitCallback(); \ MatterSoftwareDiagnosticsPluginServerInitCallback(); \ - MatterTvChannelPluginServerInitCallback(); \ MatterTargetNavigatorPluginServerInitCallback(); \ MatterThreadNetworkDiagnosticsPluginServerInitCallback(); \ MatterUserLabelPluginServerInitCallback(); \ diff --git a/zzz_generated/tv-app/zap-generated/attribute-size.cpp b/zzz_generated/tv-app/zap-generated/attribute-size.cpp deleted file mode 100644 index 455380a3520a50..00000000000000 --- a/zzz_generated/tv-app/zap-generated/attribute-size.cpp +++ /dev/null @@ -1,1022 +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. - */ - -// THIS FILE IS GENERATED BY ZAP - -#include -#include -#include -#include -#include -#include -#include - -using namespace chip; -using namespace chip::app::List; - -// The first 2 bytes specify the number of entries. A value of 0xFFFF means the list in invalid -// and data is undefined. -constexpr uint16_t kSizeLengthInBytes = 2u; - -void copyListMember(uint8_t * dest, uint8_t * src, bool write, uint16_t * offset, uint16_t length) -{ - if (write) - { - memmove(dest + *offset, src, length); - } - else - { - memmove(dest, src + *offset, length); - } - - *offset = static_cast(*offset + length); -} - -uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, bool write, uint8_t * dest, uint8_t * src, - int32_t index) -{ - if (index == -1) - { - memmove(dest, src, am->size); - return am->size; - } - - if (index == 0) - { - if (write) - { - // src is a pointer to native-endian uint16_t, dest is pointer to buffer that should hold little-endian value - emberAfCopyInt16u(dest, 0, *reinterpret_cast(src)); - } - else - { - // src is pointer to buffer holding little-endian value, dest is a pointer to native-endian uint16_t - *reinterpret_cast(dest) = emberAfGetInt16u(src, 0, kSizeLengthInBytes); - } - return kSizeLengthInBytes; - } - - if (!CanCastTo(index)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Should be between 1 and 65534", index); - return 0; - } - - uint16_t entryLength = 0; - switch (clusterId) - { - case 0x050D: // Application Basic Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0007: // allowed vendor list - { - entryLength = 2; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // INT16U - break; - } - } - break; - } - case 0x050C: // Application Launcher Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // application launcher list - { - entryLength = 2; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // INT16U - break; - } - } - break; - } - case 0x050B: // Audio Output Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // audio output list - { - entryLength = 36; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _AudioOutputInfo - _AudioOutputInfo * entry = reinterpret_cast<_AudioOutputInfo *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, - sizeof(entry->index)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->outputType, write ? (uint8_t *) &entry->outputType : src, write, - &entryOffset, sizeof(entry->outputType)); // AudioOutputType - ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING - ByteSpan * nameSpan = &nameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - } - break; - } - case 0x050A: // Content Launcher Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // accepts header list - { - entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast(index - 1)); - if (entryOffset == 0) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - - ByteSpan * acceptsHeaderListSpan = reinterpret_cast(write ? src : dest); // OCTET_STRING - uint16_t acceptsHeaderListRemainingSpace = static_cast(am->size - entryOffset); - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, acceptsHeaderListRemainingSpace, acceptsHeaderListSpan) - : ReadByteSpan(src + entryOffset, acceptsHeaderListRemainingSpace, acceptsHeaderListSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - - if (!CanCastTo(acceptsHeaderListSpan->size())) - { - ChipLogError(Zcl, "Span size %zu is too large", acceptsHeaderListSpan->size()); - return 0; - } - entryLength = static_cast(acceptsHeaderListSpan->size()); - break; - } - } - break; - } - case 0x001D: // Descriptor Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // device list - { - entryLength = 6; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _DeviceType - _DeviceType * entry = reinterpret_cast<_DeviceType *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->type, write ? (uint8_t *) &entry->type : src, write, &entryOffset, - sizeof(entry->type)); // DEVTYPE_ID - copyListMember(write ? dest : (uint8_t *) &entry->revision, write ? (uint8_t *) &entry->revision : src, write, - &entryOffset, sizeof(entry->revision)); // INT16U - break; - } - case 0x0001: // server list - { - entryLength = 4; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID - break; - } - case 0x0002: // client list - { - entryLength = 4; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID - break; - } - case 0x0003: // parts list - { - entryLength = 2; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // ENDPOINT_NO - break; - } - } - break; - } - case 0x0030: // General Commissioning Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0001: // BasicCommissioningInfoList - { - entryLength = 4; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _BasicCommissioningInfoType - _BasicCommissioningInfoType * entry = reinterpret_cast<_BasicCommissioningInfoType *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->FailSafeExpiryLengthMs, - write ? (uint8_t *) &entry->FailSafeExpiryLengthMs : src, write, &entryOffset, - sizeof(entry->FailSafeExpiryLengthMs)); // INT32U - break; - } - } - break; - } - case 0x0033: // General Diagnostics Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // NetworkInterfaces - { - entryLength = 48; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _NetworkInterfaceType - _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING - ByteSpan * NameSpan = &NameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - copyListMember(write ? dest : (uint8_t *) &entry->FabricConnected, write ? (uint8_t *) &entry->FabricConnected : src, - write, &entryOffset, sizeof(entry->FabricConnected)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->OffPremiseServicesReachableIPv4, - write ? (uint8_t *) &entry->OffPremiseServicesReachableIPv4 : src, write, &entryOffset, - sizeof(entry->OffPremiseServicesReachableIPv4)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->OffPremiseServicesReachableIPv6, - write ? (uint8_t *) &entry->OffPremiseServicesReachableIPv6 : src, write, &entryOffset, - sizeof(entry->OffPremiseServicesReachableIPv6)); // BOOLEAN - ByteSpan * HardwareAddressSpan = &entry->HardwareAddress; // OCTET_STRING - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 10, HardwareAddressSpan) - : ReadByteSpan(src + entryOffset, 10, HardwareAddressSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 10); - copyListMember(write ? dest : (uint8_t *) &entry->Type, write ? (uint8_t *) &entry->Type : src, write, &entryOffset, - sizeof(entry->Type)); // InterfaceType - break; - } - case 0x0005: // ActiveHardwareFaults - { - entryLength = 1; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // ENUM8 - break; - } - case 0x0006: // ActiveRadioFaults - { - entryLength = 1; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // ENUM8 - break; - } - case 0x0007: // ActiveNetworkFaults - { - entryLength = 1; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // ENUM8 - break; - } - } - break; - } - case 0x003F: // Group Key Management Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // groups - { - entryLength = 6; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _GroupState - _GroupState * entry = reinterpret_cast<_GroupState *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write, - &entryOffset, sizeof(entry->VendorId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->VendorGroupId, write ? (uint8_t *) &entry->VendorGroupId : src, write, - &entryOffset, sizeof(entry->VendorGroupId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeySetIndex, write ? (uint8_t *) &entry->GroupKeySetIndex : src, - write, &entryOffset, sizeof(entry->GroupKeySetIndex)); // INT16U - break; - } - case 0x0001: // group keys - { - entryLength = 31; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _GroupKey - _GroupKey * entry = reinterpret_cast<_GroupKey *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write, - &entryOffset, sizeof(entry->VendorId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeyIndex, write ? (uint8_t *) &entry->GroupKeyIndex : src, write, - &entryOffset, sizeof(entry->GroupKeyIndex)); // INT16U - ByteSpan * GroupKeyRootSpan = &entry->GroupKeyRoot; // OCTET_STRING - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 18, GroupKeyRootSpan) - : ReadByteSpan(src + entryOffset, 18, GroupKeyRootSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 18); - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeyEpochStartTime, - write ? (uint8_t *) &entry->GroupKeyEpochStartTime : src, write, &entryOffset, - sizeof(entry->GroupKeyEpochStartTime)); // INT64U - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeySecurityPolicy, - write ? (uint8_t *) &entry->GroupKeySecurityPolicy : src, write, &entryOffset, - sizeof(entry->GroupKeySecurityPolicy)); // GroupKeySecurityPolicy - break; - } - } - break; - } - case 0x0507: // Media Input Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // media input list - { - entryLength = 70; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _MediaInputInfo - _MediaInputInfo * entry = reinterpret_cast<_MediaInputInfo *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, - sizeof(entry->index)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->inputType, write ? (uint8_t *) &entry->inputType : src, write, - &entryOffset, sizeof(entry->inputType)); // MediaInputType - ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING - ByteSpan * nameSpan = &nameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - ByteSpan descriptionSpanStorage(Uint8::from_const_char(entry->description.data()), - entry->description.size()); // CHAR_STRING - ByteSpan * descriptionSpan = &descriptionSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, descriptionSpan) - : ReadByteSpan(src + entryOffset, 34, descriptionSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - } - break; - } - case 0x003E: // Operational Credentials Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0001: // fabrics list - { - entryLength = 120; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _FabricDescriptor - _FabricDescriptor * entry = reinterpret_cast<_FabricDescriptor *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->FabricIndex, write ? (uint8_t *) &entry->FabricIndex : src, write, - &entryOffset, sizeof(entry->FabricIndex)); // INT8U - ByteSpan * RootPublicKeySpan = &entry->RootPublicKey; // OCTET_STRING - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 67, RootPublicKeySpan) - : ReadByteSpan(src + entryOffset, 67, RootPublicKeySpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 67); - copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write, - &entryOffset, sizeof(entry->VendorId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, - &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID - copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING - ByteSpan * LabelSpan = &LabelSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - case 0x0004: // TrustedRootCertificates - { - entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast(index - 1)); - if (entryOffset == 0) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - - ByteSpan * trustedRootCertificatesSpan = reinterpret_cast(write ? src : dest); // OCTET_STRING - uint16_t trustedRootCertificatesRemainingSpace = static_cast(am->size - entryOffset); - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, trustedRootCertificatesRemainingSpace, trustedRootCertificatesSpan) - : ReadByteSpan(src + entryOffset, trustedRootCertificatesRemainingSpace, trustedRootCertificatesSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - - if (!CanCastTo(trustedRootCertificatesSpan->size())) - { - ChipLogError(Zcl, "Span size %zu is too large", trustedRootCertificatesSpan->size()); - return 0; - } - entryLength = static_cast(trustedRootCertificatesSpan->size()); - break; - } - } - break; - } - case 0x0034: // Software Diagnostics Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // ThreadMetrics - { - entryLength = 30; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _ThreadMetrics - _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, - sizeof(entry->Id)); // INT64U - ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING - ByteSpan * NameSpan = &NameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 10); - copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, - write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U - copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, - write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U - copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, - &entryOffset, sizeof(entry->StackSize)); // INT32U - break; - } - } - break; - } - case 0x0504: // TV Channel Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // channel list - { - entryLength = 106; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _TvChannelInfo - _TvChannelInfo * entry = reinterpret_cast<_TvChannelInfo *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->majorNumber, write ? (uint8_t *) &entry->majorNumber : src, write, - &entryOffset, sizeof(entry->majorNumber)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->minorNumber, write ? (uint8_t *) &entry->minorNumber : src, write, - &entryOffset, sizeof(entry->minorNumber)); // INT16U - ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING - ByteSpan * nameSpan = &nameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - ByteSpan callSignSpanStorage(Uint8::from_const_char(entry->callSign.data()), entry->callSign.size()); // CHAR_STRING - ByteSpan * callSignSpan = &callSignSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, callSignSpan) : ReadByteSpan(src + entryOffset, 34, callSignSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - ByteSpan affiliateCallSignSpanStorage(Uint8::from_const_char(entry->affiliateCallSign.data()), - entry->affiliateCallSign.size()); // CHAR_STRING - ByteSpan * affiliateCallSignSpan = &affiliateCallSignSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, affiliateCallSignSpan) - : ReadByteSpan(src + entryOffset, 34, affiliateCallSignSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - } - break; - } - case 0x0505: // Target Navigator Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // target navigator list - { - entryLength = 35; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _NavigateTargetTargetInfo - _NavigateTargetTargetInfo * entry = reinterpret_cast<_NavigateTargetTargetInfo *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->identifier, write ? (uint8_t *) &entry->identifier : src, write, - &entryOffset, sizeof(entry->identifier)); // INT8U - ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING - ByteSpan * nameSpan = &nameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - } - break; - } - case 0x0035: // Thread Network Diagnostics Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0007: // NeighborTableList - { - entryLength = 31; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _NeighborTable - _NeighborTable * entry = reinterpret_cast<_NeighborTable *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->ExtAddress, write ? (uint8_t *) &entry->ExtAddress : src, write, - &entryOffset, sizeof(entry->ExtAddress)); // INT64U - copyListMember(write ? dest : (uint8_t *) &entry->Age, write ? (uint8_t *) &entry->Age : src, write, &entryOffset, - sizeof(entry->Age)); // INT32U - copyListMember(write ? dest : (uint8_t *) &entry->Rloc16, write ? (uint8_t *) &entry->Rloc16 : src, write, &entryOffset, - sizeof(entry->Rloc16)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->LinkFrameCounter, write ? (uint8_t *) &entry->LinkFrameCounter : src, - write, &entryOffset, sizeof(entry->LinkFrameCounter)); // INT32U - copyListMember(write ? dest : (uint8_t *) &entry->MleFrameCounter, write ? (uint8_t *) &entry->MleFrameCounter : src, - write, &entryOffset, sizeof(entry->MleFrameCounter)); // INT32U - copyListMember(write ? dest : (uint8_t *) &entry->LQI, write ? (uint8_t *) &entry->LQI : src, write, &entryOffset, - sizeof(entry->LQI)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->AverageRssi, write ? (uint8_t *) &entry->AverageRssi : src, write, - &entryOffset, sizeof(entry->AverageRssi)); // INT8S - copyListMember(write ? dest : (uint8_t *) &entry->LastRssi, write ? (uint8_t *) &entry->LastRssi : src, write, - &entryOffset, sizeof(entry->LastRssi)); // INT8S - copyListMember(write ? dest : (uint8_t *) &entry->FrameErrorRate, write ? (uint8_t *) &entry->FrameErrorRate : src, - write, &entryOffset, sizeof(entry->FrameErrorRate)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->MessageErrorRate, write ? (uint8_t *) &entry->MessageErrorRate : src, - write, &entryOffset, sizeof(entry->MessageErrorRate)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->RxOnWhenIdle, write ? (uint8_t *) &entry->RxOnWhenIdle : src, write, - &entryOffset, sizeof(entry->RxOnWhenIdle)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->FullThreadDevice, write ? (uint8_t *) &entry->FullThreadDevice : src, - write, &entryOffset, sizeof(entry->FullThreadDevice)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->FullNetworkData, write ? (uint8_t *) &entry->FullNetworkData : src, - write, &entryOffset, sizeof(entry->FullNetworkData)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->IsChild, write ? (uint8_t *) &entry->IsChild : src, write, - &entryOffset, sizeof(entry->IsChild)); // BOOLEAN - break; - } - case 0x0008: // RouteTableList - { - entryLength = 18; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _RouteTable - _RouteTable * entry = reinterpret_cast<_RouteTable *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->ExtAddress, write ? (uint8_t *) &entry->ExtAddress : src, write, - &entryOffset, sizeof(entry->ExtAddress)); // INT64U - copyListMember(write ? dest : (uint8_t *) &entry->Rloc16, write ? (uint8_t *) &entry->Rloc16 : src, write, &entryOffset, - sizeof(entry->Rloc16)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->RouterId, write ? (uint8_t *) &entry->RouterId : src, write, - &entryOffset, sizeof(entry->RouterId)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->NextHop, write ? (uint8_t *) &entry->NextHop : src, write, - &entryOffset, sizeof(entry->NextHop)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->PathCost, write ? (uint8_t *) &entry->PathCost : src, write, - &entryOffset, sizeof(entry->PathCost)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->LQIIn, write ? (uint8_t *) &entry->LQIIn : src, write, &entryOffset, - sizeof(entry->LQIIn)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->LQIOut, write ? (uint8_t *) &entry->LQIOut : src, write, &entryOffset, - sizeof(entry->LQIOut)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->Age, write ? (uint8_t *) &entry->Age : src, write, &entryOffset, - sizeof(entry->Age)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->Allocated, write ? (uint8_t *) &entry->Allocated : src, write, - &entryOffset, sizeof(entry->Allocated)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->LinkEstablished, write ? (uint8_t *) &entry->LinkEstablished : src, - write, &entryOffset, sizeof(entry->LinkEstablished)); // BOOLEAN - break; - } - case 0x003B: // SecurityPolicy - { - entryLength = 4; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _SecurityPolicy - _SecurityPolicy * entry = reinterpret_cast<_SecurityPolicy *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->RotationTime, write ? (uint8_t *) &entry->RotationTime : src, write, - &entryOffset, sizeof(entry->RotationTime)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->Flags, write ? (uint8_t *) &entry->Flags : src, write, &entryOffset, - sizeof(entry->Flags)); // BITMAP16 - break; - } - case 0x003D: // OperationalDatasetComponents - { - entryLength = 12; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _OperationalDatasetComponents - _OperationalDatasetComponents * entry = reinterpret_cast<_OperationalDatasetComponents *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->ActiveTimestampPresent, - write ? (uint8_t *) &entry->ActiveTimestampPresent : src, write, &entryOffset, - sizeof(entry->ActiveTimestampPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->PendingTimestampPresent, - write ? (uint8_t *) &entry->PendingTimestampPresent : src, write, &entryOffset, - sizeof(entry->PendingTimestampPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->MasterKeyPresent, write ? (uint8_t *) &entry->MasterKeyPresent : src, - write, &entryOffset, sizeof(entry->MasterKeyPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->NetworkNamePresent, - write ? (uint8_t *) &entry->NetworkNamePresent : src, write, &entryOffset, - sizeof(entry->NetworkNamePresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->ExtendedPanIdPresent, - write ? (uint8_t *) &entry->ExtendedPanIdPresent : src, write, &entryOffset, - sizeof(entry->ExtendedPanIdPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->MeshLocalPrefixPresent, - write ? (uint8_t *) &entry->MeshLocalPrefixPresent : src, write, &entryOffset, - sizeof(entry->MeshLocalPrefixPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->DelayPresent, write ? (uint8_t *) &entry->DelayPresent : src, write, - &entryOffset, sizeof(entry->DelayPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->PanIdPresent, write ? (uint8_t *) &entry->PanIdPresent : src, write, - &entryOffset, sizeof(entry->PanIdPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->ChannelPresent, write ? (uint8_t *) &entry->ChannelPresent : src, - write, &entryOffset, sizeof(entry->ChannelPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->PskcPresent, write ? (uint8_t *) &entry->PskcPresent : src, write, - &entryOffset, sizeof(entry->PskcPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->SecurityPolicyPresent, - write ? (uint8_t *) &entry->SecurityPolicyPresent : src, write, &entryOffset, - sizeof(entry->SecurityPolicyPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->ChannelMaskPresent, - write ? (uint8_t *) &entry->ChannelMaskPresent : src, write, &entryOffset, - sizeof(entry->ChannelMaskPresent)); // BOOLEAN - break; - } - case 0x003E: // ActiveNetworkFaultsList - { - entryLength = 1; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // NetworkFault - break; - } - } - break; - } - } - - return entryLength; -} - -// A list is a collection of entries of the same data type. The data type may be any defined data type. -uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attributeId, const uint8_t * buffer) -{ - // The first 2 bytes specify the number of entries. A value of 0xFFFF means the list in invalid - // and data is undefined. - uint16_t entryCount = emberAfGetInt16u(buffer, 0, kSizeLengthInBytes); - if (entryCount == 0xFFFF) - { - return 0; - } - - uint16_t entryLength = 0; - switch (clusterId) - { - case 0x050D: // Application Basic Cluster - switch (attributeId) - { - case 0x0007: // allowed vendor list - // uint16_t - entryLength = 2; - break; - } - break; - case 0x050C: // Application Launcher Cluster - switch (attributeId) - { - case 0x0000: // application launcher list - // uint16_t - entryLength = 2; - break; - } - break; - case 0x050B: // Audio Output Cluster - switch (attributeId) - { - case 0x0000: // audio output list - // Struct _AudioOutputInfo - entryLength = 36; - break; - } - break; - case 0x050A: // Content Launcher Cluster - switch (attributeId) - { - case 0x0000: // accepts header list - // chip::ByteSpan - return GetByteSpanOffsetFromIndex(buffer, 256, entryCount); - break; - } - break; - case 0x001D: // Descriptor Cluster - switch (attributeId) - { - case 0x0000: // device list - // Struct _DeviceType - entryLength = 6; - break; - case 0x0001: // server list - // chip::ClusterId - entryLength = 4; - break; - case 0x0002: // client list - // chip::ClusterId - entryLength = 4; - break; - case 0x0003: // parts list - // chip::EndpointId - entryLength = 2; - break; - } - break; - case 0x0030: // General Commissioning Cluster - switch (attributeId) - { - case 0x0001: // BasicCommissioningInfoList - // Struct _BasicCommissioningInfoType - entryLength = 4; - break; - } - break; - case 0x0033: // General Diagnostics Cluster - switch (attributeId) - { - case 0x0000: // NetworkInterfaces - // Struct _NetworkInterfaceType - entryLength = 48; - break; - case 0x0005: // ActiveHardwareFaults - // uint8_t - entryLength = 1; - break; - case 0x0006: // ActiveRadioFaults - // uint8_t - entryLength = 1; - break; - case 0x0007: // ActiveNetworkFaults - // uint8_t - entryLength = 1; - break; - } - break; - case 0x003F: // Group Key Management Cluster - switch (attributeId) - { - case 0x0000: // groups - // Struct _GroupState - entryLength = 6; - break; - case 0x0001: // group keys - // Struct _GroupKey - entryLength = 31; - break; - } - break; - case 0x0507: // Media Input Cluster - switch (attributeId) - { - case 0x0000: // media input list - // Struct _MediaInputInfo - entryLength = 70; - break; - } - break; - case 0x003E: // Operational Credentials Cluster - switch (attributeId) - { - case 0x0001: // fabrics list - // Struct _FabricDescriptor - entryLength = 120; - break; - case 0x0004: // TrustedRootCertificates - // chip::ByteSpan - return GetByteSpanOffsetFromIndex(buffer, 402, entryCount); - break; - } - break; - case 0x0034: // Software Diagnostics Cluster - switch (attributeId) - { - case 0x0000: // ThreadMetrics - // Struct _ThreadMetrics - entryLength = 30; - break; - } - break; - case 0x0504: // TV Channel Cluster - switch (attributeId) - { - case 0x0000: // channel list - // Struct _TvChannelInfo - entryLength = 106; - break; - } - break; - case 0x0505: // Target Navigator Cluster - switch (attributeId) - { - case 0x0000: // target navigator list - // Struct _NavigateTargetTargetInfo - entryLength = 35; - break; - } - break; - case 0x0035: // Thread Network Diagnostics Cluster - switch (attributeId) - { - case 0x0007: // NeighborTableList - // Struct _NeighborTable - entryLength = 31; - break; - case 0x0008: // RouteTableList - // Struct _RouteTable - entryLength = 18; - break; - case 0x003B: // SecurityPolicy - // Struct _SecurityPolicy - entryLength = 4; - break; - case 0x003D: // OperationalDatasetComponents - // Struct _OperationalDatasetComponents - entryLength = 12; - break; - case 0x003E: // ActiveNetworkFaultsList - // uint8_t - entryLength = 1; - break; - } - break; - } - - uint32_t totalSize = kSizeLengthInBytes + (entryCount * entryLength); - if (!CanCastTo(totalSize)) - { - ChipLogError(Zcl, "Cluster " ChipLogFormatMEI ": Size of attribute " ChipLogFormatMEI " is too large.", - ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId)); - return 0; - } - - return static_cast(totalSize); -} diff --git a/zzz_generated/tv-app/zap-generated/callback-stub.cpp b/zzz_generated/tv-app/zap-generated/callback-stub.cpp index 5e13a065a34eab..92d6949c3e3f27 100644 --- a/zzz_generated/tv-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/tv-app/zap-generated/callback-stub.cpp @@ -50,6 +50,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_BINDING_CLUSTER_ID: emberAfBindingClusterInitCallback(endpoint); break; + case ZCL_CHANNEL_CLUSTER_ID: + emberAfChannelClusterInitCallback(endpoint); + break; case ZCL_CONTENT_LAUNCH_CLUSTER_ID: emberAfContentLauncherClusterInitCallback(endpoint); break; @@ -107,9 +110,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: emberAfSoftwareDiagnosticsClusterInitCallback(endpoint); break; - case ZCL_TV_CHANNEL_CLUSTER_ID: - emberAfTvChannelClusterInitCallback(endpoint); - break; case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: emberAfTargetNavigatorClusterInitCallback(endpoint); break; @@ -166,6 +166,11 @@ void __attribute__((weak)) emberAfBindingClusterInitCallback(EndpointId endpoint // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfChannelClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfContentLauncherClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -261,11 +266,6 @@ void __attribute__((weak)) emberAfSoftwareDiagnosticsClusterInitCallback(Endpoin // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfTvChannelClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfTargetNavigatorClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/tv-app/zap-generated/endpoint_config.h b/zzz_generated/tv-app/zap-generated/endpoint_config.h index 69ffa9c6bb798d..5f1e6e16bbf511 100644 --- a/zzz_generated/tv-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-app/zap-generated/endpoint_config.h @@ -279,7 +279,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 619 - groups, */ \ + /* 619 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -295,7 +295,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 873 - group keys, */ \ + /* 873 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -311,7 +311,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: TV Channel (server), big-endian */ \ + /* Endpoint: 1, Cluster: Channel (server), big-endian */ \ \ /* 1127 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -367,7 +367,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 1889 - accepts header list, */ \ + /* 1889 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -441,7 +441,7 @@ \ /* Endpoint: 3, Cluster: Content Launcher (server), big-endian */ \ \ - /* 2691 - accepts header list, */ \ + /* 2691 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -460,9 +460,15 @@ /* 2945 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 3, Cluster: Application Basic (server), big-endian */ \ + \ + /* 2949 - allowed vendor list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 4, Cluster: Content Launcher (server), big-endian */ \ \ - /* 2949 - accepts header list, */ \ + /* 2981 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -478,8 +484,14 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3203 - supported streaming protocols, */ \ + /* 3235 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 4, Cluster: Application Basic (server), big-endian */ \ + \ + /* 3239 - allowed vendor list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } #else // !BIGENDIAN_CPU @@ -738,7 +750,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 619 - groups, */ \ + /* 619 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -754,7 +766,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 873 - group keys, */ \ + /* 873 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -770,7 +782,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: TV Channel (server), little-endian */ \ + /* Endpoint: 1, Cluster: Channel (server), little-endian */ \ \ /* 1127 - channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -826,7 +838,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 1889 - accepts header list, */ \ + /* 1889 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -900,7 +912,7 @@ \ /* Endpoint: 3, Cluster: Content Launcher (server), little-endian */ \ \ - /* 2691 - accepts header list, */ \ + /* 2691 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -919,9 +931,15 @@ /* 2945 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 3, Cluster: Application Basic (server), little-endian */ \ + \ + /* 2949 - allowed vendor list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 4, Cluster: Content Launcher (server), little-endian */ \ \ - /* 2949 - accepts header list, */ \ + /* 2981 - accept header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -937,13 +955,19 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3203 - supported streaming protocols, */ \ + /* 3235 - supported streaming protocols, */ \ 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 4, Cluster: Application Basic (server), little-endian */ \ + \ + /* 3239 - allowed vendor list, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (91) +#define GENERATED_DEFAULTS_COUNT (93) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -976,7 +1000,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 276 +#define GENERATED_ATTRIBUTE_COUNT 281 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1184,8 +1208,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(619) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(873) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(619) }, /* groupKeyMap */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(873) }, /* groupTable */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ @@ -1193,8 +1217,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ @@ -1217,7 +1242,7 @@ { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* wake on lan mac address */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: TV Channel (server) */ \ + /* Endpoint: 1, Cluster: Channel (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1127) }, /* channel list */ \ { 0x0001, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* channel lineup */ \ @@ -1242,7 +1267,7 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1889) }, /* accepts header list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1889) }, /* accept header list */ \ { 0x0001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_LONG_DEFAULTS_INDEX(2143) }, /* supported streaming protocols */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1300,9 +1325,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Media Playback (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2655) }, /* start time */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2663) }, /* duration */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ + { 0x0001, ZAP_TYPE(EPOCH_US), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2655) }, /* start time */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(2663) }, /* duration */ \ { 0x0003, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* position */ \ { 0x0004, ZAP_TYPE(SINGLE), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2671) }, /* playback speed */ \ @@ -1311,19 +1336,22 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2691) }, /* accepts header list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2691) }, /* accept header list */ \ { 0x0001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_LONG_DEFAULTS_INDEX(2945) }, /* supported streaming protocols */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ + { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* product id */ \ + { 0x0004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* application app */ \ + { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ + { 0x0006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ + { 0x0007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(2949) }, /* allowed vendor list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 3, Cluster: Account Login (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1336,19 +1364,22 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 4, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2949) }, /* accepts header list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2981) }, /* accept header list */ \ { 0x0001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3203) }, /* supported streaming protocols */ \ + ZAP_LONG_DEFAULTS_INDEX(3235) }, /* supported streaming protocols */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 4, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ + { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ + { 0x0004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* application app */ \ + { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ + { 0x0006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ + { 0x0007, ZAP_TYPE(ARRAY), 32, 0, ZAP_LONG_DEFAULTS_INDEX(3239) }, /* allowed vendor list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 5, Cluster: Descriptor (server) */ \ { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* device list */ \ @@ -1358,10 +1389,12 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 5, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ + { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ + { 0x0004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_SIMPLE_DEFAULT(0x00) }, /* application app */ \ { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ { 0x0006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1462,7 +1495,7 @@ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ 0x0504, ZAP_ATTRIBUTE_INDEX(182), 4, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ + }, /* Endpoint: 1, Cluster: Channel (server) */ \ { \ 0x0505, ZAP_ATTRIBUTE_INDEX(186), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ @@ -1509,25 +1542,25 @@ 0x050A, ZAP_ATTRIBUTE_INDEX(238), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Content Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(241), 7, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(241), 9, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(248), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(250), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 3, Cluster: Account Login (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(249), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(251), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Descriptor (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(254), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(256), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Content Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(257), 7, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(259), 9, 138, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Application Basic (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(264), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(268), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 5, Cluster: Descriptor (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(269), 7, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(273), 8, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 5, Cluster: Application Basic (server) */ \ } @@ -1537,7 +1570,7 @@ #define GENERATED_ENDPOINT_TYPES \ { \ { ZAP_CLUSTER_INDEX(0), 21, 1967 }, { ZAP_CLUSTER_INDEX(21), 10, 1328 }, { ZAP_CLUSTER_INDEX(31), 4, 283 }, \ - { ZAP_CLUSTER_INDEX(35), 5, 407 }, { ZAP_CLUSTER_INDEX(40), 3, 366 }, { ZAP_CLUSTER_INDEX(43), 2, 106 }, \ + { ZAP_CLUSTER_INDEX(35), 5, 439 }, { ZAP_CLUSTER_INDEX(40), 3, 398 }, { ZAP_CLUSTER_INDEX(43), 2, 106 }, \ } // Largest attribute size is needed for various buffers @@ -1547,7 +1580,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (686) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (4457) +#define ATTRIBUTE_MAX_SIZE (4521) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (6) diff --git a/zzz_generated/tv-app/zap-generated/gen_config.h b/zzz_generated/tv-app/zap-generated/gen_config.h index 34ff0706057eec..44886faf0b7ca5 100644 --- a/zzz_generated/tv-app/zap-generated/gen_config.h +++ b/zzz_generated/tv-app/zap-generated/gen_config.h @@ -36,6 +36,7 @@ #define EMBER_AF_AUDIO_OUTPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_BINDING_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_CONTENT_LAUNCH_CLUSTER_SERVER_ENDPOINT_COUNT (3) #define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (6) #define EMBER_AF_DIAGNOSTIC_LOGS_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -58,7 +59,6 @@ #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_TV_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_USER_LABEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -102,6 +102,11 @@ #define EMBER_AF_PLUGIN_BINDING_SERVER #define EMBER_AF_PLUGIN_BINDING +// Use this macro to check if the server side of the Channel cluster is included +#define ZCL_USING_CHANNEL_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_CHANNEL_SERVER +#define EMBER_AF_PLUGIN_CHANNEL + // Use this macro to check if the server side of the Content Launcher cluster is included #define ZCL_USING_CONTENT_LAUNCH_CLUSTER_SERVER #define EMBER_AF_PLUGIN_CONTENT_LAUNCHER_SERVER @@ -213,11 +218,6 @@ #define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER #define EMBER_AF_PLUGIN_SOFTWARE_DIAGNOSTICS -// Use this macro to check if the server side of the TV Channel cluster is included -#define ZCL_USING_TV_CHANNEL_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_TV_CHANNEL_SERVER -#define EMBER_AF_PLUGIN_TV_CHANNEL - // Use this macro to check if the server side of the Target Navigator cluster is included #define ZCL_USING_TARGET_NAVIGATOR_CLUSTER_SERVER #define EMBER_AF_PLUGIN_TARGET_NAVIGATOR_SERVER diff --git a/zzz_generated/tv-casting-app/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/tv-casting-app/zap-generated/CHIPClientCallbacks.cpp index 759d13c5028d26..1dd55907dc2609 100644 --- a/zzz_generated/tv-casting-app/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/tv-casting-app/zap-generated/CHIPClientCallbacks.cpp @@ -16,3 +16,245 @@ */ // THIS FILE IS GENERATED BY ZAP + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::app::DataModel; + +namespace { +[[maybe_unused]] constexpr uint16_t kByteSpanSizeLengthInBytes = 2; +} // namespace + +#define CHECK_STATUS_WITH_RETVAL(error, retval) \ + if (CHIP_NO_ERROR != error) \ + { \ + ChipLogError(Zcl, "CHECK_STATUS %s", ErrorStr(error)); \ + if (onFailureCallback != nullptr) \ + { \ + Callback::Callback * cb = \ + Callback::Callback::FromCancelable(onFailureCallback); \ + cb->mCall(cb->mContext, static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \ + } \ + return retval; \ + } + +#define CHECK_STATUS(error) CHECK_STATUS_WITH_RETVAL(error, true) +#define CHECK_STATUS_VOID(error) CHECK_STATUS_WITH_RETVAL(error, ) + +#define CHECK_MESSAGE_LENGTH_WITH_RETVAL(value, retval) \ + if (!CanCastTo(value)) \ + { \ + ChipLogError(Zcl, "CHECK_MESSAGE_LENGTH expects a uint16_t value, got: %d", value); \ + if (onFailureCallback != nullptr) \ + { \ + Callback::Callback * cb = \ + Callback::Callback::FromCancelable(onFailureCallback); \ + cb->mCall(cb->mContext, static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \ + } \ + return retval; \ + } \ + \ + if (messageLen < value) \ + { \ + ChipLogError(Zcl, "Unexpected response length: %d", messageLen); \ + if (onFailureCallback != nullptr) \ + { \ + Callback::Callback * cb = \ + Callback::Callback::FromCancelable(onFailureCallback); \ + cb->mCall(cb->mContext, static_cast(EMBER_ZCL_STATUS_INVALID_VALUE)); \ + } \ + return retval; \ + } \ + \ + messageLen = static_cast(messageLen - static_cast(value)); + +#define CHECK_MESSAGE_LENGTH(value) CHECK_MESSAGE_LENGTH_WITH_RETVAL(value, true) +#define CHECK_MESSAGE_LENGTH_VOID(value) CHECK_MESSAGE_LENGTH_WITH_RETVAL(value, ) + +#define GET_RESPONSE_CALLBACKS(name) \ + Callback::Cancelable * onSuccessCallback = nullptr; \ + Callback::Cancelable * onFailureCallback = nullptr; \ + NodeId sourceId = emberAfCurrentCommand()->SourceNodeId(); \ + uint8_t sequenceNumber = emberAfCurrentCommand()->seqNum; \ + CHIP_ERROR err = gCallbacks.GetResponseCallback(sourceId, sequenceNumber, &onSuccessCallback, &onFailureCallback); \ + \ + if (CHIP_NO_ERROR != err) \ + { \ + if (onSuccessCallback == nullptr) \ + { \ + ChipLogDetail(Zcl, "%s: Missing success callback", name); \ + } \ + \ + if (onFailureCallback == nullptr) \ + { \ + ChipLogDetail(Zcl, "%s: Missing failure callback", name); \ + } \ + \ + return true; \ + } + +#define GET_CLUSTER_RESPONSE_CALLBACKS(name) \ + Callback::Cancelable * onSuccessCallback = nullptr; \ + Callback::Cancelable * onFailureCallback = nullptr; \ + NodeId sourceIdentifier = reinterpret_cast(commandObj); \ + /* #6559: Currently, we only have one commands for the IMInvokeCommands and to a device, so the seqNum is always set to 0. */ \ + CHIP_ERROR err = gCallbacks.GetResponseCallback(sourceIdentifier, 0, &onSuccessCallback, &onFailureCallback); \ + \ + if (CHIP_NO_ERROR != err) \ + { \ + if (onSuccessCallback == nullptr) \ + { \ + ChipLogDetail(Zcl, "%s: Missing success callback", name); \ + } \ + \ + if (onFailureCallback == nullptr) \ + { \ + ChipLogDetail(Zcl, "%s: Missing failure callback", name); \ + } \ + \ + return true; \ + } + +// Singleton instance of the callbacks manager +app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); + +void ApplicationLauncherClusterApplicationLauncherListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AudioOutputClusterAudioOutputListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ChannelClusterChannelListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void ContentLauncherClusterAcceptHeaderListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void MediaInputClusterMediaInputListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void TargetNavigatorClusterTargetNavigatorListListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} diff --git a/zzz_generated/tv-casting-app/zap-generated/CHIPClientCallbacks.h b/zzz_generated/tv-casting-app/zap-generated/CHIPClientCallbacks.h index 302d36ce5d8076..dcbde910989226 100644 --- a/zzz_generated/tv-casting-app/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/tv-casting-app/zap-generated/CHIPClientCallbacks.h @@ -17,4 +17,55 @@ // THIS FILE IS GENERATED BY ZAP +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Note: The IMDefaultResponseCallback is a bridge to the old CallbackMgr before IM is landed, so it still accepts EmberAfStatus +// instead of IM status code. +// #6308 should handle IM error code on the application side, either modify this function or remove this. + +// Cluster Specific Response Callbacks + // List specific responses +void ApplicationLauncherClusterApplicationLauncherListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ApplicationLauncherApplicationLauncherListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void AudioOutputClusterAudioOutputListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AudioOutputAudioOutputListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void ChannelClusterChannelListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ChannelChannelListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void ContentLauncherClusterAcceptHeaderListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*ContentLauncherAcceptHeaderListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +void MediaInputClusterMediaInputListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*MediaInputMediaInputListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); +void TargetNavigatorClusterTargetNavigatorListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*TargetNavigatorTargetNavigatorListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); diff --git a/zzz_generated/tv-casting-app/zap-generated/CHIPClusters.cpp b/zzz_generated/tv-casting-app/zap-generated/CHIPClusters.cpp index 759d13c5028d26..2bdd88c361e647 100644 --- a/zzz_generated/tv-casting-app/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/tv-casting-app/zap-generated/CHIPClusters.cpp @@ -16,3 +16,1270 @@ */ // THIS FILE IS GENERATED BY ZAP + +#include "CHIPClusters.h" + +#include +#include + +namespace chip { + +using namespace app::Clusters; +using namespace System; +using namespace Encoding::LittleEndian; + +namespace Controller { + +// TODO(#4502): onCompletion is not used by IM for now. +// TODO(#4503): length should be passed to commands when byte string is in argument list. +// TODO(#4503): Commands should take group id as an argument. + +// AccountLogin Cluster Commands +CHIP_ERROR AccountLoginCluster::GetSetupPINRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::CharSpan tempAccountIdentifier) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AccountLogin::Commands::GetSetupPINRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // tempAccountIdentifier: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), tempAccountIdentifier)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR AccountLoginCluster::LoginRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan tempAccountIdentifier, chip::CharSpan setupPIN) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AccountLogin::Commands::LoginRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // tempAccountIdentifier: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), tempAccountIdentifier)); + // setupPIN: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), setupPIN)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR AccountLoginCluster::LogoutRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AccountLogin::Commands::LogoutRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +// ApplicationBasic Cluster Commands + +// ApplicationLauncher Cluster Commands +CHIP_ERROR ApplicationLauncherCluster::HideAppRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t catalogVendorId, + chip::CharSpan applicationId) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ApplicationLauncher::Commands::HideAppRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // catalogVendorId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), catalogVendorId)); + // applicationId: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), applicationId)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR ApplicationLauncherCluster::LaunchAppRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::CharSpan data, + uint16_t catalogVendorId, chip::CharSpan applicationId) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + ApplicationLauncher::Commands::LaunchAppRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // data: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), data)); + // catalogVendorId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), catalogVendorId)); + // applicationId: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), applicationId)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR ApplicationLauncherCluster::StopAppRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t catalogVendorId, + chip::CharSpan applicationId) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ApplicationLauncher::Commands::StopAppRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // catalogVendorId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), catalogVendorId)); + // applicationId: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), applicationId)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +// AudioOutput Cluster Commands +CHIP_ERROR AudioOutputCluster::RenameOutputRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t index, chip::CharSpan name) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AudioOutput::Commands::RenameOutputRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // index: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); + // name: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), name)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR AudioOutputCluster::SelectOutputRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t index) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, AudioOutput::Commands::SelectOutputRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // index: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +// Channel Cluster Commands +CHIP_ERROR ChannelCluster::ChangeChannelByNumberRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t majorNumber, + uint16_t minorNumber) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + Channel::Commands::ChangeChannelByNumberRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // majorNumber: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), majorNumber)); + // minorNumber: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), minorNumber)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR ChannelCluster::ChangeChannelRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan match) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Channel::Commands::ChangeChannelRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // match: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), match)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR ChannelCluster::SkipChannelRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t count) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, Channel::Commands::SkipChannelRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // count: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), count)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +// ContentLauncher Cluster Commands +CHIP_ERROR ContentLauncherCluster::LaunchContentRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, bool autoPlay, + chip::CharSpan data) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + ContentLauncher::Commands::LaunchContentRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // autoPlay: boolean + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), autoPlay)); + // data: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), data)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR ContentLauncherCluster::LaunchURLRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::CharSpan contentURL, + chip::CharSpan displayString, chip::CharSpan providerName) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, ContentLauncher::Commands::LaunchURLRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // contentURL: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), contentURL)); + // displayString: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), displayString)); + // providerName: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), providerName)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +// KeypadInput Cluster Commands +CHIP_ERROR KeypadInputCluster::SendKeyRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t keyCode) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, KeypadInput::Commands::SendKeyRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // keyCode: cecKeyCode + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), keyCode)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +// MediaInput Cluster Commands +CHIP_ERROR MediaInputCluster::HideInputStatusRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::HideInputStatusRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaInputCluster::RenameInputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t index, chip::CharSpan name) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::RenameInputRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // index: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); + // name: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), name)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaInputCluster::SelectInputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t index) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::SelectInputRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // index: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), index)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaInputCluster::ShowInputStatusRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaInput::Commands::ShowInputStatusRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +// MediaPlayback Cluster Commands +CHIP_ERROR MediaPlaybackCluster::FastForwardRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::FastForwardRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaPlaybackCluster::NextRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::NextRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaPlaybackCluster::PauseRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::PauseRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaPlaybackCluster::PlayRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::PlayRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaPlaybackCluster::PreviousRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::PreviousRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaPlaybackCluster::RewindRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::RewindRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaPlaybackCluster::SeekRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t position) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::SeekRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // position: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), position)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaPlaybackCluster::SkipBackwardRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::SkipBackwardRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // deltaPositionMilliseconds: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), deltaPositionMilliseconds)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaPlaybackCluster::SkipForwardRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t deltaPositionMilliseconds) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::SkipForwardRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // deltaPositionMilliseconds: int64u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), deltaPositionMilliseconds)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaPlaybackCluster::StartOverRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::StartOverRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR MediaPlaybackCluster::StopRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, MediaPlayback::Commands::StopRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + // Command takes no arguments. + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +// TargetNavigator Cluster Commands +CHIP_ERROR TargetNavigatorCluster::NavigateTargetRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t target, + chip::CharSpan data) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TargetNavigator::Commands::NavigateTargetRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // target: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), target)); + // data: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), data)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +} // namespace Controller +} // namespace chip diff --git a/zzz_generated/tv-casting-app/zap-generated/CHIPClusters.h b/zzz_generated/tv-casting-app/zap-generated/CHIPClusters.h index 759d13c5028d26..1e9116df464206 100644 --- a/zzz_generated/tv-casting-app/zap-generated/CHIPClusters.h +++ b/zzz_generated/tv-casting-app/zap-generated/CHIPClusters.h @@ -16,3 +16,154 @@ */ // THIS FILE IS GENERATED BY ZAP + +// Prevent multiple inclusion +#pragma once + +#include +#include + +#include +#include +#include + +namespace chip { +namespace Controller { + +class DLL_EXPORT AccountLoginCluster : public ClusterBase +{ +public: + AccountLoginCluster() : ClusterBase(app::Clusters::AccountLogin::Id) {} + ~AccountLoginCluster() {} + + // Cluster Commands + CHIP_ERROR GetSetupPINRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan tempAccountIdentifier); + CHIP_ERROR LoginRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan tempAccountIdentifier, chip::CharSpan setupPIN); + CHIP_ERROR LogoutRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); +}; + +class DLL_EXPORT ApplicationBasicCluster : public ClusterBase +{ +public: + ApplicationBasicCluster() : ClusterBase(app::Clusters::ApplicationBasic::Id) {} + ~ApplicationBasicCluster() {} +}; + +class DLL_EXPORT ApplicationLauncherCluster : public ClusterBase +{ +public: + ApplicationLauncherCluster() : ClusterBase(app::Clusters::ApplicationLauncher::Id) {} + ~ApplicationLauncherCluster() {} + + // Cluster Commands + CHIP_ERROR HideAppRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t catalogVendorId, chip::CharSpan applicationId); + CHIP_ERROR LaunchAppRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan data, uint16_t catalogVendorId, chip::CharSpan applicationId); + CHIP_ERROR StopAppRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t catalogVendorId, chip::CharSpan applicationId); +}; + +class DLL_EXPORT AudioOutputCluster : public ClusterBase +{ +public: + AudioOutputCluster() : ClusterBase(app::Clusters::AudioOutput::Id) {} + ~AudioOutputCluster() {} + + // Cluster Commands + CHIP_ERROR RenameOutputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t index, chip::CharSpan name); + CHIP_ERROR SelectOutputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t index); +}; + +class DLL_EXPORT ChannelCluster : public ClusterBase +{ +public: + ChannelCluster() : ClusterBase(app::Clusters::Channel::Id) {} + ~ChannelCluster() {} + + // Cluster Commands + CHIP_ERROR ChangeChannelByNumberRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t majorNumber, uint16_t minorNumber); + CHIP_ERROR ChangeChannelRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan match); + CHIP_ERROR SkipChannelRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t count); +}; + +class DLL_EXPORT ContentLauncherCluster : public ClusterBase +{ +public: + ContentLauncherCluster() : ClusterBase(app::Clusters::ContentLauncher::Id) {} + ~ContentLauncherCluster() {} + + // Cluster Commands + CHIP_ERROR LaunchContentRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + bool autoPlay, chip::CharSpan data); + CHIP_ERROR LaunchURLRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan contentURL, chip::CharSpan displayString, chip::CharSpan providerName); +}; + +class DLL_EXPORT KeypadInputCluster : public ClusterBase +{ +public: + KeypadInputCluster() : ClusterBase(app::Clusters::KeypadInput::Id) {} + ~KeypadInputCluster() {} + + // Cluster Commands + CHIP_ERROR SendKeyRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t keyCode); +}; + +class DLL_EXPORT MediaInputCluster : public ClusterBase +{ +public: + MediaInputCluster() : ClusterBase(app::Clusters::MediaInput::Id) {} + ~MediaInputCluster() {} + + // Cluster Commands + CHIP_ERROR HideInputStatusRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR RenameInputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t index, + chip::CharSpan name); + CHIP_ERROR SelectInputRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t index); + CHIP_ERROR ShowInputStatusRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); +}; + +class DLL_EXPORT MediaPlaybackCluster : public ClusterBase +{ +public: + MediaPlaybackCluster() : ClusterBase(app::Clusters::MediaPlayback::Id) {} + ~MediaPlaybackCluster() {} + + // Cluster Commands + CHIP_ERROR FastForwardRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR NextRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR PauseRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR PlayRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR PreviousRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR RewindRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR SeekRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint64_t position); + CHIP_ERROR SkipBackwardRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t deltaPositionMilliseconds); + CHIP_ERROR SkipForwardRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t deltaPositionMilliseconds); + CHIP_ERROR StartOverRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR StopRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); +}; + +class DLL_EXPORT TargetNavigatorCluster : public ClusterBase +{ +public: + TargetNavigatorCluster() : ClusterBase(app::Clusters::TargetNavigator::Id) {} + ~TargetNavigatorCluster() {} + + // Cluster Commands + CHIP_ERROR NavigateTargetRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t target, chip::CharSpan data); +}; + +} // namespace Controller +} // namespace chip diff --git a/zzz_generated/tv-casting-app/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/tv-casting-app/zap-generated/PluginApplicationCallbacks.h index 3510899a75d526..88263561b15ab6 100644 --- a/zzz_generated/tv-casting-app/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/tv-casting-app/zap-generated/PluginApplicationCallbacks.h @@ -22,18 +22,19 @@ #include #define MATTER_PLUGINS_INIT \ - MatterAccountLoginPluginServerInitCallback(); \ + MatterAccountLoginPluginClientInitCallback(); \ MatterAdministratorCommissioningPluginServerInitCallback(); \ - MatterApplicationBasicPluginServerInitCallback(); \ - MatterApplicationLauncherPluginServerInitCallback(); \ - MatterAudioOutputPluginServerInitCallback(); \ + MatterApplicationBasicPluginClientInitCallback(); \ + MatterApplicationLauncherPluginClientInitCallback(); \ + MatterAudioOutputPluginClientInitCallback(); \ MatterBarrierControlPluginServerInitCallback(); \ MatterBasicPluginServerInitCallback(); \ MatterBinaryInputBasicPluginServerInitCallback(); \ MatterBindingPluginServerInitCallback(); \ MatterBridgedDeviceBasicPluginServerInitCallback(); \ + MatterChannelPluginClientInitCallback(); \ MatterColorControlPluginServerInitCallback(); \ - MatterContentLauncherPluginServerInitCallback(); \ + MatterContentLauncherPluginClientInitCallback(); \ MatterDescriptorPluginServerInitCallback(); \ MatterDiagnosticLogsPluginServerInitCallback(); \ MatterDoorLockPluginServerInitCallback(); \ @@ -46,10 +47,10 @@ MatterGroupsPluginServerInitCallback(); \ MatterIasZonePluginServerInitCallback(); \ MatterIdentifyPluginServerInitCallback(); \ - MatterKeypadInputPluginServerInitCallback(); \ + MatterKeypadInputPluginClientInitCallback(); \ MatterLevelControlPluginServerInitCallback(); \ - MatterMediaInputPluginServerInitCallback(); \ - MatterMediaPlaybackPluginServerInitCallback(); \ + MatterMediaInputPluginClientInitCallback(); \ + MatterMediaPlaybackPluginClientInitCallback(); \ MatterNetworkCommissioningPluginServerInitCallback(); \ MatterOtaSoftwareUpdateProviderPluginServerInitCallback(); \ MatterOccupancySensingPluginServerInitCallback(); \ @@ -60,8 +61,7 @@ MatterScenesPluginServerInitCallback(); \ MatterSoftwareDiagnosticsPluginServerInitCallback(); \ MatterSwitchPluginServerInitCallback(); \ - MatterTvChannelPluginServerInitCallback(); \ - MatterTargetNavigatorPluginServerInitCallback(); \ + MatterTargetNavigatorPluginClientInitCallback(); \ MatterTemperatureMeasurementPluginServerInitCallback(); \ MatterTestClusterPluginServerInitCallback(); \ MatterThermostatPluginServerInitCallback(); \ diff --git a/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp b/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp deleted file mode 100644 index f23dd96d4c3c84..00000000000000 --- a/zzz_generated/tv-casting-app/zap-generated/attribute-size.cpp +++ /dev/null @@ -1,1158 +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. - */ - -// THIS FILE IS GENERATED BY ZAP - -#include -#include -#include -#include -#include -#include -#include - -using namespace chip; -using namespace chip::app::List; - -// The first 2 bytes specify the number of entries. A value of 0xFFFF means the list in invalid -// and data is undefined. -constexpr uint16_t kSizeLengthInBytes = 2u; - -void copyListMember(uint8_t * dest, uint8_t * src, bool write, uint16_t * offset, uint16_t length) -{ - if (write) - { - memmove(dest + *offset, src, length); - } - else - { - memmove(dest, src + *offset, length); - } - - *offset = static_cast(*offset + length); -} - -uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, bool write, uint8_t * dest, uint8_t * src, - int32_t index) -{ - if (index == -1) - { - memmove(dest, src, am->size); - return am->size; - } - - if (index == 0) - { - if (write) - { - // src is a pointer to native-endian uint16_t, dest is pointer to buffer that should hold little-endian value - emberAfCopyInt16u(dest, 0, *reinterpret_cast(src)); - } - else - { - // src is pointer to buffer holding little-endian value, dest is a pointer to native-endian uint16_t - *reinterpret_cast(dest) = emberAfGetInt16u(src, 0, kSizeLengthInBytes); - } - return kSizeLengthInBytes; - } - - if (!CanCastTo(index)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Should be between 1 and 65534", index); - return 0; - } - - uint16_t entryLength = 0; - switch (clusterId) - { - case 0x050D: // Application Basic Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0007: // allowed vendor list - { - entryLength = 2; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // INT16U - break; - } - } - break; - } - case 0x050C: // Application Launcher Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // application launcher list - { - entryLength = 2; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // INT16U - break; - } - } - break; - } - case 0x050B: // Audio Output Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // audio output list - { - entryLength = 36; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _AudioOutputInfo - _AudioOutputInfo * entry = reinterpret_cast<_AudioOutputInfo *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, - sizeof(entry->index)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->outputType, write ? (uint8_t *) &entry->outputType : src, write, - &entryOffset, sizeof(entry->outputType)); // AudioOutputType - ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING - ByteSpan * nameSpan = &nameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - } - break; - } - case 0x050A: // Content Launcher Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // accepts header list - { - entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast(index - 1)); - if (entryOffset == 0) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - - ByteSpan * acceptsHeaderListSpan = reinterpret_cast(write ? src : dest); // OCTET_STRING - uint16_t acceptsHeaderListRemainingSpace = static_cast(am->size - entryOffset); - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, acceptsHeaderListRemainingSpace, acceptsHeaderListSpan) - : ReadByteSpan(src + entryOffset, acceptsHeaderListRemainingSpace, acceptsHeaderListSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - - if (!CanCastTo(acceptsHeaderListSpan->size())) - { - ChipLogError(Zcl, "Span size %zu is too large", acceptsHeaderListSpan->size()); - return 0; - } - entryLength = static_cast(acceptsHeaderListSpan->size()); - break; - } - } - break; - } - case 0x001D: // Descriptor Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // device list - { - entryLength = 6; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _DeviceType - _DeviceType * entry = reinterpret_cast<_DeviceType *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->type, write ? (uint8_t *) &entry->type : src, write, &entryOffset, - sizeof(entry->type)); // DEVTYPE_ID - copyListMember(write ? dest : (uint8_t *) &entry->revision, write ? (uint8_t *) &entry->revision : src, write, - &entryOffset, sizeof(entry->revision)); // INT16U - break; - } - case 0x0001: // server list - { - entryLength = 4; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID - break; - } - case 0x0002: // client list - { - entryLength = 4; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // CLUSTER_ID - break; - } - case 0x0003: // parts list - { - entryLength = 2; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // ENDPOINT_NO - break; - } - } - break; - } - case 0x0040: // Fixed Label Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // label list - { - entryLength = 36; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _LabelStruct - _LabelStruct * entry = reinterpret_cast<_LabelStruct *>(write ? src : dest); - ByteSpan labelSpanStorage(Uint8::from_const_char(entry->label.data()), entry->label.size()); // CHAR_STRING - ByteSpan * labelSpan = &labelSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 18, labelSpan) : ReadByteSpan(src + entryOffset, 18, labelSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 18); - ByteSpan valueSpanStorage(Uint8::from_const_char(entry->value.data()), entry->value.size()); // CHAR_STRING - ByteSpan * valueSpan = &valueSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 18, valueSpan) : ReadByteSpan(src + entryOffset, 18, valueSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 18); - break; - } - } - break; - } - case 0x0030: // General Commissioning Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0001: // BasicCommissioningInfoList - { - entryLength = 4; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _BasicCommissioningInfoType - _BasicCommissioningInfoType * entry = reinterpret_cast<_BasicCommissioningInfoType *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->FailSafeExpiryLengthMs, - write ? (uint8_t *) &entry->FailSafeExpiryLengthMs : src, write, &entryOffset, - sizeof(entry->FailSafeExpiryLengthMs)); // INT32U - break; - } - } - break; - } - case 0x0033: // General Diagnostics Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // NetworkInterfaces - { - entryLength = 48; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _NetworkInterfaceType - _NetworkInterfaceType * entry = reinterpret_cast<_NetworkInterfaceType *>(write ? src : dest); - ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING - ByteSpan * NameSpan = &NameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, NameSpan) : ReadByteSpan(src + entryOffset, 34, NameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - copyListMember(write ? dest : (uint8_t *) &entry->FabricConnected, write ? (uint8_t *) &entry->FabricConnected : src, - write, &entryOffset, sizeof(entry->FabricConnected)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->OffPremiseServicesReachableIPv4, - write ? (uint8_t *) &entry->OffPremiseServicesReachableIPv4 : src, write, &entryOffset, - sizeof(entry->OffPremiseServicesReachableIPv4)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->OffPremiseServicesReachableIPv6, - write ? (uint8_t *) &entry->OffPremiseServicesReachableIPv6 : src, write, &entryOffset, - sizeof(entry->OffPremiseServicesReachableIPv6)); // BOOLEAN - ByteSpan * HardwareAddressSpan = &entry->HardwareAddress; // OCTET_STRING - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 10, HardwareAddressSpan) - : ReadByteSpan(src + entryOffset, 10, HardwareAddressSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 10); - copyListMember(write ? dest : (uint8_t *) &entry->Type, write ? (uint8_t *) &entry->Type : src, write, &entryOffset, - sizeof(entry->Type)); // InterfaceType - break; - } - case 0x0005: // ActiveHardwareFaults - { - entryLength = 1; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // ENUM8 - break; - } - case 0x0006: // ActiveRadioFaults - { - entryLength = 1; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // ENUM8 - break; - } - case 0x0007: // ActiveNetworkFaults - { - entryLength = 1; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // ENUM8 - break; - } - } - break; - } - case 0x003F: // Group Key Management Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // groups - { - entryLength = 6; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _GroupState - _GroupState * entry = reinterpret_cast<_GroupState *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write, - &entryOffset, sizeof(entry->VendorId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->VendorGroupId, write ? (uint8_t *) &entry->VendorGroupId : src, write, - &entryOffset, sizeof(entry->VendorGroupId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeySetIndex, write ? (uint8_t *) &entry->GroupKeySetIndex : src, - write, &entryOffset, sizeof(entry->GroupKeySetIndex)); // INT16U - break; - } - case 0x0001: // group keys - { - entryLength = 31; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _GroupKey - _GroupKey * entry = reinterpret_cast<_GroupKey *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write, - &entryOffset, sizeof(entry->VendorId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeyIndex, write ? (uint8_t *) &entry->GroupKeyIndex : src, write, - &entryOffset, sizeof(entry->GroupKeyIndex)); // INT16U - ByteSpan * GroupKeyRootSpan = &entry->GroupKeyRoot; // OCTET_STRING - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 18, GroupKeyRootSpan) - : ReadByteSpan(src + entryOffset, 18, GroupKeyRootSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 18); - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeyEpochStartTime, - write ? (uint8_t *) &entry->GroupKeyEpochStartTime : src, write, &entryOffset, - sizeof(entry->GroupKeyEpochStartTime)); // INT64U - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeySecurityPolicy, - write ? (uint8_t *) &entry->GroupKeySecurityPolicy : src, write, &entryOffset, - sizeof(entry->GroupKeySecurityPolicy)); // GroupKeySecurityPolicy - break; - } - } - break; - } - case 0x0507: // Media Input Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // media input list - { - entryLength = 70; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _MediaInputInfo - _MediaInputInfo * entry = reinterpret_cast<_MediaInputInfo *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->index, write ? (uint8_t *) &entry->index : src, write, &entryOffset, - sizeof(entry->index)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->inputType, write ? (uint8_t *) &entry->inputType : src, write, - &entryOffset, sizeof(entry->inputType)); // MediaInputType - ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING - ByteSpan * nameSpan = &nameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - ByteSpan descriptionSpanStorage(Uint8::from_const_char(entry->description.data()), - entry->description.size()); // CHAR_STRING - ByteSpan * descriptionSpan = &descriptionSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, descriptionSpan) - : ReadByteSpan(src + entryOffset, 34, descriptionSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - } - break; - } - case 0x003E: // Operational Credentials Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0001: // fabrics list - { - entryLength = 120; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _FabricDescriptor - _FabricDescriptor * entry = reinterpret_cast<_FabricDescriptor *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->FabricIndex, write ? (uint8_t *) &entry->FabricIndex : src, write, - &entryOffset, sizeof(entry->FabricIndex)); // INT8U - ByteSpan * RootPublicKeySpan = &entry->RootPublicKey; // OCTET_STRING - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 67, RootPublicKeySpan) - : ReadByteSpan(src + entryOffset, 67, RootPublicKeySpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 67); - copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write, - &entryOffset, sizeof(entry->VendorId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write, - &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID - copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, - sizeof(entry->NodeId)); // NODE_ID - ByteSpan LabelSpanStorage(Uint8::from_const_char(entry->Label.data()), entry->Label.size()); // CHAR_STRING - ByteSpan * LabelSpan = &LabelSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, LabelSpan) : ReadByteSpan(src + entryOffset, 34, LabelSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - case 0x0004: // TrustedRootCertificates - { - entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast(index - 1)); - if (entryOffset == 0) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - - ByteSpan * trustedRootCertificatesSpan = reinterpret_cast(write ? src : dest); // OCTET_STRING - uint16_t trustedRootCertificatesRemainingSpace = static_cast(am->size - entryOffset); - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, trustedRootCertificatesRemainingSpace, trustedRootCertificatesSpan) - : ReadByteSpan(src + entryOffset, trustedRootCertificatesRemainingSpace, trustedRootCertificatesSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - - if (!CanCastTo(trustedRootCertificatesSpan->size())) - { - ChipLogError(Zcl, "Span size %zu is too large", trustedRootCertificatesSpan->size()); - return 0; - } - entryLength = static_cast(trustedRootCertificatesSpan->size()); - break; - } - } - break; - } - case 0x0034: // Software Diagnostics Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // ThreadMetrics - { - entryLength = 30; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _ThreadMetrics - _ThreadMetrics * entry = reinterpret_cast<_ThreadMetrics *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->Id, write ? (uint8_t *) &entry->Id : src, write, &entryOffset, - sizeof(entry->Id)); // INT64U - ByteSpan NameSpanStorage(Uint8::from_const_char(entry->Name.data()), entry->Name.size()); // CHAR_STRING - ByteSpan * NameSpan = &NameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 10, NameSpan) : ReadByteSpan(src + entryOffset, 10, NameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 10); - copyListMember(write ? dest : (uint8_t *) &entry->StackFreeCurrent, write ? (uint8_t *) &entry->StackFreeCurrent : src, - write, &entryOffset, sizeof(entry->StackFreeCurrent)); // INT32U - copyListMember(write ? dest : (uint8_t *) &entry->StackFreeMinimum, write ? (uint8_t *) &entry->StackFreeMinimum : src, - write, &entryOffset, sizeof(entry->StackFreeMinimum)); // INT32U - copyListMember(write ? dest : (uint8_t *) &entry->StackSize, write ? (uint8_t *) &entry->StackSize : src, write, - &entryOffset, sizeof(entry->StackSize)); // INT32U - break; - } - } - break; - } - case 0x0504: // TV Channel Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // channel list - { - entryLength = 106; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _TvChannelInfo - _TvChannelInfo * entry = reinterpret_cast<_TvChannelInfo *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->majorNumber, write ? (uint8_t *) &entry->majorNumber : src, write, - &entryOffset, sizeof(entry->majorNumber)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->minorNumber, write ? (uint8_t *) &entry->minorNumber : src, write, - &entryOffset, sizeof(entry->minorNumber)); // INT16U - ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING - ByteSpan * nameSpan = &nameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - ByteSpan callSignSpanStorage(Uint8::from_const_char(entry->callSign.data()), entry->callSign.size()); // CHAR_STRING - ByteSpan * callSignSpan = &callSignSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, callSignSpan) : ReadByteSpan(src + entryOffset, 34, callSignSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - ByteSpan affiliateCallSignSpanStorage(Uint8::from_const_char(entry->affiliateCallSign.data()), - entry->affiliateCallSign.size()); // CHAR_STRING - ByteSpan * affiliateCallSignSpan = &affiliateCallSignSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, affiliateCallSignSpan) - : ReadByteSpan(src + entryOffset, 34, affiliateCallSignSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - } - break; - } - case 0x0505: // Target Navigator Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // target navigator list - { - entryLength = 35; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _NavigateTargetTargetInfo - _NavigateTargetTargetInfo * entry = reinterpret_cast<_NavigateTargetTargetInfo *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->identifier, write ? (uint8_t *) &entry->identifier : src, write, - &entryOffset, sizeof(entry->identifier)); // INT8U - ByteSpan nameSpanStorage(Uint8::from_const_char(entry->name.data()), entry->name.size()); // CHAR_STRING - ByteSpan * nameSpan = &nameSpanStorage; - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, nameSpan) : ReadByteSpan(src + entryOffset, 34, nameSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - } - break; - } - case 0x050F: // Test Cluster Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x001A: // list_int8u - { - entryLength = 1; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // INT8U - break; - } - case 0x001B: // list_octet_string - { - entryOffset = GetByteSpanOffsetFromIndex(write ? dest : src, am->size, static_cast(index - 1)); - if (entryOffset == 0) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - - ByteSpan * listOctetStringSpan = reinterpret_cast(write ? src : dest); // OCTET_STRING - uint16_t listOctetStringRemainingSpace = static_cast(am->size - entryOffset); - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, listOctetStringRemainingSpace, listOctetStringSpan) - : ReadByteSpan(src + entryOffset, listOctetStringRemainingSpace, listOctetStringSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - - if (!CanCastTo(listOctetStringSpan->size())) - { - ChipLogError(Zcl, "Span size %zu is too large", listOctetStringSpan->size()); - return 0; - } - entryLength = static_cast(listOctetStringSpan->size()); - break; - } - case 0x001C: // list_struct_octet_string - { - entryLength = 42; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _TestListStructOctet - _TestListStructOctet * entry = reinterpret_cast<_TestListStructOctet *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->fabricIndex, write ? (uint8_t *) &entry->fabricIndex : src, write, - &entryOffset, sizeof(entry->fabricIndex)); // INT64U - ByteSpan * operationalCertSpan = &entry->operationalCert; // OCTET_STRING - if (CHIP_NO_ERROR != - (write ? WriteByteSpan(dest + entryOffset, 34, operationalCertSpan) - : ReadByteSpan(src + entryOffset, 34, operationalCertSpan))) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); - return 0; - } - entryOffset = static_cast(entryOffset + 34); - break; - } - } - break; - } - case 0x0035: // Thread Network Diagnostics Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0007: // NeighborTableList - { - entryLength = 31; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _NeighborTable - _NeighborTable * entry = reinterpret_cast<_NeighborTable *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->ExtAddress, write ? (uint8_t *) &entry->ExtAddress : src, write, - &entryOffset, sizeof(entry->ExtAddress)); // INT64U - copyListMember(write ? dest : (uint8_t *) &entry->Age, write ? (uint8_t *) &entry->Age : src, write, &entryOffset, - sizeof(entry->Age)); // INT32U - copyListMember(write ? dest : (uint8_t *) &entry->Rloc16, write ? (uint8_t *) &entry->Rloc16 : src, write, &entryOffset, - sizeof(entry->Rloc16)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->LinkFrameCounter, write ? (uint8_t *) &entry->LinkFrameCounter : src, - write, &entryOffset, sizeof(entry->LinkFrameCounter)); // INT32U - copyListMember(write ? dest : (uint8_t *) &entry->MleFrameCounter, write ? (uint8_t *) &entry->MleFrameCounter : src, - write, &entryOffset, sizeof(entry->MleFrameCounter)); // INT32U - copyListMember(write ? dest : (uint8_t *) &entry->LQI, write ? (uint8_t *) &entry->LQI : src, write, &entryOffset, - sizeof(entry->LQI)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->AverageRssi, write ? (uint8_t *) &entry->AverageRssi : src, write, - &entryOffset, sizeof(entry->AverageRssi)); // INT8S - copyListMember(write ? dest : (uint8_t *) &entry->LastRssi, write ? (uint8_t *) &entry->LastRssi : src, write, - &entryOffset, sizeof(entry->LastRssi)); // INT8S - copyListMember(write ? dest : (uint8_t *) &entry->FrameErrorRate, write ? (uint8_t *) &entry->FrameErrorRate : src, - write, &entryOffset, sizeof(entry->FrameErrorRate)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->MessageErrorRate, write ? (uint8_t *) &entry->MessageErrorRate : src, - write, &entryOffset, sizeof(entry->MessageErrorRate)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->RxOnWhenIdle, write ? (uint8_t *) &entry->RxOnWhenIdle : src, write, - &entryOffset, sizeof(entry->RxOnWhenIdle)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->FullThreadDevice, write ? (uint8_t *) &entry->FullThreadDevice : src, - write, &entryOffset, sizeof(entry->FullThreadDevice)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->FullNetworkData, write ? (uint8_t *) &entry->FullNetworkData : src, - write, &entryOffset, sizeof(entry->FullNetworkData)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->IsChild, write ? (uint8_t *) &entry->IsChild : src, write, - &entryOffset, sizeof(entry->IsChild)); // BOOLEAN - break; - } - case 0x0008: // RouteTableList - { - entryLength = 18; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _RouteTable - _RouteTable * entry = reinterpret_cast<_RouteTable *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->ExtAddress, write ? (uint8_t *) &entry->ExtAddress : src, write, - &entryOffset, sizeof(entry->ExtAddress)); // INT64U - copyListMember(write ? dest : (uint8_t *) &entry->Rloc16, write ? (uint8_t *) &entry->Rloc16 : src, write, &entryOffset, - sizeof(entry->Rloc16)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->RouterId, write ? (uint8_t *) &entry->RouterId : src, write, - &entryOffset, sizeof(entry->RouterId)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->NextHop, write ? (uint8_t *) &entry->NextHop : src, write, - &entryOffset, sizeof(entry->NextHop)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->PathCost, write ? (uint8_t *) &entry->PathCost : src, write, - &entryOffset, sizeof(entry->PathCost)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->LQIIn, write ? (uint8_t *) &entry->LQIIn : src, write, &entryOffset, - sizeof(entry->LQIIn)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->LQIOut, write ? (uint8_t *) &entry->LQIOut : src, write, &entryOffset, - sizeof(entry->LQIOut)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->Age, write ? (uint8_t *) &entry->Age : src, write, &entryOffset, - sizeof(entry->Age)); // INT8U - copyListMember(write ? dest : (uint8_t *) &entry->Allocated, write ? (uint8_t *) &entry->Allocated : src, write, - &entryOffset, sizeof(entry->Allocated)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->LinkEstablished, write ? (uint8_t *) &entry->LinkEstablished : src, - write, &entryOffset, sizeof(entry->LinkEstablished)); // BOOLEAN - break; - } - case 0x003B: // SecurityPolicy - { - entryLength = 4; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _SecurityPolicy - _SecurityPolicy * entry = reinterpret_cast<_SecurityPolicy *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->RotationTime, write ? (uint8_t *) &entry->RotationTime : src, write, - &entryOffset, sizeof(entry->RotationTime)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->Flags, write ? (uint8_t *) &entry->Flags : src, write, &entryOffset, - sizeof(entry->Flags)); // BITMAP16 - break; - } - case 0x003D: // OperationalDatasetComponents - { - entryLength = 12; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _OperationalDatasetComponents - _OperationalDatasetComponents * entry = reinterpret_cast<_OperationalDatasetComponents *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->ActiveTimestampPresent, - write ? (uint8_t *) &entry->ActiveTimestampPresent : src, write, &entryOffset, - sizeof(entry->ActiveTimestampPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->PendingTimestampPresent, - write ? (uint8_t *) &entry->PendingTimestampPresent : src, write, &entryOffset, - sizeof(entry->PendingTimestampPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->MasterKeyPresent, write ? (uint8_t *) &entry->MasterKeyPresent : src, - write, &entryOffset, sizeof(entry->MasterKeyPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->NetworkNamePresent, - write ? (uint8_t *) &entry->NetworkNamePresent : src, write, &entryOffset, - sizeof(entry->NetworkNamePresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->ExtendedPanIdPresent, - write ? (uint8_t *) &entry->ExtendedPanIdPresent : src, write, &entryOffset, - sizeof(entry->ExtendedPanIdPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->MeshLocalPrefixPresent, - write ? (uint8_t *) &entry->MeshLocalPrefixPresent : src, write, &entryOffset, - sizeof(entry->MeshLocalPrefixPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->DelayPresent, write ? (uint8_t *) &entry->DelayPresent : src, write, - &entryOffset, sizeof(entry->DelayPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->PanIdPresent, write ? (uint8_t *) &entry->PanIdPresent : src, write, - &entryOffset, sizeof(entry->PanIdPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->ChannelPresent, write ? (uint8_t *) &entry->ChannelPresent : src, - write, &entryOffset, sizeof(entry->ChannelPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->PskcPresent, write ? (uint8_t *) &entry->PskcPresent : src, write, - &entryOffset, sizeof(entry->PskcPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->SecurityPolicyPresent, - write ? (uint8_t *) &entry->SecurityPolicyPresent : src, write, &entryOffset, - sizeof(entry->SecurityPolicyPresent)); // BOOLEAN - copyListMember(write ? dest : (uint8_t *) &entry->ChannelMaskPresent, - write ? (uint8_t *) &entry->ChannelMaskPresent : src, write, &entryOffset, - sizeof(entry->ChannelMaskPresent)); // BOOLEAN - break; - } - case 0x003E: // ActiveNetworkFaultsList - { - entryLength = 1; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - copyListMember(dest, src, write, &entryOffset, entryLength); // NetworkFault - break; - } - } - break; - } - } - - return entryLength; -} - -// A list is a collection of entries of the same data type. The data type may be any defined data type. -uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attributeId, const uint8_t * buffer) -{ - // The first 2 bytes specify the number of entries. A value of 0xFFFF means the list in invalid - // and data is undefined. - uint16_t entryCount = emberAfGetInt16u(buffer, 0, kSizeLengthInBytes); - if (entryCount == 0xFFFF) - { - return 0; - } - - uint16_t entryLength = 0; - switch (clusterId) - { - case 0x050D: // Application Basic Cluster - switch (attributeId) - { - case 0x0007: // allowed vendor list - // uint16_t - entryLength = 2; - break; - } - break; - case 0x050C: // Application Launcher Cluster - switch (attributeId) - { - case 0x0000: // application launcher list - // uint16_t - entryLength = 2; - break; - } - break; - case 0x050B: // Audio Output Cluster - switch (attributeId) - { - case 0x0000: // audio output list - // Struct _AudioOutputInfo - entryLength = 36; - break; - } - break; - case 0x050A: // Content Launcher Cluster - switch (attributeId) - { - case 0x0000: // accepts header list - // chip::ByteSpan - return GetByteSpanOffsetFromIndex(buffer, 256, entryCount); - break; - } - break; - case 0x001D: // Descriptor Cluster - switch (attributeId) - { - case 0x0000: // device list - // Struct _DeviceType - entryLength = 6; - break; - case 0x0001: // server list - // chip::ClusterId - entryLength = 4; - break; - case 0x0002: // client list - // chip::ClusterId - entryLength = 4; - break; - case 0x0003: // parts list - // chip::EndpointId - entryLength = 2; - break; - } - break; - case 0x0040: // Fixed Label Cluster - switch (attributeId) - { - case 0x0000: // label list - // Struct _LabelStruct - entryLength = 36; - break; - } - break; - case 0x0030: // General Commissioning Cluster - switch (attributeId) - { - case 0x0001: // BasicCommissioningInfoList - // Struct _BasicCommissioningInfoType - entryLength = 4; - break; - } - break; - case 0x0033: // General Diagnostics Cluster - switch (attributeId) - { - case 0x0000: // NetworkInterfaces - // Struct _NetworkInterfaceType - entryLength = 48; - break; - case 0x0005: // ActiveHardwareFaults - // uint8_t - entryLength = 1; - break; - case 0x0006: // ActiveRadioFaults - // uint8_t - entryLength = 1; - break; - case 0x0007: // ActiveNetworkFaults - // uint8_t - entryLength = 1; - break; - } - break; - case 0x003F: // Group Key Management Cluster - switch (attributeId) - { - case 0x0000: // groups - // Struct _GroupState - entryLength = 6; - break; - case 0x0001: // group keys - // Struct _GroupKey - entryLength = 31; - break; - } - break; - case 0x0507: // Media Input Cluster - switch (attributeId) - { - case 0x0000: // media input list - // Struct _MediaInputInfo - entryLength = 70; - break; - } - break; - case 0x003E: // Operational Credentials Cluster - switch (attributeId) - { - case 0x0001: // fabrics list - // Struct _FabricDescriptor - entryLength = 120; - break; - case 0x0004: // TrustedRootCertificates - // chip::ByteSpan - return GetByteSpanOffsetFromIndex(buffer, 402, entryCount); - break; - } - break; - case 0x0034: // Software Diagnostics Cluster - switch (attributeId) - { - case 0x0000: // ThreadMetrics - // Struct _ThreadMetrics - entryLength = 30; - break; - } - break; - case 0x0504: // TV Channel Cluster - switch (attributeId) - { - case 0x0000: // channel list - // Struct _TvChannelInfo - entryLength = 106; - break; - } - break; - case 0x0505: // Target Navigator Cluster - switch (attributeId) - { - case 0x0000: // target navigator list - // Struct _NavigateTargetTargetInfo - entryLength = 35; - break; - } - break; - case 0x050F: // Test Cluster Cluster - switch (attributeId) - { - case 0x001A: // list_int8u - // uint8_t - entryLength = 1; - break; - case 0x001B: // list_octet_string - // chip::ByteSpan - return GetByteSpanOffsetFromIndex(buffer, 256, entryCount); - break; - case 0x001C: // list_struct_octet_string - // Struct _TestListStructOctet - entryLength = 42; - break; - } - break; - case 0x0035: // Thread Network Diagnostics Cluster - switch (attributeId) - { - case 0x0007: // NeighborTableList - // Struct _NeighborTable - entryLength = 31; - break; - case 0x0008: // RouteTableList - // Struct _RouteTable - entryLength = 18; - break; - case 0x003B: // SecurityPolicy - // Struct _SecurityPolicy - entryLength = 4; - break; - case 0x003D: // OperationalDatasetComponents - // Struct _OperationalDatasetComponents - entryLength = 12; - break; - case 0x003E: // ActiveNetworkFaultsList - // uint8_t - entryLength = 1; - break; - } - break; - } - - uint32_t totalSize = kSizeLengthInBytes + (entryCount * entryLength); - if (!CanCastTo(totalSize)) - { - ChipLogError(Zcl, "Cluster " ChipLogFormatMEI ": Size of attribute " ChipLogFormatMEI " is too large.", - ChipLogValueMEI(clusterId), ChipLogValueMEI(attributeId)); - return 0; - } - - return static_cast(totalSize); -} diff --git a/zzz_generated/tv-casting-app/zap-generated/callback-stub.cpp b/zzz_generated/tv-casting-app/zap-generated/callback-stub.cpp index 4c601605d27b22..8b5794eb07ee0b 100644 --- a/zzz_generated/tv-casting-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/tv-casting-app/zap-generated/callback-stub.cpp @@ -59,6 +59,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID: emberAfBridgedDeviceBasicClusterInitCallback(endpoint); break; + case ZCL_CHANNEL_CLUSTER_ID: + emberAfChannelClusterInitCallback(endpoint); + break; case ZCL_COLOR_CONTROL_CLUSTER_ID: emberAfColorControlClusterInitCallback(endpoint); break; @@ -143,9 +146,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_SWITCH_CLUSTER_ID: emberAfSwitchClusterInitCallback(endpoint); break; - case ZCL_TV_CHANNEL_CLUSTER_ID: - emberAfTvChannelClusterInitCallback(endpoint); - break; case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: emberAfTargetNavigatorClusterInitCallback(endpoint); break; @@ -229,6 +229,11 @@ void __attribute__((weak)) emberAfBridgedDeviceBasicClusterInitCallback(Endpoint // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfChannelClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfColorControlClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -369,11 +374,6 @@ void __attribute__((weak)) emberAfSwitchClusterInitCallback(EndpointId endpoint) // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfTvChannelClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfTargetNavigatorClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index 7b99fc7b819629..ec908383db22f5 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -277,7 +277,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 632 - groups, */ \ + /* 632 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -293,7 +293,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 886 - group keys, */ \ + /* 886 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -355,141 +355,30 @@ /* 1413 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: TV Channel (server), big-endian */ \ - \ - /* 1421 - channel list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ - \ - /* 1675 - target navigator list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ - \ - /* 1929 - media input list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ - \ - /* 2183 - accepts header list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 2437 - supported streaming protocols, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Audio Output (server), big-endian */ \ - \ - /* 2441 - audio output list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ - \ - /* 2695 - application launcher list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 2949 - bitmap32, */ \ + /* 1421 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2953 - bitmap64, */ \ + /* 1425 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2961 - int32u, */ \ + /* 1433 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2965 - int64u, */ \ + /* 1437 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2973 - int32s, */ \ + /* 1445 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2977 - int64s, */ \ + /* 1449 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2985 - list_int8u, */ \ + /* 1457 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2995 - list_octet_string, */ \ + /* 1467 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -505,7 +394,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3249 - list_struct_octet_string, */ \ + /* 1721 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -776,7 +665,7 @@ \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 632 - groups, */ \ + /* 632 - groupKeyMap, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -792,7 +681,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 886 - group keys, */ \ + /* 886 - groupTable, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -854,141 +743,30 @@ /* 1413 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* Endpoint: 1, Cluster: TV Channel (server), little-endian */ \ - \ - /* 1421 - channel list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ - \ - /* 1675 - target navigator list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ - \ - /* 1929 - media input list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ - \ - /* 2183 - accepts header list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 2437 - supported streaming protocols, */ \ - 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Audio Output (server), little-endian */ \ - \ - /* 2441 - audio output list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ - \ - /* 2695 - application launcher list, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 2949 - bitmap32, */ \ + /* 1421 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2953 - bitmap64, */ \ + /* 1425 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2961 - int32u, */ \ + /* 1433 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2965 - int64u, */ \ + /* 1437 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2973 - int32s, */ \ + /* 1445 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 2977 - int64s, */ \ + /* 1449 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2985 - list_int8u, */ \ + /* 1457 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2995 - list_octet_string, */ \ + /* 1467 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1004,7 +782,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3249 - list_struct_octet_string, */ \ + /* 1721 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1023,7 +801,7 @@ #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (98) +#define GENERATED_DEFAULTS_COUNT (91) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -1086,7 +864,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 417 +#define GENERATED_ATTRIBUTE_COUNT 402 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1286,8 +1064,8 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(886) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(632) }, /* groupKeyMap */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(886) }, /* groupTable */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ @@ -1295,8 +1073,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ @@ -1425,18 +1204,24 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionLift */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionTilt */ \ - { 0x0007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x03) }, /* ConfigStatus */ \ - { 0x0008, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercentage */ \ - { 0x0009, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercentage */ \ - { 0x000A, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationalStatus */ \ - { 0x000B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionLiftPercent100ths */ \ - { 0x000C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* TargetPositionTiltPercent100ths */ \ - { 0x000D, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* EndProductType */ \ - { 0x000E, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercent100ths */ \ - { 0x000F, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercent100ths */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionLift */ \ + { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionTilt */ \ + { 0x0007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x03) }, /* ConfigStatus */ \ + { 0x0008, ZAP_TYPE(PERCENT), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercentage */ \ + { 0x0009, ZAP_TYPE(PERCENT), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercentage */ \ + { 0x000A, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationalStatus */ \ + { 0x000B, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionLiftPercent100ths */ \ + { 0x000C, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* TargetPositionTiltPercent100ths */ \ + { 0x000D, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* EndProductType */ \ + { 0x000E, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercent100ths */ \ + { 0x000F, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercent100ths */ \ { 0x0010, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitLift */ \ { 0x0011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitLift */ \ { 0x0012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitTilt */ \ @@ -1567,75 +1352,57 @@ { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* wake on lan mac address */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1421) }, /* channel list */ \ - { 0x0001, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* channel lineup */ \ - { 0x0002, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* current channel */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Channel (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1675) }, /* target navigator list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Target Navigator (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Media Playback (server) */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Media Playback (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1929) }, /* media input list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Media Input (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Keypad Input (server) */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Keypad Input (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2183) }, /* accepts header list */ \ - { 0x0001, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(2437) }, /* supported streaming protocols */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Content Launcher (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2441) }, /* audio output list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Audio Output (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2695) }, /* application launcher list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Application Launcher (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* vendor name */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application name */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* application status */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* application version */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Application Basic (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Account Login (server) */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ + /* Endpoint: 1, Cluster: Account Login (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { 0x0000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x0001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2949) }, /* bitmap32 */ \ - { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2953) }, /* bitmap64 */ \ + { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1421) }, /* bitmap32 */ \ + { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1425) }, /* bitmap64 */ \ { 0x0005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x0006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2961) }, /* int32u */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2965) }, /* int64u */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1433) }, /* int32u */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1437) }, /* int64u */ \ { 0x000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2973) }, /* int32s */ \ - { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2977) }, /* int64s */ \ + { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1445) }, /* int32s */ \ + { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1449) }, /* int64s */ \ { 0x0015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x0016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ { 0x0019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* octet_string */ \ - { 0x001A, ZAP_TYPE(ARRAY), 10, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2985) }, /* list_int8u */ \ - { 0x001B, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2995) }, /* list_octet_string */ \ + { 0x001A, ZAP_TYPE(ARRAY), 10, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1457) }, /* list_int8u */ \ + { 0x001B, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(1467) }, /* list_octet_string */ \ { 0x001C, ZAP_TYPE(ARRAY), 254, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3249) }, /* list_struct_octet_string */ \ + ZAP_LONG_DEFAULTS_INDEX(1721) }, /* list_struct_octet_string */ \ { 0x001D, ZAP_TYPE(LONG_OCTET_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_EMPTY_DEFAULT() }, /* long_octet_string */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -1684,6 +1451,7 @@ }; \ const EmberAfGenericClusterFunction chipFuncArrayDoorLockServer[] = { \ (EmberAfGenericClusterFunction) MatterDoorLockClusterServerAttributeChangedCallback, \ + (EmberAfGenericClusterFunction) MatterDoorLockClusterServerPreAttributeChangedCallback, \ }; \ const EmberAfGenericClusterFunction chipFuncArrayThermostatServer[] = { \ (EmberAfGenericClusterFunction) emberAfThermostatClusterServerInitCallback, \ @@ -1809,7 +1577,8 @@ ZAP_ATTRIBUTE_INDEX(232), \ 19, \ 29, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ + ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | \ + ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ 0x0102, ZAP_ATTRIBUTE_INDEX(251), 19, 31, ZAP_CLUSTER_MASK(SERVER), NULL \ @@ -1852,49 +1621,49 @@ 0x0503, ZAP_ATTRIBUTE_INDEX(358), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(360), 4, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ + 0x0504, ZAP_ATTRIBUTE_INDEX(360), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Channel (client) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(364), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ + 0x0505, ZAP_ATTRIBUTE_INDEX(361), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Target Navigator (client) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(366), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ + 0x0506, ZAP_ATTRIBUTE_INDEX(362), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Media Playback (client) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(367), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Media Input (server) */ \ + 0x0507, ZAP_ATTRIBUTE_INDEX(363), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Media Input (client) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(369), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ + 0x0509, ZAP_ATTRIBUTE_INDEX(364), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Keypad Input (client) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(370), 3, 260, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ + 0x050A, ZAP_ATTRIBUTE_INDEX(365), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Content Launcher (client) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(373), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ + 0x050B, ZAP_ATTRIBUTE_INDEX(366), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Audio Output (client) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(375), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ + 0x050C, ZAP_ATTRIBUTE_INDEX(367), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Application Launcher (client) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(377), 7, 106, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ + 0x050D, ZAP_ATTRIBUTE_INDEX(368), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Application Basic (client) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(384), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 1, Cluster: Account Login (server) */ \ + 0x050E, ZAP_ATTRIBUTE_INDEX(369), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Account Login (client) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(385), 21, 1582, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(370), 21, 1582, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(406), \ + ZAP_ATTRIBUTE_INDEX(391), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(408), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(393), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(413), \ + ZAP_ATTRIBUTE_INDEX(398), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1906,7 +1675,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 18, 1958 }, { ZAP_CLUSTER_INDEX(18), 33, 4702 }, { ZAP_CLUSTER_INDEX(51), 3, 8 }, \ + { ZAP_CLUSTER_INDEX(0), 18, 1958 }, { ZAP_CLUSTER_INDEX(18), 33, 3070 }, { ZAP_CLUSTER_INDEX(51), 3, 8 }, \ } // Largest attribute size is needed for various buffers @@ -1916,7 +1685,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (1333) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (6668) +#define ATTRIBUTE_MAX_SIZE (5036) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/tv-casting-app/zap-generated/gen_config.h b/zzz_generated/tv-casting-app/zap-generated/gen_config.h index 221c4e047dbff9..357d784b21e5ea 100644 --- a/zzz_generated/tv-casting-app/zap-generated/gen_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/gen_config.h @@ -29,18 +29,19 @@ #define EMBER_APS_UNICAST_MESSAGE_COUNT 10 /**** Cluster endpoint counts ****/ -#define EMBER_AF_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_ACCOUNT_LOGIN_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_APPLICATION_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_AUDIO_OUTPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_APPLICATION_BASIC_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_APPLICATION_LAUNCHER_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_AUDIO_OUTPUT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_BARRIER_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_BINARY_INPUT_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_BINDING_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_BRIDGED_DEVICE_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_CHANNEL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_CONTENT_LAUNCH_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_CONTENT_LAUNCH_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (3) #define EMBER_AF_DIAGNOSTIC_LOGS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -53,10 +54,10 @@ #define EMBER_AF_GROUPS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_IAS_ZONE_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_KEYPAD_INPUT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_MEDIA_INPUT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OTA_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_OCCUPANCY_SENSING_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -67,8 +68,7 @@ #define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SWITCH_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_TV_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TEST_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -80,30 +80,26 @@ /**** Cluster Plugins ****/ -// Use this macro to check if the server side of the Account Login cluster is included -#define ZCL_USING_ACCOUNT_LOGIN_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_ACCOUNT_LOGIN_SERVER -#define EMBER_AF_PLUGIN_ACCOUNT_LOGIN +// Use this macro to check if the client side of the Account Login cluster is included +#define ZCL_USING_ACCOUNT_LOGIN_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_ACCOUNT_LOGIN_CLIENT // Use this macro to check if the server side of the AdministratorCommissioning cluster is included #define ZCL_USING_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER #define EMBER_AF_PLUGIN_ADMINISTRATOR_COMMISSIONING_SERVER #define EMBER_AF_PLUGIN_ADMINISTRATOR_COMMISSIONING -// Use this macro to check if the server side of the Application Basic cluster is included -#define ZCL_USING_APPLICATION_BASIC_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_APPLICATION_BASIC_SERVER -#define EMBER_AF_PLUGIN_APPLICATION_BASIC +// Use this macro to check if the client side of the Application Basic cluster is included +#define ZCL_USING_APPLICATION_BASIC_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_APPLICATION_BASIC_CLIENT -// Use this macro to check if the server side of the Application Launcher cluster is included -#define ZCL_USING_APPLICATION_LAUNCHER_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_APPLICATION_LAUNCHER_SERVER -#define EMBER_AF_PLUGIN_APPLICATION_LAUNCHER +// Use this macro to check if the client side of the Application Launcher cluster is included +#define ZCL_USING_APPLICATION_LAUNCHER_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_APPLICATION_LAUNCHER_CLIENT -// Use this macro to check if the server side of the Audio Output cluster is included -#define ZCL_USING_AUDIO_OUTPUT_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_AUDIO_OUTPUT_SERVER -#define EMBER_AF_PLUGIN_AUDIO_OUTPUT +// Use this macro to check if the client side of the Audio Output cluster is included +#define ZCL_USING_AUDIO_OUTPUT_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_AUDIO_OUTPUT_CLIENT // Use this macro to check if the server side of the Barrier Control cluster is included #define ZCL_USING_BARRIER_CONTROL_CLUSTER_SERVER @@ -130,6 +126,10 @@ #define EMBER_AF_PLUGIN_BRIDGED_DEVICE_BASIC_SERVER #define EMBER_AF_PLUGIN_BRIDGED_DEVICE_BASIC +// Use this macro to check if the client side of the Channel cluster is included +#define ZCL_USING_CHANNEL_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_CHANNEL_CLIENT + // Use this macro to check if the server side of the Color Control cluster is included #define ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER @@ -139,10 +139,9 @@ #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV -// Use this macro to check if the server side of the Content Launcher cluster is included -#define ZCL_USING_CONTENT_LAUNCH_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_CONTENT_LAUNCHER_SERVER -#define EMBER_AF_PLUGIN_CONTENT_LAUNCHER +// Use this macro to check if the client side of the Content Launcher cluster is included +#define ZCL_USING_CONTENT_LAUNCH_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_CONTENT_LAUNCHER_CLIENT // Use this macro to check if the server side of the Descriptor cluster is included #define ZCL_USING_DESCRIPTOR_CLUSTER_SERVER @@ -206,10 +205,9 @@ #define EMBER_AF_PLUGIN_IDENTIFY_SERVER #define EMBER_AF_PLUGIN_IDENTIFY -// Use this macro to check if the server side of the Keypad Input cluster is included -#define ZCL_USING_KEYPAD_INPUT_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_KEYPAD_INPUT_SERVER -#define EMBER_AF_PLUGIN_KEYPAD_INPUT +// Use this macro to check if the client side of the Keypad Input cluster is included +#define ZCL_USING_KEYPAD_INPUT_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_KEYPAD_INPUT_CLIENT // Use this macro to check if the server side of the Level Control cluster is included #define ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER @@ -220,15 +218,13 @@ #define EMBER_AF_PLUGIN_LEVEL_CONTROL_MINIMUM_LEVEL 0 #define EMBER_AF_PLUGIN_LEVEL_CONTROL_RATE 0 -// Use this macro to check if the server side of the Media Input cluster is included -#define ZCL_USING_MEDIA_INPUT_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_MEDIA_INPUT_SERVER -#define EMBER_AF_PLUGIN_MEDIA_INPUT +// Use this macro to check if the client side of the Media Input cluster is included +#define ZCL_USING_MEDIA_INPUT_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_MEDIA_INPUT_CLIENT -// Use this macro to check if the server side of the Media Playback cluster is included -#define ZCL_USING_MEDIA_PLAYBACK_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_MEDIA_PLAYBACK_SERVER -#define EMBER_AF_PLUGIN_MEDIA_PLAYBACK +// Use this macro to check if the client side of the Media Playback cluster is included +#define ZCL_USING_MEDIA_PLAYBACK_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_MEDIA_PLAYBACK_CLIENT // Use this macro to check if the server side of the Network Commissioning cluster is included #define ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER @@ -282,15 +278,9 @@ #define EMBER_AF_PLUGIN_SWITCH_SERVER #define EMBER_AF_PLUGIN_SWITCH -// Use this macro to check if the server side of the TV Channel cluster is included -#define ZCL_USING_TV_CHANNEL_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_TV_CHANNEL_SERVER -#define EMBER_AF_PLUGIN_TV_CHANNEL - -// Use this macro to check if the server side of the Target Navigator cluster is included -#define ZCL_USING_TARGET_NAVIGATOR_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_TARGET_NAVIGATOR_SERVER -#define EMBER_AF_PLUGIN_TARGET_NAVIGATOR +// Use this macro to check if the client side of the Target Navigator cluster is included +#define ZCL_USING_TARGET_NAVIGATOR_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_TARGET_NAVIGATOR_CLIENT // Use this macro to check if the server side of the Temperature Measurement cluster is included #define ZCL_USING_TEMP_MEASUREMENT_CLUSTER_SERVER diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index 6774540495e410..8e69a187b18f07 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -817,8 +817,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: User Label (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* label list */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* label list */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ @@ -834,18 +835,24 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionLift */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionTilt */ \ - { 0x0007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x03) }, /* ConfigStatus */ \ - { 0x0008, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercentage */ \ - { 0x0009, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercentage */ \ - { 0x000A, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationalStatus */ \ - { 0x000B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionLiftPercent100ths */ \ - { 0x000C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionTiltPercent100ths */ \ - { 0x000D, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* EndProductType */ \ - { 0x000E, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercent100ths */ \ - { 0x000F, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercent100ths */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionLift */ \ + { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionTilt */ \ + { 0x0007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x03) }, /* ConfigStatus */ \ + { 0x0008, ZAP_TYPE(PERCENT), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercentage */ \ + { 0x0009, ZAP_TYPE(PERCENT), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercentage */ \ + { 0x000A, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationalStatus */ \ + { 0x000B, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionLiftPercent100ths */ \ + { 0x000C, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionTiltPercent100ths */ \ + { 0x000D, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* EndProductType */ \ + { 0x000E, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercent100ths */ \ + { 0x000F, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercent100ths */ \ { 0x0010, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitLift */ \ { 0x0011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitLift */ \ { 0x0012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitTilt */ \ @@ -864,18 +871,24 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Window Covering (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionLift */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionTilt */ \ - { 0x0007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x03) }, /* ConfigStatus */ \ - { 0x0008, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercentage */ \ - { 0x0009, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercentage */ \ - { 0x000A, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationalStatus */ \ - { 0x000B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionLiftPercent100ths */ \ - { 0x000C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionTiltPercent100ths */ \ - { 0x000D, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* EndProductType */ \ - { 0x000E, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercent100ths */ \ - { 0x000F, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercent100ths */ \ + { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Type */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionLift */ \ + { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* CurrentPositionTilt */ \ + { 0x0007, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x03) }, /* ConfigStatus */ \ + { 0x0008, ZAP_TYPE(PERCENT), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercentage */ \ + { 0x0009, ZAP_TYPE(PERCENT), 1, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercentage */ \ + { 0x000A, ZAP_TYPE(BITMAP8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationalStatus */ \ + { 0x000B, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionLiftPercent100ths */ \ + { 0x000C, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* TargetPositionTiltPercent100ths */ \ + { 0x000D, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* EndProductType */ \ + { 0x000E, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionLiftPercent100ths */ \ + { 0x000F, ZAP_TYPE(PERCENT100THS), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), \ + ZAP_SIMPLE_DEFAULT(0xFF) }, /* CurrentPositionTiltPercent100ths */ \ { 0x0010, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitLift */ \ { 0x0011, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitLift */ \ { 0x0012, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* InstalledOpenLimitTilt */ \